You know you’re addicted when…

2002 November 5
by darkness

…you’re proud of yourself for avoiding games all day long. Pretty amazing. At one point I was going to play The Sims Online, but then I found out I’d have to get another FilePlanet account. I decided just to code instead.

While I’m thinking about it, here’s the scoop on The Sims Online (TSO) and registration keys. I downloaded TSO for darkho yesterday and installed it on her machine. I wanted to play it on my computer, but I did not want to do the download again. I was hoping I could avoid another $7 to FilePlanet as well. No such luck on that last point, though. I was able to install from the copy I downloaded for her, but it seems that you only get one CD key per FilePlanet account. You can’t create a new EA.com/TSO account with the same CD key: one account per key. Additionally, I can’t use her account and just create another Sim unless I want to play in another city: only three Sims per account, and no two of them can be in the same city. I also presume that two people can’t log on with the same account at the same time, though I haven’t tested that. It seems Maxis/EA/FilePlanet/whomever has covered their asses on this one, so if I want to play I have to get another FilePlanet account ($7) and find the page to generate a CD key. (Incidentally, I think that page is http://www.fileplanet.com/betas/tso.aspx.)

I finished my Perl-like configuration file parser today. Here’s my example configuration file from the Perldoc in the file:

    # This is a comment.  A comment must be on a line
    # by itself.

    # The next statement assigns the string "blee" to
    # the key "foo.bar".
    foo.bar = "blee"

    # The next statement assigns the number 1.23456 to
    # the key "some_float".
    some_float = 1.23456

    # Note that everything after the = is passed to
    # Perl's eval, which means things like the following
    # are possible.
    one_plus_one = 1 + 1

    # You can access the values of previously set
    # variables with $var{'key'}.
    #
    # NOTE: DON'T MODIFY ANYTHING IN %var!
    some_float_plus_one = $var{'some_float'} + 1.0

    # This demonstrates how you can evaluate Perl code
    # to derive the value of a key.  After the following
    # assignment, "complex_key" will be "it was blee".
    #
    # Note the final % must be in column 0 and must be
    # the only character on the line (other than the
    # trailing new line).  If you need to put a % on a
    # line by itself in Perl code, use %%.  If multiple
    # %'s are found on a line by themselves, the first %
    # is stripped off and the remaining %'s are taken to
    # be part of Perl code.
    #
    # Also note the opening % for the block must be the
    # last thing on the assignment line (except for the
    # trailing new line character).
    complex_key = %
      if ($var{"foo.bar"} eq "blee") { "it was blee" }
      else                           { "it was not blee" }
    %

    # You can also have arbitrary Perl code in the middle
    # of a configuration file.  Any resulting value of
    # the code is ignored.  The same rules as above apply
    # for terminating the code with %.  Additionally,
    # the block must begin with % on a line by itself.
    %
      print STDERR "The configuration was loaded\n";
    %

Looks pretty promising flexibility-wise to me, though I admit it might be tough for those that don’t speak any Perl. Honestly simple values should be pretty straight-forward, though. I even tried a little bit to make interpolation of config values into other values easy.

Also had to fix up my interface.pm today. I found a way — albeit maybe not the best way — to get around my problem of “package A uses package B, package B needs to read package A, but package A isn’t finished loading” (phew). I also found out about CHECK sections (see perlmod man page), which I used to implement a potentially-more-proper solution.

Went to work tonight. Had to copy my license to give to my boss for “insurance purposes” apparently…? I guess I get covered under their insurance (as well as mine?) if I’m driving my car on the job…? Whatever. The copier at work is practically out of toner, and I suspect no one much cares. Also picked up the prototype firewall box that about 11 other firewalls will be based on. Picked up one of the three Sangoma cards we had shipped to us last week to use in it too.

Watched “Donnie Darko” tonight, though I missed the first 15m or so, and a bit in the middle as well. Good movie, recommended, a bit of a mind trip. Reading things like this thread on the IMDB discussion forums for “Donnie Darko” helped me understand a little better. Note, though, that as near as I can tell, The Philosophy of Time Travel is not a real book per say; I suspect you get some form of it on/with the DVD. So, good call on the favorite movie Rachel.

No Comments

Leave A Comment

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS