Friday, June 05, 2009

readin'

Just finished Use of Weapons by Iain M. Banks. For whatever reason, found it hard to get through. Mostly because I wasn't in much of a reading mood. The two timelines also confused me at first. I enjoyed it though, and will definitely re-read in a few months to see if I like it better the second time.

Next on the to-be-read pile, in no particular order
  • IronPython in Action
  • Watchmen
  • Dark Knight Returns
  • In Defense of Food
  • Pride and Prejudice and Zombies
In other news: Got a promotion at work (in semi-official-title but not in salary). Now I get to do even more of the things I'd rather not be doing. Good times.

Tuesday, January 20, 2009

parable of the goose

The windows near my cube overlook a winding river through the nearby golf course.

Early this morning the ice was pretty patchy. Open in places, other sections just thin enough.

Thin enough that geese walking across would crack through, plop into the water, and create a 3x-goose-size hole in the ice. A pair of them fell through within a section of ice around 30 feet across. Then, a different pair swam happily past in the open area.

One goose got so upset it starts swimming back and forth. Zigging and zagging, banging into the sides of the ice. Trying to get closer to its fellow stuck in the ice, then zooming towards the freely swimming pair. Lots of excitement and action, but ultimately no movement.

Later today....

While talking over all the crazy synchronization steps that my team has to follow in order to stay useful and relevant to the rest of the project, and how we'll transition that into our long-term goals, I tell them the above parable of the goose.

I was talking with the project's PM and current SD-manager (my boss), and was trying to describe how frustrated I was getting. Back and forth, the same discussions, different groups pulling our priorities all over, and ultimately no real progress towards the end goal.

Of course... rather than end the story there, I accidentally finish it up with the goose getting fed up and flying away.

The moral of the story:
I suck at fairy tales. But, I'm awesome at Fruedian slips.

Monday, January 12, 2009

belated reading/listening/watching/playing updates

Read:
  • The Algebraist, by Iain Banks. Re-read this. Even better the second time.
  • World War Z, by Max Brooks. Also a re-read, also awesome.
Listened:
  • Ancestor and Infected, by Scott Sigler. I think I'd have liked these better in print form than as audiobooks... The author does the audiobooks, which I assume allows them to be free. As stingey as I can be, I might pony up some cash if the voices of the characters weren't so lame. Story-wise, I much prefered Infected to Ancestor.
Watched:
  • Finally saw WALL*E, The Dark Knight, and Wanted. All great.
Played:
  • Many, many games with friends and family. Some new/continuing favorites: Ticket to Ride, Game of Thrones, Hey That's My Fish, Snorta, Samurai. 

Saturday, January 10, 2009

best weird debugging experience ever

I am captivated by each nugget of horrible code.

typedef struct RMAP
{
bill* pbill;
line* pline;
rule* prule;
} rmap;

I'm not sure what I find the most interesting... The fact that somebody thought it was fine to copy that struct definition throughout 15+ .c files.

Or, the fact that somebody slightly modified a couple of those instances.

typedef struct RMAP
{
bill* pbill;
line* pline;
rule* prule;
Bool overrideFlg;
} rmap;

typedef struct RMAP
{
bill* pbill;
line* pline;
rule* prule;
double accum;
} rmap;

Or... the best subtle weirdness, in one instance someone reordered the pointers.

typedef struct RMAP
{
rule* prule;
bill* pbill;
line* pline;
} rmap;

So... when you debug the following code in any of the _other_ .c files...

void myCrazyFunction(rmap* a_rmap)
{
rule* r = a_rmap->prule;
double reduction = r->reduction;
... blahblahblahblahblah ...
}

At runtime, everything works -- the definition of rmap used by the compiler is the definition within the .c file, and the third set of pointer-size bits within the a_rmap struct are assigned to 'r'.

But, when I try to debug the code in Visual Studio and hover over the a_rmap->prule I see a bunch of garbage. I hover of 'r', and I see it's got the values I expect.

I'm guessing the debugger finds the first instance of the rmap type in the .pdb file, and the one oddly ordered struct just so happens to be in the first .c file alphabetically (and also first in build order).

But, that realization doesn't come until about 2 hours of other wild goose chases through the rest of the call stack to eliminate the other 'more likely' possibilities.

Good times.

Tuesday, November 25, 2008

further adventures in wasting time

The 2 days I'd never get back eventually turned into around 4-5 days total of developing, creating unit tests, system testing, and correcting various bugs the tests didn't find.

And now 1 more day. Backing the changes out.

Released ~2 weeks ago; customers and internal support are finally installing the new version and KABOOM! Unknown references in the C Runtime library.

Superfantastic news! Turns out our development / production testing environment isn't at the same HP-UX patch level as most customers' systems. Thanks, Oracle 11g! Thanks, budget constraints that made someone decide they had to stick it on the same server we use for support!

Wednesday, November 12, 2008

twitterpated

I'm all aflutter over the news that HBO has ordered the pilot for Game of Thrones -- http://grrm.livejournal.com/58155.html

Monday, November 10, 2008

'tis the season

For zombies. Sweet, sweet zombies.


http://iamnotinfected.com/

and

http://survivetheoutbreak.com/

great ringtone, or greatest ringtone?

don't gamble

I should learn not to bet for or against the weather.

I'd let the leaves in the yard get away from me -- decided to take a few days off leaf duty until the maples dropped more of their leaves.

I wasn't able to do the raking Saturday, due to a bunch of errands that couldn't wait till Sunday. Decided the weekend was a waste raking-wise due to the predicted weekend rain.

Woke up Sunday to see that it hadn't rained. Decided I didn't want to get started on the leaves since the clouds looked ominous, and instead started on the rain gutters. Ick. No rain by the time I'd finished, and I was filthy anyway, so I started in on the leaves. Promised myself I'd go until the rain started.

No rain. For the four hours it took me to get the leaves off the front and side yard. Lame. Stupid rain, you were supposed to give me an excuse to go inside and watch bad TV.

16 new bags o' leaves to add to the 10+ from previous weekends. Still have the backyard to do, and about a quarter of the leaves from the maples in the front yard.

Wednesday, November 05, 2008

tell me what to do, lazyweb!

I want a laptop. Or a netbook. I don't particularly want to buy both.

After trying to type on a Eee PC 900(?), if I go the netbook route I definitely want to actually try typing on it in person. Right now, leaning towards a Eee 1000H or maybe the Samsung NC10.

Or, do I just spend another $800 or so and get a just-as-portable but more powerful system? Leaning towards either the Lenovo Thinkpad X200 (non-tablet) or buckling to peer pressure and getting a MacBook.

Or... do I go for an even bigger model so that Eclipse isn't all scrunched up? Or, do I just use it for 'fun' projects where Vim is all I'll need?

Yeah, I don't know what I want, and I've got conflicting requirements. Small! Big! Cheap! Oh, alright, spend 3x as much.

A decent keyboard and sturdy build are my only consistent criteria.

Monday, October 27, 2008

2 days I'll never get back

Through sheer happenstance, one of the test databases for our new system was (mis)configured in such a way that an Oracle sequence was generating very large ID's for a certain field.

Very large as in 123,456,789,236

Guess which horrible application uses a 'long' type to hold those IDs? Guess which horrible application is supported on both HP-UX and Windows? Guess what type might be 32bit on Windows and 64bit on HP-UX? Ding! Ding! Ding!

Spent all day Friday and today rejiggering the code to use 'long long'. Most of today was spent un-rejiggering and re-rejiggering the code to work around Oracle Pro*C's inability to use 'long long' as a host variable -- today I had to swap all that out of the embedded SQL in order to use character strings and stroll/sprintf to move values from the strings to 'long long' and vice-versa.

I had thought the code was 'OK' on HP-UX... after all these recent changes, I'm not so sure. The code to transfer the values from the query results to their 'long' variable instances seems wrong. In any case... it'll work the same on both platforms now.

I take some solace from finding the problem before any customer. We have at least 3 customers nearing 1-billion bills -- although the horrible app is 10+ years old, the rate they're adding bills to their systems grows every year. They can also start/change their sequences whenever they feel like it. So, maybe we had another 1-5 years before it became a major emergency.

Wednesday, October 22, 2008

disappointment, thy name is tiny keyboard

I've been resolutely avoiding purchasing an Eee PC (or other netbook) until I actually could get my hands on one and try typing.

Tried out an Eee 900? at BestBuy the other day -- not sure which exact 900 model. Too small. Maybe I'd eventually get used to it, but I've decided I definitely should go with the slightly larger Eee 1000H.

Tuesday, October 21, 2008

not spam

I never imagined I'd get an e-mail with subject line "Help with goat talk" and it would not be spam.

Tuesday, October 14, 2008

which is better?

  1. Laughing/crying at the right-wing, loony spam mails I get from my kook of an Aunt.
  2. Laughing at the "in no way related" e-mail containing the facts behind the rumors that inevitably follows a few days later
The latest example, a forward from the doublespeak-tastic 'American Family Council', with the subject line 'Fwd: If you think things are bad now, just wait....'
{snip}

In case you may think I’m a “the sky is falling” type of person, you should know: When it comes to predictions, I am a very reserved person. But not on this one. I cannot overstate the damage a liberal victory will do to our country. The upcoming election is the most important in the history of our nation. Yes, if the liberals win you will lose some of your religious freedoms and free speech rights. Churches and pastors will not be exempt. You will not be allowed to say certain things about a particular group. Every item of the homosexual agenda will be approved. All the laws protecting the unborn will be wiped away.

{snip}
And 5 days later, the next e-mail from her with the subject line, 'In Fairness to B. Obama. AND J. McCain.....Snopes.com' :
There are so many derogatory Political Emails floating thru space out there, that I am personally tired of having to wade thru them all - and acknowledge that it's hard to get the straight-forward Truth....

I think it might do us all well to consult those who have done the research on these (either bogus or real-truth) emails. (See links below)

Click here: snopes.com: Politics (Barack Obama)

Click here: snopes.com: Politics (John McCain)
My favorite part of the inevitable follow-up e-mail is the lack of self-awareness or any hint of an apology for adding to the onslaught of misinformation herself. Despite the fact that no one has asked her to, I'm glad she's warned us that she's "personally tired of having to wade thru" all those spam messages she passes along.

I've decided whenever I get baited into a political or religious discussion with my family, I'll make the saving throw by chiming in with, "While I appreciate that these Gay Agendas (*music sting*) make our meetings well organized, they're really making me re-think my conversion to Secret Islamism."

P.S. Also plus too as well : http://www.factcheck.org/

worst. impression. ever.

Dear Autoflush Toilet,

You ain't foolin' me! You're not a bidet!

Why does your sensor think my back is transparent?

You're horrible.

Love,
Steve



P.S. Now that you're thinking about me pooping, I'd like to point out that I deftly avoided use of any onomatopoeia.

P.P.S. Mostly because I couldn't connect the dots between this post and the punchline using the consignment store named "Grunts & Postures" near the first apartments of my wife and I.

P.P.P.S. First one to comment with a "full of shit" joke gets 15 demerits.

P.P.P.P.S. Yes, despite the demerits, it is still worth it.

Wednesday, October 08, 2008

hudson == teh awesome

Hudson is great. Lightyears beyond CruiseControl. Everything configurable through the (awesome) UI, a ecosystem of plugins, and incredibly simple installation.

We don't have that complex a build, but our SCM team looks at me like I'm a crazy person when I point out yet another issue with the build. After the umpteenth time I've found yet another build problem, I decided to give Hudson a try. We need to checkout some modules from the trunk, and others from a branch. It was bad enough when their chosen solution to that problem meant we couldn't automatically trigger the builds with a check-in -- builds had to be forced from the UI, then a pre-build step did a CVS checkout of the modules from the appropriate branches. The last straw was realizing that the pre-build script also contained some logic that overwrote any changes we made to our build.xml file with some out-of-synch version of build.xml that one of them had created at some point in the past. The sort of thing you'd like a heads up about.

With Hudson, builds have been a snap to set up -- monitor these CVS modules, run this script from the repository if any changes are checked-in, the build artifacts will match this regex pattern allow download of them from the UI, keep only X number of builds on the CI server.

Hudson doesn't let you checkout from a mixture of HEAD/branch either -- but it's simple enough to set up multiple build commands, the first of which is doing the branch checkout. We won't get a complete changelog or CI automation, but it's good enough.

Tuesday, September 30, 2008

lessons in conflation : compare != sort

For months, the business people have complained that the rules engine sporadically produces different results on Windows than HP-UX. They'd complained previous developers said, "sorting is different on Windows and Unix". I did my best to restrain any reply more caustic than, "That's silly."

Until this month they couldn't point me to bills that had the problem at the same time as we had log files from our regression tests (or find me any archived e-mails from the original developers). Given that we're probably the only people running the application on both HP-UX and Windows -- during our regression testing on the two platforms -- the bug hasn't been that high a priority.

Finally tracked down the cause of the issue to be differences in the qsort() algorithm of the C runtime lib -- specifically how qsort() handles two elements that compare as equal (!). For some reason, the Windows qsort() performs some extra comparisons and 1 extra swap.

The list we're sorting looks something like :

1. $23.96
2. $23.96
3. $23.96
4. $23.96
5. $40.95

On Unix, qsort() and this particular compare (descending order by amount) results in the following :

5. $40.95
1. $23.96
2. $23.96
3. $23.96
4. $23.96

On Windows, its qsort() and the same compare function resulted in:

5. $40.95
3. $23.96
1. $23.96
2. $23.96
4. $23.96

The values we're comparing are equal... but what we're actually sorting is the value and a reference to where it started in the list. Because the sorting produces different results we end up annotating the bill lines differently on Windows than Unix.

Changing how we do the comparison fixed the problem. Now we compare left/right values, if they are equal we compare the originating line number of the values.

And now we get consistent results no matter the platform:

5. $40.95
1. $23.96
2. $23.96
3. $23.96
4. $23.96


Next time, in Steve's job rants:
  • Typedefs on top of typedefs on top of typedefs. Oh yeah, and because of typedefs A, B, C, and D it turns out 95% of calls within the system look like pass-by-value but are in fact pass-by-reference. It took me ~2 months to realize that was going on. 4 months later and it still gives me the heebie jeebies.

Saturday, September 27, 2008

loving/hating Fit

We waste a huge amount of time on our legacy code base because we have no Unit tests, and no standard way the project's developers test their changes.

It's typically some error-prone manual process -- run some SQL in Toad, copy results to Excel, run the bill, re-run SQL, compare to the old results with eyeballs, pray.

I read about Fit a few months ago, and it seemed like it'd solve a lot of our problems. Blackbox testing would help build tests up around our legacy codebase. It'd also help bridge the communication gaps between onshore/offshore development, and development/business.

Finally took the time to play with it this week -- specifically, DbFit. Without any customization, I was able to write some simple SQL in a wiki page to generate a new test case for the issue I was working on this week.

I'm in love. It seems like with some minor customization we can make some huge leaps in our productivity. But I really hate trying to navigate the Fit/Fitnesse web sites for reference information. Ugh.