Talking to your car – with OpenXC, Android, Xamarin & F#

Virtually all vehicles today operate an internal network called the CAN bus. Different modules (or ECUs – electronic control units) in the car communicate with each other via this network (e.g. engine, transmission, dashboard, etc.). In this post I reference a CAN bus reader built with F# and Xamarin.Android based on the OpenXC platform (http://openxcplatform.com/).

Update: Also see this post.

Continue reading

FAKE Script for ClickOnce Packaging of F# Apps

ClickOnce is very useful technology for delivering applications. Applications are published to the server but run on the client. If a new version is published to the server, the clients can easily upgrade to the new version via a single click. Such applications are sometimes called ‘smart clients’ because they fall somewhere between traditional rich clients and web applications.

In this post I share a build script for packaging F# projects for ClickOnce deployment.

Continue reading

Sample Mobile Web App Presented at #mobidevday

Yesterday I attended my first MobiDevDay conference and presented a talk titled “Functional Programming for the Rich Mobile Web with F#.

The scenario for the demo’ed sample app is that a central website receives orders for flowers from all across the US. Local florists can look at the orders in their area and choose to fill the ones they can – with the help of the sample app. The app has only two screens as shown below:

Screen1 Screen2

Running sample: http://mdd.apphb.com (needs HTML5 browser and location access). Allow upto 20 seconds for the first page to load. The sample is running is on the free version of AppHarbor which probably provisions some parts on demand. The total data downloaded (including all scripts) is only 250K for the first page.

qrcode.13472867

Continue reading

Visualizing a Schedule using F# and the .Net Visualization Library

My previous post on Bin Packing described how the best fit heuristic algorithm can be used for creating job shop schedules. However, as they say, a picture is worth a thousand words so being able to visualize a schedule would be very desirable.

Schedule

Above is a Gantt chart created from a schedule of machine jobs. The sample F# script code describing how to generate such a chart is here: http://fssnip.net/hK

Best Fit Bin Packing

Many types of computational problems can be mapped to ‘bin packing’. Scheduling of jobs on a set of available machines is one such problem which is common in job shop type environments.

Here is some F# code that implements the ‘best fit’ heuristic algorithm for bin packing:

http://fssnip.net/hG

Also provided is an implementation of binary tree with duplicates for tracking remaining bin capacities:

Continue reading