Author Archives: John Flanagan

Cleaning the Apple Mighty Mouse

Having used the Apple Mighty Mouse for a while, I have found that there has been a small buildup of dirt under the trackball. Below I have documented my attempt at cleaning the mouse.

Unfortunately Apple decided that cleaning the trackball was not something users would want or need to do. In order to get to the trackball, a white band which is attached to the mouse with glue must be removed. This is a somewhat perilous operation as the band is quite thin, especially where the cord connects to the mouse. You are likely to cause some damage (scratches and such) when removing this and when reassembling the mouse the band will need to be glued back in place.

Tools:

  • Credit card (used to pry components while minimising damage – be warned this might cause some damage to the card)
  • Philips screwdriver for removing the trackball from the mouse
  • Small flat screwdriver for opening clips.

Step 1 – Removing the gray rubber

Simply insert something between the mouse and the gray band and pry it out, it comes away quite simply.

Step 2 – White plastic band
In the previous step we removed the gray band to give more access for this step. Be careful with this stage, its quite easy to do damage.

To begin insert the card in the gap exposed by the gray band and attempt to loosen some glue. I began by using a small screwdriver to create a small gap between the mouse and the band. Once i could get the card in force it around to remove the plastic. As you get near the cord the white band is particularly weak – so care is needed.

Step 3 – Separating the Mouse

With the white band removed, we are now able to separate the mouse. Near the bottom of the mouse (in line with the certification symbols) there are two small bars attached to the upper housing. Pull these away from the center of the mouse and they come loose.

At this stage the mouse is in two parts, but there are two ribbon cables connecting the halves. You need to disconnect these cables before preceding.

Step 4 – Removing the trackball

There are three screws fixing the trackball to the top of the mouse. Once these screws are removed. you are free to take out the trackball assembly.

Step 5 – Separating the trackball assembly


You can use a screwdriver to remove the white plastic cover for the assembly. The rollers and trackball are quite small, so take care not to drop any of the components.

You are now free to remove any buildup from the rollers and around the assembly.

A Universe in Fireworks

A Universe in Fireworks, originally uploaded by johnflan.

Monitor the evolution of a webpage with wkhtmltoimage, bash and cron

After seeing the 37signals.com homepage evolution blog post published last week, I thought it would be interesting to record the evolution of some of my own sites. For this project I used wkhtmltoimage which is a fork of wkhtmltopdf.

wkhtmltoimage runs on the console and renders either a jpg or png of the page. I have limited this to 1000 pixels vertically in order to keep the file sizes down.

Below is the bash script I created to read a list of sites from a file and save them into a directory which is named after the site, with each image been titled with the date and time.


#!/bin/sh

FILENAME="sites.txt"

while read URL; do
    #generate the current date + time
    DATE=`date +%d_%m_%y_%H%M`
    OPTIONS="--height 1000 --crop-h 1000 --quality 80"

    #if the directory does not exist create it
    if [ ! -d "$URL" ]; then
        mkdir "$URL"
    fi

    ./wkhtmltoimage-amd64 $OPTIONS http://$URL ./$URL/$DATE.png

done < "$FILENAME"

Fractal terrain generation

Recently I became aware of how fractals are used in random terrain generation which is historically used to generate realistic looking backgrounds on the fly, particularly in older games. Below is a video example of such a terrain.

Generating Random Fractal Terrain – Paul’s article is a little old but walks through the algorithms demonstrating their results in a well written piece.

A real social network

What if… your social network was not defined by your on-line activity, but was generated from the people you meet daily, taking into account how regularly you meet, the time of day, location and duration.

As surprising as it sounds the technology for a network of this type exists today, not in some shady lab run by Google, Facebook or even Microsoft, but in our pockets.

Recently I toyed a little with the Facebook Open Graph, and since then I have been considering how these Object ID’s map to the real world. Everything in the Open Graph is an object in the software development sense and Object ID’s are used to represent individual people, businesses, events, places and activities.

So how can we exchange these ID’s quickly and invisibly?

A number of methods exist today to integrate this functionality into say the Android or iPhone Facebook applications. For example a handset could broadcast a Wi-Fi SSID of “FB-ID:XXXXXXXX” where X’s would represent the users Facebook Object ID. Bluetooth radios could also be utilised to transmit and receive this information, offering an advantage of a shorter range (10m or so) enabling the software to understand that this person was in close physical proximity.

Concurrently, your device on say a thirty-second interval could perform a scan looking for other devices broadcasting an SSID with a “FB-ID:” prefix. With this data the software can trivially discover if the detected Object ID’s around you resolve to existing Facebook friends. If they turnout to be valid object references then record the duration, the location (from GPS) and time of the meeting, and if the Object ID’s dont match existing friends store them for later analysis.

We can build systems that can dynamically partition these aquantances into categories like close friends, co-workers, business contacts and others. And importantly, manage how these relationships change over time  representing your current real life social network.

Whether or not current wireless technologies are up to this task or if users would be happy with this level of invasion remain to be seen, but I am confident that this is how the Facebook of tomorrow will function.

Thoughts or comments are appreciated.