Got myself a new MacBook Air as the ultimate email and travelling machine but now I’ve found myself getting interested in Ruby, MySql, Memcached, Rails etc..

I had a crack at installing Rails first up but didnt have much luck.. Too many connection resets was the general error.. Network was good. Not sure WTF was going on so hit Twitter and @BarnacleBarnes hooked me up with Homebrew and RVM.

I got Homebrew intsalled pretty quick and then while searching for RVM found this gold mine..

http://portertech.ca/homebrew-rvm-awesome

Anyway.. that should get you to installed point.. Now the fun begins..


This is kinda old now but I just learned a bunch from it.. Some great stuff in there..


Today marks the first day of my research into using WebSockets for a project that will otherwise pretty much be plagued by a poor user experience if its done as a web app that relies on long polling etc.

So I feel like I’m turning to the dark side, well not quite but I am getting stuck into node.js and socket.io right now and as a Windows kid this is quite a fun experience..

Once I have built a few test projects I will reflect back but until then heres how I started.

  • Download Cygwin
  • Install Cygwin and download Node.js from Git. Follow this guide
    Update: When installing the Cygwin modules you should also grab net -> curl you will need this to install npm (which is what you use to install Socket.IO)
  • Grab Socket.IO using npm

I came across this old quote/poem thing in the bottom of a draw and thought its a great way to look at life and definitely worth sharing.. Enjoy!


Searching for a string across all of the stored procedures in a database is something that I always forget how to do and then have to quickly browse Google for..

I’m not sure why this isn’t built into the MSSQL management tools but it’s super easy and can save a bunch of time if you’re bug hunting.

    SELECT ROUTINE_NAME, ROUTINE_DEFINITION
    FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_DEFINITION LIKE '%find me please%'
    AND ROUTINE_TYPE='PROCEDURE'

Recently we put together a version of Litmos that looks and feels like a native iPad app but runs via Safari on the iPad.

We were able build the UI for this in less than a day and release it due to our implementation of the WebFormsViewEngine in .Net MVC. By creating our own custom view engine which has some sneaky browser detection build in we can offer up a custom UI for desktop browsers, iPhones or iPads etc.

I will post some code at some stage soon but for an example of what can be done in very little time at all check out this video..


Recently I had to calculate the distance between 2 GPS coordinates. Theres a fair bit of help online about how to do this but I though I would share my implementation of the Haversine method.

public double GetDistance(double latitude1, double longitude1, 
                                    double latitude2, double longitude2)
{
    double earthRadiusMiles = 3963;
    double distance = 0;

    // convert degrees to radians
    latitude1 = latitude1 * Math.PI / 180;
    longitude1 = longitude1 * Math.PI / 180;

    latitude2 = latitude2 * Math.PI / 180;
    longitude2 = longitude2 * Math.PI / 180;

    // check the points are not the same
    if (latitude1 != latitude2 && longitude1 != longitude2)
    {
        distance = Math.Sin(latitude1) * Math.Sin(latitude2)
                 + Math.Cos(latitude1) * Math.Cos(latitude2)
                 * Math.Cos(longitude2 - longitude1);

        distance = earthRadiusMiles
                    * (-1 * Math.Atan(distance / Math.Sqrt(1 - distance * distance))
                    + Math.PI / 2);
    }

    return distance;
}

This is a quick preview of the new mobile version of the Litmos LMS running some Articulate Flash content on the Google Nexus One phone.


You can log javascript errors and console messages from your Android device or emulator. To do this you first need to install the Android SDK and USB drivers and enable USB debugging on the actual device.

To check if the device is connected correctly you can run the following cmd from your Android SDK tools directory and you should see a device in the list

c:\android sdk..\tools\adb devices

You can then use the Android Debug Bridge to filter debug messages so that you only see browser related messages by running the following cmd.

c:\android sdk..\tools\adb logcat browser:V *:S

By default the log is written to stdout so you will see any Javascript errors or console.log messages etc written to the cmd window.


We’ve been working on a mobile version of Litmos using jQtouch which works super nice for iPhone but we have had a few issues getting it cranking on Android browsers.

One of the issue was due to MVC rendering views by default as application/xhtml which resulted in errors in the JQuery and jQTouch libs so we wanted to change the content type output to text/html.

After a wee bit of hunting around we found that you can set the output content type on a per view basis by changing the view page directive to include a ContentType declaration.

eg.

<%@ Page Title=”" Language=”C#” ContentType=”text/html”…..