Archive for the ‘Uncategorized’ Category
Site Update
Wednesday, August 13th, 2008MN Caucus
Thursday, February 7th, 2008So this past Tuesday, I got to participate in a presidential primary/caucus that actually mattered for the first time in my life.
Strange Attraction
Monday, January 28th, 2008As the old saying goes, “it’s the little things in life that matter.” Well one of the little things in my life is recursion. What is recursion, you ask? Well if you’re programmer you probably know what it is, and if you aren’t you wouldn’t understand even if I explained it. Just know that recursion is great, because it’s simple, elegant, and extremely efficient. The only downside to it is that it’s kind of hard to understand at first look. Unfortunately in today’s coding environment of bloatware with objects and resources being allocated everywhere with little prior thought, coding techniques like recursion often get lost in the shuffle.
Well today I actually got to use a bit of recursion to accomplish a bit of string manipulation. Basically I had to strip off all the leading characters of a string that were alpha characters (letters). Needless to say, it made me smile to see something accomplished so elegantly. For those that care to see it, here’s the (badly parsed… thanks WordPress) code. It’s written in Visual Basic .Net (not my choice):
Private Function stripLetters(ByVal word As String) As String
’ Recursion, everyone cheer!
If Char.IsLetter(word.Chars(0)) Then
Return stripLetters(word.Substring(1))
Else
Return word
End If
End Function
That, folks, is a perfect function in every way, and I don’t get to write them too often.
AGU
Friday, December 14th, 2007You may or may not have heard about geologists’ fondness for beer. In order to illuminate this point, I want to mention that during afternoon breaks at the American Geophysical Union (AGU) fall meeting, we have Anchor Steam (free) on tap for attendees.
That is all.
wasn’t me!
Wednesday, November 14th, 2007The previous post was by the real Brit, Alex, who was sneakily using my login! It wasn’t me. Really. BTW, in case you’re waiting with baited breath for a Tesco to open near you, the first one is opening in LA. It may be a while.
A Programmer’s Nightmare
Thursday, July 26th, 2007Today was one of those days, where at the end of a 3 hour bug-finding mission, you want to scream.
The problem: one the support gals was having trouble running a particular export for a client. An export is basically just an extraction of specific data from the system to give to a client in a format that client wants. The specific error message was pretty vague: something about a field being truncated and loss of data.
The first clue was that this was a SQL error, because only SQL will crap out on something like that. While VB or most object oriented languages will simply convert or truncate a field for you, SQL is very strongly typed and won’t let you do that. I found the stored procedure (bunch of SQL code) for that particular export and took a look. Unfortunately there were about 50 or so fields being extracted, and one of them was causing problems. Sadly for me there’s no nifty way of figuring out which one it is. The error simply said “a field”, so I would have to go through them in chunks to figure it out. An annoying aside to this is that I had to actually mark each field three separate times in the file in order to test it, making things even more cumbersome.
I decided to do it in chunks. First I would try all the address-related fields because they are fairly similar. Then I would deal with the product fields which had quantity, price and other such information. Luckily the first chunk was the culprit because when I commented it out (removed it from being in the script) it worked fine. So I was left with 10 or so fields, and I thinned those down one by one until I eventually came across the field “ContactFirstName”. What this means is that in all the records returned by this SQL code, one of the contact’s first names is funky… most likely it’s too long (hence the truncate error).
The next step was to isolate the specific records I needed, which required a daring and creative amount of cut & pasting. Then I got the code to spit back all the first names. There were a few hundred rows returned. “Bob”, “Andrea”, “Phillip”, “Mary”, all pretty normal names. Then I found it. I came across a field containing “ANGELA, MICHAEL, BRANDON, TYLER, AUSTIN, KAITLYN, HALEY WHITE”, which is a hell of a first name. To test to see if this was the culprit, I parsed it down to just “Angela”, ran the export and got no errors.
So I found the problem after a few hours of hacking my way through a convoluted SQL file while being remotely connected to a client, which slows everything down a lot. The eventual error was that the ContactFirstName field in the export was 30 characters long whereas it was 50 characters everywhere else in the application. The creative name above happened to be more than 30 characters. The solution? Change the ‘3′ to a ‘5′, and I’m done. That’s it.
Sigh.
A Soggy Fourth
Thursday, July 5th, 2007So yesterday was the 4th of July, the annual holiday where everybody in the East End decides to be nice to each other for a day. Seriously, it’s like a big block party where I live. Lots of people having barbecues, lots of people walking around, lots of live music going on, just a busy people day. The weather wasn’t fantastic: overcast most of the day, breezy and a bit chilly. But that didn’t deter people from having a good time and getting really drunk. While I refrained from most of the alcohol consumption, I did get to see the powerfully amusing combination of fireworks and booze. Now I didn’t see anyone blow their head off, but there were plenty of rogue firecrackers going off throughout the day.
I headed back home around 8:30 to check some things before going to see the fireworks display down on the Eastern Prom at 9:15. Well at about 8:45 I heard a lot of banging, so apparently they started early. I walked down the street a bit and got a real nice view between two houses, so I just stood there and watched. And then about ten minutes into the show I realized why they started early: it began to absolutely pour. Now I love the rain, and I like fireworks on cloudy days (because the colors bounce off the clouds), so I was happy as a clam watching, but I imagine those who had parked their butts down on the Prom with no rain gear were probably pretty unamused. The show itself was quite long, about 30 minutes, and pretty good for a local show. Lots of big colorful ones, and a mix of interesting shapes ones, and a couple big bangers. My favorite sequence was one where they shot up about a dozen or so of those streamer fireworks that explode and kind of linger. It was real pretty.
Having a day off in the middle of the week was great, and even though I’m back at work today, it’s deader than doornail here, hence my work-day posting. Tomorrow will probably be similar… perhaps I should go make some bugs to fix.
Reason #317 why I’d rather shop online than in real life
Thursday, June 21st, 2007After doing some research, finding the store that sells what we’re looking for, finding a time that we’re both available to make the trip during store hours, we get in the car, head up to the store, and find a sign on the front door of the store that reads: “Closed today for employee picnic.”