General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
NOTE: All new threads will be moderated. Political threads will not be approved. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
09-16-2009, 12:36 AM
|
#61
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
Quote:
Originally Posted by estabroo
I'm truy sorry but I just couldn't resist
Code:
HAI
CAN HAS STDIO?
I HAS A MESS ITZ "Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/"
I HAS A NUM ITZ 0
I HAS A TMP
IM IN YR DECODE TIL NUM IZ 206
LOL TMP R NUM IN MAH MESS
BOTH SAEM TMP AN " ", O RLY?
NO WAI
NERFZ TMP!!
OIC
LOL NUM IN MAH MESS R TMP
UPZ NUM!!2
IM OUTTA YR DECODE
VISIBLE MESS
KTHXBYE
|
I presume this is lolcode?

|
|
|
09-16-2009, 03:57 AM
|
#62
|
Member
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313
Rep:
|
Did somebody give evil that encrypted line at a job interview? That's messed up. Or maybe it was in the Craigslist want ads?
Once I wrote a program that would solve the zodiac cryptogram by substituting the symbols with every possible combination of letters (which was pretty dumb because if it was just substitution there would have been double symbols for "l" and somebody would have solved it already). And when I was almost done I realized that since the number of permutations was N! that the universe would collapse before my program ever tried them all. And that was before it even took the time to scan for keywords.
Next time I try something like that I'm going to research it first instead of wasting an entire weekend.
|
|
|
09-16-2009, 08:17 AM
|
#63
|
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,127
Rep: 
|
Jiml8,
yeah that was lolcode
|
|
|
09-16-2009, 02:36 PM
|
#64
|
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594
|
Just bash
Credit ** goes to both "David The H." and "HKo" for helping me improve this silly thing, producing a much simplified version, and without a bunch of convoluted crap that was actually doing nothing!
Click here to see old version.
Code:
#!/bin/bash
data="Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fb"
data="${data}vprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhio"
data="${data}efrjnh copk- uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/"
leng=${#data}
while [[ $inc -le $leng ]]; do
charval=$(($(printf %d "'${data:$((inc)):1}")-1))
[ $charval == 31 ] && echo -n " " || printf "\\$(printf "%03o" $charval)"
echo -n "${data:$((inc+1)):1}"
inc=$((inc+2))
done
echo
** Sorry guys, for having happily squandered your much appreciated help, on this silly thing
Sasha
PS - I'm still researching Emacs Lisp.
|
|
|
09-16-2009, 05:02 PM
|
#65
|
Senior Member
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,836
|
Quote:
Originally Posted by GrapefruiTgirl
Hmm.. Where's that Lisp script 
|
Here are 2 Common Lisp versions:
Code:
;; imperative loop
(loop with text =
(concatenate 'string
"Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf "
"zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf"
" bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess"
"!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/")
for i from 0 upto (1- (length text)) by 2
as ascii = (char-code (char text i))
when (> ascii 32)
do (setf (char text i) (code-char (1- ascii)))
finally (return text))
;; functional
(map 'string (lambda (c i) (code-char (max 32 (- (char-code c) i))))
(concatenate 'string
"Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf "
"zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf"
" bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess"
"!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/")
'#1=(1 0 . #1#)) ; circular list (1 0 1 0 1 0 ...)
Should be easier in Emacs Lisp since characters are the same as integers there.
|
|
|
09-16-2009, 05:15 PM
|
#66
|
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594
|
Thanks for that contribution, ntubski
IMHO, the second example you provided reaffirms (to me anyway) that Lisp appears to really be well suited to such a task: there's almost NO CODE involved there! Cool
Sasha
|
|
|
09-16-2009, 09:14 PM
|
#67
|
LQ Newbie
Registered: Sep 2009
Posts: 17
Rep:
|
A silly prank?

Last edited by Tinkster; 11-01-2010 at 02:26 AM.
|
|
|
09-16-2009, 09:26 PM
|
#68
|
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594
|
Quote:
Originally Posted by linuxraja
A silly prank?

|
No, apparently part of a job application
Sasha
|
|
|
09-17-2009, 09:36 AM
|
#69
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
This is the only Lisp I know:
"Stwike him, Centuwion, stwike him vewy wuffly!"
|
|
|
09-17-2009, 10:41 AM
|
#70
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
|
And thwow him to the gwound!
|
|
|
09-17-2009, 10:49 AM
|
#71
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
Well, everyone is familiar with the famous quote of Horace Greeley: "Go West, young man!"
It is a little known fact that he had a harelip, and no one ever finishes the quote: "But wetuwn to my woom this evening"
|
|
|
09-17-2009, 11:33 AM
|
#72
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
Thanks Sasha for the pure bash version!
|
|
|
09-17-2009, 12:03 PM
|
#73
|
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536
Rep: 
|
I felt a filter-like program in the unix tradition for this was desperately needed. So a program that reads the garbled text from stdin and outputs the de-garbled text to its stdout.
This way, we won't need to change the source/script and no need to recompile when the next job application of this kind turns up on the net. And, arguably more importantly, the ugly garbled text doesn't clutter the source/script. Everything for more readable code!
So, here's my C implementation of a program that reads the garbled text from its stdin:
Code:
main(){char i=0,_;while((_=getchar())>0)putchar((i=_-33?!i:1)?--_:_);}
Example shell session:
Code:
bash$ ls
garbled.txt wiau.c
bash$ cat garbled.txt
Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk-uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/
bash$ cat wiau.c
main(){char i=0,_;while((_=getchar())>0)putchar((i=_-33?!i:1)?--_:_);}
bash$ make wiau
cc wiau.c -o wiau
bash$ ./wiau <garbled.txt
Congratulations =) You passed our idiot filter =)What are your three favorite technical books?Please include at least one software engineering book,ugfpsidsr can be whatever, i.e., physics, math, etc.
|
|
|
09-17-2009, 12:42 PM
|
#74
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,156
|
Quote:
I felt a filter-like program in the unix tradition for this was desperately needed...
|
I like it!!
[Edit] You should also get double-points for "impenetrable C coding" ! [/Edit]
I don't wish to appear "picky" but something is not quite right:
Code:
tred@vaio:~$ ./wiau <garbled.txt
Congratulations =) You passed our idiot filter =)What are your three favorite technical books?
Please include at least one software engineering book,ugfpsidsr can be whatever, i.e., physics, math, etc.
tred@vaio:~$
tred@vaio:~$
(Extra linebreak added by me, so it fits better into the CODE window)
estabroo's LOLCODE made me laugh till I cried. Thanks for that!
Last edited by tredegar; 09-17-2009 at 12:49 PM.
|
|
|
09-17-2009, 01:18 PM
|
#75
|
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536
Rep: 
|
Quote:
Originally Posted by tredegar
I like it!!
[Edit] You should also get double-points for "impenetrable C coding" ! [/Edit]
|
Thank you!
Quote:
Originally Posted by tredegar
I don't wish to appear "picky" but something is not quite right:
Code:
tred@vaio:~$ ./wiau <garbled.txt
Congratulations =) You passed our idiot filter =)What are your three favorite technical books?
Please include at least one software engineering book,ugfpsidsr can be whatever, i.e., physics, math, etc.
tred@vaio:~$
tred@vaio:~$
|
Ouch! 
That has nothing to do with being picky: that's a bug!
I did not notice it myself.
What I did see was that at a few places (e.g. after the question mark) there appear unprintable chars (0x1f after the quesion mark). But I'd argue that that's bug in the specification of the cipher 
Last edited by Hko; 09-17-2009 at 01:42 PM.
|
|
|
All times are GMT -5. The time now is 06:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|