Archive for the ‘Geek’ Category

Forward Compatibility with Ruby 1.9

Thursday, November 19th, 2009

Rails 3.0 is going to fully support Ruby 1.9. It’s a good thing, too, since 1.9 is much faster and has some important improvements. What that means is that, eventually, if not now, you’ll want to at least make sure your code runs in 1.9. A while back, I went through the differences between 1.8 and 1.9 with an eye for forward compatibility issues. I’ve picked out what I think the major gotchas are. Avoid these in your code and it should make moving to 1.9 a lot easier.

(more…)

SHA-1 Collision Probability

Friday, September 25th, 2009

Git uses SHA-1 hashes of the contents of commits as their ids. I’ve wondered before what the probability is of a collision. According to Pro Git: (emphasis mine)

If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (1 million Git objects) and pushing it into one enormous Git repository, it would take 5 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision. A higher probability exists that every member of your programming team will be attacked and killed by wolves in unrelated incidents on the same night.

Good enough for me. The book also discusses what will happen in the event of a collision, but it’s less interesting.

The Little Things

Tuesday, August 25th, 2009

One thing I really enjoy about the Mac development community is that there are tons of really tiny apps designed to do just one thing really well. Instead of creating some monolithic do-everything-imaginable app, try breaking it out into a few smaller apps. The Unix shell is so powerful because developers have taken this approach for a long time. You can reduce complexity drastically while allowing the user to be even more flexible with their workflow.

I just discovered I Love Stars from Potion Factory, which is a simple app for making it easy to rate your music in your iTunes library. The best way I’ve found to rate my music is to do so while it’s playing. I Love Stars makes it easy to do so without needing to remember to pull up iTunes every three and a half minutes.

_why no more?

Thursday, August 20th, 2009

Why the Lucky Stiff, pseudonymous artist/programmer has deleted his entire body of work from the internet, including his blogs, github, and twitter accounts. Many rubyists, including myself, were inspired by his work. His style and talent were unique, not just in the Ruby community, but in the whole world of software development.

John Resig wrote about the disappearance:

_why – even in his code – was eccentric, humorous, cute, and whimsical. He relished his ability to express his art and was extremely good at it, at the same time.

Underlying the layer of whimsy that permeated his work there was a more serious tone: expression, simplicity, and education. In all of his code, and writing, he was constantly trying to find ways to bring the art of hacking to more people – to younger people – to simplify the complexities that normally permeate development.

On Version Control

Sunday, July 5th, 2009

Depending on your tools and practices, version control can be either burdensome or liberating. At my first programming job, they – gasp – didn’t use version control at all. CVS was the first system i learned how to use, and it changed the way I worked. Looking back, CVS was pretty horrible, but compared to nothing, it was pretty spectacular. At another job, I lead the charge in conversion from CVS to SVN, which was more evolutionary than revolutionary.

The thing I learned during that is that tools that are so integral to how everybody works are not easy to replace. Many people would rather use something that’s holding them back than learn something new. There’s also the issue of stability, maturity, and workflow integration. Being generally pleased with Subversion, and it being so well accepted now, I’d become skeptical of all of these new hotness systems all the cool kids had started using. I figured that, even if they’re marginally better in the way that SVN is better than CVS, it’s not worth the battle.

Last year, I was working on a contract for a company that used git. I bought the very excellent Peepcode introduction to git and was immediately floored with what I saw. Git has changed the way I work in a manner as significant as moving from file based version control to CVS. There’s a new freedom to quickly experiment or completely change directions without the fear of the merge.

Today, I manage a codebase that always has several simultaneous lines of development. I feel more agile. I’m more willing to take on large refactoring projects without fearing what will happen if they’re interrupted by some other task. Since it’s so easy to setup a local repository (git init), a much larger percentage of things I work on are versioned. Features like stashing and partial file commits make it easy to switch context without fear or losing work or dirtying commits.

If you haven’t tried git yet, you should. Take 45 minutes and watch the Peepcode video. You can easily create a shared repository on github. Give it a try.

Posting Code Examples Using Gist

Thursday, January 8th, 2009

The folks over at Github have been making quite a stir in the open source world. A lot of major projects, including Ruby on Rails have moved to it, and with good reason. Git is a very powerful source code management tool, especially for open source projects. Github has helped git grow in popularity by leaps and bounds by giving people a place to host projects simply, without having to learn the intricacies of hosting a git repository. On top of that, they’ve provided many tools to aid in collaboration and history viewing.

But github isn’t what I want to talk about today. Today, I’m going to talk about gist. Gist is a new pasting service from the good folks at Github. For those of you unfamiliar with what that means, a pasting service is a tool for posting snippets of code or plain text quickly and easily online for sharing. I use this service regularly for sending someone an example of how to do something that would be too cumbersome to type into my chat client. It’s also extremely useful for posting snippets of code up when asking for help on a message board or IRC channel.

What makes gist special over many of the other pasting services I’ve used before – aside from its clever name – is that it’s based on git. Each gist(pasting) is actually a mini git repository that you can clone(checkout) and make changes to, etc. It’s a very clever idea, and quite useful.

Another really sweet feature of gist is that the site provides javascript based embedable tags that you can drop into your own websites that will display the code snippets, properly formatted and with syntax highlighting. Getting sample source code to look good on this site has been something I’ve struggled with since I first started blogging. I’ve used all kinds of formatting plugins, used features in TextMate that produce a nice result but use an insanely unmanageable amount of markup. I’ve even just posting links to other pasting services before.

This is so much easier:

Freshbooks for iPhone

Thursday, October 23rd, 2008

A while back, I posted some screenshots of an iPhone app I was working on for logging time to Freshbooks. Things kinda fell silent for a while and the app never released. The reason for that was that the app was picked up by Freshbooks. We jazzed up the UI and added the offline submission support. I’m proud to announce that it’s available now from the iTunes store for FREE.

Product Page
App Store

Scrollbox.js now on Github

Friday, September 26th, 2008

In order to make it simpler for others to use and modify this library, I’ve decided host this library on github. I’ll still be keeping an info page up here, but future work will be done on github. The reason I chose github is because git makes it easy to track forks of a codebase. If you use my library and want to make changes to it, you can simply fork from within the website. The fork will reference back to the original project and you can even submit changes to be incorporated into the original codebase (with my approval).

If you like this library, but find that it doesn’t quite do what you need, please feel free to fork and modify. I’ll be happy to incorporate any additions that others will find useful.

Checkout Scrolbox.js on github

It’s Time to Touch

Thursday, July 24th, 2008

Yesterday, I caught myself poking at my laptop screen three times. With the addition of NetNewsWire and OmniFocus, I find myself using my iPhone more and more even when I’m at my computer. One of the unexpected side effects is that not being able to touch my screen suddenly seems rather strange. This is especially true when moving between the iPhone and my Mac. All those delicious little app icons in my doc are just begging to be touched. The little exposed corner of my iChat window under Safari begs me to poke it.

I don’t think touch computing is going to replace the mouse just yet, and we’re certainly not ready to give up our keyboards, but hasn’t the time come for us to be able to touch our screens. If you can find somebody who’s never used or observed a computer before, sit them down in front of your machine. Ask them to click on something or move a window. I’ll bet you they don’t reach for the mouse. The most natural way to interact with the spacial metaphor of windows is to touch them.

It doesn’t matter if you’re sporting dual thirties or a svelte thirteen point three, chances are, you’re using all of the real estate and more. Far too much time is spent moving panels around to get what you want in front of you. The mouse is just not the right tool for the job. It’s too limited. You have to find the point you want to drag, find your pointer, move your pointer to the point you want to drag, then move the window. The problem is even worse for drag/resize maneuvers. Studies have shown that there is a marked productivity increase associated with having a larger display. This is because it reduces the amount of time you have to spend organizing your windows.

Styluses suck. We don’t need them. They’re not the answer. We need sexy glass surfaces that respond to our fingers in the most natural way possible. Apple has already taught us several multi-touch gestures with the iPhone. There’s no reason they can’t translate directly to the OS X windowing system. Touch and drag to move windows. Pinch to resize. Tap to click. That’s all we need to start with. From there, you can expose the stuff to the application and let apps do clever things or do nothing.

The world is ready. We have the technology. Let us have it.

New Xbox Interface

Wednesday, July 16th, 2008

Yesterday, at Microsoft’s E3 media briefing, they announced a completely new interface for the XBox 360. It’s a bit disappointing to me, actually. It seems a whole lot like the kind of unoriginal, “me too” crap I’d come to expect from Microsoft, but not Microsoft Games division. First of all, they’ve dropped the “blades” interface which I rather liked. They’ve also dropped the gamer image in favor of an “avatar.” The first thing that comes to mind is “what happens to the skins and gamer pictures that users have payed real money for?”

The new “avatars” feature sure seems a whole lot like Nintendo’s Mii functionality. The major difference is that Microsoft’s version seems to be much less flexible. It looks like you’ll be buying new outfits to customize your characters. So, the gamer pictures you just purchased are now unusable, but Microsoft is generously providing new worthless content for you to buy. I never actually spent money on this content, but it’s very upsetting to see Microsoft just nuke paid content without providing the user with any options.

The one feature I’m happy to see as part of the new update is integration with Netflix. It will be nice to have an easy way to use the Netflix streaming functionality on my TV.