|
Basically I am giving the user an option to filter a set of files based on thier size.
The user picks a comparison type (Greater Than, Less Than, Equal To) from a drop down list, and then enters a size, in bytes, to compare to. This is what I have so ...
Started by Neil N on
, 9 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
CmboCompareType.SelectedText) { case "Greater Than": fileOK = len > value; break; case "Less Than": fileOK = len < Than": requiredSign = 1; break; case "Less Than": requiredSign = -1; break; case "Equal, int, bool>....
|
|
Hello,
I need to store scientific information in a database (sql server). What is the best way to store a value in a database where "smaller than", larger than" is part of the information.
Example:
PatientId: 123 Mutation rate: <3%
PatientId: 999 Mutation...
Started by cafenervosa on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
How about adding a 3rd column for a clarifying int?
0 = Less than
1 = Less than or equal to
2 = Equal to
3 = Greater than or equal to
4 = Greater than
The easiest , is typically to use predefined values for these cases, for....
|
|
Assume a table with the following columns:
pri_id, item_id, comment, date
What I want to have is a SQL query that will delete any records, for a specific item_id that are older than a given date, BUT only as long as there are more than 15 rows for that...
Started by Matt P on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Something like this should work for you:
delete from MyTable where item_id in ( select item_id from MyTable group by item_id having count(item_id) > 15 ) and Date < @tDate
Is this what you're looking for?
DELETE [MyTable] WHERE [item_id] = 100 ... .
|
Ask your Facebook Friends
|
How can you add greater than or less than symbols to the condition on a Hibernate filter specified in the hbm.xml file?
I am trying to add a filter to limit the collection to a specific date range:
<filter name="limitTalksByDateRange" condition="talkstart...
Started by cholli2 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Also, the examples that I saw did not have the ' : ' on the limit variables,... .
Did you try:
<filter name="limitTalksByDateRange" condition="talkstart >= :tstart and talkstart <= :tend" />
Note the > and < instead of the > and < .
|
|
I inherited a project that uses SQL Server 200x, wherein a column that stores a value that is always considered as a percentage in the problem domain is stored as its greater than 1 decimal equivalent. For example, 70% (0.7, literally) is stored as 70...
Started by I Have the Hat on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
And the rounding are easier to understand than....
If its a byte field then it takes up less room in the db than floating point numbers, but unless.) is marginally easier and more efficient than doing the same with floating point numbers.
|
|
The following DataTemplate.DataTrigger makes the age display red if it is equal to 30.
How do I make the age display red if it is greater than 30?
<DataTemplate DataType="{x:Type local:Customer}"> <Grid x:Name="MainGrid" Style="{StaticResource...
Started by Edward Tanguay on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
WPF DataTriggers are strictly equality comparers if I remember correctly... .
Then use DataTrigger.Value of true (or false, depending on what you are returning) .
You could create a IValueConverter which converts an integer to a boolean based on the cutoff .
|
|
I want to use a dynamic scope in Rails where I filter by date. I want to do something like this:
Foo.scoped_by_created_on(>the_future).scoped_by_created_on(<the_past).find(:all)
Is this possible or am I stuck writing a : conditions hash?
Answer Snippets (Read the full thread at stackoverflow):
Foo.created_on_greater_than(the_future).created_on_less_than(the_past)
I have a plugin called by_star that offers you both a past and future method.
Out Searchlogic which offers named scopes for this.
|
|
I remember from C days that we were encouraged to use
i > -1
instead of
i >= 0
because of performance.
Does this still apply in the C# .NET world? What are the performance implications of using one over the other with today's compilers? i.e. Is ...
Started by Guy on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
On the x86 architecture.
Where you got the suggestion to use "i > -1" rather than "i >= 0".
|
|
Starting in SQL 2005, VARCHAR(MAX) is no longer limited to 8000 bytes, it instead can go up to 2GB using "overflow" pages.
But what if I want to limit this column to say, 10k bytes? It seems I get an error if I try to put anything in the size parameter...
Started by Neil N on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You can however use a VARCHAR(MAX) column with a ... .
Attempt to using say 10000 will give:
The size (10000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000) .
It is either 0-8000 or MAX.
Nope, you cannot do this [directly].
|
|
Out of curiosity, is there a (language independent*) way to make these two generic statements into one statement?
if (a < b) a += x; else if (a > b) a -= x;
May also be used as
if (abs(b - a) < x) a = b; else if (a < b) a += x; else if (a ...
Started by Bart van Heukelom on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Language independent is a bit tricky, but if you have cmp or similar, you can use that:
a += x * cmp(b, a)
cmp(b, a) returns:
0 if... .
A += (b - a) / abs(b - a) * x
But this is not language independent and does not really help readiness if you ask me... .
|