- 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
Wow, awesome. You get a gold star!
Admin
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'.
Admin
And apparently you get your kicks by pretending to be Indiana Jones...
Admin
That's a kind of sausage, right?
Admin
Works for me - SQL Server 2K5
Admin
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.
Admin
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.
Admin
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.
Admin
Typo:
SELECT CAST(X + 0.031 AS FLOAT) -- 0.031 is the X increment per "pixel"Admin
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!
Admin
Admin
You want stupid? Here's some stupid...
Admin
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.
Admin
FYI: The main T-SQL features used in that snippet that are new to MSSQL 2005 are:
Admin
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.
Admin
Inside a virtual machine, running a vnc client, to the real vnc server.
Admin
Not when the --repeated filter needs to be used ;-)
Admin
Admin
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.
Admin
Admin
Sort of like a Quine:
[image]Admin
More please:)
Admin
Admin
I am so inspired to find better ways to waste my time now. Thanks, Mssr. Job!
Admin
Admin
The Perl Camel:
.('['^'+') .('
'| '/').('['^'+').'||'. "'"."'".';'.('
'|'/' ).('['^'+').(''|'%'). ('
'|'.').('\$%;').( '['^'"').(',!-~,#,,').('['^'(').',(.).,\' .'$+,'.('
'|"'").('['^'(') .',\\$~&&(\\$' .'_='.('['^')').('
'|('%')).('['^'-').('
'| '%').('['^')').('['^'(').(('
')|'%').')'.("`"| '&').('
'|'/').('['^"\)").'\\@~='.( '
'|"'").("["^ ')').(''|'%').('['^'+').('\\$|--,('). "'"."'".(')').( '['^'#').('^'^('
'|'/')).(':'&'=').',<'.('^'^('
'|'.') ).'>;\\@;='.('
'|'-').(''|'!').('['^'+') .'~~'.('['^')' ).('
'|'%').('['^'-').(''|'%').('['^')'). ('['^'(').('
'|'%').','.('['^')').(''|'%').('['^'-').('
'|'%').('['^')').('['^'(').('
'|'%').'\\@~;'.('
'|'-').(''| '!').('['^'+').'\\{'.('['^'(').('['^'"').('['^'(').(('[')^ '/').('
'|'%').(''|'-').'\\$^'.('
'^'/').'=~'.('{'^",").('
'|')').('
'|'.').'?'.(''^'#').('
'^',').('{'^'(').(':'). "'".(''|'#').('
'|',').(''|'%').('
'|'!').('['^')')."'". ';(\$-=\$_%'.('^'^(''|'-')).')||(--\\$|,'.('
'|'-' ).( ''|'!').('['^'+').'\\$_='.('['^')').('
'|'%').('[' ^(( '-'))).(''|'%').('['^')').('['^'(').('
' |('%')). ',' .'\@~,\@;);'.('['^'+').('['^(')')).( ''|')' ).( "\
"| '.').('['^'/').'\$\"'.("["^ ('#')). '(' .'\$=/'.('^'^(''|'-')).'*'. (('
')| '!' ).("`"| '"').('['^ "("). '\$|' .+('*').( '^'^('
' |',')) .'-\\' .+ '$-),'. '\\$_,'. '\\$' .'/'. ( ('
')| ('&')).( ''| '/') .('['^ ')').'\\' .'$' .'-' .'&'. (('^')^( '
'| '/')).'?' .'\@;' .':' .''.
'\' .'@~;' .''. ('['
^'(' ).( '
'| ',') .''. ((( '
' ))|'%' ).( '
' |(( '%' ))) .+( '[' ^(( '+' ))) .+ (( '!')). (( (( '\\') )) ). '$%\\}'. (( ((( '\\' ))))) .+ '$' .'%..' .''. ((( '^') )^("\
"| '/' )).("^"^( ('`')|
('/'))). '"})');
One of my professors showed this neat one to us.
Admin
this looks cooler in the real file (it's been spaced out to look like a camel), but the comment system strips spaces...
Admin
absolutely brilliant!
Admin
Admin
Admin
(ok probably not.. but I'd consider buying her a breast pump for xmas)
Admin
BTW, that takes about 3 minutes on a Laserjet 2430. :-)
Admin
UUOC.
From the man page:
You could be using
sort -u
there. ;)Admin
Claiming Overtime Rates?
Admin
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.
Admin
Admin
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.
Admin
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.
Admin
Not sure but I bet it could give you a nasty yeast infection.
Admin
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.
Admin
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...
Admin
Admin
Admin
Admin
http://archives.postgresql.org/pgsql-hackers/2008-11/msg01303.php
(Requires 8.4-CVS)
Admin
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
Admin
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).
Admin
"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.
Admin
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; pp+qq < 4 && i < 32; i++)) do ((pnew=pp-qq+a, q=2pq+b, p=pnew)) done ((colour=(i/4)%8)) echo -n "\e[4${colour}m " done echo done }
Admin
Maybe he is middle east?