• Home
  • About Me
  • Contact

kanorben.net - blog

My personal blog on technology, programming, life, and the random

 

January 2008
M T W T F S S
« Dec   Feb »
 123456
78910111213
14151617181920
21222324252627
28293031  

Blogroll

  • Boing Boing
  • BorjaNet
  • Brian Mayer
  • Dean Armstrong’s Blog
  • Ellen Smith’s blog
  • Faraocious
  • Gross or Awesome?
  • Marcus Westin’s Blog
  • Nightmares of David Bowie’s Package
  • Paul Mantz’s Blog
  • Slashdot
  • Tomorrow with Alex Beinstein
  • Valleywag

Personal Sites

  • DOIT Fortune Database
  • My bookmark’s on del.icio.us
  • My CS account page
  • My Facebook Profile
  • My LinkedIn Page
  • My Picasa Albums
  • My Twitter
  • pyXSD
  • The SUCCESS Blog
  • UofC ACM Site

webcomics

  • Questionable Content
  • Saturday Morning Breakfast Cereal
  • The Perry Bible Fellowship
  • Welcome To The Future
  • xkcd

Meta

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Add to Google Add to My Yahoo! Subscribe with Bloglines
Bloggers' Rights at EFF

Twitter Updates

    RSS My Del.icio.us

    • Index of ftp://ftp.apcc.com/apc/public/software/macintosh/osx/pcns/201/
    • Hulu - The Olympia Restaurant: Saturday Night Live
    • RACHEL PAPO : Serial No. 3817131
    • Breakdowns: Netflix crash caused by botched Oracle upgrade
    • pygraphviz - NetworkX
    • Pentagon's Unmanned Spokesdrone Completes First Press Conference Mission | The Onion - America's Finest News Source
    • Duncan Campbell: America's cracked code | Comment is free | The Guardian

    RSS My Facebook Posted Items

    • Language Fail
    • Safety Fail
    • Gnarls Barkley Crazy Theremin Jam
    • Domino's Scientists Test Limits Of What Humans Will Eat | The Onion - America's Finest News Source
    • 'Warcraft' Sequel Lets Gamers Play A Character Playing 'Warcraft' | The Onion - America's Finest New

    Explorations of Hello World Perversion

    January 10th, 2008 by knorby

    What follows is probably the most perverse shell script I have ever written. I decided to write a script that somehow implemented Hello World for a bunch of languages. I didn’t include Java, because the installation of java on the machine I wrote this script on was somehow messed up. Plus, Java sucks hard. I didn’t do any javascript either as Rhino was messed up (see last sentence), and spidermonkey wasn’t installed. I included far too many, but I will gladly add more if someone bothers to write some. You can also download the file. Wordpress messed a few things up, which I tried to correct, so download the file copy if you actually want to try thing thing out. Also, you might need to install some stuff unless you are in the UofC CS department Linux clusters. I apologize to the world for what my boredom can cause…


    #!/usr/bin/env bash
    #====================================
    echo "Bash:"
    bash << EOF
    echo "Hello World!"
    EOF
    #====================================
    echo "Python:"
    python << EOF
    print "Hello World!"
    EOF
    #====================================
    echo "C:"
    TMPFILE="/tmp/stupidgcc.c"
    TMPOUTPUT="/tmp/stupidgcc"
    touch $TMPFILE
    cat > $TMPFILE << EOF
    #include <stdio.h>
    int main(){
    printf("Hello World!\n");
    return 0;
    };
    EOF
    gcc -o $TMPOUTPUT $TMPFILE
    $TMPOUTPUT
    rm $TMPFILE $TMPOUTPUT
    #====================================
    echo "Ruby:"
    ruby << EOF
    puts "Hello World!\n"
    EOF
    #====================================
    echo "Perl:"
    perl << EOF
    print "Hello World!\n"
    EOF
    #====================================
    echo "C++:"
    TMPFILE="/tmp/stupidg++.cpp"
    TMPOUTPUT="/tmp/stupidg++"
    touch $TMPFILE
    cat > $TMPFILE << EOF
    #include <iostream>
    using namespace std;
    int main()
    {
    cout << "Hello World!" << endl;
    return 0;
    }
    EOF
    g++ -o $TMPOUTPUT $TMPFILE
    $TMPOUTPUT
    rm $TMPFILE $TMPOUTPUT
    #================================
    echo "Haskell:"
    ghci -e 'print "Hello World!"'
    #================================
    echo "Awk:"
    echo '' |awk '{ print "Hello World!" }'
    #================================
    echo "Fortran77:"
    TMPFILE="/tmp/stupidFortran.f"
    TMPOUTPUT="/tmp/stupidFortran"
    touch $TMPFILE
    #http://www.roesler-ac.de/wolfram/hello.htm#Fortran77
    cat > $TMPFILE << EOF
    C Hello World in Fortran 77
    PROGRAM HELLO
    PRINT*, 'Hello World!'
    END
    EOF
    f77 -o $TMPOUTPUT $TMPFILE
    $TMPOUTPUT
    rm $TMPFILE $TMPOUTPUT
    #=======================================
    echo "Tcl:"
    tclsh << EOF
    puts "Hello World!"
    EOF
    #=======================================
    echo "Octave:"
    octave -q << EOF
    printf("Hello World!\n");
    EOF

    Posted in Linux, Python, coding, humor, javascript |

    6 Responses

    1. Ido Rosen Says:
      January 11th, 2008 at 8:10 pm

      This isn't perverse.

    2. Karl Norby Says:
      January 12th, 2008 at 2:08 am

      Maybe to you, Ido…

    3. Ido Rosen Says:
      January 12th, 2008 at 2:33 am

      If you want perversion, you should see some of the Perl porn Jon Rockway has written. Specifically, check out his blog software "Angerwhale" ( http://search.cpan.org/~jrockway/Angerwhale/lib/Angerwhale.pm ). It's beautiful, especially the way it handles authentication.

    4. Karl Norby Says:
      January 12th, 2008 at 3:34 am

      But that serves some purpose…
      I take it you are going about implementing your blog now?

    5. Ido Rosen Says:
      January 12th, 2008 at 3:35 am

      Not yet, but soon. I'm tempted to port Angerwhale to Python/Pylons…

    6. Randomness Says:
      January 12th, 2008 at 12:14 pm

      How does it feel to know you are providing a cheat sheet for computer science students everywhere?!?

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

     
    Add to Technorati Favorites - Creative Commons License - © 2007 Karl Norby