• Frank (unregistered)

    Hmm! Could this mean that, finally, test cases return either True, False, or FileNotFound??

  • nilp (cs)

    WTF - no Linux support?

  • 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.

  • savar (cs) in reply to SB
    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?

  • vt_mruhlin (cs)

    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.

  • 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.

  • 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...???" :)

  • stupid old me (unregistered) in reply to SB
    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!" :-)

  • episch (unregistered) in reply to vt_mruhlin

    Wow, oddly enough, I had the EXACT same idea.

  • Nate (unregistered)

    Genius! best app ever. can we bundle this with commercial software?? haha

  • Goldie (cs)

    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 =)

  • Mio (unregistered) in reply to Goldie
    Comment held for moderation.
  • 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..!

  • jkohen (cs)

    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.

  • Chicken Little (cs) in reply to Goldie

    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?

  • Goldie (cs) in reply to Mio
    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

  • Welbog (cs) in reply to jkohen

    That was my reaction to this application, too. "Wow! It's a very Unix-like approach!"

  • Russ Ryba (unregistered) in reply to Adam
    Comment held for moderation.
  • fennec (cs) in reply to Adam
    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...
  • Pap (cs)

    Flash demo doesn't work in Opera, either!

  • Some Guy (unregistered) in reply to Goldie
    Comment held for moderation.
  • Whiskey Tango Foxtrot? Over. (cs) in reply to SomeCoder
    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!

  • evanm (cs) in reply to Goldie
    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)

  • capnPedro (cs)

    Working fine on Vista.... the real WTF?

  • Massimo (cs) in reply to Whiskey Tango Foxtrot? Over.
    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?

  • CH (unregistered) in reply to Goldie
    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.

  • Kokuma (unregistered) in reply to Some Guy

    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).

  • rjnewton (cs)

    Cool--the results all get saved to the root of C:, so there is little danger of not being able to find them.

  • 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 ;)

  • Goldie (cs)

    yup, it works now, i had to change it to "Rekenmachine" (dutch)

  • M.G. (unregistered) in reply to vt_mruhlin
    Comment held for moderation.
  • TheOriginalMrMike (unregistered)

    The only improvement would be to paste it to mspaint and add a wood background.

  • Starfish (cs)

    Seems to work on the English version of windows only.

  • 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

  • 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.

  • 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...

  • Izzy (unregistered) in reply to TheOriginalMrMike
    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.

  • Evilwumpus (unregistered) in reply to BlueKnot
    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)

  • noname (unregistered) in reply to BlueKnot
    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).

  • powerlord (cs) in reply to Pap
    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.

  • 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.

  • igitur (unregistered) in reply to nilp
    nilp:
    WTF - no Linux support?

    Hey, that .exe ALMOST works in with Wine!

  • Gabriel (unregistered) in reply to Pap
    Pap:
    Flash demo doesn't work in Opera, either!

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

  • foobarbaz (cs) in reply to James Schend

    Works fine on Firefox 1.5. Finally, resisting the bloatware that is Firefox 2 has paid off!

  • 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."

  • PSWorx (cs)

    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?

  • KingNetSurfer (cs)

    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.

  • dkf (unregistered) in reply to KingNetSurfer
    KingNetSurfer:
    and walla you have just changed math
    Et voilà, you've just changed spelling too.
  • Mark (unregistered)

    The i18n issues just add to the charm.

  • opello (unregistered) in reply to Kokuma
    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 *)" <p>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!

Leave a comment on “OMGWTF Finalist #02: The FileSystemHashMapNotepadCalculator”

Log In or post as a guest

Replying to comment #:

« Return to Article