Bedroom Farce Review

K and I went to see Bedroom Farce last night playing at Theatre Three in Dallas. It’s written by Alan Ayckbourn, a celebrated contemporary British playwright. The Theatre Three staging is very well done and all actors seem to be well-cast. The story centers around 4 couples playing out pieces of the play in their bedrooms. The stage is set with three bedrooms where we begin to see how the lives of each couple are intertwined. The set is very well done in this staging but if you go, request seats in either the North or East sections as they have decidedly better views.

I’m not going to spoil the show but I definitely recommend going. The play is well written and acted. It runs through March 28th.

Writing Software To Show My Mom

I recently read Amy’s story at Year of Hustle and it really struck a chord with me. I’ve been writing software for going on 10 years now and I don’t have a single thing that I’ve done in my every day work life that I can point to as mine. I can’t tell my mom “go to this web site, I did that”. That’s a lot of years of working to have everything behind some firewall. Don’t get me wrong, I’ve got personal websites that run a variety of things for me but nothing beyond 5-10 users at particular times of the year. I don’t have a central location for my work partially because it never occurred to me but mostly because I just don’t have that work to display.

Making that realization got me thinking. I don’t much care for the feeling of 10 years of work that I can’t even refer to outside of a resume. Frankly, it’s a little depressing. So I’d like to make 2010 my year of hustle. I’d like to actually ship something that someone uses, a piece of software that I can at least be proud of. I’ve got a few ideas of things but one thing I struggle with is losing interest in a project. It would be generous to say that I’m a habitual project starter. I have shiny jangly disease and it manifests itself regularly. Part of the problem is that I thrive on feedback. I don’t need a lot of it but if I have to sit around working on something for a month with zero feedback, I’m going to lose interest. That happens a lot in my personal projects. So I’ve got to find a way around that.

One thing that would help is actually shipping pieces of something, something that could provide very definite and regular feedback. One idea is to create a main portal for my digital presence on the web. Currently, if you google me, you don’t even find this blog. You also don’t find my regular blog or my photoblog. I’d like to turn brettbim.com into a centralized portal for all my work, writing and photography. I’ve started playing around with that idea but the learning curve for designing something useful is pretty high for me, given the fact that I think WordPress would be the way to go. I have four WordPress blogs that get some level of regular attention so it seems like it would makes sense to use WordPress as the CMS for all my content. Problem is, when God was handing out designing skills, I was at recess. So I’ve got some learning there but then, I suppose that’s the point of having a year of hustle.

I have a few other very nebulous ideas that could be done in a year. I need to spend some time fleshing them out. I know I’m not particularly thrilled with how my work life has played out over the last 10 years. Much of what I’ve done has been low on the creativity scale and that is a big drain. I got into programming because it was a way to exercise my brain on a regular basis and exercise my need for creativity. As it turns out, most programming in corporate environments does neither. I’ve been lucky over the past few years to be in jobs that really stretched my mental capacity including my current job but the creativity always seems to be missing.

I’m not really sure what a year of hustle will look like for me. I think the best thing I could do would be to just start throwing stuff out there and see what sticks. My life has been changing in quite a few ways lately so we might as well go full out. I’d like to ship one thing this year at the very least. We’ll set the bar low and see what happens.

And The Rich Get Richer. . .

There is currently a movement underfoot in Congress to recompense investors in the Bernard Madoff and R. Allen Standford Ponzi scheme debacles. It is couched in the terms of people having lost their life’s savings being fairly represented and treated but is actually a disgusting reminder of how those in power control much of our government now, wheeling and dealing in the halls of Congress to enact hidden taxes on the American people. By and large, the investors in these schemes were wealthy individuals and families who enjoyed years of outstanding returns with little or no risk, something that should have immediately raised concerns for any normal investor. Instead, they are now trying to collect money from Wall Street firms based on returns they would have gotten in the schemes had they been above board.

Should this come into law, it will codify protections for imaginary gains in all kinds of investment schemes. These were investors, mostly all rich, who should have known that outlandish returns had to be highly risky. We should also realize that these investors weren’t left out in the cold like so many average Americans who have lost significant portions of their life savings over the last three years. People in these schemes were covered under the Securities Investor Protection Corp up to $500,000 towards legitimate claims. Claims that aren’t legitimate include instances where the individual withdrew more money than they paid in. These people are clamoring for imaginary gains when many of them actually made money on the schemes. This is ridiculous.

What this will turn into is a tax. If it becomes law, the brokerages will have to pay the fines but they will most certainly pass the costs on to the consumers, most of whom are average Americans who just happen to have accounts with them. To think that we have Senators who are gladly sponsoring legislation to defraud the public to reward the rich and connected is sickening. But I suppose that is exactly where we are these days. Millions of people are out of work and our elected representatives are trying to get imaginary returns granted to the already rich and wealthy. Some day, the people of America will get sick of this treatment. I have some fear that the response from them will not be quiet and civilized.

Making CheckBoxList Play Nice With JavaScript

I’m working on a web page that allows the user to apply a variety of filters to a set of data. The old implementation involved a check box for each filter and then a ListBox with MultipleSelection set to true. The user would tick what ever filter they wanted to include and then select the items out of the ListBox. Every time the user makes a selection in one of the ListBoxes, we’re making an AJAX call to update the current filters. That works great but the user has to do two things, first tell us that they want to use a particular filter using the appropriate CheckBox and then select items out of the ListBox, sometimes holding down the Shift or Control key to do multiple selection.

We decided to change that to a CheckBoxList for each filter. This removes one step and makes the UI a little more fluid. However, it did cause one problem. Previously, the ListBoxes were being loaded with data on PageLoad by just adding a new ListItem for each piece of data. This works well because the ListItem can hold whatever value you want to key off of. However, a CheckBoxList renders as a table of CheckBoxes, none of which have the ability to hold a piece of data to key off of.

That code rendered a ListBox that had source like this:

From there, it was really easy to grab the value of any selections via JavaScript. Unfortunately, as mentioned above, the CheckBoxList does not render that way. Using the same code in the PageLoad ends up rendering this HTML:

As you can see, none of the checkboxes have the value attribute. There is now a label for each one but it has the Key of the ListItem and not the Value which isn’t particularly helpful when you want to display one piece of data for the user but process another one based on their selection. What to do?

As it turns out, you can add an attribute that gets rendered as a span around both the input and label elements. In JavaScript, you can then grab an array of the inputs and an array of the span elements. When one of the input boxes is found to be checked, you can get the corresponding span element’s attribute and use it. It looks a little something like this:

When the items are loaded into the ListItems, we add an attribute called “myspecialid”. It can be anything you want though it doesn’t work if you pick a known attribute like id or value. Once that’s done, the HTML renders like this:

Our new attribute has been included in a span tag around the input element and the value we want to track is included there. Now in JavaScript, we can do this:

We grab all the input and span elements in the table. Then when we find a checkbox that is checked, we can grab the attribute we’re interested in off of the appropriate span element using the getAttribute method. This is slightly hackish in that the two arrays of elements have to be in the same order but that seems like a reasonably safe assumption to make.

Overall, it seems like a good way to make the UI more fluid while still retaining the ability to manipulate necessary data on the AJAX calls.

Google and Internet Explorer

Yesterday, the Gmail guys announced an improvement to Gmail related to popping windows out which makes multitasking easier. This is a pretty cool feature, one I think I subconsciously knew existed but never used. I run into this all the time when I’m writing a new message. Typically, I have to add more recipients but I can’t remember their emails and the autocomplete isn’t helping. Also, I search my email a lot while writing a new message and before I’ve always had to save to draft, go search, then go back to the draft. PITA. So this feature is muy cool. The whole reason for the post is that they have sped up the new window creation considerably. This is also muy cool.

What does this have to do with Internet Explorer? From the post:

Unfortunately, we weren’t able to make this work in Internet Explorer, so to see the speed-up, you’ll need to be using Mozilla Firefox, Apple’s Safari, or Google Chrome.

Not to go all conspiracy theorist on your ass but how hard do you think they really tried? Can’t you just see the engineers sitting around the conference table discussing this when Bob says “Wouldn’t it be cool if we just didn’t implement this for IE?” I just find it hard to believe that the geniuses at Google couldn’t come up with a way to make this work in IE. Maybe there really are some technological limitations that my puny brain can’t possibly handle but it’s a way better story if they just didn’t bother to try. Not that I’m complaining, I’d barely use IE if it was the last browser on earth after a nuclear holocaust.