Tuesday 5 April 2011

I've moved...

... to a Wordpress blog.

New address is http://markp3rry.wordpress.com/. You can also follow me on Twitter - @markp3rry.

Sunday 6 March 2011

A tribute to... Evil Genius

If you have never played Evil Genius here is a quick summary:
  • It's a PC game that was released by Elixir in 2004.
  • Gamespot awarded it 7.3 / 10 and commented on its style over substance and frustrating gameplay.
  • You play the part of an evil genius hellbent on taking over the world. To do so you hire an army of minions, build a base full of facilities for them and send them out across the world to enact various deeds of cunning and malice. All the while the forces of justice try to stop you by infiltration, robbery or sending in the marines.
There are three things about the design of the game that I really love. The first is the fact that you don't control your minions directly. The design of your base and the ability to switch rooms on or off influences them but each one is following its own set of pre - determined instructions. This initially causes frustration when you are under attack and you want to get twenty armed men to a trouble spot but once you get your head around it you learn that the design of your base is everything. I think it would be too easy if you could do the classic 'shift click' on a group and move them to attack a group of enemy soldiers. What you have to do is design a robust security network and ensure that your people can quickly arm themselves and respond to attacks. It's a very different way of looking at things. I recently discovered that the best way to build and defend a base is not something I would ever have come up with - there are some examples of optimal designs on YouTube that exploit the limitations of the enemy AI fully.

The second is the range of room options and minion skills. You don't get a lot of space to build in and there are a vast amount of rooms to cram in. All perform a purpose - if you scrimp on R & R for your staff then they will quickly start deserting. I really like the way it all fits neatly together and that it's easy to chop and change rooms as your needs change. One example is that you will want to keep moving your strongroom where all your cash is stored further and further towards the back of the base so that it's less likely to come under attack. Achieving this is very simple - providing the rest of the base design allows for it. Your men don't have to be told what to 'become' - you simply decide how many scientists or guards you want and they train themselves, leaving you to macro manage the whole operation.

The third is the sense of humour. It's all very tongue in cheek, taking inspiration from Austin Powers ("henchman arbitrarily twiddling knobs) and poking fun at spy legends like James Bond (SMERSH has become SMASH). A minion sent to interrogate an unwelcome guest to your island might perform a Michael Jackson routine until the poor soul can't take it any more and gives up his or her secrets. And the audio clips that play every time you complete an Act of Infamy always make me smile - especially the commentator in India who can see a traffic jam ahead caused by a sacred cow and a traffic jam behind caused by, er, his elephant. Not a million miles from Arty Pie in the Simpsons and just as silly. I have read many novels where the blurb swears blind that they are laugh at loud funny and it's not the case. Ditto video games but this one is an exception.

Evil Genius is really well thought out and great fun to play.

Why volunteer?

I read an article on the Guardian website recently that discussed volunteering and how those who volunteer are somehow playing into the hands of David Cameron and his 'big society', even though we may not necessarily agree with the man or his policies. It's typical that I can find plenty of articles on said newspaper website that discuss volunteering except the one that I want so I am unable to reference it. My dissertation advisor would have a cow. This highlights the fact that we're still not nearly as clever as we think we are when it comes to searching data but that's another story.

So why volunteer? I can only speak from personal experience here. But I can hazard a guess that all those who do volunteer at the moment - be it in a charity shop on the high street, or coaching a youth sports team or anything equally applaudable - will be a bit miffed if Mr. Cameron starts taking credit for the way in which they invest their time. I too am a volunteer because I want to be, not because I am responding to the call of the Conservative government. My motivation is probably a little more mercenary than most; I know that being able to show a future employer that I can work on interesting projects outside of my day job is a good thing. My MSc certainly shows this and so does my volunteer work with the International Thai Foundation. Maybe 90 out of 100 people applying for the same job as me can't show this on their CV's which at least gets me on the interview list. Once you're at that stage it's a bit of a lottery (one or more of the panel might not like you) but create enough chances and one will go your way.

So credit where it's due please. It was my idea to volunteer, and my efforts that got me the right volunteering opportunity putting my skills to good use (and learning some new ones too). Nothing at all to do with the Prime Minister.

Wednesday 23 February 2011

Delta change script for SQL Server

One of the things I have been working on recently (and finally cracked today) is a way of comparing two record sets and finding if anything has changed. This is handy if you want to integrate data from one system into another and need a constant feed of data. Obviously you don't want to be updating every single record every time; as soon as you get into thousands of records there's a big performance hit and it's slow.

I found this script on a website somewhere but can't remember the original source:

SELECT
refno, digit, pro_refno, par_refno,
title, forename, surname, nino, DOB, CorrelationID
FROM
tblDataOld
WHERE
CorrelationID IN(
SELECT DISTINCT
CorrelationId
FROM (
SELECT
*
FROM
tblDataOld
UNION ALL
SELECT
*
FROM
tblDataNew)
AS
xxx
GROUP BY
refno, digit, pro_refno, par_refno,
title, forename, surname, nino, DOB, correlationid
HAVING
COUNT(*) = 1)

You can see that I'm pulling data from two tables - tblDataOld and tblDataNew. The idea is that you have an out of date data set to compare against a brand new one. Replace my column names with your own and the script will show you all the rows that have a change. The correlation ID needs to be unique for each row; what I did was concatenate the first four fields together. In the dataset that I have used these are all numbers and I'm pretty certain that if you lump the four together it's unique from any other combination.

A note about the method too; originally I had three tables - Old, New and Delta. I would compare Old and New and put the changes into Delta to be processed. This does work but I found that if something happened in the job - one of the tables got truncated but not rebuilt properly - that the next time it ran it would see everything as a change and try to process all my records. As I have said above - not good. To get around this my tblDataNew is a temporary table that I'm populating for the duration of the identification process. Once I'm done I drop the table. Also, I don't use a table for the Deltas, I run the script inside an ASP.NET application and process each Delta in memory using the SqlDataReader object. I only need to store one table - tblDataOld - in my local database and I repopulate this at the end of the process so new becomes old.

It's much neater and I like the fact that it has a small footprint. If you search Google for Delta scripts you get a lot of links to applications that will identify changes for you but for something as simple as this one SQL script will suffice.

If anyone is interested in the full application let me know and I can mail you the source code; it includes all the steps for building the temporary table, processing the changes and tidying up at the end.

Saturday 19 February 2011

So you want to offer your IT skills as a volunteer?

So you want to offer your IT skills as a volunteer? Kudos to you. Here are a few things to think about. They are all based on my own experience and I hope they will help others avoid making the same mistakes I did.

1. How much time can you realistically devote?
Time is the scarcest resource of all. The internet is now chock full of open source and / or free to use software packages, programming resources and APIs. There are answers to pretty much any problem out there. Unfortunately there is only one of you, and you only have one pair of hands. It's better to invest a couple of hours a week in something that you can deliver on rather than waste a couple of hours a week on a project you won't finish because it's too big. Are your family members 'onside'? Before you tell me to mind my own business it's much easier if your family know what you are doing and are supportive.

2. What do you want to get out of volunteering?
So, what's your motivation. Volunteering shouldn't all be one way traffic - there should be something in it for you too. Have this clear from the start, and make sure the people you're volunteering with know it too. If you just want to help then great, but I saw volunteering as the chance to make my CV look more impressive than the hundred plus other people I will be competing for my next job with. One mistake I made was to start blogging about working with an organisation before I had OK'd it with them. They weren't happy at being used 'as a reference' and asked me to take all the posts down. They will tell you what their aims are - make sure you tell them what yours are too.

3. Get organised
When are you going to be able to do the work you have volunteered? If you (like me) are only going to be available in the evening and at weekends then a volunteering gig that needs you to be in someone's office at 10am once a week isn't right for you. It's also important to devote all the time you have set aside to doing what needs doing. So make sure you have all your resources (equipment, data, specifications) to hand before making a start.

4. Build a relationship
It's essential to have a good working relationship with the charity or community group that you are representing. So ditch the emailing back and forward, get on the phone, get on Skype or go and meet them face to face. Not only are you showing a more personal and professional approach you also have the opportunity to find out if you are going to be able to get along with the people you are meeting. This isn't like your day job where you're forced to interact with people you're not too keen on; it's your free time you are giving up. If your instincts tell you that it won't work then end the relationship and look for something else. And if you really like each other then you have made an important contact. To LinkedIn!

5. Keep records of what you are doing
This doesn't have to be onerous. I agreed with the charity I am working for to post text files containing updates of progress into a shared area. If you're setting up administrative passwords on applications, databases or servers don't just write them on the pad of paper next to your desk and then throw them away next time your tidy it up. Put them somewhere the organisation is going to be able to read them. This will help you in the long term - if, for some reason in the future you can't continue to volunteer then the last thing you want is being hassled for important information.

6. Enjoy it
For me, volunteering is a chance to do something I am not able to do at work. I can run my own project and make my own decisions. That for me is intellectually stimulating. Find an opportunity that is going to let you try something new, or do something a different way and use the experience for personal development. Don't do something that bores you because you won't stick at it and neither side of the volunteering arrangement profits. Have fun!

If you read this and would like any more help or advice then email me mark dot p3rry at gmail dot com.

Sunday 13 February 2011

IT4Communities

Just over a week ago I started having a conversation (via the wonders of electronic mail) with Anne Stafford. Anne is the Programme Manager for IT4Communities, an organisation that works on "Introducing Volunteer IT Professionals to Charities Needing IT Help". I have mentioned IT4Communities briefly in a recent post and was critical of the charities that advertised through it and whom I made contact with - they either ignored me or didn't follow through. The IT4Communities website and service are both excellent though - it's very easy to register and start finding people and groups that need skilled IT help.

Anne made a couple of very interesting points. The first is that there is generally a mismatch between the number of volunteers and projects for them to work on - the former is larger than the latter. I experienced this when browsing the IT4Communities database looking for volunteering opportunities. There was nothing in my geographic area (the North West of England) that I thought I could assist with and ended up writing to organisations based in Bradford and Seacroft. But this is probably to be expected. I know from working with community groups in the past that time is the most precious commodity of all and there is generally none spare to invest in training or finding someone who might be able to help them out. So engagement from volunteers is the key - I received a staggering response from one email stating that I was offering my services as a volunteer.

The second point that Anne made was about the sort of volunteer help that is out there. I have thought that a good use of my time might actually be to set up some sort of matching service that places volunteers in the Warrington area with projects that would best suit them. On this subject Anne says "companies seem keener to
respond to team challenges not skills based work". It is quite often the case that companies only have access to a limited pool of skills too and these are off limits because they're busy doing what they're employed to do. This is a shame because community groups need skills too. IT4Communities find that "SMEs are
really responsive but the larger the company the harder it is to release
staff time". As a team leader in a largish company I would agree 100% with this statement - any organisation approaching me for a 'loan' of a member of staff would be flat refused because we don't have the capacity, especially following recent budget cuts. So SMEs are the way to go - and I think the spirit of entrepreneurship and individuality that small IT companies have suit community groups best.

If you're a volunteer or a group looking for help then IT4Communities is a route you should consider following. Here's their website - and Anne is happy to answer any questions you might have.

Saturday 12 February 2011

International Thai Foundation (ITF)

I am delighted to announce the start of a working relationship with the International Thai Foundation (ITF). I was approached by John Lewis (their legal representative) shortly after I sent out my 'volunteer offering his services' mailshot back in December.

ITF is "an international not-for-profit organisation" with a clear set of objectives: "promote education, protect human rights / civil liberties and relieve poverty for the people in Thailand (including Distressed Foreign Nationals); and assist Thai people, their families and businesses integrate in England (and other countries outside of Thailand)".

I am really happy to volunteer my time to ITF, particularly in light of events such as this denial of free speech by the Thai government. My initial work has been to familiarise myself with the web hosting that ITF uses. I've installed Joomla and Wordpress onto one of the websites and can now start to get involved in the detail of what the site looks like and how we get traffic to visit it and keep coming back.