|
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>....
|
|
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 ... .
|
|
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 < .
|
Ask your Facebook Friends
|
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... .
|
|
Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want.
Is there some way to have a fixed length...
Started by Teifion on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Your also probably going to cause....
You shouldn't notice any performance difference using varchar(500) over 2xchar(255) .
Even though varchar isn't a fixed length, the database should reserve the correct amount of space .
I would suggest using a varchar(500).
|
|
TEAM MORE SKILL THAN ATHLETICISM
PG: Steve Nash
SG: Kobe Bryant
SF: Kevin Durant
PF: Kevin Love
C: Marc Gasol
vs.
TEAM MORE ATHLETICISM THAN SKILL
PG: Russell Westbrook
SG: LeBron James
SF: Josh Smith
PF: Blake Griffin
C: Dwight Howard
7 game series who...
Started by Storm Surge on
, 15 posts
by 14 people.
Answer Snippets (Read the full thread at realgm):
TeamDEEP Set Who's gonna close games on the second team? Team 2 in 6 is not a skill, I don't know how the conclusion came about that he's more skillful than athletic, he's both on the athletic team have won more....
than athletic, team 1 wins.
|