Press "Enter" to skip to content

SpaceRodent Posts

Eternal Darkness and other great horror games

If you like H.P. Lovecraft you have got to play Eternal Darkness for the Nintendo Gamecube. It is in the bargain bin now and I picked up my copy for ~$15. A very creepy game with a unique spell system. I am about 11 hours into the game I have three chapters left.

First/Third person horror games are few and far between. The last great one for the PC was Clive Barker’s Undying. It seems these types of games are mostly the fair of consoles.

You can’t mention horror game without talking about the Silent Hill series – of which I think Silent Hill 2 was the best. Silent Hill 3 and Silent Hill 4 seem all to eager too gross you out and lost the spooky atmosphere.

Gamecube has another great one in Resident Evil 4 which recently won Gamespot’s 2005 Game of the Year.

I am also very excited for Call of Cthulhu: Dark Corners of the Earth to be released at the end of the month. This is supposed a very hard game. For instance if you want to know how much ammunition you have left you actually have to unload the gun and check – can’t wait!

Comments closed

Python web programming

I started playing with web.py today to see how easy it would be to make a simple web app.

I followed the tutorial and everything was going well until it all stopped working. Took me about 20 minutes to figure out what was wrong. Can you see it?

urls = (
  '/', 'view'
  '/add','add'
)

No? Look again:

urls = (
  '/', 'view',
  '/add','add'
)

That’s right, I was missing a comma. Did the program complain? No. What was the output on the web browser: “not found”.

I wasn’t impressed. I hate when stuff like that happens. I will still play with web.py because it is so simple but I will be much more careful in the future.

I play a lot of computer games. Most of those games require a serial number. I am going to use web.py to make a small web app to store all of my serial numbers. Seems like a good test and more complicated than the tutorials “todo list”.

Comments closed

Look and Feel change

Well I decided I wasn’t entirely happy with my hacked up default theme. I wanted a wider theme so when I wrote code examples they wouldn’t run into the sidebar. I found a theme called Anarchy and hacked it up. I like simple designs and few graphics make it load very fast.

Comments closed

Finished Harry Potter series

Well I just recently finished the whole Harry Potter series and now am actually excited for book seven to be released. I can’t wait to see how J.K. Rowling wraps it all up.

Speaking of Rowling her site is one of the worst I have ever seen. Flash only sites are a horrible blight upon the internet and should be outlawed. She does have a text-only version but even that is ugly – white and yellow on black. Normally if I mention a site I would link to it but I can’t bear to put anybody kind enough to read my blog through that kind of pain.

Comments closed

Perl labels

I learned about Perl labels and thought I would pass it on. Basically a label names a block of code descriptively. They are usually uppercase. You can use next, redo and last within a labeled block. On the surface this doesn’t seem that useful until you start talking about loops within loops.

Take the following bit of code without labels:


while ( $somecondition ) {
    # do some work
    for my $iterator (1..10) {
        # do some more work
    }
}

Let’s say you want to use next in the for loop to control the while loop. There isn’t way to do that here. You would have to come up with some other logic to handle that. Using labels its very easy:


WHILE:while ( $somecondition ) {
    # do some work
    FOR:
        for my $iterator (1..10) {
        # do some more work
        next WHILE;
    }
}

Of course the above is a meaningless example but you get the idea.

Comments closed

X-Files and Art Bell

I just got the first disc of the first season of the X-Files today from Netflix. I used to love the show and it holds up pretty well. It’s strange to see Scully pouring over microfiche and not searching the Internet. Before this show came out I was a huge Art Bell fan and into all the conspiracy theories. I remember people calling into Art Bell talking about flying black triangles and then a few weeks later seeing it featured in an episode – exciting!

I finally grew out of all that around 1995 when I started my computer career. It’s funny how some people never grow out of it.

Comments closed

Python debugging and emacs

I am normally a vim user but am looking at emacs again. One of the features that emacs has that I love is how it does interactive debugging.

First thing to do is to have the python debugger in your path and called ‘pdb’. On my Ubuntu system that would be:

cd ~/bin
ln -s /usr/lib/python2.4/pdb.py pdb

Now edit your favorite python script with emacs and start the debugger:

M-x pdbpdb

Comments closed

Whatever happened to selling computer games?

I went down to Electronics Boutique, er EBX, er EB Games today looking for some computer games – you remember those right?Well I was shocked when I walked in and saw every single wall covered with console games. I remember back when at least two walls were devoted to PC games.

Near the back of the store on a four sided vertical shelf was the PC games. Terrible selection and only the newest games out right now.

What has happened? I wish I knew. I can only guess the console games have better profit margins.

There was a Best Buy across the street and decided to check it out against my gut feeling to run in terror (I had a really bad experience there last year and swore never to return). I cautiously approached the PC game section and it was filled with lots of games – new ones, old ones, classics, etc…

A sad day indeed with Best Buy has a better selection of PC games than EB Games. I now have no reason to ever go there again since I have a Game Crazy across the street from where I live.

Comments closed

Python == Perl when it comes to regex’s

A friend of mine is learning python and commented how he thought it was a better programming language but perl’s regex’s were better and so was better suited to scripting. I had to set him straight so I wrote a simple script in perl and python to parse telephone numbers.

Sample data:

  • (206) 329-1173
  • 206.329.1173
  • 206-329-1173
  • 206 329-1173
  • 329-1173
  • 3291173

Python:


#!/usr/bin/env python
import sys,re

phonenumber = re.compile("\(?(\d{0,3})\)?[\.\-\s]?(\d{3})[\.\-\s]?(\d{4})")
for line in sys.stdin:
    matches = re.match(phonenumber, line)
    areacode = matches.group(1)
    prefix = matches.group(2)
    extension = matches.group(3)
    if areacode == "":
        print "Prefix = " + prefix + " Extension = " + extension
    else:
        print "Area code = " + areacode + " Prefix = " + prefix  + " Extension = " + extension

Perl:


#!/usr/bin/env perl

use warnings;
use strict;

while (<>) {
    my ($areacode, $prefix, $extension) = ( $_ =~ /\(?(\d{0,3})\)?[\.\-\s]?(\d{3})[\.\-\s]?(\d{4})/ );
    if ($areacode eq "") {
        print "Prefix = $prefix Extension = $extension\n";
    } else {
        print "Area code = $areacode Prefix = $prefix Extension = $extension\n";
    }
}

Both scripts produce the same output:

    Area code = 206 Prefix = 329 Extension = 1173
    Area code = 206 Prefix = 329 Extension = 1173
    Area code = 206 Prefix = 329 Extension = 1173
    Area code = 206 Prefix = 329 Extension = 1173
    Prefix = 329 Extension = 1173
    Prefix = 329 Extension = 1173

Both scripts uses the exact same regex. Python is just as powerful as Perl for regular expressions.

Comments closed

Where are all the emacs books?

So I decided to give emacs another try. I say another because in 2004 I used it for about 3 months before deciding to go back to vim. So I went to Barnes & Noble at the University Village shopping center tonight and they didn’t have a single book! When I got home I went to Amazon.com (I work there by the way) and searched for ’emacs’. Three titles came up that were relatively new and in print. Three. The greatest editor ever and there are only three books? Eclipse hasn’t been out that long and there are entire bookshelves dedicated to it so what is the deal? I don’t know but it might be related to lisp. Lisp is supposedly the greatest programming language available but good luck finding more than one or two books on the topic and those will probably be academic texts.

Maybe the emperor doesn’t have any clothes on. Maybe I am reading all these blogs from Paul Graham and Steve Yegge and am convincing myself that the whole world is using emacs and lisp except me.I will am still going to give emacs another go but I won’t expect it to solve all my problems this time around and maybe I will enjoy it all the more.

Comments closed