General

Posts that cover general aspects of programming.

#! code Logo

Adventures In FizzBuzz

29th February 2020 - 10 minutes read time

Tests for programmers in an interview process are not uncommon. For the last couple of years I have asked a quick pre-interview question to junior developers to see what sort of stuff they come up with.

As I don't want to set any developer a task that will take longer than absolutely needed I opted to set a very simple task for them. Commonly known as "FizzBuzz", this task is as follows.

"Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"."

The expected output for this would be something like this.

#! code Logo

Image Colorising In PHP

14th January 2019 - 4 minutes read time

Colorising images is fairly simple to accomplish, especially using PHP's GD library. All we need to do is load an image, create a blank image of the same size in a particular color and then merge the two images together.

In fact, we can do this entirely with the imagecopymerge() function, but creating a function to wrap all of this makes sense as well.

The following function takes an image resource (as created by imagecreatefrompng()), the red, green, and blue values of the color, and the percentage to overlay the color on top of the image. The percentage can be set to 0 for no effect and 100 to fully replace the image with the given color.

#! code Logo

BSides Manchester 2018

18th August 2018 - 8 minutes read time

For the second year running I attended BSides Manchester conference, held at the Manchester Metropolitan University Business School on Thursday 16th August. This is a technical cybersecurity conference that is organised by a dedicated team of volunteers. I was really impressed by last years conference so was really keen on attending this year.

#! code Logo

BSides Manchester 2017

8th October 2017 - 9 minutes read time

I recently attended the BSides Manchester conference, which was held at Manchester Metropolitan University Business School on 17th August 2017. This was a security and hacking conference that was free to attend, but had a very limited number of tickets available. After missing the first two releases of tickets I managed to get one from the waiting list.

After some introductions we got started with the first talk of the day, which was Dominic Chell & Vincent Ylu talking about A Year In The Red. As a non-security professional I had to Google exactly what some of the terms in this talk meant. So apparently red team refers to a security consultancy who are hired to attack a system or network. Conversely, blue team is a security team that is resident within an organisation. A funny talk with some good demonstrations of hacking attacks.

#! code Logo

Getting Started With PhoneGap And Android

4th January 2013 - 9 minutes read time

PhoneGap is a free and opensource framework for developing mobile applications. It is a great way of creating applications that work across multiple devices including iOS, Android, Blackberry, Windows and others. It works by rendering HTML pages using a browser, which means that you can create applications using just HTML and JavaScript. It also allows you to interact with elements of the phone like the camera and accelerometer through JavaScript using a simple API.

I recently set about trying to use this system to create an application, and as I have an Android phone I started by creating a simple Android app. The PhoneGap website has a number of getting started guides, including what software you need to get started. I found that they were a little wrong for getting started in Android. I am running OSx so the instructions here might not work for you, but they should be fine for most *nix based systems.

#! code Logo

Why I Went For A Macbook Pro

13th September 2012 - 8 minutes read time

I very recently took delivery a 15 inch MacBook Pro (my first Apple computer) and I thought I would write about my reasoning behind it. Normally, people don't tend to ask why you bought a computer, but with Apple products it seems to be different. I think I have stated my reasons to a few different people already, so I thought it would make a good blog post.

#! code Logo

LAMP And Beyond: A Review

3rd July 2012 - 5 minutes read time

Saturday 30th June saw a one off event organised by the PHPNW community called LAMP and Beyond. The idea was that it would bring together people of differing abilities with the aim of sharing skills and experience with servers, programming, source control, or whatever happened to be of interest at the time.

With 30 or so people signed up to the event we filled the top floor of MadLab in Manchester and got started (after a bit of coffee first). Taking some post-it notes we wrote down what we wanted to know about and what we could teach about onto a board and then broke off into groups where people's interest matched.

#! code Logo

User Group Meetups Are More Than The Talks

28th May 2012 - 6 minutes read time

The good thing about working in a city like Manchester is that there is an active digital community. This means that there are quite a few digital events as well as a number of communities and user groups. I have been going to (and even organising) local user groups for a while now and I always learn something or help someone out, but the groups are more than that.

I recently encountered an attitude (from more than one person) that made me think that the point of usergroup meetups was slightly lost on them. Essentially, I saw that people were taking one look at the agenda for a meetup and saying "oh, there is nothing on the agenda that interests me, so I won't be going".

#! code Logo

MoSCoW Requirements Gathering And Estimates

30th October 2011 - 7 minutes read time

Understanding what it is that the client needs is an integral part of software development. The client will usually help you out by telling you what they need the system to do. What you will generally have is a big list of the things that the system should do. Rather than explain the difference between the terms "function requirements" and "non-functional requirements" to the client, you can save time by using MoSCoW. This is an abbreviation for Must, Should, Could, Won't and can also be written as MSCW or a number of different ways. I prefer the addition of the o's as it makes it more easy to communicate the idea to clients. The idea behind MoSCoW is to go through everything that the client wants the system to do and applying one of the four terms to that feature.

#! code Logo

Ideas Of March

17th March 2011 - 12 minutes read time

This week I was pointed, somewhat ironically through Twitter, to a blog post from Chris Shiflett about how we need a blogging revival. Which is something I quite agree with as although Twitter is great for a sense of community, it is impossible to impart good technical knowledge and/or experience through 120 characters.

Blogs are a fantastic resource. I have lost count of the times that I have been stuck on a problem and after a quick bit of searching I have found a blog post from someone who had exactly the same problem, but managed to find a solution to it. I have quite a few people who have done the same thing with #! code and have posted comments on how I have helped them out, which I find really rewarding.