Comment On OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

This is the second article in a twelve-part series that discusses the twelve finalists and their calculator submissions for the OMGWTF Programming Contest. The entries are being presented in the order submitted, and the winner will be announced on June 18, 2007. [expand full text]
« PrevPage 1 | Page 2Next »

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:25 • by Frank (unregistered)
Hmm! Could this mean that, finally, test cases return either True, False, or FileNotFound??



Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:27 • by nilp
WTF - no Linux support?

Fast!

2007-06-04 14:27 • by SB (unregistered)
Where is everybody? I've been refreshing so much, waiting to see who'll say "Fist!", that the F5 key just flew off my keyboard. (I'm sure it'll've happened by the time I submit this.)

I do like the way the calculator caches the answer. Users always appreciate these performance enhancements.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:35 • by savar
139909 in reply to 139908
SB:
I do like the way the calculator caches the answer. Users always appreciate these performance enhancements.


Is the term "hash key" the language of Dan U or the langauge of Alex P?

Followup question for whomver provided the term for this story: you were joking, right?

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:35 • by vt_mruhlin
brilliant!
I might as well go ahead and reveal my similar, yet less-obfuscated idea that I never got around to coding.

I wanted to make one that would just do a Google search for whatever expression you wanted to calculate, then parse the result.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:36 • by Joe (unregistered)
I accidentally brought my browser window into focus while it was working and that calculator was kind enough to close my browser window for me.

Awesome.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:41 • by SomeCoder (unregistered)
Given the two entries we've seen, I'd say it depends on what your take on the contest was.

This one wins hands down for a completely over the top, "WTF was he thinking", entry. The first one wins for being more "realistic".

Hard to say at this point. This one did make me say "What the f...???" :)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:45 • by stupid old me (unregistered)
139914 in reply to 139908
SB:
Where is everybody? I've been refreshing so much, waiting to see who'll say "Fist!", that the F5 key just flew off my keyboard. (I'm sure it'll've happened by the time I submit this.)


Ironic, isn't it, that you were the first to say "Fist!" :-)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:51 • by episch (unregistered)
139916 in reply to 139910
Wow, oddly enough, I had the EXACT same idea.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:52 • by Nate (unregistered)
Genius! best app ever.
can we bundle this with commercial software?? haha

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 14:56 • by Goldie
some weird stuff here :

I run the exe, put in something and click =, so far so good

now, it opens calc and puts just a 0 in it, copies the 0 into notepad and tries to save it to a directory whose name is indeed the calculation i just put in, but then it tries to save the file as filename "c/<(;àààà-sub-&;àààà<test;txt" which of course is not allowed by windows.

I tried to build it from source, but i needed to install microsoft platform SDK for that. While checking that out, i discovered another wtf : http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm

1) Downloading 11 seperate files instead of 1 package
2) Disk space requirement of 1.4 GB for a bloody development kit ???

The app sounds genius though, i would love to see it in action =)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:11 • by Mio (unregistered)
139919 in reply to 139918
Goldie:
I tried to build it from source, but i needed to install microsoft platform SDK for that. While checking that out, i discovered another wtf : http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm

1) Downloading 11 seperate files instead of 1 package
2) Disk space requirement of 1.4 GB for a bloody development kit ???


I believe it includes the .NET SDKs as well, and a LOT of documentation and _tons_ of samples. Use this download instead:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en

Flash demo? Howandwhere?

2007-06-04 15:20 • by Adam (unregistered)
Flash demo? What? Nothing comes up in Firefox, and Safari just shows "Created using Wink" with a little progress-bar looking thing that never changes. :( I wanna see it in action..!

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:20 • by jkohen
Wait, I don't get what's wrong with this approach? People have been doing this for decades on UNIX.

Addendum (2007-06-04 15:29):
I swear that my grammar was correct, but then I edited the post and I introduced a bug. s/?/./ to fix it.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:35 • by Chicken Little
139923 in reply to 139918
Did not work for me either. When I ran the exe provided, it simply crashed with an access violation. So I also downloaded the code and built the app. This time it did not crash. It flashed the windows calculator and notepad, both of which displayed the correct answer, but this calculator simply displays zero as the answer.

I thought the submissions had to pass the test cases? WTF?

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:35 • by Goldie
139924 in reply to 139919
Mio:
Goldie:
I tried to build it from source, but i needed to install microsoft platform SDK for that. While checking that out, i discovered another wtf : http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm

1) Downloading 11 seperate files instead of 1 package
2) Disk space requirement of 1.4 GB for a bloody development kit ???


I believe it includes the .NET SDKs as well, and a LOT of documentation and _tons_ of samples. Use this download instead:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en


thanks, it builds now, but the same weird behaviour persists

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:35 • by Welbog
139925 in reply to 139921
That was my reaction to this application, too. "Wow! It's a very Unix-like approach!"

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:35 • by Russ Ryba (unregistered)
139926 in reply to 139920
The Flash link is using the object tag which IE uses, but not the embed tag which other browsers use. Generally they are nested together.

Here is a direct link to the SWF movie.
http://img.worsethanfailure.com/images/200706/omgwtf/100066.swf

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:36 • by fennec
139927 in reply to 139920
Adam:
Flash demo? What? Nothing comes up in Firefox, and Safari just shows "Created using Wink" with a little progress-bar looking thing that never changes. :( I wanna see it in action..!

I'll confirm that - are you sure this isn't some ActiveX garbage or whatever? I do have Flash installed...

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:36 • by Pap
Flash demo doesn't work in Opera, either!

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:37 • by Some Guy (unregistered)
139929 in reply to 139918
Goldie:
some weird stuff here :

I run the exe, put in something and click =, so far so good

now, it opens calc and puts just a 0 in it, copies the 0 into notepad and tries to save it to a directory whose name is indeed the calculation i just put in, but then it tries to save the file as filename "c/<(;àààà-sub-&;àààà<test;txt" which of course is not allowed by windows.

I tried to build it from source, but i needed to install microsoft platform SDK for that. While checking that out, i discovered another wtf : http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm

1) Downloading 11 seperate files instead of 1 package
2) Disk space requirement of 1.4 GB for a bloody development kit ???

The app sounds genius though, i would love to see it in action =)


Broken demo? Can't build it on any machine other than the original developer's? This all just serves to make it a more authentic WTF.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:44 • by Whiskey Tango Foxtrot? Over.
139930 in reply to 139913
SomeCoder:
This one wins hands down for a completely over the top, "WTF was he thinking", entry. The first one wins for being more "realistic".


I'm thinking along the same lines. I like this second entry because it's just plain wacked out. It's also very simple, once you see how it works.

I also rather enjoy the first entry's fictional bug fix comments, as they make for a nice touch for the contest. I especially enjoyed this one:

/* 2001-06-30: John thinks this function leaks memory on occasion.
* I'm pretty sure he's just going crazy.
*/

I can see why Alex and Jake had such trouble selecting five! I seriously worry about my own submission's fate. Will I win? The competition is just too damn fierce!

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:46 • by evanm
139931 in reply to 139918
Goldie:
some weird stuff here :

I run the exe, put in something and click =, so far so good

now, it opens calc and puts just a 0 in it, copies the 0 into notepad and tries to save it to a directory whose name is indeed the calculation i just put in, but then it tries to save the file as filename "c/<(;àààà-sub-&;àààà<test;txt" which of course is not allowed by windows.


Same error as you. It does create the "hash" directories that are suppose to store the answers, but it craps out rejecting the file name.

Unless there's some documentation stating exactly why this error is occurring and how to correct it with system settings, then I think this submission should be rejected as the test cases fail. (Objective analysis here, never entered the contest)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:49 • by capnPedro
Working fine on Vista.... the real WTF?

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:49 • by Massimo
139933 in reply to 139930
Whiskey Tango Foxtrot? Over.:
I seriously worry about my own submission's fate. Will I win? The competition is just too damn fierce!


Did you get the email?

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:52 • by CH (unregistered)
139934 in reply to 139918
Goldie:
some weird stuff here :

I run the exe, put in something and click =, so far so good

now, it opens calc and puts just a 0 in it, copies the 0 into notepad and tries to save it to a directory whose name is indeed the calculation i just put in, but then it tries to save the file as filename "c/<(;àààà-sub-&;àààà<test;txt" which of course is not allowed by windows.



I'm having these problems too.
It seems like there are some minor localization issues...

To fix it, you only have to switch your system to use English keyboard layout and replace calc.exe with a calculator app which has the window title "Calculator".

Perhaps one of the other entries could be used for this purpose.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:54 • by Kokuma (unregistered)
139935 in reply to 139929
OK ! I finally managed to build it and make it work ! The "c/<(;àààà-sub-&;àààà<test;txt" error is due to keyboard layout (azerty for mine), so it needs a little tweaking of the function "void ClickString2(char *)"

The "azerty code" is the following :
void ClickString2(char* string) {

for (int i = 0; i < strlen(string); i++) {
if (string[i] != ':' && string[i] != '\\' && string[i] != '-') {
keybd_event(VK_SHIFT,0x9e,0 , 0);
keybd_event(VkKeyScan(string[i]),0x9e,0 , 0);
keybd_event(VkKeyScan(string[i]),0x9e, KEYEVENTF_KEYUP,0);
keybd_event(VK_SHIFT,0x9e, KEYEVENTF_KEYUP,0);
} else if (string[i] == '-') {
keybd_event(VkKeyScan(string[i]),0x9e,0 , 0);
keybd_event(VkKeyScan(string[i]),0x9e, KEYEVENTF_KEYUP,0);
} else if (string[i] == '\\') {
keybd_event(VK_LCONTROL,0x9e,0 , 0);
keybd_event(VK_LMENU,0x9e,0 , 0);
keybd_event(VkKeyScan('_'),0x9e,0 , 0);
keybd_event(VkKeyScan('_'),0x9e, KEYEVENTF_KEYUP,0);
keybd_event(VK_LCONTROL,0x9e, KEYEVENTF_KEYUP,0);
keybd_event(VK_LMENU,0x9e, KEYEVENTF_KEYUP,0);
} else {
keybd_event(VkKeyScan(string[i]),0x9e,0 , 0);
keybd_event(VkKeyScan(string[i]),0x9e, KEYEVENTF_KEYUP,0);
}
}
}


Default is all uppercase (windows is not case-sensitive) and we manage the '-' (lower case '6') and '\\' (AltGr == Ctrl+Alt).

Plus, if your windows is not in english, you'll have to replace all the "Calculator" in the Click* functions by the correct title of the window ("Calculatrice" for french people like me).

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:57 • by rjnewton
Cool--the results all get saved to the root of C:, so there is little danger of not being able to find them.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 15:57 • by Kilrah (unregistered)
Same, I get C:<2.0000-ADD-6.0000<test.txt which gets rejected and thus halts the process, along with the unmatched window name (French "Calculatrice") that will make the program read 0 for everything. It surely passed the test because the test machines were in English ;)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:00 • by Goldie
yup, it works now, i had to change it to "Rekenmachine" (dutch)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:04 • by M.G. (unregistered)
139939 in reply to 139910
vt_mruhlin:
brilliant!
I might as well go ahead and reveal my similar, yet less-obfuscated idea that I never got around to coding.

I wanted to make one that would just do a Google search for whatever expression you wanted to calculate, then parse the result.


Hah, I revealed my plans for the same thing five days ago: http://worsethanfailure.com/Comments/Announcement-The-Finalists-Have-Been-Selected.aspx#139626

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:06 • by TheOriginalMrMike (unregistered)
The only improvement would be to paste it to mspaint and add a wood background.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:07 • by Starfish
Seems to work on the English version of windows only.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:18 • by dabur (unregistered)
WTF it doesnt work,I only get 0's.. why why please somebody tell me, i need to use it in a project..puhleeeze somebody help me

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:19 • by Smilr (unregistered)
For those of you using Safari / Opera and other browsers that won't show the flash video:

The video's "Automaticaly start playing" setting is OFF. Right click or CTL-click on the little "Created Using Wink" box and select PLAY from the contextual menu.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:25 • by BlueKnot (unregistered)
Flash didn't work at first but a simple refresh did the trick.

It occurs to me that he *could* replace calc.exe with this simply by changing the calls to the original calc.exe to reference one of the other contest entries...

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:31 • by Izzy (unregistered)
139945 in reply to 139940
TheOriginalMrMike:
The only improvement would be to paste it to mspaint and add a wood background.


Nah. You should route it to the printer, wait for the page eject (onto a wooden table, of course), then photograph it with the web-cam to update the calculator window.

riaa: linear from 20Hz to 20KHz.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:31 • by Evilwumpus (unregistered)
139947 in reply to 139944
BlueKnot:
Flash didn't work at first but a simple refresh did the trick.

It occurs to me that he *could* replace calc.exe with this simply by changing the calls to the original calc.exe to reference one of the other contest entries...


Even better: Make it call itself! (but modify it a bit so it doesn't get an infinite loop)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:36 • by noname (unregistered)
139949 in reply to 139944
BlueKnot:
Flash didn't work at first but a simple refresh did the trick.

It occurs to me that he *could* replace calc.exe with this simply by changing the calls to the original calc.exe to reference one of the other contest entries...


That, or he could just run every calculation he'd ever need before making the replacement so the answers would be cached.

(Which brings up a missed opportunity, he could have included files for the test cases as a WTF attempt at benchmark fixing).

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:51 • by powerlord
139951 in reply to 139928
Pap:
Flash demo doesn't work in Opera, either!


It works fine on Opera 9.02... for Windows. Not sure about for other platforms.

Also, to the person who mentioned using object instead of embed, that's probably because object is part of the HTML standard, while embed is a proprietary tag.

Granted, it SHOULD have a type attribute with the correct mime-type, as clsid classids are Microsoft proprietary.

Addendum (2007-06-04 16:57):
That should read Opera 9.20. Pardon my apparent dyslexia.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:53 • by James Schend (unregistered)
Flash no-workie in most current Firefox on Windows XP SP2. Saw the other tip to right-click and select "play", but I don't even get the first frame of the Flash. Just a blank line.

Fail.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:56 • by igitur (unregistered)
139953 in reply to 139907
nilp:
WTF - no Linux support?


Hey, that .exe ALMOST works in with Wine!

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 16:58 • by Gabriel (unregistered)
139954 in reply to 139928
Pap:
Flash demo doesn't work in Opera, either!


What version? It works fine for me (Opera 9.0)

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:04 • by foobarbaz
139955 in reply to 139952
Works fine on Firefox 1.5. Finally, resisting the bloatware that is Firefox 2 has paid off!

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:10 • by Hit (unregistered)
What a great submission. Make sure to read the code too, it's littered with hilarious comments throughout.

This just feels like the epitome though of roundabout code written by people. I've seen code like this again and again. Granted, it's not this obviously stupid, but the SPIRIT is there: it's the kind of mess where you wonder if the developer ever thought "You know, there has to be an easier way."

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:13 • by PSWorx
I ROFLed, even though it has the same language dependant quirks here. can't we put that as the winner of some subcategroy? Maybe the Rube Goldberg Award of Straight Foreward Engeneering?

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:24 • by KingNetSurfer
The thing I love the most is that you can change the laws of math as they stand, simply do a calculation, go in and modify the text document in the appropiate calculation folder, and walla you have just changed math, always wanted 2+2 to equal 5, or wanted it to equal 22, well now you can.

Want to see if your kid is using the computer calculator to do his homework or actually figuring it out by hand, make all answers 1.

This one has to win hands down, I doubt any of the others will allow you to completely change the laws of Mathematics.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:31 • by dkf (unregistered)
139960 in reply to 139959
KingNetSurfer:
and walla you have just changed math
Et voilà, you've just changed spelling too.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:52 • by Mark (unregistered)
The i18n issues just add to the charm.

Re: OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator

2007-06-04 17:56 • by opello (unregistered)
139964 in reply to 139935
Kokuma:
OK ! I finally managed to build it and make it work ! The "c/<(;àààà-sub-&;àààà<test;txt" error is due to keyboard layout (azerty for mine), so it needs a little tweaking of the function "void ClickString2(char *)"

The "azerty code" is the following :
void ClickString2(char* string) {

...
}


Default is all uppercase (windows is not case-sensitive) and we manage the '-' (lower case '6') and '\\' (AltGr == Ctrl+Alt).

Plus, if your windows is not in english, you'll have to replace all the "Calculator" in the Click* functions by the correct title of the window ("Calculatrice" for french people like me).
Amazing, the beauty of open source is demonstrated here. Already a localization patch!
« PrevPage 1 | Page 2Next »

Add Comment