[quote user="Carnildo"]IIRC, in relational algebra (ie, SQL), any comparison involving null returns false.[/quote]
Posts made by Azrael
-
RE: Legacy code. Or: If they are both null, only one is null, or neither is null...It's really a question about the realm of logic that the logic operators operate in. Are they diagraph or trigraph? C++ versions operate as diagraphs. Nulls are converted to false immediatly before we do any logic operations. SQL works in trigraph, where nulls are preserved through the operations and only converted to false if a true/false judgement has to be made.
-
RE: Wrapping direction?
[quote user="dhromed"]
"Wrapping" is an oddly transitive verb (there may be some better term for it, but English is not my native language and I suck at grammar jargon)
You can wrap foil, but you can also wrap meat. So when someone says "wrap this", he should probably explain which gets wrapped around what, if it's not obvious from the two subjects involved (you obviously can't wrap meat around foil.). For example, you can wrap DirectX around OpenGL, and you can wrap OpenGL around DirectX. If some guy says "we need to wrap DirectX" he's not being clear.
Except when it's obvious from context. If you [i]know[/i] you need to use the OpenGL API in the project, the guy obviously doesn't mean you wrap DirectX around OpenGL. :)
[/quote]
You wrap something. Something being the subject of the whole wrapping experience. The difficulty comes in when people omit the other words, because english speakers are lazy. You can wrap with foil, or use foil to wrap. The problem is that people don't think that foil itself is a wrappable item (its for wrapping with) and so english speakers insert the with.So wrapping DirectX is that. We are going to hide DirectX behind something (foil could be used, but might not work).But then again with modern event driven programming you don't know who's wrapping what. The OS is wrapping the hardware for your program, and your program is wrapping some logic for your hardware. Pickup a perspective of what's wrappable and stick to it. -
RE: Redesigning Paste
Auto formating is a good thing. Select some text tell the editor to apply my formatting standards to it.
The problem is also that auto formating is a bad thing. There are times when you need to lay code out differently so that the really important features are immediatly obvious.egSOME_CONST_VAR = 6;SOME_MUCH_LONGER_CONST_VAR = 12;TINYCONSTVAR = 18;REALLY_REALLY_REALLY_REALY_REALLY_LONG_CONST_VAR = 34;SOME_CONST_VAR = 6;SOME_MUCH_LONGER_CONST_VAR = 12;TINYCONSTVAR = 18;REALLY_REALLY_REALLY_REALY_REALLY_LONG_CONST_VAR = 34;NOTE: the equals are meant to be at the same indentation.The latter isn't a formatting style i normally use, but sometimes the important bit is accross severall lines and needs to be made blantently obvious. The format on paste would destroy this, along with the semantic information i need to get accross to other developers. Granted it's still there, but you have to look for it.So it is smart to have a format on paste (lets say control + shift + v) and a standard verbatim copy of the clipboard paste which happens to be control + v.Cheersps.it would also be nice if programming languages could provide an unobtrusive character that is simply ignored during compilation so that lines could be followed more easily. -
RE: Semaphores + error checking == uh oh.
[quote user="foxyshadis"][quote user="hk0"]
Semaphores can be used to make sure no more than "N" entities can hold an object. You initialize the semaphore to the "capacity", and down operations decrement this counter. When you hit zero, you block.
Typically a semaphore is initialized to one since most people use it like a mutex.
[/quote]
The best mutex is obviously a file opened for exclusive writing. If it's good enough for a web application it's good enough for the kernel!
[/quote]HANDS OFF THE KERNEL, RIGHT NOW!PUT THEM UP IN THE AIR WHERE I CAN JOLLY WELL SEE THEM!!STEP BACK AND AWAIT SUMMARY EXECUTION!!!So how were you going to get exclusive access to a file on a multi process system? You need to get a lock, so we open up a file exclusively. But wait we need a lock to open that file up exclusively so we need to ...It might work for a web server, because it can indirectly get the kernel to do what it really wanted to do in the first place. It doesn't work in many parts of the kernel. Sometimes because there are parts of the kernel which don't understand the concept of a file. Sometmes because they would create a cycle like i've illustrated just before, but mostly because it's just too damn expensive. Especially when there are dozens of nicer aleternatives. -
RE: Is it a Number?
[quote user="marvin_rabbit"][quote user="savar"][quote user="nbit"]
public static boolean isNumber(char c)
{
return c >= '0' && c <= '9';}
[/quote]
Should be isDigit(char c)....
[/quote]
No... You don't want to call it isDigit() because there is already an isDigit function. hmmm. Hey wait a minute guys! I think I have an idea!!!
[/quote]The really sad thing is that you still haven't picked up the underlying problem with this code. Your makeing the assumption that it is encoded as ASCII. What about all the other really fun codecs who don't have a nice unbroken binary sequence between 0 and 9.Not that i can think of any, but as IT pro's we should at least entertain that idea.