Basically, this.
LegacyCrono
@LegacyCrono
Best posts made by LegacyCrono
Latest posts made by LegacyCrono
-
RE: Finally nada
@Mason Wheeler said:
From a JavaScript file in our codebase:
Line 690:
try {
lines 985-987:
} finally { // nada }
(Yes, it's the same try block.)
A 295 lines long try block? What the heck, what exactly is being done there?
-
Talking to the code
I just found this on the code I'm trying to fix... Not really a big WTF but anyway.
# Go DEBUG almight, show us what's is going on! if ($debug) { print "\n\t - Environment:Device selected: $environmentsAndDevices\n"; }
(local $envName, local $hostame) = split(':',$environmentsAndDevices);
Chompz!
chomp($envName);
chomp($hostame);Clean! to assure it will be empty (concatenated variable)
$arrGrpName = "";
$arrUserName = "";(snip...)
-
RE: If would be greater than For, if I knew what If or Greater Than were for
@Julia said:
@LegacyCrono said:
Please enlighten me, because I honestly see no problem with that code.
Besides, of course, the fact that it's VB
It only processes the first row then bombs out of the loop? Looks like the original author is using For/Next/Exit to do a bounds check on IndexBeingViewed.
Ah, oops. I didn't noticed the EXIT FOR there.
-
RE: If would be greater than For, if I knew what If or Greater Than were for
Please enlighten me, because I honestly see no problem with that code.
Besides, of course, the fact that it's VB
-
RE: Diablo 3 launch
@lettucemode said:
In case you don't know about Diablo 3, its prequels basically invented the action-RPG genre.
Hahaha, under which stone have you been living? Sorry to burst your bubble, but hundreds of action-RPG games were released before Diablo (released in 1996). Just some examples: Crystalis (1990), Legend of Zelda (1987), Ys (1988), and friggin Atari 2600's Adventure (1979).
Besides, Diablo is actually what we call a Rogue-like, which is a genre that spanned from the concept of a 80's computer game called Rogue.
-
RE: Super constructor failure antipattern?
Gosh, every time I see a piece of Objective-C code, I feel like gouging my eyes out of my face.
Anyway... Apparently there IS a reason for that. Although I still don't see the reasoning behind it returning null. Or rather, calling the constructor of null. But hey, I'm not a Obj-C programmer...
-
RE: Connect the dots
@Peraninth said:
tldr: The SQL Server Management Studio query designer is only usefull for people who should not be writing queries.
Hah! Would be great for my coworkers then.
-
RE: JUnit test
Looks like he doesn't really trust his templates huh.
Oh I see the WTF, it's obviously missing the assertion below
TheClass<Boolean> tcb = new TheClass<Boolean>(); tcb.setData(FILE_NOT_FOUND); Object gotb = tcb.getData(); assertEquals(Boolean.class, gotb.getClass());
-
The Repetitive Database Access
I've started noticing a pattern on the rather large PHP/Perl (yeah) application I'm supporting now.
There's a class called DBAccess that is used to connect to the database (which is PostgreSQL) and perform queries. The class is something pretty simple and doesn't do much. Now, one would think that one instance of DBAccess would be enough for all our needs. That connecting once to the database is the best approach. But not the original developer of this... thing. (who, btw, is also my boss)
$getData1 = new DBAccess(DBSERVER1); $getData1->setSQL($sqlQuery1); $getData1->Open(); $getData1->disconnect(); // Do something with $getData1 $getData2 = new DBAccess(DBSERVER1); $getData2->setSQL($sqlQuery2); $getData2->Open(); $getData2->disconnect(); // Do something with $getData2 $getData3 = new DBAccess(DBSERVER1); $getData3->setSQL($sqlQuery3); $getData3->Open(); $getData3->disconnect(); // Do something with $getData3 $getData4 = new DBAccess(DBSERVER1); $getData4->setSQL($sqlQuery4); $getData4->Open(); $getData4->disconnect(); // Do something with $getData4 // ... snip ... $getData12 = new DBAccess(DBSERVER1); $getData12->setSQL($sqlQuery12); $getData12->Open(); $getData12->disconnect(); // Do something with $getData12