spacing hack


solo piano 20101223

Well, the rebuild won't be anywhere near where I had hoped at the end of this 48 hour window.

A huge chunk of my programming time yesterday got wasted spinning my wheels trying to figure out how to parse the so-called "PROBABILISTIC OUTLOOK POINTS DAY 1" file. Here's an example.

For good or bad, I chose not to review my Python code that I had used to parse it before for 2 reasons:

  1. The old code was on an external hard drive that wasn't where I was.
  2. It would've potentially been mostly irrelevant anyhow because, back then, I wasn't parsing all of the file. i.e., I was only parsing the so-called "categorical risks" (slight/moderate/high). I was discarding the information on thunderstorm lines and all of the percentage chances for hail, tornadoes, and damaging winds (if you look at the example file in the above link, you'll probably know what I'm talking about).

Reasons why I spun my wheels for so long:

  • I was originally trying to get a regex expression that would break apart the tornado, hail, wind, and categorical risks into individual array items. This never panned out and I ended up dealing with the file line by line instead.
  • I don't remember ever having difficulties with variable scopes in Python, but they're tripping me up everywhere in Ruby. So part of it was learning that I would need to use instance variables instead of whatever is the default type (@variable vs variable).
  • I didn't know what data type I needed ultimately and got stuck trying to create the "right" thing as part of this increasingly confusing loop. I believe I was originally attempting to do an array with nested hashes. Ultimately, I ended up dropping arrays and just using hashes nested inside one another. Learn from me here: if you don't know exactly what you want, manually create a sample array/hash/whatever that has the info you need, and try querying it. If I had done this to start with, I would've realized right off that bat, that what I was going for, was the wrong approach.

So yeah, v1 will be very minimal. But honestly, I think some of the most confusing things may already be out of the way.

Fingers crossed.