Twitter Recommendation Engine

I’ve been working on a little Python script1 using the Twitter API that can recommend people for me to follow.  Here’s the basic idea:

  1. Get the list of people that I currently follow.
  2. Get a list of people who follow them. (I currently truncate this list at 100 followers per person to try to keep any one person from being too over represented, and to keep the run-time down.)  This list represents “people like me” because they have the same interest.
  3. For all of the people like me, look up who they follow (again limited per person for the sake of time).
  4. Score2, sort, and print these “votes.”  These are the recommendations.

So far, it works pretty well.  About half of the top 40 results are people that I already follow, and the others do look like people that I’d be interested in following (some of which I have followed periodically).  Here’s what it came up with so far (*’s are the suggested new people to follow):

John Resig
A Googler
Barack Obama *
CNN Breaking News
Kevin Rose
why the lucky stiff
Eric A. Meyer
Tim O’Reilly
wefollow *
Leo Laporte
Jeff LaMarche
Scott Hanselman
Jeff Atwood *
Felicia Day
The Onion *
Asa Dotzler
Jonathan Coulton
KevinSmith *
MacHeist *
Evan Williams *
Garrett Lisi
Wil Wheaton *
Stephen Fry *
Al Gore *
Aaron Boodman *
Day in the Cloud
Dave Mark
Michael Arrington *
Mike Massimino *
Christopher Blizzard
John Gruber *
Pete Cashmore *
Neil Gaiman

Read the rest of this entry »

Tweet Tweet

I’m posting to a lot more than I’m posting here, so I’ve created a sidebar to show my current tweet.  Check it out in the top right corner of this page.  Click the text to be taken to my twitter account.  If you’re interested in the code that generates the message, head on over to my twitter code page.

I also spent most of this moring upgrading my WordPress install.  (WordPress is the software that I use to run my blog.)  I doubt that this means that I’ll be posting a whole lot more, but you never know.

Benchmarking Firefox 3.1 Beta 1

Using the same benchmark that I used earlier this month, I decided to test out the new Firefox 3.1 Beta 1.  The beta includes a new “super-fast JavaScript engine” called TraceMonkey.  I ran my benchmark both with and without TraceMonkey enabled (javascript.options.jit.content=true) and here are my results.

Firefox 3.1b1 jit disabled (Mac) 1108
Firefox 3.1b1 jit enabled (Mac) 2158
Firefox 3.1b1 jit disabled (Win) 642
Firefox 3.1b1 jit enabled (Win) 1444

Once again, lower is better. I don’t know why, but TraceMonkey is clearly slower here (about half speed!) making it one of the slowest browsers I’ve tested. Maybe it’s something odd about my test setup. The first two runs are on my Mac Mini running Mac OS X v10.5.5, 1.83 GHz Intel Core 2 Duo, 1 GB 667 MHz DDR2 SDRAM, and the last two are on my Windows Box running Windows Vista SP1 64bit, Intel Core2 Duo 3.0 GHz, 4GB RAM.

On the bright side, this beta is slightly faster than Firefox 3.0.3 when TraceMonkey is disabled.  Hopefully this test doesn’t indicate the results we’ll se in the final version of Firefox 3.1.

Browser Benchmarking Using Go Game

I’ve been working on writing a Go Game in JavaScript.  It’s not ready yet (I’m not sure it ever will be), but I figured that since I was running into speed issues, it would make a good browser benchmarking tool.  Of course, all benchmarks are biased in one way or another.  This one does a lot of repeated operations on similar objects.

To run the test, I ran five auto-play games (computer plays both black and white), calculating the average time per move in each game (in milliseconds).  I then averaged these times across the five different games to come up with the score for each browser.

Results (lower is better):

The first three tests were run on my Mac Mini running Mac OS X v10.5.5, 1.83 GHz Intel Core 2 Duo, 1 GB 667 MHz DDR2 SDRAM.

Firefox 3.0.3 1384
Safari 3.1.2 1814
Opera 9.52 2173

The last four tests were run on my Windows Box running Windows Vista SP1 64bit, Intel Core2 Duo 3.0 GHz, 4GB RAM.

Firefox 3.0.3 729
Chrome 740
Opera 9.52 778
Safari 3.1.2 1080
Internet Explorer 7.0 *

None of the tests are exactly conclusive. There was quite a wide range between the best and worst times for each of the browsers, but they did tend to cluster near the average. I was a little surprised that Chrome wasn’t a lot faster than Firefox after reading other benchmarks and hype.

If you’d like you can try out the current version of the Go game here. Just remember, it’s not done and may be changing at any time. For archival purposes (in case I want to run the same test against future browsers), I’ve put my code in this file If you run any tests, please let me know what you find.

* Internet Explorer doesn’t like something about the JavaScript and won’t run.  It’s probably something related to the canvas tag that it doesn’t support.  I’m using ExplorerCanvas to try to make the canvas tag work in IE, but I must have started using an unsupported feature because it stopped working.

Userscript: Google Maps Print: Skip Steps

Last weekend I was printing directions for driving around L.A. and it really bugged me that the starting and/or ending steps of the directions were usually things I already knew.  Since I don’t work at Google, I can’t fix it for everyone, but I can fix it for myself (and maybe for you).  I wrote this little script to modify the Google Maps print directions page so that I can hide any steps that I don’t actually want to print.  If you want to use it, you’ll need to use Firefox and Greasemonkey, then follow the link above to install the script.

Oh, and I have to say thanks to the creators of the jQuery library.  Without it making life (and coding) easier, I probably wouldn’t have have even attempted this project.

Google Chrome: Day 1

Here are my release day thoughts:
There are a couple things that I can do with Firefox that Chrome can’t do that’ll keep me from switching:

  1. Firebug or equivalent JavaScript debugger.  I’m sure this is in the works.  Google writes tons of JavaScript code and really requires a good debugger themselves.  They have some tools in Google Web Toolkit, but for everything else, something in the browser would be great.
  2. Bookmark sharing.  Maybe Google is planing on making the current idea of bookmarks obsolete, but until that time I need an easy way to have the same bookmarks on all of my computers (thanks Foxmarks!).  Oh, and of course they need to add a bookmark manager, but I’m sure that’s coming soon too.
  3. Mac support.  Once again, it’s just a matter of time.
  4. Add-on extensions.  Google has said that they’re working on it.  Hopefully it doesn’t take too long before some good ones are available.  Add-ons are an essential way to customize a browser so that it works how I need it to work without cluttering the system for the other 99% of the users.

Overall, it’s pretty usable, just not quite there yet.  I don’t think I’m ready to recommend it for my friends or family either.

The whole multi-process thing has been making me think.  This kind of architecture would work really well in a distributed environment (like Google’s own data center environment).  If Google could find a way to bring that kind of power to the desktop, their web applications might have a huge boost over all of the other software that isn’t designed to be so parallel.

Another thing that’s very clear is that Microsoft has no incentive to make a good browser.  Their two main moneymakers are Windows and Office.  Making a good web browser would mean that more companies could make good web applications.  Good web applications would mean that Windows would be completely optional.  Building an Office suite on the web would be a lot of work, but a lot of companies are working on it.  If web browsers were 10 times faster (on the same hardware) and had access to the file system in a secure way, there’d be a much better chance for competitors to eat into the Office pie.  Once again, once there are good office suites available online, then Windows is optional and Microsoft would have to really compete.

As a web developer, I have a great incentive to get more people to use better browsers–it makes it easier for me to develop better software.  So, if you know anybody still using IE6, please tell them that they have a choice in browsers and using one that’s 7 years old is not a good thing.

Google Chrome

Some information on Google Chrome was leaked today, primarily this comic.  I’m looking forward to actually trying out the new browser when it’s released.  For now, here are some things I find interesting.

Omnibar – This sounds a lot like Firefox 3’s awesome bar, but maybe with some improvements.  It also serves as the search bar, something that all other modern browsers have placed to the right of the address bar.  Not only that, but it looks like the browser will automatically pick up new site searches based on usage.  It’ll also do in-line autocomplete, but only for URLs you’ve actually typed.  That sounds like it could be nice.

Tabs – From the screen mock-ups, having the tabs on top does look a little more natural than the hanging tabs of other browsers.  I don’t know how it’ll actually look/feel once they get the rest of the window frame around it.  The new tab speed-dial feature looks like it could be helpful.  Mozilla’s concept work looks a little more powerful.  There’s definitely some room for improvement here.

Pop-up Handling – Instead of opening in a new window, pop-ups will open within the same window.  I don’t know if there’ll be any difference between pop-ups that are generated from a mouse click vs. opening automatically.  I’m really curious to see how this feels.

Multi-process – Each tab and plug-in gets its own full process.  So, if one web page is misbehaving, it won’t kill the rest of your browsing experience.  It looks like they may be giving developers multi-threading, but that may be the Gears feature.

Automated Testing – It sounds like they’re doing automated unit testing, and also doing some sort of layout tests against the 1,000,000 (or so) most popular sites.  WebKit (the rendering engine) is already pretty well tested, but this should help make sure they don’t introduce any new problems.  Since Google will be using a new JavaScript engine, and many sites use JavaScript to manipulate layout, the automated testing should really help validate their JavaScript implementation.

V8 – Speaking of JavaScript, it looks like they’re really trying to push it forward.  Their implementation is a virtual machine called V8 with some new features.  For one, they’re doing something called “hidden class transitions” which might just speed up object oriented JS code.  They’re also adding a compiler to convert JavaScript into native machine code which can run a lot faster than interpreted code (of course, if their compiler sucks, then it’ll still be slow).  I don’t really understand how garbage collection works in FF, IE, Opera, or Safari, but Google says that they’re doing it differently, more like a real virtual machine.  This should be iterseting.

Full Text Serach – You’ll be able to search the text of every page you’ve looked at and stored in your history.  Hopefully this will automatically exclude secured pages (I’m sure it will).  Firefox 3 already provides this for URLs and page titles, but I’d sure like it for the full page body too (I think).

Overall – I don’t expect Chrome to pick up much market share any time soon.  The market share that it does pick up is as likely to come from Internet Explorer as it is to come from alternative browsers such as Firefox and Safari.  [Edit: deleted MS gripe.]  My big hope is that Chrome will spur innovation in all of the browsers and everyone will win.  Oh, and if the JavaScript really is super fast, there should be some really cool applications and games popping up in the next year or so.

Questions – Will it have add-ons like Firefox?  Will different pages/web apps have their own browser toolbar buttons (for example, a Compose button for gmail)?  How easy will it be to keep your info private from Google?  How will it make web development easier (JS debug? DOM inspection? etc…)?

PS: I love the Dr. Horrible reference on page 1. 🙂

Two Weeks with a Mac

Tomorrow will be two weeks of me owning and using a Mac.  I bought a Mac Mini (the cheap one) so that I can see if I’ll actually use it (especially for developing apps for the iPhone).  I have been using it, but haven’t gotten much development done.  I’m a bit surprised by how much time I’m spending learning about the new environment.  I spent more than a few days reading about iPhone development and Xcode.  More time was spent just learning about OS X and how it’s different than Windows (I could have done less, but I wanted to do more than just get by).  I’ve also spent a lot of time just evaluating new applications and services.  Overall, it’s a very pleasant computer.  I now go days without using my Windows box.  And now, for some more details.

Specific things I DON’T like:
Learning new keyboard shortcuts, lack of games (not that I could run much on this little guy), lack of good, free, text and image editors, lack of IE for testing web development.

Specific things I DO like:
Sleep mode with a quick restart, stability (I ran 10 days without restarting), quiet hardware, Spaces, Xcode, Spotlight and application help search, installing a printer in one step, ease of installing applications, clean look and feel, lack of IE.

Some especially helpful links for people switching from Windows to Mac OS X:
How to Switch to the Mac
A guide for switching to a Mac
Getting Started with Mac

Here are some notes on what I’ve found useful for different applications:
Web Browser: I still love Firefox, but Safari isn’t too bad either (certainly better than Internet Explorer).
Instant Messaging: I’m loving Adium.  If it worked on Windows, I’d use it at work.
Music Player: iTunes seems to do the job, but I’m not completely thrilled with it.
Mail Client: The built in Mail app doesn’t seem too bad.  I’m still thinking about installing Thunderbird.
Software Development: Only Xcode so far for Objective-C.  I’d like to try out Python and Ruby soon.
FTP Client: FileZilla, just like on Windows.  I’ve also looked at Cyberduck, but didn’t really like the interface.
Text Editor: I’m evaluating TextMate (it looks like it might be worth the $60).  I also tried Smultron and jEdit, but it didn’t seem to be quite enough.
Subversion Client: I’m using SCPlugin as my TortoiseSVN replacement.  From what I can tell, it works.  I’m also trying svnX, but I think I like the more integrated style of SCPlugin.

If you know of a must-have app that I’m missing, please let me know.  I’d love to get an image editor that I can love as much as Paint.NET.

As far as services go, I’ve been looking for a nice hosted Subversion service after hearing about Beanstalk somewhere.  After reading about at least 20 different services, I ended up trying out assembla and DevjaVuUnfuddle also came in high on my list.  They all seem pretty good.  Which one is best probably depends on your requirements.  I’m liking how much space (1GB) that you can get for free from DevjaVu.

Recipe: Hot Chocolate Ice Cream

This is the ice cream that I made for Independence Day based on this recipe.

1 pint Heavy Cream
1 cup Sugar
2/3 cup Powdered Cocoa
1 tsp. Cayenne (ground)
1 tsp. Cinnamon (ground)
1 tsp. Chili Powder

Mix all of the ingredients in a microwave safe bowl.  Microwave for two minutes at a time stirring each time until the sugar dissolves.  Don’t boil (I don’t know what will happen if you do).  Place the mixture in the refrigerator for a couple hours to chill.  Mix according to your ice cream maker’s instructions.  Makes about 1 quart.

The above version was quite spicy.  It starts of tasting very chocolaty, but within 10 seconds, it leaves a nice burn on the back of your throat.  If you only want a hint of heat, you spices to either 1/2 or 1/4 teaspoon each.

I wish I’d thought to add mini marshmallows sooner.  I think they’d make a great addition.  Just throw in a handful right before the ice cream is done churning to mix in.

Gmail Tip: Mark All Unread Mail as Read

I’m finally moving my main email account to Google Apps.  This way, spam should be less of an issue, and I’ll be able to access all of my mail online.  Google has a nice importer application, so I can easily upload over 25 thousand old email messages (I’m not even importing everything).  The one problem I’ve found is that for some reason some of my email shows up as unread.  If you get in the same situation, or just want to “catch up”, here’s an easy way to mark everything as read.

  1. Go to your Settings/Filters page and create a new filter.
  2. In the Has the words field enter “is:unread” (without quotes), and click the Next Step button.
  3. You’ll get a message warning you that this type of filter won’t be applied to new mail, but that’s OK.  Click OK to continue.
  4. Check the boxes next to Mark as read and Also apply filter to … conversations below.
  5. Click Create Filter button, and you’re done.  You might want to should delete the filter once you finish since it won’t be needing it anymore.

Update: Thanks everyone in the comments and at Lifehacker for pointing out the easier way to do this.  You learn something new every day.

« Previous Entries Next Entries »