2018 and 2019 staff holiday Excel planner and one page Excel calendar

January 17th, 2017

It is only January 2017, but I’ve already had my first request for a 2018 staff holiday calendars (I know some people have holiday years that overlap calendar years). So here are the staff holiday planning spreadsheets for both 2018 and 2019. Also I’ve uploaded the 2018/2019 one page excel calendars.

Staff holiday planner

First up are my free spreadsheet that can help you track staff leave/holiday, training, sick days, maternity/paternity, offsite days, etc.

2018 2019 staff holiday planner

They come set up with formulas that can automatically track the total number of holiday days remaining (columns C&D) for each employee. If you don’t want to use this simply delete those columns.

The default formula subtracts 1 or 0.5 from the remaining holiday if the employee cells contain the words ‘holiday’ or ‘half. You can copy and paste (ctrl-c, ctrl-v) the coloured tags (holiday, half, training, etc) from the top left into the staff planning cells and the totals are automatically updated.

Note that the formulas measure the tags from the very start column (which is the year before) to the very end column (which is the year after). If you want it to be fixed to the calendar year then you’ll have to tweak the formulas.

See the old 2012 planner for some customisation examples.

The week numbers are based on ISO 8601, and the top and left parts of the staff planner are frozen so you can always see them – this makes navigation easy. You can download them from here:

Download 2018 staff holiday planner spreadsheet – 12kb
Download 2019 staff holiday planner spreadsheet – 12kb

You’ll need to use a relatively modern spreadsheet package such as Excel 2007 or LibreOffice (which is free) to view the whole calendar. This is because the staff holiday planner has over 365 columns and some old spreadsheet package such as Excel 97 don’t support that many columns. One workaround if you are forced to use Excel 97 at work is for you to use LibreOffice at home to split the spreadsheet into 2, one part for H1, and one for H2.

One page Excel calendar

In these Excel spreadsheets you’ll get the whole year on a single page. You should be able to print it onto a single sheet of A4 paper if you wanted to.

2018 2019 one page excel calendar

You can load the XLS using any version of Microsoft Excel from 97 onwards, or using the free OpenOffice or LibreOffice.

2018 one page Excel calendar – 4kb
2019 one page Excel calendar – 4kb

The one page Excel spreadsheet calendars and the staff holiday planners are zipped up. If your OS won’t automatically open the zip files you can download the free 7-Zip to unzip them for you.

2016 and 2017 staff holiday Excel planner and one page Excel calendar

August 30th, 2015

The requests for the 2016 excel staff holiday planning spreadsheet have been coming in so I have made it as well 2017 one. Also I’ve uploaded the 2016/2017 one page excel calendars.

Staff holiday planner

First up here are my free spreadsheet that can help you track staff leave/holiday, training, sick days, offsite days, etc.

2016 2017 staff holiday planner

They come set up with formulas that can automatically track the total number of holiday days remaining (columns C&D) for each employee. If you don’t want to use this simply delete those columns.
The default formula subtracts 1 or 0.5 from the remaining holiday if the employee cells contain the words ‘holiday’ or ‘half. You can copy and paste (ctrl-c, ctrl-v) the coloured tags (holiday, half, training, etc) from the top left into the staff planning cells and the totals are automatically updated.

Note that the formulas measure the tags from the very start column (which is the year before) to the very end column (which is the year after).

See the 2012 planner for some customisation examples.

The week numbers are based on ISO 8601, and the top and left parts of the staff planner are frozen so you can always see them – this makes navigation easy. Here is the download link:

Download 2016 staff holiday planner spreadsheet – 22kb
Download 2017 staff holiday planner spreadsheet – 22kb

As the staff holiday planner has over 365 columns you won’t see the whole year if you open it with an old spreadsheet package such as Excel 97. You’ll need to use a more modern spreadsheet package such as Excel 2007 or LibreOffice (which is free). One workaround if you are forced to use Excel 97 at work is for you to use LibreOffice at home to split the spreadsheet into 2, one part for H1, and one for H2.

One page Excel calendar

I’ve put the whole year in this one page Excel spreadsheet.
2016 2017 one page excel calendar

You should be able to load the XLS using any version of Microsoft Excel from 97 onwards, or using the free OpenOffice or LibreOffice.

2016 one page Excel calendar – 13kb
2017 one page Excel calendar – 13kb

The one page Excel spreadsheet calendars and the staff holiday planners are zipped up. If your OS won’t automatically open the zip files you can download the free 7-Zip to unzip them for you.

High speed M&M sorting machine

December 22nd, 2014

M&M sorting machines are a popular project for people who like combining electronics, programming and machine building. I decided I’d try to make my own version but with a different approach to the majority of existing M&M (or Skittles / Smarties!) sorting machines out there.

Most of them send a single M&M down a chute to a simple colour sensor where the colour sensor will then take a second or two to figure out the colour. A servo motor will then rotate a chute that will direct the M&M into the correct pot.

My approach sends M&Ms down a chute to start with. But I don’t stop the M&M for colour recognition. Instead I use an iPhone to capture the colour of the M&M as it is in freefall. As it is still falling the iPhone talks to a Bluetooth module attached to an Arduino and that fires off the correct electro magnet controlled gate. This sends the M&M into the correct pot. Even though this is just a rough prototype it is reasonably fast because the colour recognition and path that the M&M takes down the chute is decided and determined whilst the M&M is moving under gravity. Here’s a video of the prototype:

mandm sorting machine front 12

Initial M&M sorting ideas

I’d been thinking about making an M&M sorter for a while as a fun project so I could play around with an Arduino. But I didn’t want to stop the M&M for colour recognition or use a servo motor to direct the M&M as these approaches seemed slow to me.

It was this video of a high speed coin counting machine that got me thinking about some kind of binary gate that would deflect the M&Ms into the correct place. https://www.youtube.com/watch?v=2GGKYHf8DQo. What they’ve done is really cool and impressive – the coins zoom through a sensor faster than you can see, and are nudged down the correct path by a pop up nodule.

M&M dispenser

Starting from the top of the machine I had to figure out how to ‘release’ the M&Ms one by one.

I did attempt to make some kind of spinning ‘thing’ that would shoot M&Ms down a tube in the style of the coin sorter video I saw. It did kind of shoot them down the tube, but mostly it sent the M&Ms flying all around my living room. I still don’t know if I’ve found them all!

The problem here was making the M&Ms come out one at a time (they often came out in bunches), and the fact that they flew out at different angles and velocities – this would lead to them bouncing around which would make it hard to predict where they were going to go next.

mandm sorting machine dispense experiment 17

I also experimented with a cylinder that the M&Ms would go into first, and then they’d fall though the holes when the holes lined up. I realised here that the amount of torque I’d need to rotate these two tubes would be too much for my motors. Plus there was still the problem of the M&Ms falling out in twos.

mandm sorting machine dispenser experiment 18

I had more success with trying to replicate this tried and tested design adopted by a number of other successful M&M sorters. The M&Ms are in the container and they drop into the holes as the holes become empty.

mandm sorting machine dispenser experiments

The trick to success is to ensure that the height of the hole that the M&M drops into is about the same height as the M&M. This ensures that only one M&M is in the hole at a time. And then as the M&M rotates and approaches the chute it goes under a covered area (like a bridge which touches the surface of the spinning disk) which ensures that when the M&M and the hole line up only the M&M in the hole can fall down.

mandm sorting machine dispenser 10

The bridge is barely visible in the photo as it is obscured by the sides – it is right at the front and is secured into place with that screw. The piece of foam board on the left perhaps helps to encourage the M&Ms into the hole but may not be necessary. I have the dispenser angled to the back so that the M&Ms fall to the edges (I want to ensure that they all go through the sorter).

Spinning the dispensor

I initially bought a 6V 500RPM motor from Amazon, and a set of motor mounts to attach the motor to the spinning disk.

I tried to decrease the speed to something sensible using a set of gears that I got from Maplin. However with my crude setup there was so much juddering that it prevented the M&Ms from falling smoothly.

mandm sorting machine motor gears 3

So I bought a 12V 80RPM high torque motor from eBay along with a motor speed controller which allowed me to direct drive the spinning disk. It was much smoother now, and this shows that simpler is often better.

mandm sorting machine motor 14

Electro magnet gates

I’d decide to try deflecting the M&Ms down the correct chute by using electro magnets to control quick reacting gates. Electro magnets can react very fast – much faster than the slow turning of a servo.

I first bough a very small low powered electro magnet – it was useless as it was so tiny it wouldn’t have been able to move anything. So I bought a bigger 12V 2A pull magnet from eBaay. This had pulling power (and goes back to its original position when the power is off because of the spring).

My first attempt was a simple ‘pull’ gate. Here the pulling of the magnet would close the gate.

mandm sorting machine slide gate 7

I tried doing this with both the magnet on the same level as the chute (above) and also below the chute (below).

mandm sorting machine chute experiments

The problem was that the magnet only pulls 1cm, and taking the diagonal into account that does not fully close the chute. It worked a lot of the time, but sometimes an M&M would slip past the gate. As I couldn’t find electro magnets with a larger pull length (one with 2-3cm would have made all this much simpler!) I went for a ‘chop’ gate instead.

As the electro magnet pulls back the gate ‘chops’ downwards by means of 3 pivot points. This design turns the small amount of electro magnet movement into something much larger which can cover the entire width of the chute diagonally.

The difficulty is figuring out the exact shape and size of the moving parts. I didn’t have any scientific way of doing this – I just experimented. First using thin cereal box cardboard as shown in the image on the right. Then using rigid plastic sheet that I bought from a hobby shop. On the left is the final design I went for. These gates react extremely fast, and make quite a bang as the plastic hits the bottom of the chute.

mandm sorting machine electro magnet gates experiment

I had to make 5 of them and here is what they were looking like when glued (using a glue gun) onto the foam board. I added a bit of black tape (which was loose at the bottom) to slightly muffle the sound.

mandm sorting machine side electro magnet gates

Colour sorting of M&Ms

I knew that I was going to use an Arduino to control the M&M sorter so it seemed natural to buy the Arduino compatible colour sensor that most of the other projects were using. The colour sensor is in the photo on the left and is the thing that the bright white light is coming from. What I discovered though using it was that the sensor is very slow. You have to individually sample the 4 colour sensors (red, green, blue and white) and then figure out the colour. This isn’t as easy as the sensors aren’t calibrated with each other, so you need to figure out the calibration first.

mandm sorting machine side arduino bluetooth

I abandoned the colour sensor as too slow (I can see why the designs that use this sensor have to stop the M&M to figure out the colour now) and decided to use an iPhone 5S camera instead. The iPhone’s camera and CPU was fast enough to film the M&M in free fall and 1) spot that there was an M&M in the field of view and 2) figure out what colour it was. The traditional cheap colour sensors available for the Arduino wouldn’t have even been able to detect that an M&M was even there as it wizzed past in freefall.

The camera is placed a bit back from the chute to give it a wider field of view. And for efficiency it is only processing the vertical strip of pixels that make up the chute. No need to process the parts of the image that the M&M will never appear in.

I bought a Bluetooth LE module for the Arduino (shown in red above) so that the iPhone could talk to the Arduino.

To make determining the colour more simple I flattened the colour palette of the video images as they came in. I made it so the software only saw the colours of the M&Ms that I was interested in seeing (so no shadows which were a big problem!) and everything else was white. It was then simply a matter of counting the number of coloured pixels, and then if the number was above a threshold sending the Bluetooth command to the Arduino.

mandm sorting machine iphone 5

Here you can see the Bluetooth board plugged into the Arduino and wired up to the relay. Wires are then heading out of the relay to the electro magnets.

mandm sorting machine back arduino 13

Putting the M&M machine together

Once the three key problems of the 1) M&M dispenser, 2) electro magnet gates and the 3) colour recognition were solved it is just a matter of putting it all together. This involved a lot of foam board and glue from a hot glue gun.

I used a sharp hobby knife to cut the foam board, and bought a cutting compass so that I could cut neat circles for the dispenser.

As I started testing various bits together I did find a few problems.

  • The M&Ms would ricochet about as they fell down the chute, sometimes ricocheting down the wrong chute before they had reached their gate. I kind-of solved this by putting the chute at an angle so the M&Ms would be ‘encouraged’ to stay on the smooth side of the chute.
  • The electro magnets could get very hot if left on. So hot in fact they could melt the glue that was holding them in place. I had to modify the software to disengage the magnets after they’d been fired (but after the M&M had hit) rather than leaving them in the engaged position.

Here’s a side view of the assembled prototype.

mandm sorting machine side 15

And here is the front view. It differs slightly from the version in the video as I extended the M&M ‘pots’ at the bottom to store more M&Ms and I added a button to turn the motor on/off at the top as well as a speed dial for the motor.

mandm sorting machine front 12

I have a small compilation of video snippets of earlier M&M sorting experiments on YouTube.

Future improvement ideas

I think there is a lot of potential for improving on this design. I think with some improvements the speed and accuracy of the M&M sorting could be better.

  • Try to get rid of the whole iPhone / Bluetooth setup. I think to do this you could try using a Raspberry Pi with a high speed (60/120FPS) capable camera directly attached. The Pi probably has the processing power to do the image processing.
  • At the moment there are three power supplies – one for the Arduino, one for the electro magnets, and one for the motor. It would be great to get everything running off a single power supply.
  • More work on the image processing – you may have noticed I wasn’t sorting brown M&Ms. They are a pain to distinguish from orange and shadow. Obviously it can be done but it would need a bit more software work and perhaps some LED lighting on the chute to reduce the effect of the shadows.
  • 3D printing of the parts – my prototype is very rough – it would be amazing to see it as a smooth 3D printed consumer unit.

Currently the gates are in a line – this causes slight timing issues – there is less time between the camera recognising the M&M colour and the first gate needing to fire than the last gate needing to fire. NES4_Life came up with the suggestion of having all the chutes arranged in circle (like a flower) and then have the chutes move into the centre at the correct time. This would mean a fairly constant time between colour recognition and firing the electro magnet which could simplify things, especially if the speeds get higher. I did a quick test of the concept (below) and I think it has potential but I haven’t figured out exactly how to do it.

mandm sorting machine flower gate experiment 24

Some of the items I bought for the M&M machine

Here a partial list of what I bought – I’ll try to add more if I remember!

Bought and used on final prototype

  • Arduino Mega kit – comes with lots of extra components to play with.
  • Extra jumper cables
  • 8 channel relay module
  • Arduino Bluetooth Low Energy (BLE)Shield – £18.05
  • Various power supplies (which I won’t give links to as the ones I got were really dodgy ones that I’m sure weren’t properly safety tested!)
  • DC 12V 2A Push Pull Type Open Frame Solenoid Electromagnet 10mm 20N 4.4LB * 5 – ~£5 each, the ones I bough are listed on eBay not but there from the same seller but are loads of other identical ones on the site
  • 12V 80RPM motor from eBay – £6.30
  • Motor mounts – for attaching the motor to the spinning dispenser disk.
  • PWM Pulse Width DC Motor Speed Control Controller Governor 6V-28V 3A – £5.59 from eBay
  • 30cm steel ruler
  • Circle cutting compass – from any good hobby shop
  • Foamboard – lots of this!
  • Plastic sheet – white for the electro magnet gates
  • Plastic sheet – clear to cover the M&M chutes and stop the M&Ms bouncing out on their way down to their designated pot.

Bought but not used on the final prototype

Other M&M / Skittles sorting projects

Here’s a list of other M&M sorting projects that I’m aware of (in alphabetical order). It is definitely worth looking at all of them to get inspiration for your own.

Lego Mindstorms M&M Sorting Machine
Lego Mindstorms NXT – The M&M Dispencer
m&m’s sorter
m&m sorter #3, take two
M&M sorter
M&M Sorter (da Vinci’s Workshop)
Skittles Sorting Machine 3
Sorting Machine – Skittles and M&M’s

And there’s even more if you search on YouTube!

2014 and 2015 Excel staff holiday planner and one page Excel calendar

December 2nd, 2013

I’ve been getting loads of requests for the 2014 versions of my staff holiday planning spreadsheet, and the one page Excel calendar. I thought it was about time I created them. And for good measure I did the 2015 version as well.

Staff holiday planner

First up here are my latest free spreadsheet that can help you track staff holidays, training, sick days and offsite days.

2014 excel staff holiday planner

They come configured with formulas that can automatically track the total number of holiday days remaining (columns C&D) for each employee. If you don’t want to use this simply delete those columns.

The default formula subtracts 1 or 0.5 from the remaining holiday if the employee cells contain the words ‘holiday’ or ‘half. You can copy and paste (ctrl-c, ctrl-v) the coloured tags (holiday, half, training, etc) from the top left into the staff planning cells and the totals are automatically updated.
It is easy to customise the formulas if you want to factor in sick days for example. See the 2012 planner for more example formulas. Note that the 2014/2015 calendar formulas count the entire row (which includes the last bit of the year before and the first bit of the year after), whereas the 2012 calendar formulas just count the 2012 year. You can adjust the formulas to suit your requirements.

As always the week numbers are based on ISO 8601, and the top and left parts of the staff planner are frozen so you can always see them – this makes navigation easy. Here is the download link:

Download 2014 staff holiday planner spreadsheet – 21kb
Download 2015 staff holiday planner spreadsheet – 21kb

As the staff holiday planner has over 365 columns you won’t see the whole year if you open it with an old spreadsheet package such as Excel 97. You’ll need to use a more modern spreadsheet package such as Excel 2007 or OpenOffice (which is free). One workaround if you are forced to use Excel 97 at work is for you to use OpenOffice at home to split the spreadsheet into 2, one part for H1, and one for H2.

One page Excel calendar

As always you get the whole year in a very simple one page Excel spreadsheet.

2014 one page excel calendar
You should be able to load the XLS using any version of Microsoft Excel from 97 onwards, or using the free OpenOffice or LibreOffice.

2014 one page Excel calendar – 13kb
2015 one page Excel calendar – 13kb

The one page Excel spreadsheet calendars and the staff holiday planners are zipped up. If your OS won’t automatically open the zip files you can download the free 7-Zip to unzip them for you.

The 2016 versions of these spreadsheets are here: https://www.reviewmylife.co.uk/blog/2015/08/30/2016-and-2017-staff-holiday-excel-planner-and-one-page-excel-calendar/.

Web Social Stats for SEO

July 14th, 2012

Web Social Stats for SEO is an iPad app I’ve written which may be useful if you run a website. It allows you to quickly see how many Twitter Tweets, Facebook Likes, and Google +1s your own pages (or your competitor’s pages) are getting.

You can add pages by clicking the ‘+’ button and typing in the full web address, or by browsing to the pages you want and then adding them.

You can either add the original URL that you typed in, or you can add the URL which is currently shown on screen.

web social stats seo iphone app 1

Retults are shown in a table with one social service per column. The columns can be sorted in ascending or descending order.

The results are stored so you can view them offline.

web social stats seo iphone app 2

There is a second experimental way of adding URLs. You can pass in the address of a small sitemap.xml (up to 50 URLs) and the results for each URL will be retrieved. If there are more than 50 URLs in the sitemap.xml any additional URLs will be ignored.

I may increase the number of URLs that can be downloaded from the social services using a sitemap.xml in future released. Perhaps up to 100 in the next one.


Update: This app is not currently available on the App Store.

Technical Details

In case you like knowing these things…

I’m using operation queues to download the data in the background. The social stats are parsed using the JSONKit API. Results are stored in a SQLite database accessed using the FMDB wrapper.

Batch conversion of historical foreign currency values into a native currency

June 8th, 2012

Maybe you are in the situation where you have received payments in a variety of currencies, and now you need to convert the payment values into another currency (perhaps your own native currency).

But your task is made more complicated by the fact that you need to use the exchange rate at the date the payment was received, rather than totalling up all the values in each currency and then using a single exchange rate from a specific date.

This could happen to you if for example you receive PayPal payments in a multiple currencies and want to produce a report showing how much you earnt each month. For the monthly totals to make sense you would have to have all the values in a single currency.

You could do all the conversions manually, but that would be very tedious if there are more than a few to convert. Using an Excel spreadsheet to do it for you is much more fun.

Download payment and currency data

First of all I downloaded my transaction history from PayPal. Here I’ve set it to download a year’s worth of data.

currency conversion by date 1

Then I downloaded some historical exchange rate data for the same period. I got my data from Oanda (http://www.oanda.com/currency/historical-rates/), but there are plenty of other sites offering similar data.

currency conversion by date 2

I set the ‘Currency I Want’ to be my native currency (GBP) and then used the ‘Currency I Have’ to get the currency data for each of the currencies I’ve received payments in. Which in my case is USD and EUR.

Using the spreadsheet

The spreadsheet contains some example payment data, and historical currency prices for USD and EUR so you can see how it works.

The areas that you’ll need to edit have yellow column header, and the areas with orange column headers are auto-calculated for you and shouldn’t be edited.

Download the example historical batch currency conversion spreadsheet – XLS (20kb Zip file)

Enter the payments

On the ‘Payments’ tab I entered the details of the payments received from Paypal (I filtered out any payments that I made). The data should nicely fit into the existing columns if you downloaded it as ‘Comma Deliminated – All Activity’. If your data is not from Paypal, or is in a different format you may have to re-order your columns to fit my spreadsheet.

currency conversion by date 4

The important bits to enter are the dates in column A, currency in column G, and amount in Column H.

currency conversion by date 5

You should then enter your native currency tag into cell P3. E.g. my native currency is GBP which means that I don’t want any payments received in GBP to be converted. Payments in the native currency can just be used as-is.

currency conversion by date 6

Columns L-N contain calculated values. You shouldn’t need to edit them, but you may need to copy down the formulas if you have a large list of transactions.

Enter the historical currency data

Next you should enter the historical currency data into the ‘FXRates’ tab.

currency conversion by date 3

Enter it from row 6 onwards, using a separate column for each currency. Make sure the dates for each currency match up.

Above the data in row 3 you should enter a currency tag for each currency. This tag should match the currency tag that is in column G of the ‘Payments’ sheet. E.g. you may have USD, HKD, EUR etc.

Cell A3 contains the native currency tag that you entered on the ‘Payments’ sheet, you don’t need to edit this cell.

Also don’t modify the numbers that are highlighted in orange on row 4. These are column numbers which are used to help the formulas pick the correct currency.

I use a HLOOKUP to get the column number of the currency:

=HLOOKUP(G4,FXRates!$A$3:$Z$4,2,FALSE)

And then I do a VLOOKUP to get the exchange rate. You’ll see the first condition sets the exchange rate to ‘1’ if the payment is in the native currency.

=IF(G4=$P$3,1,VLOOKUP(A4,FXRates!$A$6:$Z$10000,L4,FALSE))

Simple?

If you’d done it all correctly you should see the converted values in column N of the ‘Payments’ sheet. You can see a total in Q3.

I’d recommend you cross check a few random values to make sure that you have set the spreadsheet up correctly.

Script to produce iPhone app icons at different sizes

May 29th, 2012

The tools for writing iPhone software are really easy to use, and allow you to concentrate on the coding rather than on obscure configuration problems. But one area of iOS development that I found a little tedious whilst writing my Solar Balls game was producing Apple’s mandatory and optional icons, which need to be in a variety of sizes.

The application icons need to be generated at different sizes for the old screen resolutions, retina display resolution and for iPhone/iPad screen types. There are also other sizes you can produce for Spotlight and Settings.

The different icon sizes are described on Apple’s developer website here and here.

If you work for a big company and have access to an art department they may well manually produce optimised version of each icon. I don’t have an art department and don’t have time (or the interest!) to optimise each icon so I just wrote a very simple script to do the resizing for me.

It takes a source image and then resizes it into 8 different icons. It gives them names that fit in with Apple’s old recommended icon naming conventions.

solar balls lite icons

Icon list

57x57 Icon.png
114x114 Icon@2x.png
72x72 Icon-72.png
144x144 Icon-ipad@2x.png
29x29 Icon-Small.png
58x58 Icon-Small@2x.png
50x50 Icon-Small-50.png
100x100 Icon-Small-100.png

Usage

generateIcons.bat sourceicon [tag]
e.g.
generateIcons.bat iTunesArtwork
generateIcons.bat iTunesArtwork Lite

Or you can just drag the source image over the batch file.

If the first example the icons will be generated from your iTunesArtwork image with the names previously listed.

In the second example a tag is inserted into the name. So if the tag is ‘Lite’ then instead of Icon.png, you get IconLite.png. This can be very useful if you are using one XCode project to produce both a full and a lite version of your app.

You’ll need to have ImageMagick installed and on your path for this to work – ‘convert’ is a binary from ImageMagick.

This is a Windows batch file but you could easily convert it to a Mac OS shell script. I just happened to be using Windows at the time I was doing the icons for Solar Balls.

iPhone icon resizing script

goto :skip_functions
:makeAppIcons
	:: iPhone icon generator
	:: Details at https://www.reviewmylife.co.uk/blog/2012/05/29/script-to-produce-iphone-app-icons-at-different-sizes/
	set filename=%1
	set tag=%2
	:: icon sizes from
	:: http://developer.apple.com/library/ios/#qa/qa1686/_index.html
	:: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW1
	:: App icons
	convert %filename% -thumbnail 57x57 Icon%tag%.png
	convert %filename% -thumbnail 114x114 Icon%tag%@2x.png
	convert %filename% -thumbnail 72x72 Icon%tag%-72.png
	convert %filename% -thumbnail 144x144 Icon%tag%-ipad@2x.png
	:: Spotlight search result icons
	convert %filename% -thumbnail 29x29 Icon%tag%-Small.png
	convert %filename% -thumbnail 58x58 Icon%tag%-Small@2x.png
	convert %filename% -thumbnail 50x50 Icon%tag%-Small-50.png
	convert %filename% -thumbnail 100x100 Icon%tag%-Small-100.png
goto :EOF
:skip_functions
call :makeAppIcons %1 %2
:end

It should be very obvious how to generate any additional sizes that you might need. And you could of course use a very similar script for resizing other app images that you might need for the standard/retina/iPhone/iPad screen resolutions.

Solar Balls game for iOS

May 8th, 2012

solar balls iphone
Today I released my first game for iOS. It is called Solar Balls, and is a simple arcade game where you have to flick coloured balls into the correctly coloured target. The game has:

* 16 mission levels
* 3 bonus levels which become unlocked when your score is high enough
* An arcade mode where you just have to get the highest score possible

The aim of the game is to save the Earth from the Solar Balls. They are heading towards our planet, and the only way to prevent them from destroying our planet is to fire them into the matching targets.

Game background and technical information

I wrote this game for fun, and to learn some iOS programming. It is built on top of the Cocos2D game framework. I tried first coding it using UIKit, but it was far too slow once I had more than 5 balls on screen at once.

solar balls ios 1

Cocos2D is built on top of OpenGL and was easily fast enough to run at 60FPS on my 2G iPod Touch even with 20+ balls on screen.

I did mix in a bit of UIKit for the menu buttons, and also to construct the sprites. Cocos2D has no easy way of drawing simple anti-aliased shapes such is circles, or dotted lines. I therefore drew these offscreen with UIKit and then imported the image data into a Cocos2D sprite.

solar balls 2

The physics is coded using Box2D. Originally I wrote the ball bouncing and collision code myself, but once I started adding angles and obstacles into the level it became obvious that I really should just use a physics engine to save me a lot of pain. As Box2D is written in C++ this has the knock on consequence that any parts of the game that interface with it also have to be written in C++ instead of Objective C.

I used the Particle Designer tool to make some of the explosion particle effects.

The game sounds use the OpenAL framework for low latency, and the background sounds use the simple AVAudioPlayer. I used the Finch wrapper to simplify using OpenAL, but had to customise it to handle automatically pausing/restarting the audio when necessary (e.g. if an incoming call occurs, or the game is backgrounded).

I found that the audio was the biggest user of memory. I had to re-convert many of the samples to lower bitrates to reduce the app size. Also I found that it was best to completely unload all audio and the audio framework if the game was backgrounded. I then reloaded all the audio again if the game was brought back to the front.

I’m not an audio or sound person so I made use of free images and sound effects. For the background I was able to make use of NASA great collection of copyright free images. As an extra touch I added information about each of the images to the start screen of each level (click on the level location at the bottom to see it).

It can be time consuming to produce multiple sets of images (original iOS screen resolution / retina display / menu buttons), so I wrote a script using ImageMagick to automatically convert each source image into the correct resolutions and to give them the correct names.

The sounds all come from freesound.org. This is a great resource for free game audio, but make sure you understand the licence terms for each sample. They have several different licences in use on the site.

XCode was really easy to use, as was debugging on hardware. In fact debugging on hardware is just as easy as debugging on the simulator which certainly encourages you to continually test on the real hardware.

Update: Solar Balls is not currently available on the App Store.



Send a single fax online

April 19th, 2012

If you don’t have a fax machine and need to send a single fax you might be looking at online fax services. I was in this position and found that most online fax services are subscription based, aimed at businesses that regularly need to send and receive faxes. I only wanted to send one fax, and didn’t fancy walking to the local copy shop to do it (it probably would have been cheaper, but you have to factor in the time of travelling there as well).

I looked at a few sites but settled on FaxZero.com. They have a free fax service that will insert an advert on the fax cover page, and a paid service with no ads. The faxes are sent at a higher priority with the paid service as well. The paid service is $1.99 per fax, and you can pay using PayPal. There are no additional costs which is good if you just need to send a one-off fax.

faxzero online fax sending

You don’t need to register, you just enter your name, email, receiver’s name, fax number, and then attach an image, .doc or PDF of your fax. I attached a JPEG. I then paid my $1.99 via PayPal.

The confirm page tells you that the fax should be sent in the next 30 minutes. You also get an email with a link to the status page.

About 10 minutes later I got a confirmation email telling me that the fax had been delivered. And more importantly I heard a short time later from the recipient that the fax had been received.

faxzero online fax success

I’ve used the FaxZero service twice, and both times the fax has got through pretty quickly. I do think $1.99 is a bit expensive if you are just sending a single page, but it does work, and you could always try the free fax option if the price bothers you.

2012 – 2013 UK tax graphs for income tax and NI

April 18th, 2012

I’ve been publishing UK tax graphs since the 2008-2009 tax year. It is easy to find tax information in the official government tables, but it is very hard to find simple graphs that show that the numbers mean in simple terms which is why I make these graphs. I missed out last years graphs so this year I will include the 2011-2012 and the 2012-2013 tax years. The 2010-2011 tax year is also included for comparison.

First of all here is an overview of the overall percentage of tax paid for salaries up to £200,000. The percentage for the 2011-2012 and 2012-2013 years jump mainly because of the national insurance rate increasing from 1% to 2% for earnings above the upper earnings limit.

percent tax vs gross salary 2012 2013 2

At the more average end of the salary scale the change between the years is more affected by the increase in the personal allowance.

percent tax vs gross salary 2012 2013 1

Here is a closer look at the income tax. It shows that the changes between these years have been fairly minor. There is always a lot of talk about tax changes in the budget, but in reality things don’t change much.

income tax 2012 2013 2

income tax 2012 2013 1

The national insurance graphs show a larger change for higher earners since the 2011-2012 tax year because of the 1% rate increase.

national insurance graph 2012 2013 2

national insurance graph 2012 2013 1

And finally two charts showing the absolute change in pounds paid as tax during these two tax years. These show that taxes for average earners have been decreasing, and taxes for higher earners have been increasing.

uk tax change 1011 1112

uk tax change 1112 1213

More next year…