Where’s the TV? or, How I finally learned to spell “burglarized”

Deliberately dialing 911 is a bit of an odd experience…

So, it’s December 15th — well, about 12:50 AM on the 16th — but I’m still up, sitting in bed, putting the finishing touches on a post for the Cloudspace blog. I decide that it’s looking really good, and I can get some sleep. Laptop closes, goes on the floor next to me, and the lights go out.

I’m laying in bed, with the TV on, and I start trying to get my mind off everything so that I can rest. But, the cats are downstairs screwing around like they normally do. It sounds like they’re attacking the window blinds. Usually they get the fights over with quickly. Ploofy came upstairs into the bedroom and started staring at me, looking a bit tweaked. Maybe he was fighting? Whatever. The rustling keeps happening, but not as loud, so I figure they’ve gotten it sorted out.

So, I get back to what I was doing. Laying in bed. TV on. Clearing mind.

The TV volume is low, but I hear a beeping noise. Stupid commercials, that’s a really annoying noise. Are you going to annoy me into purchasing your product? The commercial ends, and the show comes back on. And I hear a beeping noise. It’s three beeps in a row, then silence, then three more beeps. I start looking at the TV, and I realize that it’s people talking; nothing visually indicates that there should be beeping. WTF is that?

I get up, and walk out into the open area upstairs. I wait a few seconds, and I hear some beeping again. Is that a smoke detector? Pretty weak smoke detector. I take a few steps down the stairs, and I hear it again. Is it the fridge? The TV? I go further down the stairs, and and I look left into the living room.

It’s not the TV beeping. I’m looking at the TV stand, and all I see is white wall where the TV should be. Did Chas move the TV?

Why would Chas move the TV?

Wait…

Fuck.

Excuse me, adrenal gland? Please hook me up.

I quickly start checking the house. No one downstairs, and there was definitely not anyone upstairs. The front door is shut and locked, and all the blinds are closed. I walk to the back of the house, and realize that the blinds covering the sliding door are moving. Closed, but moving.

All the lights are on inside the house, but it’s pitch black outside. You know how if you’re coming from a light place into a dark place, your eyes take at least a few seconds to start adjusting? You know how you can’t see *anything* until they adjust? Yeah, pitch black to my eyes.

In what is easily among the top 10 scariest moments of my life, I go over to the closed blinds, and reach through to grab the door to push it open. Except when my hand goes through the blinds into the pitch black, it doesn’t hit the door. My whole arm goes through the window, and I realize that the door isn’t there. I half expect someone to yank my arm forward, pull me off balance, and throw me to the ground.

I shove the blinds aside, and see the door is wide open. I run back upstairs, yell something to Chas (who was enjoying her sleep) about having been robbed, and I’m calling 911. I grab my phone, go downstairs, through the blinds, through the door, and onto the back porch. The porch screen door doesn’t open properly, so you basically have to hit it loudly in order to unlock it. I bust open the porch screen door, and go out back. The screening on the door, and one of the panels has been cut wide open.

Not having expected to be entertaining visitors so late, I am in my underwear. It’s a bit cool outside, but the adrenaline is encouraging me to focus on other things. Specifically, where are my new house guests? I’m looking all around — there are no fences so I can see through everyone’s yard up and down the block. Nothing and no one.

I start walking around the side of the house, on the phone with 911. “What’s the nature of your emergency? Are they still in the house? Are you in the house?”

I notice some white thing laying on the ground, some type of cord. I walk over, pick it up, and realize it’s Chas’s laptop cord to hook up to the TV. Why would they take this? Maybe it was attached to the TV?

Since it’s dark, I don’t immediately notice the screen ripped off one of the windows. It’s just that one of the windows looks funny.

I keep going to the front of the house, and I stand in the street. I’m on the phone with 911 still, answering their questions, but it’s mostly “keep ’em talking” type stuff, so I’m not really paying attention. I just stand in the street looking all around to see if anyone might be coming back, or if I see anyone hiding behind a car. But, there’s nothing. No kidding, it’s 1AM. The only people out are either burglarizing, or getting burgled. I was out there for a minute or two, and only one SUV drove by. I noticed it rolling by on the cross street, and from where I was standing, I could look between the houses and see that it didn’t come through. Must have been someone heading home. Anyways, standing out here is doing nothing. Cops are on the way, and I’m still standing in the street at 1AM in a pair of boxers. You never want to be standing in the street at 1AM in a pair of boxers when the cops arrive.

I go back inside to check on Chas, and put some more clothes on. She’s fine, but says she can’t find her laptop. I show her the cord, and we quickly conclude they took her laptop. Her phone was next to her laptop, but she can’t find that either.

Back outside, still on the phone with 911, but a bit more clothed. A big Orange County Sheriff SUV pulls up, and two cops get out.

One is a big white guy with a shaved head. I’d hate to get slammed up against a car by this guy. Although, he’s actually very nice. He later tells us that he was working on a graduate degree in therapy (mental, not physical), and it seems that he’s actually a cop because he genuinely wants to help people. Big softie, right? Don’t tell him I said that.

The other cop was another white guy, around my height, maybe 6-foot. He obviously works out a bit, but there’s definitely a vest under his shirt, making him seem bigger than he is.

We head inside, and they start asking me who is here, what happened, did I touch anything? They tell me not to go outside and disturb anything, since they want the dogs to be able to get a good scent. Oops, too late. They tell me it’s not a big deal.

They start pulling out some paperwork, to get our stories down on paper. As I’m recounting the events in my head, I remember that first SUV I saw when I was standing outside. Obviously a minor detail, but I mention it to one of the cops anyways. “I saw this SUV drive by when I was outside, it’s one of those really big ones, sort of Escalade-looking things”. He nods his head, turns to his shoulder radio, and mumbles something about an SUV. I go back to my paperwork.

The other cop is talking to Chas and myself, guiding us through the form we’re filling out. Press hard, it’s got to go through three layers; write down all the details. We lost a TV, Chas’s laptop, and her phone. Should I try calling her phone? No, ok.

I’m trying to write as clearly as possible, but the adrenaline is still running a bit. The whole situation is a bit surreal, I’ve never been robbed before. Actually, I still haven’t been. The cops explain to me that robbery is done to a person, burglary is done to a place. I later find out through some Googling that I don’t actually know how to spell “burglary”.

All of a sudden, the cops’ shoulder radio starts chattering. That thing is loud, but all I can make out is “Mrrble mrrble, grff lbbl”. Doesn’t register in my head, but he says “They pulled over an SUV. What color was the one you saw?”

Aw fuck. I just ruined someone’s night. All I saw was one SUV, probably belonging to someone in my neighborhood, and now some other random person is getting pulled over and harassed. I tell the cop that the one I saw was sort of a tan, or maybe silver. Moonlight isn’t great for colors, you know? The cops explain that although it’s just the two of them here, there’s a bunch of patrols in the area, and one of them has obviously stopped this vehicle. Anyways, back to the paperwork.

“Mrrble mrrble, grff lbbl” from the radio again. How do these guys understand each other? The cop translates for me.

“There’s a big flat panel TV in the back of the SUV, what brand was yours?”

No way. No way. No way. The surreality has gone up a notch. We are now at 11.

“Uh, Vizio. V-I-Z-I-O.”

Chas and I stop doing paperwork. The other cop stops talking. We’re all looking at the big guy with the radio. “Mrrfle grrble”.

“They took your cell phone, right?”

“Yeah.”

“Call it.”

Heh. No way.

I pull my cell phone out of my pocket, and hit Chas’s number. It rings.

And keeps ringing.

“*click* The number you have reached…” Ugh.

I should take this time to explain that Chas’s phones never seem to work well. I once called her phone that was right in front of me with a perfect signal, and it didn’t ring.

I give the phone another shot. I dial, and it rings. Rings twice. *click*

Uh, what the heck? Am I about to talk to the burglar? What the hell do I say? ‘Excuse me sir, could you de-burgle my house? Kthx.’ Are we about to have a negotiator get on the phone? Do cops know how to negotiate? I decide to give it my best go.

“Hello?”

Some deep male voice says “Did you just get burglarized?”

“Yes.”

“We got ’em”

No way. Commence the spine tingling.

I tell Chas and the cops, and we all spend a second in shock and awe mode. It’s 1:30AM. Radio cop gets back to his mumbling, confirming everything. Yup, they got the SUV, they’re in a neighborhood not far away. Paperwork cop tells me that we need to update the paperwork with the new info, that we called the cell phone, it was found, etc.

When we’re done with the paperwork, he explains that we’re going to follow them out to the scene, we’ll verify the stuff, and then get everything back. Sweet!

We all head outside (after making sure everything is locked and closed), Chas and I jump in my car, and we start following the SUV. These cops go fast. Out of our area, down the road, round the cul-de-sac, and into another development. We’re still in Avalon Park, just another section.

As we come around the corner, there’s obviously a police presence; at least 6 cars. Paperwork cop tells me to go to the end of the street, and wait at the corner until he gets us. They’ve got to get the suspects in their cars, and get a few things sorted out.

This part takes a while, but they had us go over to the vehicle, and see the stuff. Sure enough, my TV is in back. There are backpacks on the bench seat filled with stuff. Backpacks? There’s whiteout stars and words drawn on the backpacks. Chas’s laptop and wires are in their backpacks, along with our Wiimotes. They took our Wiimotes, too? Fuckers. Turns out they also snagged the Wii. Obviously, the cops have Chas’s phone. They left it on the back bumper of the SUV.

The cops send us back to our car, where we keep waiting while they dust everything for prints. We fill out some more paperwork with what happened since we filled out the last set of paperwork. We also get asked if I own jewelry, watches, or a gun. Turns out that they found jewelry, watches, and some bullets too.

Eventually, they have me back the car up to the SUV, and we load our stuff into my car. The cop explains that there’s fingerprint dust all over the stuff, and we need to not breathe it in, nor should we let it get near the vents on the electronics. Fingerprint dust is a fine graphite, and it can fuck up the electronics inside.

We talk with a few other cops at the scene. Handshakes all around, and the usual “Be sure to keep your doors and windows locked”. They tell us that it was 4 suspects, aged 17-19. Little punks. Chas was talking with a female cop, and mentioned that in addition to the laptop, TV, and phone, they also took our Wii.

“They took your weed?!” comes the reply.

“No, our video game, the ‘weeeeee’,” clearly emphasizing that there’s no ‘d’ at the end of that word.

“Haha, okay. Because we’d have given that back to you.” What?

We get everything loaded, and head back to our place for the cops to finish up some paperwork, and also take pictures. The cops are joking with us, as they have been for a while now, that this is some supercop shit. Normally it doesn’t work like this. Burglaries generally don’t get your stuff back, and it almost never happens this quickly. One of the cops has never seen it happen this like this, usually they catch bad guys days later. He is in a great mood.

After the cops left, Chas and I are back in bed, but definitely awake. I point out that I’ve been tweeting the events of the night, but now this puts me in a weird situation. I’ve got no empty room to point at and say “Look, I got burgled”. All I’ve got is a piece of paper with a cop’s name on it, a bit of dust on the TV, and a hole in the screen. Not very compelling evidence. Everything else is back as it was. Which is how I like it. You never appreciate how cool it is that when you put something someplace, it stays there. Object persistence.

Oh, and the beeping? The whole reason I went downstairs? The burglars, being very slick, carefully unplugged all the wires from the back of the TV, and from the wall. The only problem for them is that the TV isn’t plugged into the wall.

I bought the whole TV and stereo from my friend Dan, when he moved out. I never even moved it, it’s always been as he initially set it up. And when he set it up, he plugged everything into a battery backup. Not a power strip, a real battery backup. The kind that makes a beeping noise when you unplug it.

And if you’re interested, here’s the tweets from this night. The first tweet is about 10-12 minutes after the burglars actually left my house.

  1. Just got robbed. Fuck
  2. I’m ok. Cops caught em quick
  3. Chas is ok too.
  4. Amazing. I’m looking at someone elses car filled with our stuff
  5. Waiting in car for cops to finish processing. The SUV had other peoples’ jewelry and watches.
  6. Tv back. Fingerprint dust wiped off. Cops are photographing the scene.
  7. Sheriff says burglary = 5-10 years.
  8. Chas’s laptop and cell phone are back, so is TV and Wii. Cops remind us that were are very lucky to have it go so smoothly.

The HTML structure of webmail interfaces: Gmail, Hotmail, and Yahoo Mail

As part of the Zentact project I’ve been working on, we were asked to integrate with various webmail clients. This makes it easy to manage your contacts while sending email.

Doing this was a bit of a pain. Since all code is minified, and they all use Javascript events differently, there was a good bit of working to figure out the details. I wanted to share this info in a blog post for programmers who come along in the future. If you don’t know/care about HTML, Javascript events, the DOM, YUI, or AJAX, this post is not for you. Please enjoy one of my other fine posts, perhaps this post on military code names.

Before I begin: there was a ton of info learned (and already forgotten) about this process. This is not a complete guide, but is mostly a brain dump from implementing UI integration on three different webmail interfaces.

  • Gmail uses 6-character strings, [A-Za-z0-9] for all its classes. These classes remain the same from load-to-load, but I believe that they may change over time with minification. IDs are not as constant, and many are dynamically assigned. These start with a colon.
  • When you’re working with events, you may get inconsistent results. Some events are not fully propagated, they get captured and you can’t find out about them. If onclick doesn’t work, try listening for onmousedown or onmouseup. One of them may get you notified of the event you want. Same advice goes for onkeydown, onkeyup, and onkeypress. That being said, once you get into these, be sure to realize that these three events will occur in particular orders. Make sure you’ll be getting notified at the right time.
  • All of the webmail UIs use iframes. This lets them keep their code for loading the UI separate from the code to display the UI. I know there’s some cross-site scripting implications in this, but I’m not sure of all the details. Gmail’s loading screen (the loading bar they show you) is a different iframe than the one that shows you the inbox. All of these iframes are at the root of the document, and there’s nothing else in there.
  • You could use Firebug break points to pause the code and examine what’s going on, but nearly all JS is minified. Since breakpoints can only be set by line, and there’s multiple functions defined per line, it ends up not being helpful.
  • For its UI, Yahoo seems to use YUI, plus some other stuff on top of that. There’s some weird results because of this. The body of the email editor is a group of DIVs, some are invisible, some are for border decoration, and others are for the background of the editor.
  • When we inserted elements into Yahoo Mail using regular DOM operations, they would appear behind other page elements, until another part of the UI was interacted with, when the screen would redraw and then they would bump into place. YUI seems to have its own redraw/repaint functionality, and it won’t play nice with DOM manipulations.
  • Hotmail is strangely one of the less-exotic interfaces. They use consistent IDs. I don’t think they’re hand-coded, however, because they submit to a naming scheme that seems too machine-generated. But still, they are there, and you should take advantage of them.
  • When you’re using events, and you get notified of an event, use the event.originalTarget property to find out where in the DOM you are. That’s useful information when you’re dealing with a DOM tree of nonsense class names and IDs.
  • When you’re trying to figure out where in a DOM tree you are, don’t hesitate to go up several levels and check a great grandparent node, or a “cousin” node. Once you get a single point of reference, you can generally work out where everything else is, relative to it.
  • Some UIs open each message in its own iframe, which means that IDs are consistent since they’re in their own namespace.

Also, thanks to Nate Koechley for helping me get through some of the Yahoo details.

If you’ve got other questions, shoot me an email. I remember more stuff, but might need a good question to shake it loose.

Code reviews

I’ve been quoted in a series of articles at CIO.com on code reviews. The two particular ones I’m in are

Neat!

The author of the articles is Esther Schindler, who has also written articles like “Four Non-Obvious Things Pink Floyd Can Teach Your Team“. I <3 analogies.

acts_as_presenter

Hey kids! Guess who’s presenting at Acts as Conference, 2009! These guys! Also, some guy with a big nose.

I’m giving a talk on OAuth, the greatest way to protect your APIs while keeping your users secure. Simple, easy, fun, and it might even get you laid. The amazing, spectacular, splendiforous OAuth! Yea. It’s gonna be that good.

And now, for the official marketing:

Acts as Conference 2009 is a two-day Rails conference that will make you a more competitive Rails developer by learning from those driving the innovation that is fueling the Rails community. Held February 6th and 7th in Orlando, Florida, Acts as Conference features a great speaker lineup, free food, a chance to meet with Rails innovators, and a live via video Q&A session with David Heinemeier Hansson. At $125 dollars and limited to 175 attendees, the conference will sell out fast, perhaps faster than last year. Register today at http://www.actsasconference.com. See you there!

Thanks Adam Savage

I saw this video of Adam Savage talking at The Last Hope this past year. I recommend it. It’s awesome to see how dedicated he is, and what it takes to produce such great stuff.

Other than getting a preview of (then) new Mythbuster footage and getting  to see a downloaded AVI of The Dark Knight on Adam’s hard drive, I really liked when he showed his projects folder. It was cool seeing that he works on things when he feels like it, and then saves his progress so he can come back later.

I’ve been trying to get more organized lately (what with the Getting Things Done/Agile planning at Cloudspace and all), so it’s something that stuck out for me, that I wanted to share with you.

Capitalist Showers, Economics Showers, and using less water.

I saw my friend Kitzzy’s tweet about navy showers a while ago, and I’ve been trying them out. No, “navy shower” isn’t what you might think.

Basically, it’s a braindead-simple way to reduce water and electricity/gas usage, with no inconvenience to you. Plus, I always seem to take quicker showers, which means I can clear out another blog or two from my RSS feeds.

Before I go off from this, I wanted to share a trick, if you’re interested in trying this out.

Pro tip: I recommend not shutting off the water completely. I find it is useful to wash soap off of your hand when you want to go turn the handle — very slippery otherwise. The Navy probably has foot-activated water valves.

Anyways, this navy shower concept got me thinking about minimizing consumption and efficiently using resources. It’s an economics issue — how do I get the most use/value out of a fixed amount of resources? From here, I started thinking about business.

It should be no surprise that businesses want to minimize use of resources. The less they have to spend on getting raw materials, the more those resources can be applied to other things, like salaries, and stock dividends. It’s even more aggressive in small businesses with slim margins, where becoming more efficient can mean the ability to hire more employees and grow, or purchase better equipment.

And this is where capitalism and the eco-movement intersect. Going with the “saving water” idea; let’s say you’re a business that makes Gadgets, and it takes 1000 gallons of water to make a Gadget. If you figure out how to make a Gadget with 600 gallons of water, you’ve already got a savings on your hands. One of your costs has been cut by 40%. Hooray! Fire up the yacht!

This is how businesses have worked for a very long time. “Efficient use of resources” should be a mantra in every group. But now with the eco-movement, companies are doubly-motivated to use resources more efficiently. Because now, when they become more efficient, they can advertise their “greenness” and get a PR boost on top of their new found financial savings. Some of them even charge more for their new “green” product, giving them a bigger return on the investment.

So that’s it. Your daily dose of economics and business. Of course, if you still want to do more to reduce your use of resources, try navy showering with a friend.

Zentact reaches out to web and says hi. Web waves back.

It’s official, Zentact is live. This is the product that Cloudspace has been building for the past several months for John Sampson, Eric Marcoullier, and Jared Brandt (who also makes some damn fine wine).

The skinny of Zentact is that it’s an address book with a Firefox extension that lets you know when someone in your address book might be interested in the page you’re viewing. Go to the site and give it a whirl.

It has been an exciting day. Watching the comments roll in on Twitter is awesome, and so is watching the emails go out from Zentact.

Mashable loves us. So do the fine folks at ReadWriteWeb and VentureBeat. And finally, an excellent review of Zentact from Mr Howard Lindzon. Also, coverage from some unbiased sources, like Cloudspace. 😀

You should check it out. You’ll need a invite code, and you can use TIMZEN. Or, just sign up with this link, which magically includes the Zentact invite code. Let me know what you think.

A Javascript debugging tip for Firebug (or “Stop using alert()!”)

Did you know that if you’ve got Firebug for Firefox installed, you can use it for debugging your own code? By calling

console.log("Here's a message!");

Firebug will print the message to it’s internal message log. Neat!

Firebug message console

Now, that’s all good. But let’s say you’re on a project that’s not using a Javascript preprocessor to minify and strip debugging code — which would be the best option. You want the benefits of debugging, but not having to constantly remove debugging code for deployment. If a user doesn’t have Firebug installed, they won’t have a console object. So obviously leaving your debug code in is going to cause an error.

Or will it?

Try adding this code before any of your other Javascript. It will set up a fake console so that if Firebug is not installed, there won’t be any errors.

if(!console || !console.log) {
var console = new Array();
console.log = function () {}
}

Bonus idea! If you combine the idea shown here, with my previous post about debugging Firefox extensions, you can see how to prevent extension debugging from getting in the way of your users.

if(!Firebug || !Firebug.Console || !Firebug.Console.log) {
var Firebug = new Array();
Firebug.Console = new Array();
Firebug.Console.log = function () {}
}

A message for rich people: “Spend your money!”

Buy American wine. Drink it on your American yacht. Read Forbes for instructions on how to spend your money. Eat American caviar. Stuff hundreds into tip jars when you go get coffee. Read the “Most Expensive” blog for ideas on how to support the economy. We’ve got to keep our economy going, and since you richies have over 70% of the wealth in this country, it’s time to pitch in. You people are always going on about how great firefighters were in NY on 9/11, here’s your chance to be a hero, and it’s easier than running into a burning building.

In case you’re wondering what the hell I’m going on about, I just finished reading The Great Crash. It’s an excellent book. One of the things mentioned is the unequal distribution of wealth in the 1920s. When the economy started going south, rich people stopped spending money on trivial shit. Unfortunately, “rich people spending money on trivial shit” was a portion of the economy.

Once again, we’ve got an unequal distribution of wealth. And an economic crisis. Although there are differences, ultimately, we need to get money moving through the economy.

So, if you’re feeling stressed about your 401K, perhaps you’d like a massage. Don’t forget to tip your masseuse, so they can go out to dinner and support another set of workers, who will in turn consume more goods and services. Aren’t spending multipliers awesome?

How to use Extension Developer’s Extension in Firefox 3

Here’s a tip for developing Firefox Extensions in FF3.

You might have heard of the Extension Developer’s Extension (EDE). EDE is an extension that provides useful settings and features for people who are writing their own extensions. For example, EDE makes it easy to activate Javascript debug settings, interactively debug Javascript, and a few other goodies.

My personal favorite feature is the “Extension Builder” — it that lets you install a development copy of the extension . That is, you can run an extension from your working copy/dev folder. Without EDE, you’d have to — uninstall an extension, restart Firefox, install, restart — every time you wanted to test a change. With it, you can just restart Firefox one time, and your dev extension is reloaded. When doing heavy development, I have personally saved over an hour per day from this one feature.

The sad part is that this feature does not work in FF3. The option is just grayed out. But, there’s a workaround. Load up FF2 with the same profile that you use for FF3. Use EDE to install the extension from disk like you normally would. Then, quit FF2, and launch FF3. Since the extension is tied to your profile, FF3 will load your extension from your dev folder, just like in FF2.

Win!