spacing hack


solo piano 20110101

A good day for me is a bad day for a lot of people.

For instance, yesterday was awesome because there were storm warnings all day long. It was great for me because I got a chance to implement the parsing of warnings for the wickedwx beta site. I even went on to implement the parsing of weather watches, which is functionality that doesn't even exist on the original site.

See, the real reason why yesterday was awesome is that I don't have a way to access historical storm warning data (or at least I haven't found one yet). Ergo, if I want to write a program that goes out and retrieves the storm warnings and does something useful with them... then there better be some actual storm warnings happening right then and there, otherwise I have nothing to work with.

And given that it's winter, there are going to be plenty of "dead" days in regards to the type of weather that wickedwx covers (tornadoes, thunderstorms, and flash flooding), so I get to count myself lucky that I caught a rare winter day when I was actually able to throw myself into programming long enough to get it working.

Even now, it's dead quiet on the watches and warnings pages. And this is further exacerbated by the fact that the SPC has yet to update their outlooks to work for the year 2011, so even the main page is dead.

But it's been amazing to me how quickly the rewrite has gone so far. Some of that is just the plain fact that some things are just a copy/paste with trivial editing for them to work in the new environment. But I think a lot of it is the fact that I'm working with a better set of tools and a better me.

Like, the old site is hosted on Google's App Engine, so there were some utilities I flat out couldn't run if they weren't pure Python. Which led to my having to reinvent the wheel for some of the data parsing I was doing. I've seen some of my old code and there were plenty of instances where I was literally parsing a file line by line to get what I needed. Granted, a lot of it might have just been ignorance on my part of better tools that would have been compatible with App Engine.

And some of it is definitely Ruby. For one, regular expressions are first class citizens - they're baked right in. I look at the Python code for some of the regular expressions I did, and it just looks like a mess compared to the Ruby equivalent that I wrote yesterday.

I'm also getting lots of use out of Ruby's block structures. Honestly, the same stuff may exist for Python, which is why I threw in the part about working with "a better me". I'm doing tons of junk in one line that would've taken probably quadruple that with the old me.

And finally, there's me in general. There's the previously mentioned ignorance, but it's also that I feel I'm way more efficient this time around. The original wickedwx code base grew to a point where I was somewhat intimidated because of all of the random stuff that was going on in seemingly random locations. I don't want the same thing to happen to the new code base, so I'm trying to be extremely sensitive to anything that will lead the new project down the same path. For instance, there's at least 3 different ways I've found that the SPC specifies their latitude and longitude coordinates and none of them are in a directly usable format. Before, I probably would've just written 3 different ways to handle it, but now I'm going to see what I can do to make sure that all 3 can call the same function.

So yeah.

Storm reports are the next big thing I'm going to tackle. And lucky me, I do have access to historical data on this one so I won't have to wait for the "perfect" day. Hurray.