LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 09-16-2009, 12:36 AM   #61
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

Quote:
Originally Posted by estabroo View Post
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?

 
Old 09-16-2009, 03:57 AM   #62
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Rep: Reputation: 34
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.
 
Old 09-16-2009, 08:17 AM   #63
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Jiml8,

yeah that was lolcode
 
Old 09-16-2009, 02:36 PM   #64
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Cool 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.
 
Old 09-16-2009, 05:02 PM   #65
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,787

Rep: Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084
Quote:
Originally Posted by GrapefruiTgirl View Post
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.
 
Old 09-16-2009, 05:15 PM   #66
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
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
 
Old 09-16-2009, 09:14 PM   #67
linuxraja
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Rep: Reputation: 0
A silly prank?

Last edited by Tinkster; 11-01-2010 at 02:26 AM.
 
Old 09-16-2009, 09:26 PM   #68
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by linuxraja View Post
A silly prank?
No, apparently part of a job application

Sasha
 
Old 09-17-2009, 09:36 AM   #69
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,302
Blog Entries: 61

Rep: Reputation: Disabled
This is the only Lisp I know:
"Stwike him, Centuwion, stwike him vewy wuffly!"
 
Old 09-17-2009, 10:41 AM   #70
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
And thwow him to the gwound!
 
Old 09-17-2009, 10:49 AM   #71
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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"
 
Old 09-17-2009, 11:33 AM   #72
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Thanks Sasha for the pure bash version!
 
Old 09-17-2009, 12:03 PM   #73
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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.
 
Old 09-17-2009, 12:42 PM   #74
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
Old 09-17-2009, 01:18 PM   #75
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by tredegar View Post
I like it!!
[Edit] You should also get double-points for "impenetrable C coding" ! [/Edit]
Thank you!

Quote:
Originally Posted by tredegar View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A little instability in my Slackware, Need to decipher these errors BobNutfield Slackware 13 08-20-2008 10:02 AM
Can Someone help me to decipher this error? randell6564 Ubuntu 2 10-15-2006 04:20 PM
How to decipher this C declaration? CM019 Programming 6 05-28-2006 06:01 PM
Can anyone decipher my K3b error message? Trinity22 Linux - Software 3 04-21-2004 09:01 PM
Try to decipher this :) Whitehat General 42 06-29-2003 06:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration