- 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
It was fun running it on the live production server, 12 seconds :[D
Admin
Admin
Thats pretty awesome!
Admin
This has already been done in SQL: http://forge.mysql.com/tools/tool.php?id=25 and the source was more elegant.
Admin
I feel much better about my lotto number generator I once wrote in SQL.
Admin
Admin
Here's an obfuscated C version of the above. Expects an 80 column output window.
#define problems > #define crazy ++ #define confused = #define fool < #define obfuscation for #define decoding putchar #define makes ( #define absolutely ) #define no { #define sense float #define bamboozled } #define screw += #define this main #define hell * this makes absolutely no sense totally, bloody, pissed, even_more, you, me; obfuscation makes me confused -15; me fool 16; me crazy absolutely obfuscation makes you confused -63; you fool 17; decoding makes even_more problems 116?32:46 absolutely, you crazy absolutely obfuscation makes totally confused bloody confused even_more confused 0; even_more crazy fool 116&& totally hell totally + bloody hell bloody fool 4; pissed confused totally, totally confused totally hell totally - bloody hell bloody, bloody confused pissed hell bloody hell 2, totally screw you / 40, bloody screw me / 16 absolutely;bamboozled
Admin
Sentinel has converted the following code into oracle syntax in the following thread:
http://forums.oracle.com/forums/thread.jspa?threadID=828677
hope he doesn't mind me reposting:
with ord as (select rownum - 1 xyz from dual connect by rownum <= 100) , xgen as ( select -2.2 + xyz0.031 cx, xyz ix from ord) , ygen as ( select -1.5 + xyz0.031 cy, xyz iy from ord) , z as ( select ix, iy, i from xgen, ygen model partition by (ix, iy) dimension by (0 i) measures (cx, cy , cx x , cy y ) ignore nav rules iterate (100) until (X[iteration_number] * X[iteration_number] + Y[iteration_number] * Y[iteration_number] > 16) ( cx[iteration_number] = cx[cv()]+cx[cv()-1] , cy[iteration_number] = cy[cv()]+cy[cv()-1] , x[iteration_number] = cx[cv()]+x[cv()-1]*x[cv()-1]-y[cv()-1]*y[cv()-1] , y[iteration_number] = cy[cv()]+y[cv()-1]*x[cv()-1]*2 ) ) select replace(ltrim(max(sys_connect_by_path(i,'|')) keep (dense_rank last partition by ix),'|'),'|') from (select ix, iy, substr(' .,,,-----++++%%%%@@@@### ',least(max(i),26),1) i from z group by ix, iy) connect by iy = prior iy and ix = prior ix + 1 start with ix = 1 group by iy;
Admin
Admin
TRRWTF is that Ie reads this page and couldn't work out that he was attempting to run SQL from 2005+...Did you not see the PIVOT operator and realise? tut tut!
captcha: persto - a bit like pesto but with peronality?
Admin
Incidentally, here's the same query for Postgres:
WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( SELECT IX::integer, IY::integer, X::float, Y::float, X::float, Y::float, 0::integer FROM (select -2.2 + 0.031 * i, i from generate_series(1,100) as i) as xgen(x,ix), (select -1.5 + 0.031 * i, i from generate_series(1,100) as i) as ygen(y,iy) UNION ALL SELECT IX, IY, CX, CY, X * X - Y * Y + CX AS X, Y * X * 2 + CY, I + 1 FROM Z WHERE X * X + Y * Y < 16::float AND I < 100 ) SELECT array_to_string(array_agg(SUBSTRING(' .,,,-----++++%%%%@@@@#### ', LEAST(GREATEST(I,1),27), 1)),'') FROM ( SELECT IX, IY, MAX(I) AS I FROM Z GROUP BY IY, IX ORDER BY IY, IX ) AS ZT GROUP BY IY ORDER BY IY ;
Admin
And again with a "[ code ]" tag around it:
Admin
Everything can be done in shell scripting, of course ;)
http://www.dctsystems.co.uk/RenderMan/rensh.html
Admin
Go to http://sql-ex.ru/?Lang=1, there you can find a lot more such SQL tasks.
Admin
Sorry - the prize for MOST useless programming is still held by the creators of Vista.
Admin
You're right, it does look like your wife's episiotomy!
Admin
All you have to do is remember that Benoit Mandelbrot's name is pronounced Ben-wah Maw-Dell-Brote and you'll never misspell it again!
Admin
Admin
That's a bit harsh. Vista has proven to be a terrific platform for running many critical applications, such as Norton Antivirus, Spybot Search & Destroy, O&O Defrag, Ad-Aware, RegOptimizer, and it even comes with Windows Update and System Restore!! That's a hell of a lineup!
Admin
Here is a raytracer in Linq, which is sorta-like-real-sql-but-not-quite-cause-its-in-csharp-with-syntax-hightlighting-and-colorful
http://tirania.org/blog/archive/2007/Nov-16.html
Admin
Wow, how freak'n cool is that! Dude it rocks!
Admin
What, no Julia set?
Admin
And that's why, comments should be disabled.
3 pages of nothing!
The Mandelbrot trick looked great! Ignore the griefers.
Admin
$WTF == "Well Thought, Functional";
Admin
Where do these people find the time to do these things?!
Admin
Ok, so maybe I went a little mad. I used this T-SQL as a base to construct a JS (and thus entirely client-side) ASCII-Art Mandelbrot explorer - allowing you to zoom in and out and move around the "image" at will. It's considerably quicker than the T-SQL version, though it's not instant (and speed will of course depend on your hardware). Enjoy!
Admin
Modify the values in the Cast() statements. The first value is the starting point and the second value is the step size for each of IX and IY.
Admin
It actually is pretty cool code. I'd give bonus point for the use of a CTE and PIVOT.
Admin
Holy cow... that my friend is not a stupid trick..its amazing...my reaction when i say the output...wtf
Admin
To funny for words
Admin
reminds me of a gag program i saw: type in a word, and it makes a "sine wave" on the screen with that word...