Stupid Coding Tricks: The T-SQL Mandelbrot

  • Rhywden 2008-11-19 08:04
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Note from Alex: Ugh... fixed! I really should start writing these before 2AM...
  • squeamish ossifrage 2008-11-19 08:05
    OK, I admit it, I've been known to stare into the cosmic wonder of the Mandlebrot Set while under the influence of a mind-numbing ... uh, margarita.

    But in this case I think it would be much more interesting to gaze into the depths of the brightly colored source code.
  • Someone You Know 2008-11-19 08:09
    Alex Papadimoulis:

    The bar for entry into CodeSOD is pretty straight forward: professionally-developed code that elicits that certain What The— reaction.


    Is there really any point to censoring the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway?

    Come on, this is a submarine! This is not a monastery!
    Can you say s u b m a r i n e?
    Ah, forget it. I'll pull something from my personal library.
  • Carl 2008-11-19 08:10
    And this is why programmers should not be math majors.
  • zikko 2008-11-19 08:10
    The T-SQL Madlebrot
    I could use T-SQL to generate... Madelbrot."
    a text-representation of a Mandelbrot Set.

    Three different version! What the fuck?
  • tdittmar 2008-11-19 08:15
    Rhywden:
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Which would be...? "Mädelbrot" macht keinen Sinn, "Madenbrot" scho, aber "Madelbrot"?
  • dkf 2008-11-19 08:16
    This reminds me of when (many years ago now) we sent a postscript file to our brand-new 300dpi printer which computed and displayed the Mandelbrot set at maximum resolution, with all computations performed in the PS interpreter. I don't remember if it was an overnight job or an "over a long weekend" job, but it was definitely awesome...

    No, I don't have the code.
  • Zagyg 2008-11-19 08:31
    I like it, let's see more like this. Probably like most folk here, I wish I had more time at work to be bored and produce similar inanity.
  • blindman 2008-11-19 08:33
    I coined a term for this type of entertaining, yet uselss code a long time ago: "MSSQLbation".
  • google HR manager 2008-11-19 08:33
    Dammit, Alex, now I'm going to have to rewrite one of the questions on our 15 minute handwritten pre-interview test.
  • Heinz 53 2008-11-19 08:37
    tdittmar:
    Rhywden:
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Which would be...? "Mädelbrot" macht keinen Sinn, "Madenbrot" scho, aber "Madelbrot"?


    In Austrian dialect, Mädel is maiden (Mädchen), and who knows, maybe there is some kind of bread made by maidens. Or maybe, if you put it into the context of the file "Hostel", bread made out of maidens...
  • Tachyon 2008-11-19 08:37
    zikko:
    The T-SQL Madlebrot
    I could use T-SQL to generate... Madelbrot."
    a text-representation of a Mandelbrot Set.

    Three different version! What the fuck?


    Seems like the text was generated by a Mandelbot...
  • mauhiz 2008-11-19 08:40
    that easily owns any of my usual bored activies.
  • Alistair 2008-11-19 08:50
    I take it this is SQL Server 2005+ only, I bravely tried to crash our server running this but just got syntax errors!
  • snoofle 2008-11-19 08:53
    How about [i]Impressively Useless[i] Coding Tricks?

    Could be an interesting regular feature!
  • memals 2008-11-19 08:54
    Just for *fun* I took the ispell 354984 word list and rot13'd it. then I checked how many *encoded* strings matched real words from the original list.
    Zero matches :( I am very disappointed. I expected at least 1% to *encode* into another valid string.
    I was amazed how quickly the following commands ran
    cat ROT13.LST | uniq -u > BIG.LST
    cat mword10/SINGLE.TXT | uniq -u >> BIG.LST
    cat BIG.LST | uniq --repeated > ROTRES.LST
    ROTRES.LST was empty, uniq -u removed any duplicates.
    echo owl >> test.file
    echo fox >> test.file
    echo owl >> test.file
    echo owl >> test.file
    cat test.file | uniq --repeated
    Gave the correct result "owl"
  • Smeagle 2008-11-19 08:56
    Depends on the region. Here in Bavaria, it's "Madel" for girl. So "Madelbrot" would be girlybread?

    - Oliver
  • Mark 2008-11-19 08:58
    My WTF on this is why was he at work on a Sunday (10-12-2008) with nothing better to do?
  • g 2008-11-19 09:01
    2005+ (as it uses PIVOT).

    It only took 11 seconds to run on my local VM, so I think you'll be alright ;)
  • adiener 2008-11-19 09:01
    This reminds me of a friend of mine, who was working on writing a raytracer in SQL last time I talked to him.
  • Sean 2008-11-19 09:06
    dkf:
    This reminds me of when (many years ago now) we sent a postscript file to our brand-new 300dpi printer which computed and displayed the Mandelbrot set at maximum resolution, with all computations performed in the PS interpreter. I don't remember if it was an overnight job or an "over a long weekend" job, but it was definitely awesome...

    No, I don't have the code.


    http://warp.povusers.org/MandScripts/ps.html
  • JD 2008-11-19 09:10
    The Article:
    What's the most useless thing I could do with my time without actually doing anything?

    How about this website?
  • UUoCA 2008-11-19 09:13
    http://partmaps.org/era/unix/award.html
  • Herman 2008-11-19 09:14
    I made a 2.5D rolling ball application made out of WinForms buttons once.

    facilisis = the new syfilis, get it NOW!
  • ion 2008-11-19 09:15
    Here’s an ASCII mandelbrot in dc(1) i made a few years ago:

    [lolssdsl0lqx]sx[1+lddd*lld*-ls+dsdrll2**lo+dsld*rd*+4<kd15>q]sq[q
    
    ]9ksk[d77/3*2-ss47lxx-P1+d78>0]s00[d23/.5-3*so0l0xr10P1+d24>u]dsux
  • ion 2008-11-19 09:21
    Oh, since the article mentioned quines, i might as well include a dc quine:

    [91PP[dx]93PP]dx
  • blah 2008-11-19 09:22
    TRWTF is that you made a screenshot out of plaintext you had on hand. Clearly you should have pasted it into Paint first, shot that, and pasted that into another imaging app, and included a shot of that.
  • Carl 2008-11-19 09:23
    blah:
    TRWTF is that you made a screenshot out of plaintext you had on hand. Clearly you should have pasted it into Paint first, shot that, and pasted that into another imaging app, and included a shot of that.

    ... on a wooden table.
  • BadFellas.org 2008-11-19 09:29
    Stupid coding trick? This is awesome! :D This is a clever waste of time, not a WTF!
  • ParkinT 2008-11-19 09:34
    BadFellas.org:
    Stupid coding trick? This is awesome! :D This is a clever waste of time, not a WTF!

    Acknowledging that I took the time to read these comments is a true WTF/WoT (Waste of Time)
  • anne 2008-11-19 09:38
    Heinz 53:
    tdittmar:
    Rhywden:
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Which would be...? "Mädelbrot" macht keinen Sinn, "Madenbrot" scho, aber "Madelbrot"?


    In Austrian dialect, Mädel is maiden (Mädchen), and who knows, maybe there is some kind of bread made by maidens. Or maybe, if you put it into the context of the file "Hostel", bread made out of maidens...


    Doesn't "Mandel" mean tonsil? Back in the day we used to laugh about old tonsil bread and his set. Seriously.
  • blah 2008-11-19 09:38
    Someone You Know:
    Is there really any point to censoring the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway?
    This is Alex we're talking about. The same guy who renamed the site because of his grandma.
  • Kyre 2008-11-19 09:42
    Courtesy of the great JoCo:

    Take a point called Z in the complex plane
    Let Z1 be Z squared plus C
    And Z2 is Z1 squared plus C
    And Z3 is Z2 squared plus C and so on
    If the series of Z's should always stay
    Close to Z and never trend away
    That point is in the Mandelbrot Set

    Mandelbrot Set you're a Rorschach Test on fire
    You're a day-glo pterodactyl
    You're a heart-shaped box of springs and wire
    You're one badass fucking fractal
    And you're just in time to save the day
    Sweeping all our fears away
    You can change the world in a tiny way
  • Someone You Know 2008-11-19 09:59
    blah:
    Someone You Know:
    Is there really any point to censoring the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway?
    This is Alex we're talking about. The same guy who renamed the site because of his grandma.


    I guess I thought that mentality had been put aside with the demise of the "Worse Than Failure" idiocy.

    Besides, people don't really think he actually changed the name because of his grandmother, do they?
  • Charles400 2008-11-19 09:59
    It's an inkblot test. I see my wife's episiotomy.
  • KenW 2008-11-19 10:02
    Someone You Know:
    s there really any point to censoring the phrase


    Is there really any point to spelling out the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway? Or are you just some juvenile script kiddie who still gets his kicks saying bad words.

    While everyone knows what it means, some of us appreciate the censorship so that it's a little less NSFW. You know, those of us who are grown up enough to actually have jobs? You'll get there someday, kid, if you're lucky.
  • KenW 2008-11-19 10:03
    zikko:
    Three different version!


    Great. Another loser heard from who has to get his kicks from criticizing typos. Yay.

    We adults with basic reading skills knew what he meant. Perhaps you should take a class.
  • Arancaytar 2008-11-19 10:10
    OH NO!

    And here we thought that a text-only display could prevent us from BLIT. :P
  • Chris 2008-11-19 10:16
    Upon reading this, I got all excited and decided that my sql client had to show me this work. The screenshot was just not enough.

    As I was watching it *think*, I realized I just ran some sql found on the interweb without really reading or understanding it. Wow. TRWTF is me.
  • Nick 2008-11-19 10:20
    This is awesome. I want that guy on my team.
  • sam 2008-11-19 10:22
    [quote user=memals]
    Zero matches :( I am very disappointed. I expected at least 1% to *encode* into another valid string.
    [/quote]

    You have to sort the input before using uniq; it only looks at adjacent lines.

  • Me 2008-11-19 10:24
    Ouch!
  • Yep 2008-11-19 10:24
    Käsebrot, imo.
  • Arancaytar 2008-11-19 10:26
    Chris:
    Upon reading this, I got all excited and decided that my sql client had to show me this work. The screenshot was just not enough.

    As I was watching it *think*, I realized I just ran some sql found on the interweb without really reading or understanding it. Wow. TRWTF is me.


    TRWTF would have been if you ran it on a production database server.
  • Paul 2008-11-19 10:29
    Arancaytar:
    Chris:
    Upon reading this, I got all excited and decided that my sql client had to show me this work. The screenshot was just not enough.

    As I was watching it *think*, I realized I just ran some sql found on the interweb without really reading or understanding it. Wow. TRWTF is me.


    TRWTF would have been if you ran it on a production database server.
  • Addison 2008-11-19 10:30
    I did the same thing, only I went "huh, the only thing it does is select letters" and hit F5.
  • Impressed 2008-11-19 10:30
    Jaw droppingly cool...

    But how do you get it to "zoom in" to one of the curls?
  • Someone You Know 2008-11-19 10:51
    KenW:
    Someone You Know:
    s there really any point to censoring the phrase


    Is there really any point to spelling out the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway? Or are you just some juvenile script kiddie who still gets his kicks saying bad words.

    While everyone knows what it means, some of us appreciate the censorship so that it's a little less NSFW. You know, those of us who are grown up enough to actually have jobs? You'll get there someday, kid, if you're lucky.


    Well done! Hadn't had a good laugh yet this morning.
  • seconddevil 2008-11-19 10:54
    memals:
    Just for *fun* I took the ispell 354984 word list and rot13'd it.
    ...
    ...
    ...
    cat BIG.LST | uniq --repeated > ROTRES.LST
    ...
    ...
    ...


    uniq expects the list to be sorted.

    From the man page:

    NAME
    uniq - report or omit repeated lines

    SYNOPSIS
    uniq [OPTION]... [INPUT [OUTPUT]]

    DESCRIPTION
    Discard all but one of successive identical lines from INPUT
    (or standard input), writing to OUTPUT (or standard output).
    ...
    ...
    ...


    you should be using sort | uniq there.
  • Code Dependent 2008-11-19 10:56
    Someone You Know:
    Is there really any point to censoring the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway?
    It stands for "Worse Than Failure". If you're filling in the other phrase, it's coming out of your own nasty mind. :D
  • evilspoons 2008-11-19 11:00
    Wow, awesome. You get a gold star!
  • Ie 2008-11-19 11:08
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.
  • PlanetExpressShip 2008-11-19 11:17
    KenW:
    Someone You Know:
    s there really any point to censoring the phrase


    Is there really any point to spelling out the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway? Or are you just some juvenile script kiddie who still gets his kicks saying bad words.

    While everyone knows what it means, some of us appreciate the censorship so that it's a little less NSFW. You know, those of us who are grown up enough to actually have jobs? You'll get there someday, kid, if you're lucky.


    And apparently you get your kicks by pretending to be Indiana Jones...
  • ChiefCrazyTalk 2008-11-19 11:21
    Rhywden:
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Note from Alex: Ugh... fixed! I really should start writing these before 2AM...


    That's a kind of sausage, right?
  • ChiefCrazyTalk 2008-11-19 11:24
    Ie:
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.


    Works for me - SQL Server 2K5
  • Machtyn 2008-11-19 11:25
    Well, shoot, I thought it meant "What the Flip" or "What the Fudge". Dang, now I can't use that phrase anymore.

    captcha: consequat. What happens when you use a kumquat inappropriately.
  • Wyrd 2008-11-19 11:25
    I can give you a useless mathematical expression:
    1 + e^(Pi*i)

    Where, of cousre,
    "e" is Euler's number
    "Pi" is the ratio of a circle's circumference to its diameter
    "i" is the square root of -1.

    Math geeks will, of course, point out that the above expression is not truly useless because it serves to bring together four (or five if you rewrite it as an equation) of math's most important numbers in an elegant way.

    p.s. Deep math geeks will also point out about the T-SQL Mandelbrot that in order to be a *really good* representation of the Mandelbrot set, the original code would need to be able to dynamically recalculate the set on the fly based on coordinate range settings supplied by the user.

    It's still cool though.

    --
    Furry cows moo and decompress.

  • Graeme Job 2008-11-19 11:34
    You can:
    WITH XGEN...
    SELECT CAST(-2.2 AS FLOAT) -- -2.2 is the Starting X coordinate
    SELECT CAST(X + 0.031 AS FLOAT) -- -2.2 is the X increment per "pixel"

    So if your coords are MinX = -2.2 and MaxX = 0.9
    then your increment is (MaxX - MinX) / 100 or (0.9 - -2.2) / 100, or 0.031

    Same with YGEN.
  • Graeme Job 2008-11-19 11:36
    Typo:
    Graeme Job:
    You can:
    SELECT CAST(X + 0.031 AS FLOAT) -- -2.2 is the X increment per "pixel"

    SELECT CAST(X + 0.031 AS FLOAT) -- 0.031 is the X increment per "pixel"
  • Mr B 2008-11-19 11:41
    Ie:
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.


    TRWTF: Is that you are running SQL code you don't understand. If you understood it, you'd realise it was using SQL 2005 T-SQL syntax.

    Edit; oh and that's pretty cool code, I've been playing with it for a few hours now...thanks!
  • PseudoBovine 2008-11-19 11:42
    Heinz 53:
    In Austrian dialect, Mädel is maiden (Mädchen), and who knows, maybe there is some kind of bread made by maidens. Or maybe, if you put it into the context of the file "Hostel", bread made out of maidens...

    My German teacher, when explaining "das Mädchen" (it's neuter because all -chen diminutives are neuter) mentioned that the parent word (Mädel) is no longer used in standard German because it has since picked up the connotation of "prostitute". I'm trying to imagine what would be meant by "whore bread".

    anne:

    Doesn't "Mandel" mean tonsil? Back in the day we used to laugh about old tonsil bread and his set. Seriously.

    I was under the impression that it meant "almond". Consulting Google translate and an online German-English dictionary (LEO), it seems we're both right. "die Mandel" can mean either almond or tonsil, depending on context. I think "almond bread" was probably the original meaning, though.
  • Mark Bowytz 2008-11-19 11:43
    You want stupid? Here's some stupid...

    #include <stdio.h>
    
    int main(){printf("\x54\x2C\x68\x2C\x65\x2C\x20\x2C\x74
    \x2C\x69\x2C\x6D\x2C\x65\x2C\x20\x2C\x69\x2C\x74\x2C\x20
    \x2C\x74\x2C\x6F\x2C\x6F\x2C\x6B\x2C\x20\x2C\x74
    \x2C\x6F\x2C\x20\x2C\x64\x2C\x65\x2C\x63\x2C\x6F\x2C\x64
    \x2C\x65\x2C\x20\x2C\x74\x2C\x68\x2C\x65\x2C\x20
    \x2C\x6C\x2C\x61\x2C\x73\x2C\x74\x2C\x20\x2C\x70\x2C\x61
    \x2C\x6E\x2C\x65\x2C\x6C\x2C\x20\x2C\x77\x2C\x61\x2C\x73
    \x2C\x20\x2C\x77\x2C\x65\x2C\x6C\x2C\x6C\x2C\x20\x2C\x77
    \x2C\x6F\x2C\x72\x2C\x74\x2C\x68\x2C\x20\x2C\x74\x2C\x68
    \x2C\x65\x2C\x20\x2C\x65\x2C\x66\x2C\x66\x2C\x6F\x2C\x72
    \x2C\x74\x2C\n"); return 0;}



  • TGV 2008-11-19 11:43
    You are completely right about using sort before uniq, but the more elegant method is (be sure there are no spaces in the words, i.e. multi-word entries, or use a non-default separator character):

    sort dict.txt > words.srt
    rot13 dict.txt | sort > rot.srt
    join words.srt rot.srt

    (although you can combine the last two commands via a pipe as well). By the way, I don't expect any coincidence.

    More interesting exercises: use rev instead of rot13.
  • Winston 2008-11-19 11:50
    FYI: The main T-SQL features used in that snippet that are new to MSSQL 2005 are:
    - the WITH form (or, as Microsoft likes to call it, the "common table expression"), which allows declaration of temporary tables scoped local to the next statement only, and
    - the PIVOT expression, which transforms a table by basically turning it on its side (turning values of a user-selected column into individual columns, and performing aggregations).
  • Alex 2008-11-19 11:50
    One notable (and very pleasing) rot13 coincidence is "irk" <-> "vex". Assuming your dictionary has both of them, you can look for that to check that your code is working.

    Also, you don't need to do "sort | uniq"; "sort -u" will do the same.

    I absolutely love the SQL Mandelbrot, BTW.
  • Adam Heath 2008-11-19 11:55
    Inside a virtual machine, running a vnc client, to the real vnc server.
  • seconddevil 2008-11-19 11:55
    Alex:
    ...

    Also, you don't need to do "sort | uniq"; "sort -u" will do the same.

    ...


    Not when the --repeated filter needs to be used ;-)
  • rbonvall 2008-11-19 12:18
    KenW:
    Is there really any point to spelling out the phrase "What The Fuck" when everyone knows what "WTF" stands for anyway? Or are you just some juvenile script kiddie who still gets his kicks saying bad words.

    I bet he doesn't get enough status (hehe, hehe, hehe)
  • dubbreak 2008-11-19 12:40
    Heinz 53:
    tdittmar:
    Rhywden:
    Isn't it called "Mandelbrot"?

    "Madelbrot" has a slightly different meaning in German :)


    Which would be...? "Mädelbrot" macht keinen Sinn, "Madenbrot" scho, aber "Madelbrot"?


    In Austrian dialect, Mädel is maiden (Mädchen), and who knows, maybe there is some kind of bread made by maidens. Or maybe, if you put it into the context of the file "Hostel", bread made out of maidens...

    Maiden's bread makes as much sense to me as sweet woman's milk (or whatever the direct translation of liebfraumilch is.. I thought it was young woman's milk for some reason).

    Doesn't every mashing together of nouns in german make sense? Just because it isn't used now doesn't mean it won't be at some point in the future.
  • Code Dependent 2008-11-19 12:46
    dubbreak:
    Maiden's bread makes as much sense to me as sweet woman's milk (or whatever the direct translation of liebfraumilch is.. I thought it was young woman's milk for some reason).
    I've always understood it to mean "mother's milk".
  • dcardani 2008-11-19 12:58
    Sort of like a Quine:

  • Tilendor 2008-11-19 13:11
    More please:)
  • CynicalTyler 2008-11-19 13:14
    Smeagle:
    Depends on the region. Here in Bavaria, it's "Madel" for girl. So "Madelbrot" would be girlybread?

    - Oliver
    Where can I purchase some of this aforementioned girlybread?
  • Nadie 2008-11-19 13:46
    I am _so_ inspired to find better ways to waste my time now. Thanks, Mssr. Job!
  • Dwayne 2008-11-19 13:54
    CynicalTyler:
    Smeagle:
    Depends on the region. Here in Bavaria, it's "Madel" for girl. So "Madelbrot" would be girlybread?

    - Oliver
    Where can I purchase some of this aforementioned girlybread?

    It could be worse.
  • Ninad Sathe 2008-11-19 13:55
    The Perl Camel:

    ''=~('(?{'.(
    ('`')| '%').('['^'-').
    ('`'|'!'). ('`'|',').'"\\$~='
    .('['^'+') .('`'| '/').('['^'+').'||'.
    "'"."'".';'.('`'|'/' ).('['^'+').('`'|'%').
    ('`'|'.').('\\$%;').( '['^'"').(',!-~,#,,').(
    '['^'(').',(.).,\\' .'$+,'.('`'|"'").('['^'(')
    .',\\$~&&(\\$' .'_='.('['^')').('`'|('%')).(
    '['^'-').('`'| '%').('['^')').('['^'(').(('`')|
    '%').')'.("\`"| '&').('`'|'/').('['^"\)").'\\@~='.(
    '`'|"'").("\["^ ')').('`'|'%').('['^'+').('\\$|--,(').
    "'"."'".(')').( '['^'#').('^'^('`'|'/')).(':'&'=').',<'.
    ('^'^('`'|'.') ).'>;\\@;='.('`'|'-').('`'|'!').('['^'+')
    .'~~'.('['^')' ).('`'|'%').('['^'-').('`'|'%').('['^')').
    ('['^'(').('`'|'%').','.('['^')').('`'|'%').('['^'-').('`'
    |'%').('['^')').('['^'(').('`'|'%').'\\@~;'.('`'|'-').('`'|
    '!').('['^'+').'\\{'.('['^'(').('['^'"').('['^'(').(('[')^
    '/').('`'|'%').('`'|'-').'\\$^'.('`'^'/').'=~'.('{'^"\,").(
    '`'|')').('`'|'.').'?'.('`'^'#').('`'^',').('{'^'(').(':').
    "'".('`'|'#').('`'|',').('`'|'%').('`'|'!').('['^')')."'".
    ';(\\$-=\\$_%'.('^'^('`'|'-')).')||(--\\$|,'.('`'|'-' ).(
    '`'|'!').('['^'+').'\\$_='.('['^')').('`'|'%').('[' ^((
    '-'))).('`'|'%').('['^')').('['^'(').('`' |('%')). ','
    .'\\@~,\\@;);'.('['^'+').('['^(')')).( '`'|')' ).(
    "\`"| '.').('['^'/').'\\$\\"'.("\["^ ('#')). '('
    .'\\$=/'.('^'^('`'|'-')).'*'. (('`')| '!'
    ).("\`"| '"').('['^ "\("). '\\$|' .+
    ('*').( '^'^('`' |',')) .'-\\' .+
    '$-),'. '\\$_,'. '\\$' .'/'. (
    ('`')| ('&')).( '`'| '/')
    .('['^ ')').'\\' .'$' .'-'
    .'&'. (('^')^( '`'| '/')
    ).'?' .'\\@;' .':' .''.
    '\\' .'@~;' .''. ('['
    ^'(' ).( '`'| ',')
    .''. ((( '`' ))|
    '%' ).( '`' |((
    '%' ))) .+( '['
    ^(( '+' ))) .+
    (( '!')). ((
    (( '\\') ))
    ). '$%\\}'. ((
    ((( '\\' ))))) .+
    '$' .'%..' .''. (((
    '^') )^("\`"| '/' )).(
    "\^"^( ('`')|
    ('/'))). '"})');

    One of my professors showed this neat one to us.
  • Ninad Sathe 2008-11-19 13:56
    this looks cooler in the real file (it's been spaced out to look like a camel), but the comment system strips spaces...
  • Hal Lesesne 2008-11-19 14:00
    absolutely brilliant!
  • ebenblues 2008-11-19 14:00
    JD:
    The Article:
    What's the most useless thing I could do with my time without actually doing anything?

    How about this website?

    Oh yeah? How about this website?
  • CynicalTyler 2008-11-19 14:33
    ebenblues:
    JD:
    The Article:
    What's the most useless thing I could do with my time without actually doing anything?

    How about this website?

    Oh yeah? How about this website?
    DEAR GOD WHAT HAVE YOU DONE?!?
  • dubbreak 2008-11-19 15:08
    Code Dependent:
    dubbreak:
    Maiden's bread makes as much sense to me as sweet woman's milk (or whatever the direct translation of liebfraumilch is.. I thought it was young woman's milk for some reason).
    I've always understood it to mean "mother's milk".

    If my mother lactated delicious white wine I'd still be breastfeeding!

    (ok probably not.. but I'd consider buying her a breast pump for xmas)
  • wesley0042 2008-11-19 15:30
    BTW, that takes about 3 minutes on a Laserjet 2430. :-)
  • OhU 2008-11-19 15:58
    seconddevil:
    memals:
    Just for *fun* I took the ispell 354984 word list and rot13'd it.
    ...
    ...
    ...
    cat BIG.LST | uniq --repeated > ROTRES.LST
    ...
    ...
    ...


    uniq expects the list to be sorted.

    From the man page:

    NAME
    uniq - report or omit repeated lines

    SYNOPSIS
    uniq [OPTION]... [INPUT [OUTPUT]]

    DESCRIPTION
    Discard all but one of successive identical lines from INPUT
    (or standard input), writing to OUTPUT (or standard output).
    ...
    ...
    ...


    you should be using sort | uniq there.


    UUOC.

    From the man page:
      
    
    NAME
    sort - sort lines of text files

    SYNOPSIS
    sort [OPTION]... [FILE]...

    DESCRIPTION
    Write sorted concatenation of all FILE(s) to standard output.
    ...

    ...

    ...

    -u, --unique
    with -c, check for strict ordering; without -c, output only the first of an equal run


    You could be using `sort -u` there. ;)
  • Logic 2008-11-19 16:13
    Mark:
    My WTF on this is why was he at work on a Sunday (10-12-2008) with nothing better to do?


    Claiming Overtime Rates?
  • sally 2008-11-19 16:22
    Yawn...

    There are some really cool things that are useless. These is not one of them. It looks to me like the Nerd version of chest-thumping. I don't know if the guy is of comparable pilosity to a gorilla, but at least we know their psyche's are of comparable complexity.
  • Mr.'; Drop Database -- 2008-11-19 16:29
    Ie:
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.
    If you were using a version of MSSQL that supported WITH and PIVOT, you wouldn't be using Query Analyzer.
  • MyKey_ 2008-11-19 16:36
    I wrote a Mandelbrot generator using MS Excel once. It wasn't ASCII art, it was cell art. You had to zoom out till every cell had the size of a pixel to see the picture.
    That was some years back in school before a actually learned about programming.
  • Blakeyrat 2008-11-19 17:13
    10 seconds on my reasonably beefy SQL server. And yeah, I picked the one that wouldn't totally hose us it this made it crash and burn.

    If you want real boredom, have some calculate the Big(O) of the SQL version compared to an optimized native code version.
  • funkwit 2008-11-19 17:21
    PseudoBovine:
    I'm trying to imagine what would be meant by "whore bread".


    Not sure but I bet it could give you a nasty yeast infection.
  • JohnFx 2008-11-19 17:30
    KenW:
    zikko:
    Three different version!


    Great. Another loser heard from who has to get his kicks from criticizing typos. Yay.

    We adults with basic reading skills knew what he meant. Perhaps you should take a class.


    Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
  • koan 2008-11-19 17:41
    I think it is a form of addiction. Once I learnt of the infamous set, I tried to conjour it up in all sorts of places.

    Like Rexx. And ADABAS/NATURAL - but only the NATURAL part, I didn't think to get the db to do the work!

    Both of these are text only of course...
  • Leak 2008-11-19 18:08
    CynicalTyler:
    ebenblues:
    JD:
    The Article:
    What's the most useless thing I could do with my time without actually doing anything?

    How about this website?

    Oh yeah? How about this website?
    DEAR GOD WHAT HAVE YOU DONE?!?

    Meh... I've seen worse...
  • Mr.'; Drop Database -- 2008-11-19 18:48
    JohnFx:
    Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
    You hvae unfltnaerotuy fllaen for ahntoer uabrn legned. The cailm, bseeids sduinnog ibmuasiplle, can ealisy be doresmaenttd fslae by sufifhlng the lteerts radonlmy itsnead of sulfhifng tehm by hnad wichh wluod ioutnrcde huamn bais. Frrtmreouhe, Cabmrgide nveer aulcalty pferromed taht rehsrace.
  • danixdefcon5 2008-11-19 20:18
    Mr B:
    Ie:
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.


    TRWTF: Is that you are running SQL code you don't understand. If you understood it, you'd realise it was using SQL 2005 T-SQL syntax.

    Edit; oh and that's pretty cool code, I've been playing with it for a few hours now...thanks!
    I was baffled by that "WITH" command as well. I only have SQL Server 2000 available, so I can't run this.
  • Alex 2008-11-19 20:31
    http://archives.postgresql.org/pgsql-hackers/2008-11/msg01303.php

    (Requires 8.4-CVS)
  • Solving Sudoku with Dpkg 2008-11-19 20:44
    You can solve Sudoku puzzles with Debians 'dpkg' package manager. I was impressed.

    Here's a link to a Slashdot item about it... http://games.slashdot.org/article.pl?sid=08/08/24/008201
  • Steve Kass 2008-11-19 21:33
    Excellent! Here is a shorter, more efficient version using ROW_NUMBER (the latter because you did 100 iterations but put a space if the point escaped after 25 iterations or never).


    -- ORIGINAL AUTHOR: GRAEME JOB
    -- ORIGINALLY CREATED: 12-OCT-2008
    -- ADAPTED BY: STEVE KASS
    -- BECAUSE: IT'S EVEN SHORTER AND FASTER
    WITH GEN(V, IV) AS ( -- DIM GENERATOR
    SELECT CAST(0 AS FLOAT) AS V, 0 AS IV UNION ALL
    SELECT CAST(V + 0.031 AS FLOAT) AS V, IV + 1 AS IV
    FROM GEN
    WHERE IV < 100
    ),XGEN(X, IX) AS ( -- X DIM GENERATOR
    SELECT -2.2+V AS X, IV AS IX FROM GEN
    ),YGEN(Y, IY) AS ( -- Y DIM GENERATOR
    SELECT -1.5+V AS Y, IV AS IY FROM GEN
    ), Z(IX, IY, CX, CY, X, Y, I) AS ( -- Z POINT ITERATOR
    SELECT IX, IY, X, Y, X, Y, 0
    FROM XGEN, YGEN
    UNION ALL
    SELECT IX, IY, CX, CY, X * X - Y * Y + CX, Y * X * 2 + CY, I + 1
    FROM Z
    WHERE I < 26
    AND X * X + Y * Y < 16
    ), ZR(IX, IY, C, R) AS (
    SELECT
    IX, IY, CASE WHEN I > 25 THEN ' ' ELSE SUBSTRING(' .,,,-----++++%%%%@@@@###',I,1) END,
    ROW_NUMBER() OVER (PARTITION BY IX, IY ORDER BY I DESC)
    FROM Z
    )
    SELECT
    [0]+[1]+[2]+[3]+[4]+[5]+[6]+[7]+[8]+[9]+[10]+[11]+[12]+[13]+[14]+[15]+[16]+[17]+[18]+[19]+
    [20]+[21]+[22]+[23]+[24]+[25]+[26]+[27]+[28]+[29]+[30]+[31]+[32]+[33]+[34]+[35]+[36]+[37]+[38]+[39]+
    [40]+[41]+[42]+[43]+[44]+[45]+[46]+[47]+[48]+[49]+[50]+[51]+[52]+[53]+[54]+[55]+[56]+[57]+[58]+[59]+
    [60]+[61]+[62]+[63]+[64]+[65]+[66]+[67]+[68]+[69]+[70]+[71]+[72]+[73]+[74]+[75]+[76]+[77]+[78]+[79]+
    [80]+[81]+[82]+[83]+[84]+[85]+[86]+[87]+[88]+[89]+[90]+[91]+[92]+[93]+[94]+[95]+[96]+[97]+[98]+[99]+[100]
    FROM (
    SELECT IX, IY, C FROM ZR WHERE R = 1
    ) AS P(IX,IY,C) PIVOT (MAX(C) FOR IX IN (
    [0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],
    [20],[21],[22],[23],[24],[25],[26],[27],[28],[29],[30],[31],[32],[33],[34],[35],[36],[37],[38],[39],
    [40],[41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[58],[59],
    [60],[61],[62],[63],[64],[65],[66],[67],[68],[69],[70],[71],[72],[73],[74],[75],[76],[77],[78],[79],
    [80],[81],[82],[83],[84],[85],[86],[87],[88],[89],[90],[91],[92],[93],[94],[95],[96],[97],[98],[99],[100])
    ) AS Piv
  • Bob 2008-11-19 21:56
    JohnFx:


    Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.


    "researcher" does not have the first and last letters in the correct place.


    Actually, you're reading sentences as a whole, not words from context using the two and three letter words as well as the four letter words which have only the middle letters swapped.

    Actually, why not just use asterisks then:

    A********g to a r********r at C*******e U*******y

    or even just numbers showing the number of letters.

  • GG 2008-11-19 22:13
  • GG 2008-11-19 22:13
  • Anonymous ZSH Fan 2008-11-19 23:34
    A better man than me once implemented Mandlebrot thus:

    function most_useless_use_of_zsh {
    local lines columns colour a b p q i pnew
    ((columns=COLUMNS-1, lines=LINES-1, colour=0))
    for ((b=-1.5; b<=1.5; b+=3.0/lines)) do
    for ((a=-2.0; a<=1; a+=3.0/columns)) do
    for ((p=0.0, q=0.0, i=0; p*p+q*q < 4 && i < 32; i++)) do
    ((pnew=p*p-q*q+a, q=2*p*q+b, p=pnew))
    done
    ((colour=(i/4)%8))
    echo -n "\\e[4${colour}m "
    done
    echo
    done
    }
  • Edvardas 2008-11-20 00:16
    Mark:
    My WTF on this is why was he at work on a Sunday (10-12-2008) with nothing better to do?


    Maybe he is middle east?
  • Edvardas 2008-11-20 00:23
    g:
    2005+ (as it uses PIVOT).

    It only took 11 seconds to run on my local VM, so I think you'll be alright ;)


    It was fun running it on the live production server, 12 seconds :[D
  • Mr.'; Drop Database -- 2008-11-20 02:10
    Bob:
    Actually, why not just use asterisks then ... or even just numbers showing the number of letters.
    Uncyclopedia has an example of that.
  • Rich 2008-11-20 03:37
    Thats pretty awesome!
  • Bob Fractal 2008-11-20 04:03
    This has already been done in SQL: http://forge.mysql.com/tools/tool.php?id=25 and the source was more elegant.
  • PaulG 2008-11-20 04:07
    I feel much better about my lotto number generator I once wrote in SQL.
  • Rhialto 2008-11-20 04:24
    dkf:
    This reminds me of when (many years ago now) we sent a postscript file to our brand-new 300dpi printer which computed and displayed the Mandelbrot set at maximum resolution, with all computations performed in the PS interpreter. I don't remember if it was an overnight job or an "over a long weekend" job, but it was definitely awesome...

    No, I don't have the code.

    A friend of mine once coded the solution to the Towes of Hanoi. In Postscript. Fully animated. Too bad he left out all the showpage commands :-) But it looked pretty in Ghostscript.
  • anoncow 2008-11-20 04:24
    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
  • Whitehat 2008-11-20 04:38
    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 + xyz*0.031 cx, xyz ix
    from ord)
    , ygen as (
    select -1.5 + xyz*0.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;

  • Rhialto 2008-11-20 05:13
    memals:
    cat ROT13.LST | uniq -u > BIG.LST
    cat mword10/SINGLE.TXT | uniq -u >> BIG.LST
    cat BIG.LST | uniq --repeated > ROTRES.LST

    cat test.file | uniq --repeated

    Misuse of the cat command... 4 counts.
  • London Contractor Mart 2008-11-20 08:02
    ChiefCrazyTalk:
    Ie:
    TRWTF: I just tried it in Query Analyzer:

    Server: Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'WITH'.
    Server: Msg 170, Level 15, State 1, Line 10
    Line 10: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 16
    Line 16: Incorrect syntax near ','.
    Server: Msg 170, Level 15, State 1, Line 42
    Line 42: Incorrect syntax near 'PIVOT'.


    Works for me - SQL Server 2K5


    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?
  • Gerg 2008-11-20 09:15
    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
    ;
  • Gerg 2008-11-20 09:16
    And again with a "[ code ]" tag around it:


    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
    ;
  • Kuba 2008-11-20 09:27
    Everything can be done in shell scripting, of course ;)

    http://www.dctsystems.co.uk/RenderMan/rensh.html


    $$$$:
    ~####++
    ~@@@+

    o ~####++
    ###PP$$$$##o ~####++ ~PPPPPPPPPP++++ $ ,::
    ###Po#####PPP ~####++ :oooooo:: +$$$ o##~
    ###Po~~ oPPPo ~####++ P:oo +++@@@@@ o##
    ###Po~~ ~### ~####++ :PP~ +++@@@@@@@ o##
    ###PoPPPPP### ####++ +++PPPPPP~ ::::@@@@@@@@@, o##
    ###PP~~~~~P$ ####++ ++PPPPPPPP
    ###PP
    ###PP
    ###PP
    ###P
    ###P
    ###P
    ###
  • Scuko 2008-11-20 11:54
    Go to http://sql-ex.ru/?Lang=1, there you can find a lot more such SQL tasks.
  • Posti 2008-11-20 13:41
    Sorry - the prize for MOST useless programming is still held by the creators of Vista.
  • csrster 2008-11-21 02:45
    Charles400:
    It's an inkblot test. I see my wife's episiotomy.


    You're right, it does look like your wife's episiotomy!
  • Michael B 2008-11-21 21:20
    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!
  • Jno 2008-11-23 07:31
    KenW:
    zikko:
    Three different version!

    Great. Another loser heard from who has to get his kicks from criticizing typos. Yay.

    We adults with basic reading skills knew what he meant. Perhaps you should take a class.

    Well, not quite kicks, exactly. It's just that those of us with better than basic writing skills like to point and laugh. You know, peer pressure and all that.
  • Vic Tim 2008-11-23 11:31
    Posti:
    Sorry - the prize for MOST useless programming is still held by the creators of Vista.


    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!
  • Daniel 2008-11-24 04:51
    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
  • Schwab 2008-11-24 12:07
    Wow, how freak'n cool is that! Dude it rocks!
  • Geoff Mcgehee 2008-11-24 15:50
    What, no Julia set?
  • Hax Or 2008-11-24 16:55
    And that's why, comments should be disabled.

    3 pages of nothing!

    The Mandelbrot trick looked great! Ignore the griefers.
  • Ben 2008-11-25 01:15
    $WTF == "Well Thought, Functional";
  • Pol 2008-11-25 10:29
    Where do these people find the time to do these things?!
  • Paul Nicholls 2008-11-26 01:32
    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!
  • Anonymous Coward 2008-12-02 17:45
    Impressed:
    Jaw droppingly cool...

    But how do you get it to "zoom in" to one of the curls?


    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.
  • drfreak 2011-01-04 23:25
    It actually is pretty cool code. I'd give bonus point for the use of a CTE and PIVOT.
  • Earl Carey 2012-03-08 09:46
    Holy cow... that my friend is not a stupid trick..its amazing...my reaction when i say the output...wtf
  • Earl Carey 2012-03-08 09:48
    To funny for words