Austin got snow before Seattle did this year. (So did Houston and New Orleans) Now we just need another few days above 70 before Christmas and I’ll be happy.
Winning a race, I’d prefer to lose
Laying hardwood down the hall
Obligatory: That’s what she said. I’m glad I’m done with this project because it was impossible to talk about it without getting those comments. I’m also glad because it looks freaking awesome.
The craziest thing about this project is I wasn’t planning on doing it in the first place. I just had so much leftover wood that I couldn’t not do it. (yes, TWSS) I wanted to have that point at the edge of the living room be the boundary between public and private and have a wood to carpet boundary, but I guess since the guest bathroom is public this makes more sense. Of course, I still have extra flooring and no more floor to cover, but I think I’ll live.
Oh and here’s a side-by-side before and after:
The tile I traded my knees for
Today, I (finally) laid some tile in the guest bathroom. Multi-colored slate in a basic grid pattern. There’s a part of me that wishes I had gone diagonal or used some smaller tiles, but my sister Susan pointed out to me that it’s already very visually interesting with the different colors and textures.

Stupid Sign Errors
if (lastCall != nil && [lastCall timeIntervalSinceNow] < 300) {
if ([cacheData valueForKey:scenario] == nil) return; //user double clicked update
[self loadScenario:[cacheData valueForKey:scenario]];
return;
}
Turns out calling timeIntervalSinceNow on a date in the past gives you a negative number. And as now gets later and later it gets more and more negative. So, it will never be more than 300, and our app never lets users refresh the data. Thank God, I never wrote that number out to disk, so if you shut down the app and reopen it, the app will successfully load new results.
In other news I hate rich client apps. If this were a web app, or I had done what I planned on doing earlier and putting the timeout inside of the file, I could fix it. There’s basically no way I can fix it at this point. If anybody using the app reads this. I am sorry. My bad.
Earthquakes + Tornadoes = Just move, seriously
Apparently, those durn Californians are so intent on making Texas like their old home they brang the earthquakes with ‘em.
One of my Favorite Interview Questions
This was stolen from a hiring manager with Microsoft Office when I went through one of the strangest interview loops of my life. Maybe I’ll talk about that another time, but suffice it to say that if another multinational technology company tries to hire me they shouldn’t try to do it in an office park in Las Colinas (Dallas suburb) in a room with no windows under absurd “This offer expires at the door” conditions. But I don’t want to talk about the past, I want to share a pretty mind bending interview question. If you’ve found this because I’m going to be interviewing you, please mention that you found this entry. I will be impressed that you did research in advance on your interviewer.
As with all good interview questions this one is best done in C. Imagine a singly-linked list who’s data is a pointer to another node in the list or is null. So you’ve got something like:
struct Node {
Node* next;
Node* data;
}
Write a function that when passed a linked list makes a deep copy. By which I mean that if you had the following
| Node | Next | Data |
|---|---|---|
| A | B | C |
| B | C | null |
| C | null | C |
the function would return:
| Node | Next | Data |
|---|---|---|
| D | E | F |
| E | F | null |
| F | null | F |
Well, a pointer to D, but you knew that already. Writing any function that successfully implements the problem description is passing, but the bonus points come when you do it without using any additional memory (with the obvious exception of the new Nodes that need to be created). To be considered all answers must be in linear time (multiple iterations of the list are acceptable, but it should be a constant number of times, but you knew that when I said linear time)
Polytechnical
Operating Systems used in the last two weeks:
- OS X (Leopard)
- Windows (XP)
- Linux (Ubuntu Silly Something)
Programming Languages used in the last two weeks:
- Java
- Objective-C (iPhone)
- Python (dinky little script for Austin Stone, but still)
- PHP (ASCC again)
- Ruby
- VB.NET (sorta, was used while conducting an interview)
I don’t know what the cost in depth is when trying to stay current in a number of different technologies, but it does make me keenly aware of which technology space I’m in. Objective-C ticks me off when I need to manage my own memory (especially when there’s so little of it). Java when I deal with hashtables or delegates which are so wonderful in other languages. PHP when I have to look at it. VB when I think about arrays.
I need to get some time in on C# here before too long. I’ve heard there’s a 800 character long regular expression that can convert Java 1.4 into C# 2.0 and vice versa, but there’s stuff like LINQ that I’d like to get my hands on.
Squawk
The code I use to watch twitter in OSX: http://pastie.org/304317. Based on http://blog.behindlogic.com/2007/06/twitter-growl-squawk.html.
Edit: Originally I linked to http://pastie.org/303602, which had some bugs. The new link actually works (I think)
Wind Shift
Today wasn’t that cold, but there was a fair breeze blowing. Not a gale like there was last night, but definitely some movement in the air. It is a mixed blessing, because it seems like this type of weather makes for some of the best sailing, but at the same time makes normal people just not that interested.
Story: (I expect that I’m remembering parts wrong, Mac and Dylan: correct/embelish as necessary)
Last year, when I had finally been out to the boat enough that I was more than ballast, and I felt I could legitimately be called part of the crew, we needed to move the boat off the T-head and into a slip. If we were going to drive all the way out there, we wanted to make a day of it, but there was a storm coming in and it looked pretty hairy, so we waited to see if it would hit or not.
At some point we realized that we needed to move the boat whether the storm hit or not, so we mounted up and headed for the club. As we arrived, the storm was clearly visible and was definitely going to be fairly intense, but as we moved the boat a funny thing happened and we somehow talked each other into sailing into the face of it.
I feel I should pause for a moment and tell people that it is normally very safe to come out sailing with us. Travis is fairly calm and it’s basically impossible to roll a Capri 25 without a Spinnaker (a sail which we don’t have). HOWEVER: if there is a storm, all bets are off, the boat won’t roll, but lightning doesn’t care.
The wind that day was coming out of South by South-West (IIRC) and it was blowing hard. On the way out of the cove we passed a few sailboats making their way into dock, and as we got out into the lake a few motorboats were gunning it home. We got on a starboard tack and headed straight down the lake towards the dam, dipping a rail most of the way. For those who have never experienced it, the rail is the perimeter of the deck, when we dip a rail on Caprica, it means the wind is blowing so hard that the boat is tilted about 35-40 degrees and the edge of the deck is below the water line. You know you’re alive when the deck is below water.
About half a mile out of port, the last boat on the water, a Sheriff, motored past and just kinda stared at us as we sailed straight for the storm; no wave, just a stare. As we flew closer on that crazy wind, isolated drops portending the rain to come, we could see the water falling in sheets, obscuring the houses as the worst of the weather reached the shores of Lake Travis. And as we neared, we wondered when we would finally wise up and turn around. When we saw lightning to the East, our resolve finally broke and we turned around.
The process of turning the boat is characterized by a flurry of activity as the skipper yells out and the crew responds with rote calls of “READY”. The boom flies, the jib cracks and lines get released and reeled in with frantic tugs and are pounded home into their cleats. But that day was different.
Texas is a mercurial state when it comes to weather and I’ve yet to meet a woman as fickle as Lake Travis. And that day, whether it was a freak coincidence, divine providence or something earned by the extra swig of the boat whiskey that we knew would be needed for that afternoon but the wind did something that I haven’t seen since. As Dylan pulled the helm and we swung around, the wind decided to follow and we found ourselves pointing straight back at the club still close hauled and heeled over with the breath of a thunderstorm coming over our starboard bow. We held that course all the way back in and tied up the unchristened Caprica just before the worst of the rain came in.
Some of the best wind comes in these Fall and Winter days, but it is hardly cruising weather. Summer is great for hauling friends as cargo, but I’m looking forward to some of the days when the wise stay home, and only the crazy will chance the lake.
JSON: Way better than XML
When we were architecting ElectionMap, one of the things that we had to decide on was how we were going to get data down from the server. This being 2008 and us being primarily web developers we were of course using HTTP/TCP/IP, but that left us with a stream of bytes, if anything the most dangerous thing you can give two software developers, witness UNIX.
During an early coding run, Dylan added some values to a plist file which is really just some Apple window dressing around XML, and were it not for my adamant hatred of XML, that probably would have been our data interchange format of choice. But luckily for my cause, the iPhone parses XML the same way your car burns vegetable oil, only after a lot of messy work and even then it probably runs slower (I have no specific knowledge on the performance characteristics of vegetable oil, but the metaphor sounded good in my head). However, after reading Jeff Atwood’s anti-XML screed and my experiences writing iPhone apps for redacted, I knew of a Better Way ™.
JSON (JavaScript Object Notation) is a pretty darn spiffy data interchange format that has 4 data types: dictionaries, arrays, strings and numbers. If you really care about the thing GIYF, but the reason I bring up it’s structure is that it allows it to be on a single pass looking only at the first character. { = dictionary, [ = array, " = string, \d = a number. The code to parse this on iPhone is hosted at Google Code under the TouchCode project and though its interface is a little clunky at times, it's fast and gets the job done.
Because of using JSON, our polls.json file consists of entries like the following:
"WA" : [ which resulted in a 3775 byte file. (we could get it down to 3625 if Dylan removed the 3 extraneous spaces per state), but I think our xml would probably have looked something like:
4,
"As of Oct 22\nMcCain: 43%\nObama: 54%\nPollster: Rasmussen"
]
<state>which at an average of 43 bytes more per state, would result in a 4775 byte file, or a little over a 30% increase in size. This 30% seems pretty silly to stress about, but the polls.json file has been downloaded over 40,000 times so far for a little over 150MB of traffic. On election day we’re hoping to get absolutely hammered on /elect/results.json, which means we want to be getting the files out the door quickly and get the connections torn down. 30% less file bandwidth, 42% more requests/second if setup/teardown was free (lies, damn lies and statistics).
<name>WA</name>
<vote>4</vote>
<text>As of Oct 22\nMcCain: 43%\nObama: 54%\nPollster: Rasmussen</text>
</state>
Obviously, there are some things I could do to reduce the lead JSON has over XML like using attributes instead of full blown entities. You could point out that the JSON cheats by using an array instead of a dictionary, but I’m not even sure if you can use that cheat in XML. The point is that JSON is as expressive as XML, and is a lot more concise.
I considered YAML, since Dylan mentioned it. It definitely wins in the human readable category, but the reason is that it shares that same perverse faith in humanity’s ability to distinguish between tabs and spaces. It frequently seems more reasonable to me to end sentences with semi-colons than periods and I put curly braces around single line blocks in C/C++/Java. You can have my redundant structural markup when you can tell the difference between a tab and 4 spaces on a default vi installation.




