- 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
Nice 'Creative' idea I suppose.
Admin
What? No SQL query sent by the client that the server blindly executes for the arithmetics.
I can't wait to see a calculator with "MSSQL or Oracle" as a requirement.
Admin
the real WFT is the web browser is bon echo... someone needs to upgrade to a stable version :)
Admin
Admin
I was trying to do this just the other day. I didn't know it was possible. It is possible to send an ajax request, and have that request return javascript, that is then executed?
I lose for seeking support here.
Anyways, keep the wtfcalcs coming, very entertaining.
Admin
you can use eval() to execute a string as JS.
http://www.devguru.com/technologies/javascript/11460.asp
Admin
The real WTF is that it uses port 12345, which is also the Netbus port. I hope muy vict... errr friends don't start using this calculator...
Admin
Wow. This is truly an OMG code but, unfortunately, not WTF code.
A webserver (with content !) in 10KB of C? With Ajax? Most people rarely touch Ajax without js libraries, and jQuery is 19KB compressed (!). This calculator even has error handling ("Check Internet connection") and sensible comments!
I think that the author would have better chances if he spent more time WTFing the code rather than improving it.
Nonetheless, I'm truly impressed at the author's skills, I haven't seen something like this in a while.
Admin
Admin
At first I wasn't impressed, but this is actually kind of cool. Its a web app with NO web code. There are no JS files, no JSP, no ASP, no PHP, no nuthin'. (Not counting JS hardcoded in the server itself, of course.)
Admin
Anyone had a look for obvious buffer overflows?
Admin
Admin
Admin
Give this person the laptop :-D :-p
This, to me, is a WTF in the truest sense of the expression. It works, it's nice code, it's efficient, infact it's quite brilliant but deep underneath the covers there is a nasty piece of work no one could possibly expect.
It's not until you delve deeper that you truly start to understand the horror of this snippet. I'm concerned that I have been reading comments such as this isn't a WTF. So let's revisit what this is doing... It is a calculator making requests on google for the answers to simple maths expressions and people don't see the WTF in that?
This is a prime example of WorseThatFailure and goes far beyond silly true/false/maybe sort of stuff we've been seeing of late.
Admin
wtf does wtf have "marital aid" ads? doesn't seem very worksafe to me:
http://pics.livejournal.com/cowbert/pic/00001s2t
Admin
TWM for teh win! How long it's been since I've seen one of these... I must be getting old
Admin
It's actually a bizarre ad for the TV series "The 4400". How odd...
Admin
Nicely done. I heard about the google query calculator, and was wondering if anyone would pull it off. A very ineffective approach, but the code itself very much devoid of wtfiness, which is kinda a shame.
Keep 'em coming, I wonder who gets the nice wallpaper and such (and if he perhaps is willing to share it by parsing each byte as ints through his calculator to us :o)
Admin
BASIC on a TI-99/4A at six and then C on the Amiga. Sounds like Dave and I have a lot in common.
My first few BASIC programs made starships fly off the top of the screen...
Admin
I can credit my TI for drilling me in binary-to-hexadecimal. After all, Bill Cosby knows computers.
10 CALL CHAR(128, "3C42A581A599423C") 20 CALL CLEAR 30 FOR I=1 TO 24 40 CALL HCHAR(I, 1, 128, 32) 50 NEXT I 60 GOTO 60
Memories... ^_^
Admin
It has no rounded corners though. Clearly not "AJAXy" enough.
Admin
Unfortunately a lot of 'Web 2.0' sites use exactly this methodology without realising what a WTF it actually is
Admin
You return the javascript & then eval it. I can't find it now, but yesterday I found one that was using httprequest to dynamicly import javascript functions, eval them, then add them to the window.function list.
Admin
for pure creativity, this submission, while bending or liberally interpreting the guidelines, is a winner!
Admin
Granted couldn't you do CALL HCHAR(1, 1, 128, 768)?
Also, I am insulted about the "six year old" comment of the writeup. A six year old can write a random snowflake program, or a fill the screen with random garbage program. Or mess with plotting SIN( ) on a really coarse 32x24 text display.
I can't say I'd ever even thought of something as mundane as a 10 PRINT "CRAP" 20 GOTO 10 program. Its results would be obvious, and you learn very quickly about the FCTN-F4 (Clear) or C= RUN/STOP key.
Admin
Could anyone make it work correctly on browsers other than Firefox? I've tried it on Opera and IE7, and the number entry was broken on both. Or is the dependency on a single browser part of the WTF?
Admin
It's a WTF that it's dependant on a single browser that ISN'T IE.
Admin
WTF?
Admin
I think the article could do more to emphasize that the "server" in this submission actually sends the calculation to GOOGLE through http and parses the response from html before sending it back to the Javascript Ajax call.
I didn't notice it until I downloaded the source and read it.
Admin
That's not Web 2.0-ish at all. Look, the name at the top is in a serif font, the buttons' corners aren't rounded, and there's not a shade of greyish-blue or bluegreen anywhere.
Admin
Ah yes, CALL CHAR...
...taught me how to count in binary when I was 6 years old.
I remember for no good reason, I defined actual lowercase letters just for the sake of doing it.
Admin
(Yes, Adam, I am who you think I am.)
Admin
Dave, you're my hero.
Admin
Oh god, I'm having flashbacks to my group project for a class where we had to use Squeak.
We figured we didn't have time to write the fuzzy string comparison method that would tell you how similar two last names were (it was a genealogy program), so instead we took the arguments to the function, plugged them into a CGI script on some genealogy website, parsed the resulting HTML, and returned the result. Our program would fail if they changed the layout of their website.
We weren't slackers either, we had just spent most of our time fighting with that stupid, ugly, undocumented bastard of a language. Hate Squeak SO much... It makes me cry that they're putting it on the OLPCs.
Admin
OK, I did actually come up with the idea to use Google to do the actual calculations as well. Guessed I wouldn't be the only one and besides, I couldn't be arsed to actually write it ;)
However, this solution adds several more fine layers of exploitable web 2.0 AJAXy goodness. I would call it a winner :)
Admin
WPI FTW!
After reading some of the finalists, I thought it would be funny to wrap Google, and lo, someone did. The code sounds clean, which means it probably won't win.
Admin
The code isn't that clean!
It is littered with potential buffer overflows, poor error checking, and gross inefficiencies.
Then again, so is most code.
LOl
Admin
...so I didn't have to.
I was "this" close to going through with it... I had actually written a[n] (obscenely complex) regex for parsing Google'c calc output.
Then I promptly shoved everything into a wastebasket, lit it on fire, and downed two fifths of vodka.
Enjoy your laptop.
Admin
http://www.forex.co.ir http://www.meta-fx.com forex فارکس