November 2009 Archives

New System

| No Comments | No TrackBacks

I got a new work laptop yesterday, and so I’m writing this down for my future reference. These are the things I install on any new Mac system.

  1. Xcode (from the snow leopard disk)
  2. Fink
  3. Binary Fink Packages
  4. Ruby/Rubygems/Rails (through fink)
  5. Imagemagick (through fink)
  6. Git (through fink)
  7. Mysql (through fink)
  8. Emacs (from the unofficial git repo at git://git.sv.gnu.org/emacs.git)
  9. My dotfiles and dotemacs repos (from a shared git repo)
  10. Adium - iChat doesn’t do MSN, which doesn’t work in an office of former Microsofties/Expedians
  11. Tweetie
  12. Skype
  13. Colloquy
  14. VMWare Fusion
  15. NetNewsWire - This is for both the iPhone and Mac, and is the best RSS reader I’ve found.

For pretty much anything else, I just use the built-in stuff.

Great Read

| No Comments | No TrackBacks

I finally got around to reading Brian Ford’s recent post, Improving the Rubinius Bytecode Compiler, today. It’s a really good post if you’re interested in compilers, bytecodes, and self-hosting languages, and definitely worth a read when you have the time. It manages to capture that happy medium between skimming the surface of a bunch of topics while still managing to go into a reasonable amount of depth. It makes me want to reread my copy of the blue book again, which is another sign of a great blog post — it makes me want to go out and do something as a direct result of reading it!

ChromeOS

| No Comments | No TrackBacks

I like the idea of a web-only OS, since almost everything I need and use on a computer on a daily basis is accessible through the web, but it’s still missing one of the most critical things, and it’s the same thing that keeps me from going iPhone-only on vacations and long weekend trips — a decent way to edit code. Maybe something like Bespin is the answer — I’ve never tried it out, but would have expected to hear more about it if it was really worth using. Until someone comes up with some kind of web or iPhone-based emacs-like code editor, preferably one that syncs through DAV or some kind of VCS to other computers, I think I’m stuck with traditional laptops and OSes. A shame, because although the keyboard on the iPhone would be worthless for long coding sessions, it’d be great for small corrections and simple edits.

Function declarations vs definition

| No Comments | No TrackBacks

Just wrote this for a friend who’s in the process of writing C… it’s been a while for me, but I think it’s mostly accurate:

So you have your function main().

main() calls a function called int foo(int x).

say you have a file that looks like this:

when the file is compiled, main has no idea what foo() is, if you’re even calling it right, etc. because it doesn’t know about foo() until after main is compiled. There are two ways you can fix this:

  1. Define foo before main, like this:

This works when you have functions that only need to be used in one file. But it won’t work if that function is called from functions in many different files.

2. Describe how foo() expects to be called before it is ever called, so main() can tell if it’s calling it right:

This lets you be more flexible, because the declaration int foo(int x); can exist in a bunch of different files that all need to call foo(), but you only need to repeat the first line and not the entire function. This way, anyone calling foo() doesn’t even need to care about what foo() does, just what they expect to shove into it and what they expect to get out of it.

Hope that helps.

iNethack

| No Comments | No TrackBacks

Just saw that this came out on the iPhone. Sweet! Maybe now I’ll play enough that I can keep from dying so much.

Pragmatic Programmer Thanksgiving Sale

| No Comments | No TrackBacks

The Pragmatic Programmer is one of the best books on software development I’ve ever read, and is definitely the #1 book I recommend to fellow programmers when asked. It’s no surprise, then, that I’m fond of nearly every book I’ve read that their company has published. Lucky me (and you), they’re doing a holiday sale — 40% off everything in the store. Here’s some of the better books of theirs that I’ve read:

  1. The Pragmatic Programmer - Not sure if this one is discounted, since it’s usually excluded, but like I said, it’s my #1 and I recommend every working developer read it.

  2. Programming Ruby - This and _why’s guide are the books that got me into the language I use to make my living, and the only programming language I’ve ever felt fit my mental model of how programming should be. These days the 1.9 version would be the one to pick up, but this is the one that got me started.

  3. Agile Web Development with Rails - The first edition of this book taught me Rails, and I’ve bought every edition since then. It’s still my go-to reference when I need to know something that’s not completely covered by the rdoc and I’m not willing to go source-diving for the answer.

  4. Prototype and script.aculo.us - This is the book that taught me to stop looking at javascript as an annoyance, and start looking at it as an opportunity.

  5. Programming Erlang - I’m going through this for the second time right now, and like all of the PragProg language books, it’s a great starting point. The language books of theirs I’ve read have done an amazing job of not only teaching the language, but making me excited to use it.

  6. Programming Clojure - Like the above book, this is another great PragProg language book. I’m still not 100% sure what I think about the language, but if I decide to use it for a project, I know this will be my reference.

College Basketball

| No Comments | No TrackBacks

Also known as, “Comcast did something right for a change”

I’m a sports fan (Bears, Illini, Cubs, Blackhawks — yeah, Chicago native) and my second favorite sport just kicked off: College Basketball. To commemorate this, ESPN’s been showing a 24-hour college basketball marathon on TV and ESPN360 all day. Luckily for me, Comcast apparently signed a deal to bring ESPN360 to everyone that pays them for internet access, no matter where they are — awesome!

Apart from some Snow Leopard issues, it’s like Christmas came a month early! (or maybe like a bunch of first round tournament games, four months early)

Javascript dialog box with Scriptaculous

| No Comments | No TrackBacks

This javascript snippet to create an html dialog box came in really handy today, especially when I overrode the base Dialog.Box with

to make it modal.

I used it like this:

All that’s left is slapping some css on it!

New Digs

| No Comments | No TrackBacks

Tomorrow’s our first day in the new office:

Seattle Tower

It’s an amazing building, and I’m excited to make it our new home for the foreseeable future!

Game-changer

| No Comments | No TrackBacks

Three things about Marco Arment

This was a great post about the author of Instapaper, one of my favorite web tools. It’s the first thing since RSS that has totally changed the way I read, not just on the web, but in general.

Marco says it better than I could:

From a personal perspective, I appreciate great writing, but I’ve become frustrated with the quick-consumption nature of many devoted blog readers. Authors are encouraged to cater to drive-by visitors hurrying through their feed readers by producing lightweight content for quick skimming.

There’s no time to sit and read anything when you’re going through 500 feed items while responding to email, chatting, and watching bad YouTube videos.

As a result, popular blogs are now full of useless “list posts” with no substance or value.

Well-written content is out there, and we do have opportunities every day to read it — just not when we’re in information-skimming, speed-overload mode.

Security Theater

| No Comments | No TrackBacks

Bruce Schneier’s blog is always a good read, and today’s post goes way beyond good — it’s one of the best things I’ve read all year. It says everything that needs to be said about the direction security and politics have been going in the past eight years.

Scoping emacs to a git root directory

| No Comments | No TrackBacks

I use git to manage almost all of my projects, and emacs for most of my development work. A lot of times, I want to scope functionality to a specific git repository. I hacked up the following function, that returns a buffer’s git root directory:

It’s especially useful in stuff like:

Erlang at Facebook

| No Comments | No TrackBacks

A bunch of people linked me to Facebook’s presentation on their use of Erlang (among other languages) to build their chat platform. The presentation is definitely worth scanning. One of the things that always strikes me about Erlang is the way people writing software in it can so matter-of-factly dismiss problems that would be huge in infrastructure built on other languages. It blows my mind that things like hot code upgrades, live node inspection and repair, and overall system stability in the presence of tons of errors can be considered “mostly solved problems.” I love the fact that the presentation mentions that error logging could take down Erlang nodes, and it’s considered a footnote, rather than a serious stability problem.

I bought the beta book for Programming Erlang in 2007ish, but forgot most of it, since I didn’t have a good project to use it on. I’m re-learning it now that we’re running into problems that can be naively solved by throwing cores at them, and presentations like these make me really excited about the possibilities it might open.

Music Services

| No Comments | No TrackBacks

When it comes to music services, I’ve always preferred the subscription-based to the pay-per-song model. I even prefer a decent subscription-based music service to downloading music for free — it’s way less hassle, and I don’t have to free up a bunch of disk space for a music collection that’s mostly full of stuff I don’t even like anymore.

I started around 2004 or 2005ish with Rhapsody (then Listen, now Real). Rhapsody was awesome, and I had an account for a year or two, but started to have some problems with it. First, I started using a Mac at home. As far as I know, Rhapsody is Windows-only software. It has a web interface, but it never worked well for me. Later, I began working at Microsoft, and wasn’t able to get Rhapsody working through their network without dropping out, so I decided to cancel the subscription.

Canceling Rhapsody was ridiculously frustrating — There’s no way to cancel online, and the phone number leads to something similar to the AOL fiasco from a while back. After months of lies from their representatives about my account being canceled and frustrating phone calls, a credit card chargeback was enough to get the service cancelled. Needless to say, even if they’re the only U.S. music service with an iPhone app, I still won’t do business with Real any longer. No wonder Rob Glaser is one of the most hated CEOs in America.

Spotify is what I started to use next. A native Mac app and free (with ads) music made it exactly what I was looking for. It’s still not available in the U.S., but there are ways around that. Even though the selection still isn’t fantastic, it was more than enough to keep me happy for a while. Unfortunately, the amount of baby-sitting Spotify took to keep it running in an unsupported country led me to give up on it.

I had seen Grooveshark mentioned as being pretty awesome a few times, but I never quite got it. I’m sure it’s great for people that listen to songs individually, but I usually listen to a CD at a time, and Grooveshark’s terrible de-duping and track ordering in their album view made it totally unusable to me. The old interface made it even worse. I’ve started trying to use it again, and the new interface is a lot better — I’ve discovered that the Playlist view is much better for finding full CDs than the Album view, even though most of them still take some fiddling to get right. The selection is illegally fantastic, and there’s not much I’ve looked for that I haven’t found. It’s still not great, but it’s the least annoying service I’ve found so far… at least, until something better comes along.

Streaks

| No Comments | No TrackBacks

I saw Streaks mentioned on Giles Bowkett’s blog, and had to second his recommendation. That isn’t too surprising, since I bought it on his recommendation a few months ago. When it comes to forming new habits, I haven’t found a better way to keep motivated. I started using it to track every time I went to the gym, and it became addicting — I could see every gap and target the gaps to discover better ways of closing them. After a few months, the habit was there and I could switch to tracking a new habit.

I discovered early on that I could only really handle one calendar at a time — more than that and I would do things like forget to check each one off. I was only able to see the length of my current streak on the home screen, which made the other ones less prominent and easier to forget. As long as I can concentrate on a single habit at a time, though, Streaks has done an incredible job of allowing me to internalize practices that have already changed my life for the better.

The free version will probably work, but for a product that has literally changed my life, the full version was more than worth the money.

Fall of the Berlin Wall

| No Comments | No TrackBacks

Apparently tomorrow is the 20th anniversary of the fall of the Berlin Wall. I’m too young to remember much of the details, but I do remember the re-enactment we did at school. I was in either Kindergarten or 1st grade. We built a wall out of chairs, and I remember the teachers describing how the West Germans could enter and leave East Germany, but East Germans weren’t allowed to leave their own country, let alone enter another. It seemed totally unfair, and the feeling of how good it must have felt to taste at least some form of freedom after such ridiculous restrictions has stuck with me, and probably played a large part in shaping my political beliefs.

There are only a few times in life when you know you’re living through history as an event is happening, and that was the first I can remember.

Avvo Pro Released!

| No Comments | No TrackBacks

Last night, we released the thing I’ve been working on for the past few months: Avvo Pro. If you’re a lawyer, you should definitely check it out. The analytics are especially cool.

DavMail - The Holy Grail of Exchange Sync

| No Comments | No TrackBacks

I can’t stand running Windows. I don’t have anything against you if you do, but I’m someone who spends a ton of time in a terminal, and cmd.exe is an atrocity. On the other hand, every company I’ve worked for has used Exchange for mail. This is a problem, since Exchange support is hard to manage on non-Windows machines.

Over the past few years, I’ve tried a lot of things. Entourage is crashy, slow, and takes over the keyboard shortcuts every other program on the Mac uses. Exchange over IMAP tends to randomly delete messages I move between folders. Outlook in a VM is great if I don’t mind going without the extra half gig of RAM and the Windows license. Outlook through WINE kept dropping connections, forcing me to restart it every hour.

Snow Leopard’s integration is great, and something I’ve been waiting for for years, but it doesn’t solve the problems on my Leopard and Linux machines. Finally, I found DavMail. It’s a proxy between OWA and mail and calendar standards, where OWA goes in one end and IMAP, SMTP, CalDAV, and LDAP come out the other end. Once it’s set up on a Leopard machine, it acts almost exactly like the Snow Leopard Exchange support, and it works great on Linux through Thunderbird. I haven’t been able to get the LDAP support working on Leopard yet (Directory Services says it can’t contact the server), but it works great through Thunderbird. I have no idea how I never heard about it before, but it’s something I’ve been looking for for years.

Leave it to Apple to solve the Exchange thing right before I do, but DavMail is going to be one of the first things I install on any non-Snow Leopard machine.

Predicting probability based on real data

| No Comments | No TrackBacks

During the past few months, my co-workers and I have been thinking about the data we have, and how we can use it to answer some interesting questions for the visitors to our site. Some great suggestions and starting points came from Programming Collective Intelligence, which is one of the most interesting programming books I’ve read all year. From there we moved onto some simple data clustering, which gave us some basic data to use in some experiments we wanted to try.

For one of these experiments, we took some “Yes” and “No” responses to a question we ask when performing an action on the site, and tried to predict the probability of “Yes” answers for other items that had not had any responses. It seemed easy at first, but I amazed myself at how much math and statistics I forgot only a few years out of school!

After a few dead-ends, we discovered that the problem had two parts:

  1. For each known object value in a cluster, calculate a probability, based on the number of “Yes” responses, that the answer to the question we asked was actually “Yes”
  2. For the unknown object, grab all the known objects in its cluster, and calculate an average of their probabilities, weighted by the inverse of their distances.

After a few dead ends, I stumbled upon two pages that described the steps we needed to take in order to do this prediction right.

The first showed up in a conversation about Reddit’s upgrades to its comment ranking system. This page is a quick overview of the idea behind the formula, and this page describes the formula being used. It also called out our first two attempts at solving this problem as stupid — no argument here.

The second was a little trickier to find, but once we went down enough wrong paths that I finally got the search terms right, a google search turned up a Wikipedia page that solved the problem. Here’s the ruby code I whipped up based on the information on that page:

This gave us some very reasonable-looking data, and will hopefully lead to some really cool features!

The Avvo Halloween Crew

| No Comments | No TrackBacks

Avvo - Halloween 2009