- 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
What the hell is up with those <font face="Arial"></font>-tags in beginning of the text?
Admin
As I understand it, Adblock intercepts the HTML you download from the server, and either inserts CSS to set the display style for unwanted items to "hide", or removes them altogether, before passing the page source on to the rendering engine. Or maybe it changes "IFRAME SRC=ad.php" to "IFRAME SRC=about:blank" or similar. I'm not positive.
Anyway, as a result the rendering engine has no reason to request the blocked items (be they images, IFRAMEs, or what have you), so they're not downloaded. I used to have a proxy to do the same thing (Proxomitron FTW!) before I switched to FF. Whichever way you do it, the point is to take the reference to the ad out of the HTML source before it gets rendered -- clever and effective. I love my ABP!
Admin
That's because it's actually TIME WAIT.
No, no, no, you just add a third column, RealText, with a 255 length, just in case there is anything using the original with a too-small buffer and no checks.
Admin
[5], [6], [7]? I think your internet browser (or your mind) used fill series rather than copy cells. :)
Admin
Arrays in C and it's derivatives are zero based, so months[1] will actually give you the second entry, which in this case happens to be "Jan". Mapping 1 to "Jan" seems pretty correct to me...
np: Justus Köhncke - (It's Gonna Be) Alright (Safe And Sound)
Admin
At least this system was written in C and is supported by Oompa Loompas. I work with a system written PL/1 and is supported by a bunch of cavemen.
Admin
Wibble Wobble WTF
Admin
Problem with BIT datatype is that it's nullable, leading to a trinary state of null, 1, 0.
Admin
BIT binaryflag NOT NULL ?
Admin
Yes, if a business is confusing "bowls" with "bowels" then I certainly don't want to eat in the company cafeteria.
Admin
Admin
Except in C, where struct tm has a member called tm_mon that's 0-11.
Admin
that would be especially useful in the case of an external "malformed string" attack. then the system will automatically resize the table to however long a mess is injected where it doesn't fit. beautiful workaround. the only issue is having to randomly upsize drives all the time for lord-only-knows what reason.
Admin
I wish I could get paid for the time I just wasted trying to figure out what those code snippets are supposed to do.
Admin
The 'minim' is a WTF in itself. By using minims to build up letters in times past, scribes made it impossible for readers to discern "m", "n", "u" etc from each other. (Let alone words like "minimum".)
Admin
At last! A real WTF that doesn't pussy around with the sort of insane database crap that one expects from insane database freaks!
Not that you'd be able to deduce this from most of the comments, however.
The "Oompa Loompa" joke is inspired.
The TCP/IP state-handling code is, well, not quite genius level. It misses out both the 1% inspiration and the 99% perspiration. I am, however, impressed that it has been cut'n'pasted twenty times or more, without anybody muttering the magic three letter incantation to themselves.
I can actually solve the massively-distributed bit of this problem for these people. I'd have to kill them after I showed them the solution of course; purely for the benefit of the gene-pool, you understand.
But I'm not going to tell you how.
Admin
sp_addtype(). Informix's (and Microsoft SQL Server's) lame version of CREATE DOMAIN.
If you're going to use BIT, better be sure you'll never need a value for "don't know/don't care" in that field.
OT, you have to serve it the SQL -- why is it called SQL Server? ;-D
Admin
No they don't. C arrays are 0-based. So month 0 is the blank one, month 1 is Jan, etc.
And for the rest, I assume they meant bowels, not bowls.
Admin
Use bit for booleans, make sure you mark it as NOT NULL. For enumerations, you could create a lookup table with a foreign key if you really wanted to, but it's a lot of overhead for just a few values. There's a couple of other options...
You could create an enumeration in code and just store the underlying integer value in the database. For example, in C#...
public enum MyStatus { New, InProgress, Complete }
int myStatus = (int)MyStatus.InProgress;
If you need something more descriptive in the database for something like a separate reporting module, you could store the text of the enumeration instead -- but then you risk the application breaking if someone renames a value in the enumeration.
string myStatus = MyStatus.InProgress.ToString();
There are a few ways to skin this cat. I'm sure others have differing suggestions.
Admin
Oh god, what do we do if I'm born in xx20 to xx80? or legitimately born in 1915? its y2k all over again.
Admin
use EFILE
Admin
I've got a system with some of this code we're trying to get out of the door. The sinking feeling in my stomach is because the WTF code I just read is better than the code on the screen in front of me.
Admin
Only storing the int or the text of an enumeration is IMHO not a good idea. You create an invisible dependency. The first person who changes the enumeration breaks the code.
So I usually go for the lookup-table solution if possible. You could use a constraint or an user defined type (I know that SQL Server supports this, Oracle probably too). Unfortunately I usually use diagrams to view/control my database and constraints/ are not immediately visible present while a lookup table is.
Constraints/user defined types are also more limited then a lookup table (in SQL Server anyway, don't know in other products). I usually prefer numbers as unique values in enumerations (be it in code or in the database) instead of strings. I usually work in ASP.NET and depending on the culture (English Americain,...) that you use for your code a string compare can fail or not fail. Numbers compare always the same way. But I also want a string representation of those unique values so an lookup table is the way to go.
Admin
Admin
if (youreHappyAndYouKnowIt){ ClapYourHands(); }
Admin
I have done code like that which would update the year entered by the user as soon as the input field lost focus. But where this example uses a fixed cutoff at 20, I made it dynamic based on the current year. Such that in 20 years the code would still behave as the users expected.
Admin
Of course, why haven't I ever done that. If I can't listen port, what I want then I try to listen ports that are close to the one I wish to listen. Maybe some whispers on packets come trough. I recommend that this site will begin doing the same, so when it can't listen at port 80, it listens 81, 82, 83 or 84.
NB: The 1,800-line function called "doit" is actually documented. The HPC wrote the diagrams and ideas on napkins and maintenance programmers were simply unqualified to look from there
Admin
The real WTF is that programming is done in bowls.
Admin
Admin
Admin
Of course bits being just 0 and 1 dont have any real meaning - other than the conventions that non sql people follow... in SQL of course, 0 represents success... so we like to have things explicit. It helps on presentation too, or indeed nice outer joins that show the number of x and ys even if no ys exist.
But programmers never have to do all that kind of tedious crap, they just move onto the next piece on unmaintainable Front Ahead Design Enterprise app.
captcha - appellatio - sounds rude to me ;)
Admin
As informed programmers know, we immortals were born in the year 60. I for one appreciate not having some nitwit add 1900 years to my birthdate. But don't worry, the problem will be solved as soon as I cut off the heads of all my fellow immortals.
Admin
And what happens in 2020? Or if someone mistakenly uses this function for birth years rather than the current year?
Admin
I find that the latter typically works best when written on the back of beer vouchers. Of course, the Architect has to hang out with the plebs down the pub, but then we all have our cross to bear.
Admin
Boo, it's another dolt.
The whole purpose of this site is reading other people's terrible code. Perhaps you shouldn't be loading it in your browser then?
Admin
All right... let's see here. How do I get "Feb?" Is it... months[2]? Huh... no that returns "DoWibble." Hmm... is it... months[1][2]? Huh.. no that returns the Radial Tires object. Maybe its months[5][2]? No, that's "grandma's cookies." And months[20][12][4][2] returns "12." [Snip][Snip][Snip] AH!! I found it! To get Feb, you have to use months[13][4][2]! Of course! How aptly named.
Admin
The flexibility!
Admin
You can set AdBlock to download but not display, or to not download. I don't know if AdBlock+ has that functionality.
Admin
Admin
By any chance was this a program to calculate the answer to "who's on first"?
Admin
The ONOFFTABLE bit reminds me of some code my last roommate was writing. Except that that was the only table in the database... and the database was built in access.. to support a VB.Net app that used a separate access db as a backend.
Oh the nightmares this will cause.. I think I need a drink.
Admin
No if they use the month number converted to integer to index the array (we agree the array begins at index 0, right?). Indexing the array is faster than substraction, and substraction will be far more cryptic. What you people don't get is that this was designed for clarity, not for performance (just look at the 10 if blocks) ;)
It's self documenting code!
Admin
This wasn't, by chance, a Canadian financial institution with a TLA, was it? Related to good old Wall St?
I've seen a roughly 1800 line function with a name something like "doit", which copied values from one SQL db into another.. It had a 3-400 line while loop, IIRC...
Admin
This code is eirily similar to a system I used to work on that was written in PHP, it used to use CURL requests on HTTP to get servers accessing databases, instead of accessing them directly, most variables where called things like $loop25 and there was a common occurrance of the variable $doit, which could have many numerical values which made one massive script do all sorts. Wierd thing is, I never knew the guy who coded it could write C.
Admin
the system i'm currently working on uses a mixture of integers, smallints, tinyints, bits, and strings to represent boolean values. better still, its the same in the code.