OpenGL Fog: the z component is at the model transformation.

September 4th, 2008

When dealing with fog, the z distance used to compute the fog density. However, which z?

Turns out, the z depth used is the z depth that is computed after applying the GL_MODELVIEW matrix but before applying the GL_PROJECTION matrix. One result of this is that through the careful manipulation of both matrixes you can create the effect of fog on the valley floor below the viewpoint: fog doesn’t just have to be haze in the distance.

Design is How Things Work

August 25th, 2008

How Design Can Save Democracy

It’s an interesting series of articles and the New York Times interactive feature is well worth browsing. And the problems they address are also relevant to web site design and to application development: by clearly segregating instruction from function (in this case, how to fill in the ballot from the ballot bubbles themselves), it makes figuring out the ballot easy and fast.

Software Development Tools

August 19th, 2008

Many years ago I got a DSL connection with a fixed IP address. I paid a fortune per month to run that fixed IP address, but the nice thing was being able to put my server on-line so I could run my own e-mail server, my own web server, and my own source control system.

A couple of months ago I switched to a new ISP which was cheaper–but I gave up the fixed IP addresses in the process.

On the other hand, there is no need for having my own IP address when for less money I can sign up for the following services:

Google Apps: Free e-mail and shared documents.

SVN Hosting: I am using the $7/month level service at SVNRepository.com; this gives me theoretically unlimited repositories and users and a 2gig storage cap.

Web Hosting: I’m using the $7/month level basic service at LunarPages.com; I can park all of my different web sites on the same account (and even host different page collections from one account), and for an extra $2/month they’ll also host my JSP pages.

So I’m out $16/month on the above services–but the fixed IP address was running me $30/month, and it required me to maintain a separate computer, constantly update and maintain the software there. I don’t know how secure SVNRepository is: if I’m running something mission critical or creating software worth hundreds of millions of dollars I’d probably run my own SVN server. But for synchronizing my code across three different computers and providing me the ability to share code bases with other people, it’s pretty damned cool.

And so a new chapter begins for our plucky hero.

August 15th, 2008

The application checklist for applying to graduate school includes the following:

  1. A completed application form.
  2. A Statement of Purpose
  3. At least 3 letters of recommendation.
  4. Additional information, such as abstracts, resume, list of publications, etc. Essentially a CV or the work equivalent.
  5. GRE test scores.

I’ve completed #5 in the list above. I have until December 15th (realistically, December 1) to complete the rest. (And I got an 800/610–respectable, though I thought I could do better on the verbal. But in a test environment, you choke–and I choked hard. Assuming the essay portion of the test went well, I think it’s good enough.)

If all goes well, then by next spring I should hear from one of the three schools I’m applying at: either Caltech, USC or UCLA. And if this all works out as I hope, then I will be entering the Ph.D program in Computer Science.

Why a Computer Science Ph.D.? Because I promised myself 20 years ago when I left college that someday I would go back and get a higher degree. And now is the time to complete that promise.

Updated ASN.1 Library

August 14th, 2008

Well, I got an interesting correspondence yesterday and a follow-up today–and in investigating I realized that there were some primitives in my ASN.1 BER library which I failed to handle back when I wrote this two years ago.

Originally I wrote the library because I was interested in building my own LDAP engine. I had written parts of an engine, but I “borrowed” the Netscape LDAP library’s BER tag parsing code to handle incoming and outgoing messages. But the LDAP library wasn’t mine, nor was it robust, so I set out to write a replacement.

The problem was when I got enough to parse LDAP, I considered my replacement done. And it wasn’t. Far from it.

It turns out there are a couple of other primitive types that have been introduced elsewhere: RFC 3641 defines a couple of new constructs, and it turns out I completely skipped one of the primitives, the relative OID type, when I originally built my library.

I’ve corrected the problems, and uploaded a new version of the library, though the new types aren’t very well tested at this point.

Update: After spending the past few months writing Objective C++ code, it felt good to blow the dust off my mad Java sk|11z.

Update 2: Did I mention Fatih Batuk’s Java ASN.1 Compiler that uses my library? Go check it out.

So here is an interesting experiment.

August 7th, 2008

I have a meeting in downtown Los Angeles, right off a subway stop at 7th street. So I thought I’d take the subway.

Why not; if I’m going to help pay the fourth billion dollar tax bill of the subway I may as well get some value out of it, right?

A few notes: first, it feels like any other subway I’ve taken in Europe or back east. Except for the turnstyles, which do not exist: the whole thing is run on the honor system. Well, there are cops, but they seem more interested in stopping me from taking pictures than they are in making sure I have a value day pass.

I take pictures anyway.

If I had taken my car to the office building at this time of day it would have taken me 20 minutes to get there. As it is it took me 10 minutes to get to the parking lot, another 10 minutes to park, and about a 10 minute wait for the subway car to run. I gave myself an hour. Let’s see how well this pans out.

A day pass is only $5, making this cost effective if I’m paying for parking. And so far the train seems to be running with efficiency: since my meeting ends at five my theory is that it may save time on the return trip, since downtown traffic is a nightmare at rush hour.

Later…

It took about 25 minutes, making me about five minutes late to my meeting. Not bad, not great.

Later…

Now the real test: leaving downtown Los Angeles. Right now trains are running every 10 minutes; if I can get back to my car in a timely fashion, then this will be–well, not a win, but at least a draw.

It’s clear to me that the real purpose of the subway is not transportation, though it serves that role. The real purpose is infill redevelopment in the Los Angeles area. I may just pop my head up at a couple of stops to see if I find what I did in Hollywood: massive development at each stop.

Huh. The train is late.

Addendum: I’m playing subway “wack-a-mole” and poking my head up every few subway stops to test my theory that the subway is about redevelopment. This may take a little longer, but it is more entertaining.

Later…

I think the LA subway is interesting. As a transportation method it is clearly a failure: for what we spent for it we could have improved the freeways a lot. But for incouraging infill development, it works very well.

I love Wikipedia.

July 30th, 2008

The other day I had to hook up some code via JSON. Having no idea what JSON is, I looked on Wikipedia. Basic data types, examples, syntax, and a link to RFC 4627 later, and I was set. Cool!

I wanted to implement a hash map, but I wasn’t sure if I wanted to do what I’ve done in the past, which is to represent each hash bucket with a linked list, or if I wanted to use a list. Unsure of the pros and cons, I looked up Hash tables on Wikipedia and got a reasonable overview discussion.

I’m finding there is a lot on Wikipedia that provides a good cursory overview of different protocols and algorithms, and more importantly, points me to the relevant research, descriptions or RFCs which describe the thing in greater detail. And while I tend to take Wikipedia with a grain of salt (you never know if the guy who wrote the article knew what he was talking about, or if the page was vandalized), the cursory overview (even inaccurate) combined with pointers to scholarly research or published standards makes a great reference.

I know this is old news: however, in the past few days I’ve found myself using Wikipedia as a starting point for a lot of CS related searches.

WordPress for the iPhone

July 22nd, 2008

Now I can blog on the fly with a new toy for my iPhone! Weeeeeee…

Another gotcha to remember.

July 17th, 2008

For some reason a development profile seems tied to the computer as well as the specified phone on the iPhone. What this means is that when you move the device from one computer to another to work on some software (say, a personal laptop to a personal desktop and back again), you need a way to clear out the development profile before things will work again.

I learned this the hard way yesterday when I blew away the contents of my iPhone, only to have things not work correctly (and deleting all my music at the same time).

Turns out the profile certificates are accessible and can be deleted from the iPhone itself: under “Settings” navigate to “General”, then scroll down to “Profiles”: this will show a list of profiles installed on the device which can then be deleted. Delete your development profile(s) from the device before plugging it into the new machine, and Xcode will load the profile for that platform onto the iPhone and things will just work again.

I survived the Great iPhone Line of 2008.

July 11th, 2008

Nine and a half hours.

Nine and a half friggin’ hours!

If it weren’t for the fact that I absolutely needed a device so I could test some location-aware software on the gadget, I would have never bothered.

Meh.