Welcome to the adventure

A million definitions served

Wednesday January 31, 2007

At around 7pm today, Ninjawords served its millionth definition.

I guess this is proof that people value an application that gets out of your face and lets you do your work. Look for more apps like this from me in the future ;-)

I’ve been keeping some stats. Here are the top… 38 words looked up. It was originally 50, but 12 of the top 50 are expletives.

  1. ubiquitous (21495)
  2. ninja (6551)
  3. test (1241)
  4. fast (1115)
  5. hello (1040)
  6. ninjawords (970)
  7. sex (857)
  8. dictionary (827)
  9. god (820)
  10. google (693)
  11. A (690)
  12. penis (673)
  13. LOL (666)
  14. dog (657)
  15. cool (624)
  16. word (622)
  17. poop (574)
  18. MMORPG (547)
  19. love (527)
  20. Ajax (496)
  21. cat (486)
  22. wow (471)
  23. dig (466)
  24. Zeitgeist (450)
  25. what (420)
  26. the (391)
  27. car (387)
  28. monkey (383)
  29. loot (383)
  30. hi (379)
  31. apple (373)
  32. F (369)
  33. Schadenfreude (332)
  34. onomatopoeia (325)
  35. stealth (325)
  36. help (306)
  37. words (299)
  38. No (287)

Yes, those are the top 38 words looked up by a large base of tech users. These stats demonstrate the most common spontaneous words people think of when they want to play with an interface. I’m glad to see ninja snagging the #2 spot. Dog beats cat by a wide margin, and “No” finishes up the list at a strong 38 (it doesn’t mean what you think it means — try no).

Ubiquitous is #1 by a wide margin because StumbleUpon links to ninjawords.com/ubiquitous.

These stats don’t include definitions served up from clicking the random button, or words that we don’t actually have definitions for. It took 2.5 months to reach a million (successful) queries, and it looks like on average each visitor looks up ten words per visit.

Thanks to everyone who uses it and contributes feedback!

Some ads are pretty good

Wednesday January 31, 2007

As a corollary, not all ads are bad. Take this one from cafemom for example. I saw it on Digg (it’s animated; the frames switch every few seconds):
cafemom1.jpg

cafemom2.jpg



Very intelligent. The somewhat alarming picture of a giant baby face crying will unfailingly draw your attention, but not in an obnoxious way. It’s just a genuinely interesting, static picture, which I think is the best way to get someone’s attention. No need for some intrusive, flash-animated, sound-enhanced buzzing flies (you know those of which I speak) to wrest your attention away from what you’re doing.

Throw in some clever copy and you’ve got a click-through.

You know you skim too many blogs when…

Tuesday January 30, 2007
  1. you crawl the Internet for a solution to a problem, like getting iPhoto to understand exif data
  2. find and carefully read a very detailed post that sounds like it might be what you’re looking for
  3. think to yourself “hey this is great! Wish I had found this earlier…” but woefully notice that the post is incomplete!
  4. You scroll down to the end of the post to write a comment about it, only to find there’s just one previous comment — yours, from when you researched this same problem two weeks ago.
  5. Argh!

I wish I had a tribe on the web

Friday January 26, 2007

Seth Godin articulated a really interesting idea which gets at exactly what technology should be helping us do.

I use the web because it saves me time and I can get tons of information if I want it. I spend days (literally) researching which programming framework I should try or which keyboard will lessen the chivying RSI. The problem is that there’s way too much information. “Three days on a keyboard?” you say; “just take someone’s recommendation and be done with it!”

Well, there are a lot of recommendations out there on the web, but few that I trust. The web should be helping me find advice from people whose opinion I value, and really good resources, not the junk you get with most Google searches.

Here’s an example of how my web works today: if this guy mentions a good book on Javascript, I buy it, immediately. It’s so powerful it’s scary. But here’s why it’s powerful — I could spend all day at Amazon reading mediocre reviews from people who may or may not have a clue, and end up closing the browser in frustration. But as soon as someone I’m familiar with mentions the title of a book, it narrows my search instantly, and I give it a very close look. It’s what Google Search should be.

This “tribe” social power is the power technology should help me leverage. Technology should understand who I pay attention to, either through IM, email, or blog reading. In all of my activities it should help me leverage those connections if I want to. While shopping at Amazon, I would love to know what my friends thought was interesting enough to buy.

Take that, and think bigger. I’m Googling for car insurance agencies. Which agencies are my friends using? Didn’t my dad criticize this agency a year back in an email? This data is really, really important and will help me make decisions much faster; I wish it were made available to me even when I’ve forgotten about it. I don’t want to search my email history for “car insurance;” do it for me!

The people whose opinions we trust — either personally, or out of respect for their talent — act as a filter. I don’t want to read the opinion of some guy I don’t know or some editor hired to give companies praise (looking in your direction, Amazon editor reviews!); it doesn’t help me make decisions. I don’t want to leverage the social mass like Digg tries to do; that’s useful for a few things, like breaking popular news stories as soon as they happen, but usually mass opinion is just more noise. I need to narrow down options, and quickly, so I can get back to work.

This should go the other way too. I try hard to save people time by writing about things that only need to be figured out once, like how to set up a web server. I really want to help the people I know and save them time. If I attain an informed opinion after trying every network router on the market, and then I write about it, the web should offer my opinion to everyone who values it whenever they’re looking at routers.

Seth mentioned the word tribe in his web4 article, and that’s exactly what the Internet should be. It should help you build and leverage a tribe of people larger than you would be able to maintain through traditional forms of communication. It should help us spend less time filtering the information we’ve got and more time using it.

Enable server-side compression to cope with those huge Javascript libraries

Friday January 26, 2007

To make a rich web UI, you’re going to need a sweet Javascript library to handle your outrageous animations and the like (along with the actual Ajax, DOM manipulation, and event handling, which are of secondary importance…)

But have you seen these things? They’re massive. Prototype (the default Javascript framework of Ruby on Rails) alone is a 50K file, growing with each release, and that doesn’t include animations. Throw in a rich text editor, and you’re at 300K worth of Javascript. To be fair, you get a lot with these libraries, but wow! That’s a high price to pay for a flashy UI.

Turns out if you’re serving a lot of textual content on your page (that means YOU, Joe Blogger!) then you can have your server start doing some work to reduce the bandwidth needed to view your site. Just zip the textual stuff on its way out, and modern browsers know how to unzip it on the client machine.

You can save significant bandwidth (this is just for my blog’s plain HTML):

picture-3.png

A lot of people already know that this is possible, but not how to set it up or ensure it’s working. I thought my sites were using compression for the past few weeks, but being mildly naive and equally retarded, I trusted the online Apache docs without even testing to ensure compression worked. So here’s how to do it and test it.

How to get it going in Apache

In Apache 2, it’s pretty simple. First, enable mod_deflate.

On Ubuntu, that’s as easy as
# a2enmod deflate

For other distros, I expect that there’s a little more trickery involved, but not much.

Now, all you need to do is tell Apache what to compress. The Apache docs seem to think you can it going with this simple shortcut line, added to the top of your site’s config file (/etc/apache2/sites-enabled/000-default on Ubuntu), which will apply to all virtual hosts.


AddOutputFilterByType DEFLATE text/html text/plain text/xml

However, this did not work for me. I assumed it did. A few weeks later, I discovered some tools to verify that compression was enabled on my servers, and lo and behold it was not. Thankfully, they also list an alternate configuration, which works just fine on my servers:

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images.
# At one point I was missing "zip" in this list of extensions, which caused
# IE to download corrupted zip files
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|zip)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
# Header append Vary User-Agent env=!dont-vary

Restart your web server to enact the changes:
#/etc/init.d/apache2 force-reload

Test it

Here are some really useful online tools-

  • whatsmyip.org has a gzip test — it’s a fast tool that shows you whether you have compression enabled, and nothing else. I like it.
  • Port80software, in addition to telling you about the state of your server’s compression, can also look at the cache headers being sent. This is great if you’re testing some caching code.
  • The classic Web Page Analyzer shows you the bandwidth used for all of your resources (html, images, javascript) in a useful way. It also tells you, hidden away in a paragraph somewhere, if server-side compression is enabled.

Further reading: Yahoo UI uses a modular Javascript approach (so does Dojo). See YUI’s impressive bandwidth numbers, including comparisons with gzip enabled.

Playing Ogg vorbis files on the Mac in iTunes

Friday January 19, 2007

I’ve just moved to OS X for all of my development. Gotta have music while programming, but a large part of my music library is in Ogg Vorbis. Mac doesn’t support Ogg out of the box, so here’s how to get it going. It took me awhile to figure it out, so I’ll summarize to save others time. I’m going to cover using Ogg in iTunes from both a local iTunes library and for music stored across the network on another machine (in my case, a Ubuntu Linux server).

If you want to skip all this crap and just convert the things to mp3 so you can stick them on your ipod and every other player, take a look at this ogg2mp3 perl script.

iTunes, and I think Mac apps in general, use the QuickTime engine for media playback. So if you want to play something in iTunes, QuickTime needs to know what the heck it is.

Fortunately, the folks behind Ogg have recently developed a free, open source Ogg QuickTime component. When you download and install that, QuickTime can play your ogg files.

What about iTunes

iTunes can play them too; try it. However, there are some severe limitations, but I’ll describe what I did in my setup as workarounds.

iTunes can only play Ogg files on your local file system

It cannot play them over streaming daap shares. This is because iTunes assumes all daap streams to be of type mpeg. Fix your bugs Apple!

While this isn’t a direct remedy, you can still play Ogg music in iTunes even if it’s stored on another computer. You can just mount the files from another computer onto your OS X file system, and they appear to iTunes as if they’re local.

This would usually be a kludge, but it’s not, because OS X’s automounting code is brilliant. In the finder, select Go -> Connect to server. Find the server that has your music files (whether it be Windows or another Mac) and a link will be made on your desktop. Right click on the link and say “make alias.” Now a permanent shortcut resides on your desktop to the remote server. Even if you reboot and then double click that alias, the remote files will get automounted. Awesome.

In iTunes, go to preferences and uncheck “Copy files to iTunes music folder when adding to library.” Now, you can drag and drop ogg files from your remote computer into your iTunes library, and they’ll play as if they resided on your own hard disk.

If you happen to have your music on a Linux server instead of another Mac or Windows box, you can share the folder containing your music very easily over the afp protocol. It’s really simple on Ubuntu:

apt-get install netatalk
apt-get install zeroconf

nano /etc/netatalk/AppleVolumes.default

The syntax of the AppleVolumes file is this:
<local path> <volume name> allow:<user1>[,<user2>,...]

Just make an entry for your music folder and you’re done. Macs can now connect and mount the folder with an entry like “afp://myserver/musicFolder” in the “connect to sever” dialog of the Finder. Easy.

Track names in Ogg files aren’t picked up by iTunes

If you like to listen to an album’s tracks in order, this can be really freaking annoying. iTunes doesn’t read the track number from the Ogg file’s header! That means iTunes will play your tracks in alphabetical order.

This is what you can do: after you’ve imported all of your oggs, run an Apple Script over them. It will manually look at the file’s header information, parse the track number out, and update the iTunes database so that it has the track numbers.

It’s pretty simple, although tedious. Put all the tracks you want “scanned” in a big playlist in iTunes. Have that playlist open in your iTunes window.

Download the script here, unzip it, and double click the script file. Click run, and it will process the files you have in your playlist. It takes a long time to run, “40 minutes to process 1858 songs” according to the author. Here’s more info about the script from the author, Tim Allen.

Caveats

It’s a bit of hack already, but there are a few more things to be aware of.

If you edit a file’s metadata in iTunes, it isn’t written back to the Ogg file. I don’t know if that’s the case for all media files, but don’t go doing massive changes on your music collection and expect them to be in effect outside of iTunes.

That’s it. If anyone knows how to get iTunes to scan my locally-mounted music folder every once in awhile to pick up any new stuff, let me know.

Flying ninja upgrades

Friday January 19, 2007

In the news: Ninjawords (a fast online dictionary) hit Ajaxian, digg and StumbleUpon awhile back. Warning — the Digg comments are less than insightful.

Anyway, a few long awaited features have just landed. Here’s the run down:

  • Now using the latest dump of Wiktionary, which is the main source for definitions. This means more words and better definitions.
  • You can add ninjawords directly to your search bar if you’re running Firefox or IE7:
    searchprovider.gif
    Check out a short screencast made by Mikkel Kamstrup Erlandsen (hacker on Deskbar) to see how it works.
  • IE6 DOM fixes, which will make Ninjawords faster in IE6 (no, it can never be too fast)
  • Ninjawords now understands what a capital letter is, so definitions like zeitgeist work. Amazing.
  • Bug fixes for parsing and displaying definitions. There are now fewer out-of-place characters (like “*”) that show up in the definitions, and long examples are truncated more accurately.

And best of all…

Ninja thesaurus

Well, not quite, but Ninjawords can now show you synonyms. It can help you serve up insults at incredible rates:

syn1.png

syn2.png

Enjoy!

Apple keynote — why everyone loves apple

Wednesday January 10, 2007

The video of the keynote speech by Steve Jobs from Macword 2007 is now online. If you’ve never watched one before, you should. Besides getting to see new technology, it’s educational to see a master at work. I like watching so that I can try and mimic the reality distortion powers of Steve Jobs. He can make me believe and get excited about anything. That’s a skill most evangelists (technology or otherwise) would love to have.

A few quick notes about the keynote:

The first half hour is spent covering Apple TV; it’s a cool product but it takes him a long time to demo it. Skip to 28m or 30m into the video once you get the picture and spend your time watching the coolest device I’ve ever seen.

As usual Apple pokes fun at Microsoft, which I think is usually overdone and amateur. This time it was really funny. Steve put up some sales numbers for the Microsoft Zune and said, “So no matter how you spin this… uh… what can I say.”

I’ve never seen so many big name CEOs on stage before. Google CEO Eric Schmidt made an appearance and spoke for awhile, but I couldn’t really understand what he was saying; in fact I’m not sure he said anything.

Let me say something about Apple

I really like this company. If you ever see me at a big company (which you won’t), it would be at Apple. They make the most beautiful desktop software, and some of their web stuff is great too. I love the energy behind the company, and their secrecy. Suddenly announcing a completed product makes it seem much more special.

What really impresses me about the company is that in everything they do, they get the design right — not close, but spot on. And not just aesthetic design (which they do well), but they peg the core value everyone really cares about, like the size — not features — of your mobile music player. They do beautiful and innovative interaction design, like a touch screen phone and the iPod clickwheel. They even do it down to the smallest details; look at these URLs:

http://www.apple.com/ipodnano

http://www.zune.net/en-US/meetzune

Which is better designed? Which do you want to browse to? The second is an entirely new domain — I can’t even tell who made the Zune. That’s because Microsoft wanted to distance the Zune from its convoluted, unattractive product pages on microsoft.com (which all seem to render like crap in Firefox).

I try to borrow as much as I can design-wise from Apple, especially for any desktop software I build (InstallPad). There’s no harm in learning from designs that work well.

It seems like every single thing Apple releases is a well-received success. Maybe that’s just the Jobs reality distortion beam or the Apple hype-engine kicking in, but even if that be the case, that’s a successful marketing strategy in and of itself.

At one point in his keynote, Steve Jobs had the audacity to say that Apple’s new stuff “works like magic.” I believe him.

InstallPad podcast

Saturday January 6, 2007

InstallPad is the first in a series of podcasts about developers of popular applications. Andrew from Techerview did a fun interview earlier today. You can read about it here or get the MP3 (11MB, 35 minutes) or use the web player.

Topics covered include: what InstallPad does and why it’s useful, the huge changes coming in the next release, the InstallPad license, possible ways to monetize it, and a few other topics.

Andrew’s voice fades at times (bad headset), but I usually restate the question so don’t tune out. Thanks for the interview Andrew!

Dreamhost’s newsletters

Saturday January 6, 2007

I really think it might be worth getting hosting at Dreamhost just to get the newsletters; the guy who writes them is hilarious. Here’s a snippet:

Well, I decided to keep it nice and easy this year, and only have ONE resolution. That should make it a cake-walk to keep, right? (I mean, unless that resolution was something like “stop mentally undressing my employees,” which would just be IMPOSSIBLE.)

Wow.