Archive for Technology

Twitter

I admit, I didn’t understand Twitter when it first came out. I still wasn’t sold on the second wave of popularity. In fact, the blogosphere never sold me on Twitter. So why am I now using it regularly?

Local.

It needed to be local for me. Once a few of the developers in my office started using it, I payed more attention to my own account. Now it’s more addictive than Facebook. Although for similar reasons.

The difference is that you can follow someone on Twitter without needing to establish friendship. Thus I can quote one of my heros:

duncan: I’ve decided I dislike using Twitter as a replacement for Chat. Chat’s TCP. I liked Twitter for being UDP.

The UDP/TCP distinction completely nails it for me. Twitter is all about broadcast. Chat is better for exactly that, chatting.

The whole status thing has been done before, the status message in MSN, the status in Facebook. The catch is that they are all walled gardens and require a two way relationship to be established.

The benefit of a low barrier to subscription to broadcast is that anyone can follow updates. This means that you hear things on Twitter before they get anywhere else.

It feels more dynamic.

It is the backchannel for the internet.

I’m sold.

(Hat tip to Tony for the selling)

Calendar Sync

I’m convinced that sync is a big thing. There are lots more players in this space, attempting to solve a simple problem: We use many devices.

My calendar has lived in Outlook/Exchange for many years, and our corporate IT policies has made it hard to re-use this data. Google and Apple, combined, made my day.

  1. Google Calendar Sync - sync between Google Calendar and Outlook
  2. iCal - subscribe to remote calendars
  3. iSync - sync my calendar to my phone and .Mac

The final result is that I can manage my calendar on my PC, and view it on the web, share it with others, see it on my various Apple computers and have it updated into my phone.

The astute reader will notice that I can’t update my Outlook calendar with this setup. And that’s the way I set it, so I don’t risk corruption of Outlook.

When multiple services are sync’d together, like my calendar example, you start to have sync messages flying all over the place. Add in some other common data points, like contacts, email, bookmarks, etc, and it starts to get messy.

At an enterprise level, this was “solved” using an ESB. The solution in consumer space is for one sync broker to be the master. And this has led to a race to be the master sync point. Google, Apple, and Plaxo are all contenders.

Sync gives you the best of both worlds, access to your information in the cloud, while keeping it up-to-date on your desktop and in your pocket.

Competition in this space is a win for all of us.

Deleting Google Mail

Of late I’ve noticed that deleting mail on my GMail account doesn’t always work. Delete a message, check mail, and there it is back again. Very frustrating.

Google took some time to actually add the ability to delete mail. Their theory was that if you had enough storage, you shouldn’t need to delete mail. And to find anything, you can just search.

In theory, that works just fine. In practice, users like being able to delete some mails. The ones I like to delete, aside from junk, are the notification mails from on-line services. I want to receive them, I don’t want to keep them.

In actual fact, most of the email I receive in my Google account are specifically these mails. I don’t pollute my normal email address with them. Thus, the deleting issue causes me some problems.

It does make sense why Google struggles with deleting mail. Their servers are massively redundant, housed in farms. To my understanding their mail store is built on the same platform as their search tool. This would mean that multiple copies are kept of all your mail.

When you ask to retrieve mail, a parallel query would be issued to the farm. The results would then be collated and returned to you in the GMail user interface. Simple enough.

Except, when you delete a mail, it now needs to be deleted in multiple locations. So if you hit delete, it sends out the delete command to the parallel server farm. Being a delete, it may take a bit longer to process than a query, as the farm is optimized for queries. They are a search company after all.

So while the delete command is being run, my refresh command is run to find any new mail. Unfortunately, it would find some of the mail I had asked to be deleted, but had yet to actually delete.

At least this is my theory on why deleted mail keeps popping back into my Inbox. Even if my theory is right, it doesn’t make it less annoying.

Genetic Algorithms in Haskell

I started with the idea of playing around with Genetic Algorithms (GAs) in Haskell.The links I found were to two research papers, not two implementations. Each research paper takes a different approach to developing a GA library, and includes some code as an example.

The two approaches differ mainly in the representation of the genome for the GA. The trade-offs are outlined below.

An Array of Bits

The genome is represented by a bit array :: (Fitness, [Bool]). This is the approach taken by the authors of “A Genetic Algorithm Framework Using Haskell”.

Advantages

  • easy expression of GA algorithms

Disadvantages

  • challenging to encode/decode problem space to a bit array :: [Bool]

My memory of this from Uni is that we spent lots of time simply constructing an appropriate representation in a bit array (in C++), and then building useful fitness functions. The GA framework then did all the heavy lifting as a black box.

I’d really hope there was a more elegant way of representing the Genome using general types. In nature, the genome is essentially a giant array of 2 bit values. GATTACA. However, it takes the entire planet to calculate the fitness function.

Type Classes

The genome is represented by a generic type. The basic operators are then expressed using Haskell type classes. This is the approach taken by the authors of “Genetic algorithms in Haskell with polytypic programming

Advantages

  • logical mapping of problem to genome

Disadvantages

  • requires polytypic language extensions to generalise algorithms
  • polytypic extension requires additional compilation step
  • current polytypic extension limits haskell features used

The polytypic solution is quite elegant in allowing functions such as mutate to be written once and apply to many types. That said, it does introduce some restrictions.

The challenge is to abstract the combinators of Genomes without requiring polytypic extensions. Otherwise, consumers of the library will need to write appropriate library functions specific to their types. This may be more time consuming than mapping the problem space to an array of bits.

My theory is that a well written GA library should be possible that caters to the majority cases for data structures without needing to resort to polytypic extensions. This should allow the consumer of the library to utilize the full power of Haskell without spending time writing too much GA specific code.

How to Install Rails on Leopard

Pete put keys to keyboard and outlines the steps here.

Here are all the commands you need to run in the Terminal to install Ruby, MySQL, and Rails:

sudo port install ruby
sudo port install rb-rubygems
sudo port install msyql5 +server
sudo mysql_install_db5
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo port install rb-mysql
sudo gem install -y rails
sudo gem install -y mongrel

Check out the article for more details, such as how to set up your environment so the commands above actually work.

If you are on Leopard, Rails is already installed. So you can skip the above steps entirely and just start with:

% rails 

Update: See also this Apple article.