## Simple fractional odds conversion app..

I was never very good at understanding gambling odds until I had to run a book for our annual golf trip last year (and had to learn by being thrown in the deep end!). Everything you need to know about odds/gambling/book making/probability can be found in these three articles:

Requires a little bit of study but it’s worth it!

However, I still find fractional odds confusing and too difficult to process in my head (especially when being discussed in a pub!), so I wrote a very trivial mobile app that lists common fractional odds and their decimal equivalent (and associated probability). So if someone drunkenly offers you odds of 11/8 on something, you can do a quick lookup to see that 13/8 is 2.38 in decimal odds (i.e. you get back your money multiplied by 2.38), and also that 13/8 has an implied probability of 42.02% (i.e. the chance of this happening). I hope this saves me a fortune

You can browse to it on your phone here (and make a shortcut to it from your phones desktop for quick pub access). If you have an Android phone you can also download the app to your phones sd card from here and install it directly using an Android App Installer (see this article for instructions).

Also, this app was written using ‘Mobl’, see www.mobl-lang.org. The source .mobl file for it is on GitHub here. The HTML5 that Mobl generates from this file can be found here.

## Exiv2 native extension for Node.js

I’ve been dabbling a bit recently in writing native extensions for node.js, specifically, I wanted to use exiv2 from within Node. Exiv2 is a fantasic tool for reading and writing Exif (and IPCT/XMP) metadata to/from photos, see Wikipedia or exif.org for more info. The ability to manipulate Exif data in my photos is just a small part of a bigger pet project I’ve been working on, which uses Node..

Rather than launch the exiv2 process from within Node (messy), I had a go at writing a native C++ extension that would use the exiv2 library to do the reading/writing. Additionally, this processing happens on a background thread, so its asynchronous when used from within Node itself (in keeping with the non-blocking Node way of doing things).

The result is here on GitHub: https://github.com/dberesford/exiv2node. See the README for usage, etc. Doesn’t cover all of exiv2′s functionality, but can be easily extended if necessary.

I also learned quite a lot about Node & V8 in the process, the ability to add easily add asynchronous extensions like this is a really awesome feature of Node. Some links I found useful for developing native Node extensions:

Finally, many thanks to everyone behind both Node and Exiv2.

## Windows build of ZeroMQ and C# bindings..

Took a look at ZeroMQ this evening and as its a source only distribution, I thought I’d share my compiled windows library binaries and ‘hello world’ projects. (Note you can also get the library binaries through NuGet as described here if you wish).

The following zip file contains:

• A build of zeromq library, version 2.0.10, built with Visual Studio 2008
• A build of the C# ‘clrzmq2‘ bindings (Version 2), also built with Visual Studio 2008 (not 2010, which version 2 is targeted for)
• Visual Studio 2008 C# Solution containing the ZeroMQ ‘Hello World’ C# client and server demo applications, as documented in the ZeroMQ Guide.

Congrats to all everyone involved in ZeroMQ, very impressed so far.

hwclient and hwserver in action

## Our unusual unit testing..

We’re currently developing an application for the Ingenico iCT 220/250 Telium terminals. Nifty little devices, ARM9, Linux, GNU C with an Eclipse based development environment.

It’s pretty bare bones from a development perspective however, so the first thing we developed was a unit test framework (pretty hard to do TDD without one!). Here it is in action:

Ingenico iCT 220

## DIY Burglar Alarm

Not that I have much faith in burglar alarms (having a dog is apparently more of a deterrent for thieves) but we were fast becoming the only house in our small estate that didn’t have one. I got a quote to have one installed but thought it was a bit on the high side (to put it politely), given that the alarm units themselves don’t cost all that much (and there’s also not really *that* much to them . So I went down the DIY route.

If you’re thinking of doing the same (or getting one put installed for you for that matter), first figure out what your requirements are, i.e. broadly speaking, do you want:
– wired or wireless alarm (probably depends on if your house is already wired for an alarm)
– with or without auto-dialer (i.e. do you want it to contact you or not)
– how many door contacts and IR detectors you need

Like securing anything, the more secure you make it the greater the costs involved, and this is particularly true when it comes to figuring how many sensors you need to secure your house to a level that you (and your pocket) are happy with. E.g. for our house, I went with a wireless alarm with an auto-dialer, contacts for all the external doors and enough IR detectors to protect the main downstairs areas and the upstairs landing.

So product wise, I eventually went with a Friedland Response alarm. I got the base SA5 package with the few additional sensors I wanted and an additional remote control. The main reason I went with Response is because they have their instruction manuals all online here, so you know in advance how it all fits together and whats involved in installing it. (When also get a really handy DVD when you buy the kit; its a pity they don’t have this online too as its a better illustration of what’s involved in installing each component).

After a bit of shopping around, I found that Amazon is cheapest for an SK5 kit, however (and rather annoyingly) they don’t deliver to Ireland (apparently they don’t/can’t fly batteries across the pond for security issues – don’t know if this is actually true or not). I also found the the local B&Q are selling an SA5 kit for €380, that’s quite a paddy tax guys! There also wasn’t much available on ebay at the time (although there are quite a few generic looking wireless alarms for sale if you want to chance a cheaper kit). So in the end I bought it from the Response website themselves, they do deliver to Ireland if you ring them up and ask them to courier it (costs an extra £11.50).

Installation wise it all went quite smooth (I’ve had much harder self assembly jobs!), but I did take my time at it and it’s always fun to get the drill out. You definitely don’t need to be an electrician to put in a wireless alarm. Configuring everything from the control panel (i.e. the zones, numbers to dial, etc) is just a case of following the steps in the manual. The one thing I was a bit worried about before hand was how to drill the door contacts in to the patio door, but thankfully they optionally come with sticky bits so installing them only takes a minute, result!

So in all it’s worked out very well all told. If you are considering the DIY route and have any questions, leave a comment below or drop me a twitter“>tweet.

## ‘New-WebServiceProxy’ cmdlet in PowerShell 2.0

I’ve been using PowerShell quite a bit of late, bit of a learning curve but when you get into it it really is amazingly powerful (the ability to pipe objects (and not just text) is a game changer). Hence the name I suppose!
In the last while, I’ve been using PowerShell 2.0 in Windows 7, and with it the excellent ‘New-WebServiceProxy’ cmdlet. In a nutshell, this allows you to use Web Services API’s directly from the shell, which I’m finding incredibly productive.
Here’s a short example of using a relatively non-trivial Web Service: the BetFair API.
\$bfExchange = New-WebServiceProxy -uri
https://api.betfair.com/exchange/v5/BFExchangeService.wsdl -Namespace
BFE
\$bfGlobal = New-WebServiceProxy -uri
https://api.betfair.com/global/v3/BFGlobalService.wsdl -Namespace BFG
# Get some Betfair Events, happening in the next 3 hours
\$marketsReq = New-Object BFE.GetAllMarketsReq
\$marketsReq.fromDate = Get-Date
# Invoke the call
\$marketResp = \$bfExchange.getAllMarkets(\$marketsReq)
# The format of the Markets, etc, is all documented here:
# http://bdphelp.betfair.com/API6/6.0/RefGuide/wwhelp/wwhimpl/js/html/wwhelp.htm
foreach(\$market in \$marketResp.marketData.Split(‘:’)) {
\$data = \$market.Split(‘~’)
Write-Host “Market: ” \$data[1] “Path: ” \$data[5]
}
Although trivial, its a good example of ‘feeling your way around’ an external Web Service without having to write any real code (i.e. fire up VSTS).
If your thinking of trying out powershell, give PowerGui a look http://www.powergui.org, and also I find Console to be way better than the default Windows cmd. I’ve also plenty of interesting Powershell links bookmarked on delicious: http://delicious.com/dberesford/powershell

I’ve been using PowerShell quite a bit of late, bit of a small learning curve but when you get into it it really is amazingly powerful (hence the name I suppose!). The ability to pipe objects, and not just text, makes it excellent ‘glue’ for which to bind things together (e.g. data in SQL Server, Excel, Email, your own .NET components/services, etc).

In the last while, I’ve been using PowerShell 2.0 in Windows 7, and with it the excellent ‘New-WebServiceProxy’ cmdlet. This allows you to use Web Service API’s directly from the shell, which I’m finding incredibly useful. (You could do this in Powershel 1.0 but it was a bit more involved)

Here’s a short example of using a relatively non-trivial Web Service, the BetFair API:

`#short script to log on to Betfair and grab some upcoming events`

`\$bfExchange = New-WebServiceProxy -uri https://api.betfair.com/exchange/v5/BFExchangeService.wsdl -Namespace BFE`

`\$bfGlobal = New-WebServiceProxy -uri https://api.betfair.com/global/v3/BFGlobalService.wsdl -Namespace BFG`

``` \$loginReq = new-object BFG.LoginReq \$loginReq.username = <your betfair username> \$loginReq.password = <your betfair password> \$loginReq.productId = 82 \$loginReq.vendorSoftwareId = 0 \$loginResp = \$bfGlobal.login(\$loginReq) # Get some Betfair Events, happening in the next 3 hours \$marketsReq = New-Object BFE.GetAllMarketsReq \$marketsReq.header = New-Object BFE.APIRequestHeader \$marketsReq.header.sessionToken = \$loginResp.header.sessionToken \$marketsReq.fromDate = Get-Date \$marketsReq.toDate = (Get-Date).AddHours(3) # Invoke the call \$marketResp = \$bfExchange.getAllMarkets(\$marketsReq) # The format of the Markets, etc, is all documented here: # http://bdphelp.betfair.com/API6/6.0/RefGuide/wwhelp/wwhimpl/js/html/wwhelp.htm foreach(\$market in \$marketResp.marketData.Split(':')) { \$data = \$market.Split('~') Write-Host "Market: " \$data[1] "Path: " \$data[5] } ```

Although trivial, its a good example of ‘feeling your way around’ an external Web Service without having to write any real code (i.e. fire up VSTS).

If your thinking of trying out powershell, give PowerGui a look, and I also  find Console to be way better than the default Windows cmd. I’ve also plenty of Powershell links bookmarked on delicious.

## Windows build of ‘PJSUA’

I was doing a bit of research into SIP development and I struggled to find to pre-built binary for PJSUA (a sample console application for the excellent PJSIP) for windows.

There are quite a few steps involved in building PJSIP on windows, so if anyone is looking for a pre-built binary for PJSUA for windows, here it is. It’s built with MS SDK 7, and version 2914 of the pjsip trunk.

Although it is billed as a reference application, PJSUA is really quite comprehensive in terms of functionality, and works very well when run against my Blueface account.

Many thanks to everyone behind the PJSIP project, I hope to use it in earnest in the near future.

## Open week in Tramore Tennis Club

It’s Senior Open Week in the local Tennis Club and for the first time ever (yes, this is 2009!) the fixtures and results for each day are all available on the website: http://www.tramoretennis.com(Disclaimer: I host the website, and my better half sits in on committee meetings and keeps the site updated)

The results/fixture management is done using a copy of Tournament Software which is used in the club office by the hard working people who run Open Week, and the updates are published to the Tournament Software web site every evening. Works quite well, previously all this information was just posted on the club notice board. So far we’ve had a great reaction to it and hits on the website are way up (from the usual dribble of visits it gets).

Senior Open Week is the highlight of the year in the club, there are over 200 entrants – mainly from the surrounding Waterford clubs but also a few from further a field; Cork, Kilkenny, and even Dublin!  I usually make a point of seeing the ‘A’ finals (which will be on next Sunday, August 9′th) each year where the standard of tennis is just incredible to watch. Good prize money for the winners I believe, and the cakes and sandwiches are usually top notch too!

## Bealtaine Festival of Outdoor Science 2009

CALMAST are running the Bealtaine Festival of Outdoor Science from May 17 – 24th with an incredible line up of outdoor activites for school kids and the general public in the local Tramore and surrounding areas (with the majority of the outdoor events happening along the Copper Coast), see the full schedule here.

These two in particular grabbed my attention:

 Saturday 23rd May For Family groups. General public Event Mosaic on Annestown Beach Venue Annestown Beach Co. Waterford Build a giant Mosaic on Annestown using natural materials found on beach with Artist Sinead Driver and geologist Tina Keating of the Copper Coast Geopark The Copper Coast Geopark runs between Tramore and Dungarvan, in Co. Waterford and comprises 25 km of beautiful coastline. But did you know that this part of Ireland was once close to the South Pole, exposed to violent volcanic eruptions and earthquakes? Did you know that the area was once a desert, dissected by large rivers, long before the landscape was gouged by glaciers? Here’s your chance to find out. The Copper Coast Geopark has it all, 460 million years of Earth history recorded in the rocks, explained on panels, brochures or during school visits and excursions throughout the year and guided tours in the summer.”

Woodlands and Uplands – 2 short walks in the Comeraghs

The Crough Walk is a 1.5km woodland walk along the banks of the Mahon Stream, where we plan to do some nature-spotting – mammal-tracking, tree-naming, stream-dipping and bird calls. We will then go to the Mahon Falls Walk to see some upland habitat and blanket bog and the special flora associated with it.

Date: Sunday 24th May 2009

Venue: Mahonbridge / Comeragh Mountains

The Comeragh Mountains form part of the largest SAC (Special Area of Conservation) in Co. Waterford, protected under law for important habitats. May 24th is Wildwatch Day, when events take place all around the country for people to get out, experience the wild and learn about the nature on their own doorstep. The Irish Wildlife Trust volunteers organise regular outings to places with interesting natural history:

Time: 2 pm

Duration: 2 hours approx

Age group: All Ages Welcome. Children under supervision

Meeting point if different to venue: Mahonbridge Village. There is limited parking at the walk start, so car-pooling is encouraged

To Book: Log onto www.livingearth.ie

Special requirements for participants: The walk has been well finished by the Comeragh Community Group/Coillte and is suitable for buggies/wheels. However, it is an uphill course for the first half.

Directions to venue: From Waterford, take the N25. Turn off just past Kilmacthomas, for Mahonbridge. Follow signs for 3km approx. until you arrive in the village. The walk start is just 50m away, through village on the Comeragh Drive. Mahonbridge is located on the main Dungarvan to Carrick-on-Suir Road, about 16km from Dungarvan.

Plenty there to interest everyone, again see the full event list here: http://www.livingearth.ie/Full%20Events%20Listing. I think I might skip the ‘cooking seaweed’ event myself however

## April 2009 Budget Calculator

Myself and John have released a Budget Calculator for this emergency 2009 Budget which you can run here.

Your not likely to find good news, so please don’t shoot the messenger! By the way, RedOakTaxRefunds is the relaunched & rebranded version of Tax123.ie.

Plenty of disquiet around the country over this budget, a lot of unhappy campers (myself included!):