I told you so

Coworker: Can you help me fix this?
Me: If you remove something from the solution you need to tell the installer solution to not look for it any more.
[a minute passes]
Me: Oh, you’re probably aware of this, but if you remove that you need to coordinate this with all of the downstream consumers.
Coworker: We’re the only one who is using that
Me: [with trepidation] well…okay then. Just being careful.
Coworker: Thanks!
[a few minutes pass]
Coworker: Why are all the integration builds failing?! Help!

This is my job 68% of the time.

Lambda lambda lambda

It can help ya help ya help ya.

It’s Python’s lambda function1! Pesky urllib2 not allowing you to construct a DELETE request? Environment Overlords not letting you install a sane http module like Requests2? Don’t like what a module you have no control over is doing for you?

Lambda the damn thing!

For example urllib2 has a method called .get_method(). It returns the type of HTML request being made. In their infinite wisdom, the writers of urllib2 thought there were only two useful types of request anyone would ever want to make using their module, GET and PUT. The method looks at the URL and if it sees post data it returns “POST”. Otherwise it returns “GET”.

But it’s a modern Web we live in and we want to do modern things like make calls against a RESTful api provided by a vendor. Sometimes that vendor uses the kind of request being sent to determine the kind of action to take. Makes sense, no? But urllib2 spits on us and makes us write bad checks. What shall we do?

In this case we just hack the bejesus out of the .get_method() method and force it to return “DELETE” every time.


import urllib2
req = urllib2.Request( "http://www.example.com" )
req.get_method = lambda: "DELETE"

Now we can run DELETE requests against the RESTful API all damn day long. And then, later, when we want to do a “GET” all we have to do is lambda the damn thing again and make it return “GET”. Yay for us!

Yay for lambdas!

This is my rose for the day.

1http://www.secnetix.de/olli/Python/lambda_functions.hawk
2http://docs.python-requests.org/en/latest/

The binary scale

My manager type person just asked me if I though a proposed story was something I could bang out. To which I replied thought it was bangable. Which makes is a “1” on the binary scale. Which, if you get right down to it, is the scale that matters way more than the traditional 1 – 10 scale.

Fantasy whinge

I am the Dusty Baker of fantasy baseball management. Betancourt brings this year’s Beatniks count of season/career ending injuries to at least three and possibly as many as five depending on how Marshall and Revere shake out.

On the pitching side of the roster there are six DL residents, further evidence of my Bakerness. Also funny? Every player traded for this season is on the DL at this time.

Eating crow…sort of

In the past I’ve made no bones about rather having Cory Schneider in goal rather than Roberto Luongo. Schneider is the more technically adept goalie. He has likely has better instincts. Most importantly, however, he isn’t prone to the kinds of meltdowns that turn Luongo into merely an above-average NHL goalie.

On the other hand, over the last year or so I’ve really come to appreciate the man Luongo is. In a very public way his team demoted him and dangled trading him for a year. By virtue of signing him to possibly the stupidest contract of all time, Luongo was basically untradable. Despite all of this, he remained a good natured guy, stepped into his backup role with aplomb, and worked hard to show there was no ill will between Schneider and himself. He has been the very definition of a standup guy.

In his first public comments since the Schneider trade1, he continues to show he is a bigger guy than the Canucks deserve. He was even talking about voiding his crazy-ass contract just to help Vancouver and he move on.

But now that the team wants/needs him, he’s committed to the Canucks–at least publicly. He says all the right things. He’s motivated to repeat his 2010 Team Canada performance in the 2014 Olympics. It’s hard to not like the guy. I even follow him on Twitter2 because he’s a funny guy. I notice he still has the goalie wearing the “?” uniform as his avatar. So maybe there are some underlying hard feelings.

Not that I blame him.

I’d still rather have Schneider as my goalie though.

But I’ll feel some vindication if Luongo puts together the solid, no-head-games season he can. And I’ll enjoy the Stanley Cup celebration that such a season would bring.

1 http://o.canada.com/2013/08/23/roberto-luongo-breaks-silence-on-canucks-drama-considered-voiding-contract/
2 https://twitter.com/strombone1