guyblade.com #/


PSN
Gamercard


2008 Jul 17 tifa


Guy Blade Guy Blade---06:52:00


Lovelace would be disgusted
Ada is a badly designed language and its designers should feel bad.

I say this for several reasons which I will soon impart to you.

1. How many types are too many? Basically, Ada allows you to define all sorts of types. You can define a type which is all positive integers. You can define a type which is all real numbers between 2 and 3. You can define a type which only represents a valid number of seconds to occur in a day. At first, this sounds like a great idea because it forces you to make sure that all of your numeric values are legitimate and verifies them at runtime. The downside is that you have to cast every single time you move from one to another. It doesn't matter if two different types are both defined to be all positive numbers representable with an unsigned 32 bit integer, you still have to explicitly cast. This becomes even worse if you're doing such simple things as adding, where if you're adding two different kinds of numeric types, you'll have to cast one into the other. Also, if you're using the built-in functions for doing things like converting an integer into a string, you have to know the exact type that you're using or else you won't know what function to call, and loathe to you who would try to use the wrong one.

2. What's that about interfaces? So, sometimes you have to deal with binary interfaces. In my case, I'm reading satellite data which is in a fixed (and not going to change) format. Ada does, luckily, provide something similar to C structs called records which you can theoretically use to read such binary data in fixed structs. Unfortunately, the language (or at least the gnat implementation) made an idiotic design decision: if you're packing a record, the compiler can feel free to rearrange the elements of the record (see 8 in link). Now, that just isn't going to work when the layout of the data has been pre-defined. When I say that the record is an int32, a uint8, and then an int32, it isn't ok to put the uint8 at the end to keep alignment easy!

3. Shift what now? So, you can't use a record to just read the data in straight. What do you do instead? You use an array of bytes (Unsigned_8s in Ada parlance) which is the same size as the record that you're trying to read and then reconstruct them into the various types that you need. Sounds like no problem to me, just a bunch of shifting and ORing then some type fiddling to make everybody happy. Unfortunately, however, Ada only provides bit shifting operators for "modular" (i.e., unsigned) types. Also, due to the crazy type system mentioned in part one, you can't force a negative integer value which you've constructed in say a Unsigned_32 into an Integer_32 by using the casting operations. Clearly, that wouldn't make sense because the "negative" value in the Uint32 is larger than the maximum value of the Int32! How do you get around this impasse? By doing two's complement calculations on your own, of course! This, along with my complaints in part 1, make the code to convert 4 bytes into a 32 bit integer something like 10 lines long instead of being more like the one line long piece of C code that I use to process other data plus it has lots of wonderful constants like 16#80000000# (which is the bitmask for seeing if the MSB is set) and 16#7FFFFFFF# (the negation of that for anding out the other part).

4. What do you mean it doesn't matter? Ada is a case insensitive language. I don't think this is inherently a bad design decision, but it has, in the code base that I'm working with, led to the brilliant decision to use ALL UPPERCASE to refer to all non-built-in types, functions, and variables.

5. I would kill for fprintf. Ada's options for writing numbers to text files are rather sparse. You can use Type'Image(variable) to produce a string which contains the value in a fixed format (integers would match the regex /(-| )\d+/; floats would match the regex /(-| )\d+\.\d+E(\+|-)\d+/). This has the downside of producing very ugly floating point numbers every positive number is have a space at the front of it. It's pretty easy to remove, but I shouldn't have to. The other method is to create an instance of the Ada.Text_IO.Integer_IO or Ada.Text_IO.Float_IO classes. Of course, these classes can't be instantiated directly, you have to extend them so that they apply to a specific type of integer or float and won't work on any other types (see part 1 again). That's one extended class for each type or a whole lot of casting. Good luck trying to use integer/float IO at the same time as doing regular "text" IO. I wasn't able to ever get it working right. I'm sure there is a way; I'm also sure that it is bad and that it should feel bad.



Published by XPost


Permalink to this post     Com/0


2008 Jul 14 yuffie


Guy Blade Guy Blade---13:15:00


Alternate Plan
A couple of weeks ago, my iPod was stolen. This has led to me using WMHD as a music source at work. Unfortunately, my music tastes and what is available on WMHD do not coincide well. As such, my answer thus far has been to set up an icecast stream so that I can listen to my music from work. It turns out that mpd makes a very good source for icecast and can do all the nifty things necessary to make a decent little remote music player.

The only problems that I've had so far are difficulties set up any sort of security on the stream. Icecast (at least the svn trunk) supports streaming over SSL, but there is essentially zero documentation. Also, icecast only supports two kinds of authentication: htpasswd which is essentially identical to apache's htpassword auth, and "url" auth which sends a command to a remote http(s) machine and greps the output for a given magic string to authenticate a user. The problem with the htpasswd is that it is a pain in the ass to configure and the "url" auth doesn't play nice with using a self-signed SSL certificate (fails to authenticate without explaination) or provide a method for ignoring the self-signedness.

Obviously, I don't want to run an open music stream over the internet, so I'm going to have to figure something out. The obvious answer would be to enable ipsec and only allow it to work over ipsec, unfortunately, ipsec connections aren't allowed through my firewall at work.

Published by XPost


Permalink to this post     Com/0


2008 Jul 11 terra


Guy Blade Guy Blade---07:22:00


Your statement has been added to the record
So, a while back, I threw together a quick commenting tool for use on guyblade.com and andersonhighschool.com. At some point, it became spammy and I just disabled it. Based on the dates of posts, this was like two years ago. I was reminded that this page existed by looking at my awstats and seeing that, dispite the fact that it was impossible to actually post to the comment page, it was being spammed to the tune of a few hundred hits a month.

My response was, of course, to try to re-enable it with some sort of security. My first attempt was a brain-dead captcha made using PHP's gd library. Apparently, spammers have prebuilt libraries for solving any captcha using the built-in fonts in PHP's gd build as I had several hundred spam posts by the time I checked again.

My second attempt (the current one) is to present an equality of the form "x * y + z = t" wherein one of x, y, z or t is missing and all are non-negative integers. The user is prompted to solve for the missing value. Although it is also brain-dead simple, I hope that it is not in the pre-built captcha solving libraries. If it is, I may be forced to make people solve simple definite integrals over polynomials and/or evaluate simple derivatives at points on polynomials.

I suppose this could have the side effect of preventing some people from being able to comment on my posts @ guyblade.com, but I think it will be ok.

Published by XPost


Permalink to this post     Com/0


2008 Jul 10 peach


Guy Blade Guy Blade---17:51:00


The bullets go up
So, a few days ago, I rediscovered the game Tyrian. It was a vertical scrolling shooter made in the mid-90s that was exceptionally good for its time and has managed to age very well. What caused me to rediscover it was finding (through stumbleupon) that the game's engine has now been open-sourced and released for free through the OpenTyrian project. This is especially nice because the game now will run more or less flawlessly under linux without any special emulation required. I highly recommend it to any fans of the scrolling-shooter genre.

Published by XPost


Permalink to this post     Com/3


2008 Jul 02 rinoa


Guy Blade Guy Blade---06:12:00


Things that suck.
1. Finding out right as you're getting ready to leave work that something absolutely has to get done before you leave.
2. It taking an hour.
3. Horses going down the wrong side of the street, toward you, while you're on a bike.
4. Blowing a breaker when the breakerbox is outside, downstairs, behind the building, in a dark alley at night.
5. Your iPod getting stolen. Again.
6. Vacuum cleaners.
7. Wasting a DVD trying to burn YellowDog for the PS3 with a bad image.
8. Trying to install Ubuntu on the PS3 and it refusing to ever load X.
9. Rent going up by $100.
10. Being on call for jury duty.


Published by XPost


Permalink to this post     Com/0


2008 Jul 01 elly-miang


Guy Blade Guy Blade---06:53:00


No Hero
So, I just finished my second pass through Metal Gear Solid 4. I have to say that the game is very well presented, wraps up the series nicely, and manages to take one of my favorite characters and actually make him a better character. MGS4 also manages to make MGS2 make sense. The second pass through was to try to beat the game without killing any enemies. I my first pass, I only killed 7. Six of those were during a scene in which I thought that I was required to kill a set of "armored soldiers". I didn't realize that I could simply ignore them and the game would progress past them. I'm not sure where the other kill came from. I know it happened during act 4, but it could have been anywhere.

Beating the game with zero kills unlocks the bandana. If you've played any of the other metal gear games, you know that this item gives infinite ammo.

In an unrelated, but related note, MGS4 may have the best flashback of any video game that I've ever played. There is a dream sequence in which Snake flashes back to his memory of Shadow Moses Island. During this flashback, you play through the first screen of metal gear solid one, in all of its PSX glory. This, in my mind, means that the original game, in its highly pixelated form is canon. I suppose this means that their universe, sometime during the last decade and a half, underwent a massive shift in existence which caused people, places, and things to spontaneously develop additional polygons, bump mapping and the like.

Published by XPost


Permalink to this post     Com/0


2008 Jun 20 garnet


Guy Blade Guy Blade---12:21:00


That's no moon.
Successful seperation and deployment of the solar arrays makes for a good prize early in the morning.

Published by XPost


Permalink to this post     Com/0
Guy Blade Guy Blade---11:04:00


L+17
So, OSTM has launched. It is currently coasting after second stage cutoff and will be for about the next ~40 minutes. After that, the satellite will seperate from the launch vehicle and the real fun will begin.

Published by XPost


Permalink to this post     Com/0


2008 Jun 19 elly-miang


Guy Blade Guy Blade---17:23:00


T-15h
For those of you who were unaware, I've been working at JPL for about a year. During this time, I have been work almost exclusively on writing various pieces of software for use on the ground for OSTM. Today, however, is the big day. A little bit before 1 am PST tonight, OSTM will launch. If you're interested in seeing the launch, it will be telecast on NASA TV. Some other briefings will be starting at 1pm PST today.

Since I expect that none of you actually know what OSTM does, I'll summarize breifly. Basically, OSTM is the third satellite in a series which have been measuring sea surface height since 1992. OSTM will be continuing that mission to keep building the long-term sea surface height data record once Jason-1 (the most immediate predecessor) fails. Based on the most recent data that I've seen, the sea levels were rising at about 1.5 mm/year when Topex was launched back in 1992. Now, about six years into Jason-1, sea surface height is rising at about 3 mm/year. OSTM will help us determine if this increase in sea level is a long term trend or something else by continuing to build the dataset.

Published by XPost


Permalink to this post     Com/0


2008 Jun 02 emeralda


Guy Blade Guy Blade---10:57:00


Fission Mailed
I just got back to my apartment. I spend Friday, Saturday, and Sunday back in Indiana. Primarily, I was visiting home to go to my brother's high school graduation. I also took the opportunity to visit the Theta Xi house and fetch my paddle. I was very disappointed with the number of people there (one active(?): Phil; one alumni: Stanfield). I was also somewhat suprised to see what a mess the house was in. I told Phil to relay my disappointment in both cases to the actives.

At home, I went to my brother's graduation. It was pretty standard--very similar to my own 5 years ago. I was, as always, sad to see the state of the class. Of the approximately 400 students who entered with my brother's class, only 220 or so were walking (you walk as long as you have <= 2 credits remaining). Also, less than 1/5 of the students bothered to go through the Academic Honors Diploma program which is a slightly (very slightly) more rigorous degree than the standard degree. Also, I was more than a bit annoyed by the overtly religious speech given by the principle during the graduation. It was the sort of thing that tiptoes right up to the edge of what is allowable at a public school (short version "You need to have faith in something other than yourself. I happen to have it in god. You could pick your friends. What? That wasn't an endorsement of religion. See, I defined faith broadly to encompass almost anything, but I really only mean that first one. Wink-wink nudge-nudge say no more.").

I also did the standard visit family thing. I found out that I am apparently my grandmother's attorney-in-fact. Who knew?

------

OSTM launches in 14 days, 0 hours, 50 minutes.



Published by XPost


Permalink to this post     Com/0


2008 May 29 relm


Guy Blade Guy Blade---17:42:00


On the Road Again
So, I'm going to be in Anderson this weekend for my brother's graduation. I'm taking the red-eye out tonight, so I'll probably be exhausted by the time his graduation actually starts. We'll just have to see I suppose.

The fun part will be seeing if the rental car places forces me to pay the $10 fee for being under 25 years old. I hope they don't since that would increase the cost by over 50%.

Published by XPost


Permalink to this post     Com/0


2008 May 27 peach


Guy Blade Guy Blade---11:52:00


Entropy
This following video may be the single most amazing video that I've ever seen. I am absolutely sure this is the case if we restrict "video that I've seen" to only include Mario related videos.



Published by XPost


Permalink to this post     Com/0


2008 May 21 terra


Guy Blade Guy Blade---04:06:00


Tactical Espionage Action
So earlier today I managed to snag a preorder for the Limited Edition Metal Gear Solid 4 Bundle. I had attempted to preorder one yesterday, but the site was being exceptionally broken. In fact, in order to get one today, I had to go through bizarre gesticulations which involved tricking it into letting me put one in my cart (they used a cookie-based system that only let you add the bundle to your cart once, regardless of whether or not you actually had one in your card, have successfully ordered one, etc), then creating a new account on Konami's website in order to get around a bizarre error which told me that having one bundle in my cart meant that I had an invalid amount of bundles in the cart. Nevertheless, I have persevered and managed to preorder (with receipt!) one. Now I need to go to gamestop and cancel my preorder there.

In other news, I retired Eve and Claire and replaced them with a set of three low powered machines. The machines are actually just a low powered motherboard with an integrated processor (fanless) powered by Pico-PSUs and booting off of 4GiB compact flash cards. It turns out that all three machines can be successfully be driven by a single 12V/25A power supply (uses 310W peak). This means that I'm able to get essentially the same work out the machines in exchange for 2 moving parts: 1) one of the machines boots off of a hard drive for various reasons and 2) a small thermally controlled fan in the PSU. The whole aparatus is mounted into a 2U rackmount shelf. I'll take some pictures later on.

Published by XPost


Permalink to this post     Com/0


2008 May 16 peach


Guy Blade Guy Blade---03:25:00


Tearing Up
So, I started ripping all of my old playstation games yesterday. I've become concerned that the oldest of them are getting to be nearly a decade old and many of them will probably never be reprinted. I fear that my current disc space may be insufficient to hold the new influx of data that this will generate, but I'll cross that bridge when I come to it.

I've also started trying to rip my ps2 games and have met with, at best, limited success. It seems as though the only tool that has had any success for me is k3b which seems to rip properly (Final Fantasy X did start successfully in pcsx2), but without a real emulator or tested ripping methods, I am unsure.

Published by XPost


Permalink to this post     Com/0


2008 May 12 emeralda


Guy Blade Guy Blade---01:28:00


This Creedo
So, yesterday I beat Assassin's Creed. If you haven't played it yet, it may be worth telling you that this game has an ending similar to Advent Rising, Anachronox, XIII, and Halo 2. Due to the relatively good sales of Assassin's Creed (something like 3 million copies), I expect things to go more like Halo 2 than Anachronox.

As for the game itself, it is rather fun, but it isn't as good of an assassination game as the Hitman games (at least post Hitman 2). The game usually feels like an open world version of Prince of Persia, but unfortunately there isn't much to do in that open world: there are essentially zero (interesting) sidequests, there are no real interaction with NPCs in the world, and there are arbitrary barriers which prevent you from ranging freely for large portions of the game.

The game does have one sidequest: collecting flags. These flags serve no purpose other than fulfilling an optional objective. Completing the objective provides no in-game benefit and is itself time-consuming since there are literally hundreds of flags. In the console versions of the game, collecting flags at least gave achievements. In the PC version, the only reason to ever pick up a flag is because they refill your health. Of course, you regenerate over time rather quickly anyway, so this too is rarely of use.

At least the PC version doesn't force you to walk to every city that you have to visit to do an assassination like the console versions do. The PC version wisely gives a quick travel option after you've been to a city once.

Published by XPost


Permalink to this post     Com/0

Older Posts

Archive
Copyright 2002-2024 Blade Libergnosis//Powered By Blogger