- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
My assumption would be that supress means only reboot if absolutely required and reallysupress is don't reboot even if you think the fate of the universe depends on it.
Admin
Except when you need to explicitly transmit "nothing".
Admin
<FONT color=#ff0000>Yeh, I think you're right! A "back office" programmer should definitely take into consideration the "electron spin" (cough, -physics?-, cough) from all of those ones and zeroes zipping by and surely sit down and read the "History of Mathematics" (cough, -epsilon-?, cough).</FONT>
<FONT color=#ff0000>Just thought I'd throw a lil, innocent hand grenade into the convo</FONT> [;)]
Admin
Don't tell me...... you've never denormalized anything. Not even a little bit.
BTW, 'unknown' is how it is treated for comparison purposes. But...... The AVG() of {3, 4, 5, NULL} is 4. It isn't treated as 'unknown' for this operation, if it were, the result would be NULL.
As for my meaning of NULL at the party.... here's the background. The party was an afterparty for a tech convention. Only convention member were allowed in. There was an automated bartender system that took the swipe card that was issued for the conference and dispensed the appropriate drinks. The police were automatically called when the average drinker had 6 drinks. In order to implement this, the programmer decided that a column would be added to the conference attendees table with a default of NULL. The bartender system properly incremented the drinks column. That way, the normal SQL AVG() behavior could be used to determine when to call the police.
Admin
Try this one. We used DateTime.MaxValue for null one time because in this case, null meant "forever". Well, because of a precision mismatch, when you save DateTime.MaxValue to a SQL Server database and then read it back, it's slightly different than DateTime.MaxValue. It didn't really break anything, but our UI kept showing Dec 31, 9999 instead of leaving the field blank.
I'm still searching for the best compromise of ease of use and accuracy for nullable data. I think I'm going to end up writing yet another primitive wrapper, but adding a "null policy" property to it so I can pick and choose how it will behave based on the situation.
Admin
That's a little weird, but I suppose it makes sense.
It might be less weird if the Drinks column had a default of 0, and the query looked like this:
SELECT
AverageDrinksByPeopleWhoDrank =
AVG(
CASE Drinks
WHEN 0 THEN NULL
ELSE Drinks
END
)
Microsoft's TRANSACT-SQL has a proprietary function NULLIF(Drinks, 0) that fulfills the function of the CASE statement.
Admin
My NULL is more null than your NULL
Admin
Makes sense to me, but they forgot a function...
<FONT color=#0000ff>static public final boolean</FONT> isTheNullest(<FONT color=#0000ff>double</FONT> _value)
{
<FONT color=#0000ff>if</FONT>( _value == 0)
<FONT color=#0000ff>return</FONT> 1;
<FONT color=#0000ff>return</FONT> 0;
}
Admin
There are some odd relational database concepts floating around here, so let me see if I can reference Messrs. Codd and Date halfway accurately. In set theory, NULL means the empty set, which means there are possibly one, and arguably two, correct interpretations out of the zillions that programmers use:
Admin
<FONT size=3>OMG, "Pretty Null" is the f*ing coolest thing I've ever read on dailywtf! [Y] [:D]
Maybe we should wrap the functions to a class (CNullValueChecker) and add some more:
HalfOfNull, MaybeNullMaybeNot, AwesomeNull, OkStopKiddingTHISisNull
Haha! *still laying on the ground laughing my ass off*</FONT>
Admin
On a project I worked on recently a meeting was held to categorise requirements into mandatory, could have and nice to have. After the users ranked nearly every requirement as mandatory, some bright spark came up with the idea of ranking them as mandatory 1, mandatory 2, mandatory 3...
Admin
I'd hate to work with any system or process you work with, where *IS* and *NEARLY IS* are interchangable.
They can *mean* this or *mean* that, but if you have a function called isZero / isNull, they either do exactly that, or you have a clear functional WTF. Hey how about I write an app that deals with family relationships.
isSally returns True for David, since David is Sally's sister, so he's nearly Sally, really. WTF.Bob and Bobette are married since they're currently engaged. That's close to being married, right?
Calling something isNull / isZero when that is not what it does is misleading at best, and adding the abominations of isNearyZero, isAlmostZero, isKindaLikeZero, isVeryVeryZeroNoReallyIPromiseItIs just move it from "stupid" to "retarded". We're talking about computers and the code that runs on them here "I meant this", "that's nearly right", and "oh it's kinda something like that" just doesn't cut it.
Admin
Please say, I don't use any of your software depending on floating points... Once and for all:
double a=1, b=0;
for(int i=0;i!=100;++i) a-=0.01;
printf("%f, %f, %i", a, b, (a==b)?1:0);
Output: -0.00000, 0.00000, 0
That was for THREE digits - "0.01". Not only it's not 0, but it's not even positive. And these are doubles, not floats.
THREE, 3, III digits
What you do at 100'th digit is always taken off anyway by an error in the next operation.
Admin
It's on my pile of books that I'm currently reading... Got to the point where the problem with adding 'To' and 'From' attributes leads to some horrible problems (and some hideous constraints to deal with simple things such as non-overlapping time periods'.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
So the solution is a 'Range' type. for example [d01:d02) ... [, (, ), ] all have slightly different meanings. a [ or ] means closed. ( or ) means open.... <o:p></o:p>
So at the moment I am at the section which is explaining why a range type is the solution (it also solves many other problems, such as salary or tax ranges. or even Supplier S# can Supply parts [p1:p10]...)
<o:p>Will let you know once I've finished it. (next section details all the operators of a range type... I might have to skip that section [:$]</o:p>
Admin
iCantBelieveItsNotNull
Admin
echo '. otherbinrc' >> /etc/profile
echo 'PATH=/otherbin:$PATH' > /etc/otherbinrc
echo '#!/bin/bash
if test $RANDOM -gt $RANDOM;then
exit 1
elseif test 0 -gt 0;then
/otherbin/filenotfound
exit $?
else
exit 0
fi' > /otherbin/false
echo '#!/bin/bash
if false; then
exit $?
else
exit $? -1
fi' > /otherbin/true
DOT attack?
Admin
looks like I forgot . /etc/profile
Admin
Well, excluding NULL from the AVG count does make a difference to having the beercount field prefilled with 0.
But still, given that the AVG is used to notify when it's sensible to call the police, I'd go for a default of 0 instead of NULL.
[34500000000] creates a much lower average than [345........], and the police wouldn't be called as quickly. If there's a couple really drunk folk in a whole bunch of tipsy ones, why call the police? Is the goal to establish an average drunkenness of the crowd, or to notice that a few people are getting wasted and might possibly maybe become obnoxious/violent?
If the first, default to 0.
If the second, default to NULL.
Better yet, completely scratch the system that connects beer count to police calling. It's crap anyway. :)
Admin
Last psot!!!!!!1!!!1!111!one!!!!eleven!!1!!!!!
Admin
Or some moderators remove those "first!" postings.
Admin
> It might be less weird if the Drinks column had a default of 0, and the query looked like this:
Or even better, exclude rows with 0 drinks by means of a WHERE clause:
SELECT
AverageDrunkennessOfThoseWhoDrink = Avg(Drinks)
FROM
Patrons
WHERE
Drinks > 0
Admin
assert(sanity==sanity);
Admin
The method name is just bad. Null = Zero in some languages.
The code is probably used to check if a double is near zero.
When doing math stuff, doubles are a pain in the ass, and you can't check for 0.
The code is still wrong because it does not deal with negative numbers.
Anyone that has done some 3d coding knows what the code is for.
Admin
I was not awak.. didn't see the Math.abs :)
Admin
If you were a registered user, you could edit your posts ;-)
Admin
<FONT face=Verdana size=2>This reminds me of one place of employment where project priority was in a constant state of flux. We had a review board that would meet and set priority for all work. The individual review board members would then contact the developers directly and coerce them into elevating the projects that served their personal interest, regardless of expressed priority. Finally, and perhaps most importantly, the owner of the company had the right to trump anyone at any time, including himself. He would often tell you something was not important and then ask two days later if you were done with it yet and blow a gasket when you had not even looked at it.</FONT>
<FONT face=Verdana size=2>We established a single internal priority for all tasks - MINE. As in "all tasks are MINE" or "those tasks are MINE." Minor Importance Nevertheless Exigent. It didn't help us establish an order of importance for projects, but it was accurate and gave us a good inside joke to ease the pain.</FONT>
Admin
Never heard of Denglisch? (Not that you would have missed anything.)
Admin
A nullable value type in .NET 2.0 is still a value type. "int" is a value type and so is "int?" aka "Nullable<int>".
Of course the contained type (any value type except Nullable itself) is wrapped by a new type, but said new type is not a reference type (or "class" in C# parlance), which means it is not garbage-collected. It can be boxed, though (a boxed "null" then becomes a "real" null).
Admin
"value_" is the sound when a drunken driver wants to ask the policeman "Warum" ("why?") when he is about to loose his drivers license.
Admin
Well, null-ish then?
Admin
C++ does support NULLing types like int (it just needs a small hack)! Example:
The WTF is that i saw this one in some prod. code somewhere... If i could just remember where.
Admin
I'm proposing a "close enough" operator "===":
double a = 0.0001 if (a == 0.0002) => false if (a === 0.0002) => close enough, so we'll believe it's true
We could add an additional template parameter for the desired precision... if (a ===<-4> 0.0002) => true if (a ===<-3> 0.0002) => false