One hugely important thing in coding is debugging. Unfortunately, a lot of Javascript debugging gets done via alert() calls. This gets awkward quickly, with the alerts affecting timing, and just being annoying if you have to dump large amounts of data out.
Firebug is a great development tool, and has a really handy logging interface that you can dump debugging info to. Just calling console.log(whatever) will dump it to the main Firebug interface as text that you can copy/paste, scroll through, etc.
If you’re developing a Firefox extension, this debugging capability is really useful. Except, calling console.log() doesn’t work, console isn’t defined for the browser, only for each window.
The trick? Call it directly from the Firebug extension object.
Firebug.Console.log()
Be sure to capitalize both Firebug and Console, and you’ll be good to go. In addition to having great capabilities for logging, the console will prevent your debugging messages from popping up to your users, in case you leave some code where it shouldn’t be.
By the way — if you found this helpful, check back here in a few days. I’ve submitted a presentation proposal to SXSW for Firefox extension development, where I’ve got tons of info for creating extensions for web applications. They collect votes from the community, and I’d like your support. Plus, if the presentation goes through, I’ll be collecting lots of my best tips and putting them online as a resource for the attendees. That means you’ll get all of them too, and you don’t have to go anywhere!
Edit (2008-08-21: Added link for SXSW voting panel)
My blog has a new theme. Classic Tim flavor, new box.
This might affect you if you were subscribed to an RSS feed. I think the themes have their own RSS URL structure. But, if you were subscribed to http://www.timrosenblatt.com/blog/, then you should be okay. Of course, if you were subscribed to the old one, you wouldn’t be seeing this anyways.
I’ve been practicing my drums lately. I’m better now, more than before.
Before I start the links, here’s an article I found discussing how serious drummers can be more physically fit than top athletes. So um, I’m not making noise, I’m exercising!
There’s some links that I wanted to have handy, and I figured I’d share them on here so that others could see them.
Dr Beat Metronome — I’ve heard that Dr Beat are the best. This one seems nicely priced, and has lots of good features. I’ll probably order it soon, since the metronome on my iPhone just isn’t good enough anymore.
Drum Practice Cheat Sheet — lots of good info in here. If I ran throught his full practice schedule consistently, I’d be really good.
MySpace announced they’ll be creating OpenIDs for their users. Although, it’s not full support for OpenID — users can only use their MySpace logins for other sites, but not for signing into MySpace. I’m not sure why they do this, I doubt it’s for any technical or spam-prevention reasons. It seems like a business decision, one that might change in the future.
This might be the tipping point for OpenID. Average MySpace users might not know what OpenID is, but when sites start saying “Sign in with your MySpace account,” people might start noticing. Granted, this might make phishing for MySpace accounts easier, but that was already as easy as catching fish in the frozen food section at the grocery store. ![]()
Zombie Feynman got me reading about Feynman, and I came across a great page discussing Feynman’s involvement with the textbook industry. Although it’s funny at times, it’s fairly sad that this is actually the back end of our education system.
Saw a post on the Freakonomics blog about wines, and people’s abilities to tell the difference between good and bad wines. I love Levitt for his willingness to piss people off in the pursuit of truth (read the part about the scholar who stormed out of the room!) Anyways, there was a large study done, and the conclusion is that people generally can’t taste the difference between “great” wines, and ordinary wines (link goes to original paper).
Don’t get me wrong, I’ve had some reasonably pricey bottles of wine. And I’ve enjoyed some of them. I appreciate that there’s people who really take care of their vines; who pick the best grapes; who use classic equipment and methods. But, I’ve also had bottles that cost under $20 and tasted quite nice.
Generally (and with no expertise to back this up) I think the knowledge of how to produce a decent wine has spread very far, and snobbery is mostly a hangover from the past few hundred years when lots of wines were actually quite bad.
Of course, I know the true secret behind great wine. It’s that any average wine becomes great when you drink it with great people. Salud!
This post is for those of you who follow international politics on any level.
The US has had a policy of not speaking to Iran for many years. There’s even a debate in the current presidential election around “should we talk to our enemies?”. Well, apparently someone in the current US administration thinks so.
There’s a lot of people who pooh-pooh talking, and I understand and agree with them. If you need to put up a building, standing around and talking about it won’t put the building up. If you have to make food for dinner, talking about it won’t make a nice beef stew. Talking is basically useless.
Unless you’re doing something that involves people. In that case, talking is hugely important.
If you’re involved in the process of writing code on any real level, you should be a reader of Coding Horror. It’s written by a guy named Jeff Atwood, and he’s definitely got something going on between his ears.
There’s a good post from a few days ago talking about “monkey patching” which brings up some good points. A lot of code gets modified in this way, and while it makes for some really clean code at times, I can understand a maintainer of a large system to freak out when they can’t find a piece of code that they know is running. It’s one of the reasons I don’t like Flash. It’s a great language, it’s even good for teaching people OO concepts. But code can be hidden anywhere, and given that a lot of Flash pieces are made by people who are designers first and coders second, they tend to get code stuffed away in obscure places. This makes modifying it killer.
Another example of a great article is the one right after the monkey patching — it’s about normalizing databases and performance issues. This is an article with direct real world implications. If you work with databases, this post is straightforward and simple truth.
Definitely get this blog in your RSS reader. I’ve got it.
I don’t know Twitter’s mission statement, but to me it seems like it should involve enabling stream-of-consciousness communication. When I look at heavy Twitter users (especially those with iPhones), it is close to stream-of-consciousness — it seems like they’re sending every other thought to Twitter. But it’s not stream-of-consciousness for most people, there’s too much overhead in posting to Twitter.
It seems to me that if Twitter had some spare cash, it would be wise to look into developing some more advanced technology. The iPhone is very close to wearable computing, but I’m sure there’s some clever ideas in the wearable computing area that could be adopted and branded by Twitter. There’s a great opportunity for them to pull a trick like Apple did with the iPhone, and bring this technology to mass-market in a nice slick package. It’s a natural extension of their current business, and it’s a technology that’s coming — a nice time to catch the wave.
This Gorbachov music video is insane. There’s some Russian history going on, and some metal, and some hot girls with Twinkies. This video is bizzare, but totally awesome.
Thanks to Corey for the link.