POV-Ray : Newsgroups : povray.off-topic : And you thought Andrew was a geek Server Time
6 Sep 2024 19:20:39 EDT (-0400)
  And you thought Andrew was a geek (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Gail
Subject: And you thought Andrew was a geek
Date: 28 Nov 2008 02:52:57
Message: <492fa359@news.povray.org>
Courtasy of one of the SQL MVPs (and reposted with his permission)

Here's the Mandelbrot set in T-SQL.
Why? Because we can....

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

Requires SQL 2005 or higher.


Post a reply to this message

From: Stephen
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 03:15:00
Message: <web.492fa75bac6f151465d3b2410@news.povray.org>
"Gail" <gail (at) sql in the wild (dot) co [dot] za> wrote:
> Courtasy of one of the SQL MVPs (and reposted with his permission)
>
> Here's the Mandelbrot set in T-SQL.
> Why? Because we can....
>


What do you say about us to them?


Stephen


Post a reply to this message

From: Gail
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 03:28:10
Message: <492fab9a@news.povray.org>
"Stephen" <mcavoys_AT_aolDOT.com> wrote in message 
news:web.492fa75bac6f151465d3b2410@news.povray.org...

> What do you say about us to them?
> It can't be much good :)
>

Don't think I've said anything. We mostly talk SQL. No surprise there


Post a reply to this message

From: Warp
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 07:08:07
Message: <492fdf27@news.povray.org>
Gail <gail (at) sql in the wild (dot) co [dot] za> wrote:
> Courtasy of one of the SQL MVPs (and reposted with his permission)

  A version of this?
http://thedailywtf.com/Articles/Stupid-Coding-Tricks-The-TSQL-Madlebrot.aspx

-- 
                                                          - Warp


Post a reply to this message

From: Gail
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 07:38:31
Message: <492fe647@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:492fdf27@news.povray.org...
> Gail <gail (at) sql in the wild (dot) co [dot] za> wrote:
>> Courtasy of one of the SQL MVPs (and reposted with his permission)
>
>  A version of this?
> http://thedailywtf.com/Articles/Stupid-Coding-Tricks-The-TSQL-Madlebrot.aspx

Yup.
-- ORIGINAL AUTHOR: GRAEME JOB

One of the guys looked at it and said to himself, I can make that more 
efficient, and proceeded to do go

Geek level 1 - writing something useless just for fun
Geek level 2 - rewriting it to make it run faster.


Post a reply to this message

From: Invisible
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 07:42:15
Message: <492fe727$1@news.povray.org>
Gail wrote:

> Geek level 1 - writing something useless just for fun
> Geek level 2 - rewriting it to make it run faster.

Geek level 3 - rewriting it in an exotic Turning-complete gibberish 
language just to prove you can.


Post a reply to this message

From: Stephen
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 08:05:03
Message: <web.492febe9ac6f151465d3b2410@news.povray.org>
"Gail" <gail (at) sql in the wild (dot) co [dot] za> wrote:
> "Stephen" <mcavoys_AT_aolDOT.com> wrote in message
> news:web.492fa75bac6f151465d3b2410@news.povray.org...
>
> > What do you say about us to them?
> > It can't be much good :)
> >
>
> Don't think I've said anything.



>We mostly talk SQL. No surprise there

Rather you than me, then :)

Stephen


Post a reply to this message

From: Warp
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 08:08:45
Message: <492fed5d@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Gail wrote:

> > Geek level 1 - writing something useless just for fun
> > Geek level 2 - rewriting it to make it run faster.

> Geek level 3 - rewriting it in an exotic Turning-complete gibberish 
> language just to prove you can.

  There is certain fun in stressing programs or devices with unusual code.

  It's a shame that almost no printer nowadays supports reading and
interpreting PostScript anymore (nowadays almost every single one of them
has a OS driver which interprets the PostScript on the computer and only
then sends the chewed up page data to the printer), but in the good old
days when PS files were sent *raw* to printers and the printer interpreted
it, it was fun to send a PostScript Mandelbrot for them to ruminate about.

http://warp.povusers.org/MandScripts/ps.html

  Remember that back the first year I was at the University I tried it with
a printer there, and it took it something like a half an hour to print it.
Many years later I tried it again with a newer printer, and it had printed
it before I could get from the computer to the printer.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 08:12:42
Message: <492fee4a$1@news.povray.org>
Warp wrote:

>   It's a shame that almost no printer nowadays supports reading and
> interpreting PostScript anymore (nowadays almost every single one of them
> has a OS driver which interprets the PostScript on the computer and only
> then sends the chewed up page data to the printer), but in the good old
> days when PS files were sent *raw* to printers and the printer interpreted
> it, it was fun to send a PostScript Mandelbrot for them to ruminate about.

Hey, I STILL DO THIS! :-D

I know most cheap printers don't support PostScript, but IME 
industrial-grade laser printers still accept raw PS as input. (E.g., our 
recently-purchased HP LaserJet 4250 accepts it just fine.)

I think it's just cheaper to make the host do it then put a powerful 
computer inside the printer itself. Makes the printer cheaper.

(Do you remember the scandle of "win modems"?)


Post a reply to this message

From: Eero Ahonen
Subject: Re: And you thought Andrew was a geek
Date: 28 Nov 2008 10:42:51
Message: <4930117b$1@news.povray.org>
Gail wrote:
> 
> Don't think I've said anything. We mostly talk SQL. No surprise there

INSERT INTO laughable_things (name,scale) VALUES('povray.off-topic',5);
COMMIT;


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.