How to draw a Dartboard using HTML’s Canvas

This post will cover the steps required to draw a traditional Dartboard using HTML5’s canvas.  The final product produces the following rendered board.

Dartboard drawn using HTML5’s canvas

To tackle this task one’s thought process was to picture how one would draw a dartboard using layers.  In theory you would start by drawing the black circle that forms the base of the board.  Followed by the alternating black and while pie sections.  The double and treble arcs would then be placed accordingly, followed by the outer-bull and bulls-eye circles.  And finally, the wire-works between the pie sections and lettering on the outer ring.

Continue reading “How to draw a Dartboard using HTML’s Canvas”


Tip #2 Web development tips and tricks

Tip #2 in this series touches on the topic of security.  With the latest heartbleed vulnerability within OpenSSL hitting the headlines security it currently at the forefront.  I think it is fair to say that security is not a priority for most web developers: for some it is not even on the radar.  The problem is, that it is way, way too easy, to roll-out a site for a new project, get paid and move on. But, what happens to the site a week, month or a year down the line?  Worse case scenario is the site gets hacked.  Why? Because, it is not being kept up-to-date with the latest security patches and your web developer has moved on.

The simple solution is to keep you platform up-to-date.  Whether it Magento, Symfony, WordPress or Joomla.  It needs to be kept current.  If you were offered a way to improve the security of your house would you take it?  Of course you would.  The same should apply to your website.  Security vulnerabilities are discovered all the time. We should give the framework vendors credit here.  They issue security patches with a high level of speed and efficiency.  The problem you face is getting that security patch installed on your website.  I’d suggest striking a deal with your web designer/agency so they are responsible.  Of course they would expected some recompense for this, but, it shouldn’t be a lot.  Any web designer/agency who will not agree to this are obviously not a good choice to begin with.  Security first!

Responsive Web Design

Responsive Design does not equal Mobile Optimised

2013 Responsive Design really exploded.  It seems to have past the test of time and is here to say. Yes, it causes web developers a little more of a headache than a non-responsive site; however, the advantages it brings are well worth reaping.  With the ever increasing number of mobile devices it is hard to ignore responsive design.
Continue reading “Responsive Design does not equal Mobile Optimised”

JavaScript: A private member variable design pattern

JavaScript does not include some of the common features of a class based language like Java or C++. Simple concepts such as private member variables are not available via in-built syntax. This can result in the global scope becoming littered with variables leading to name conflicts or variable corruption.
Continue reading “JavaScript: A private member variable design pattern”

Security: the Good, the Bad and the Ugly

In the physical world everyone applies basic security principles such as closing and locking doors when leaving their home.  We are, in the most, security conscious and the majority of us wouldn’t knock on the door of a con man and start a conversation.  It’s also true we have a good understanding of what  makes our world safe, such as fitting a car alarm, or, carrying a personal safety alarm.  In the digital world we seem to loose these basic instincts and brazenly click link after link, trusting that we’ll end up in a safe place.  Unfortunately, many innocent looking websites are acting for the forces of evil and it is not always obvious this is the case. Continue reading “Security: the Good, the Bad and the Ugly”

Eclipse, Java and a Rest API – An introduction

In this post I want to introduce a few real world tools and programming examples to anyone who is fed up with the hundred-and-one ‘Hello World’ examples.  More often than not, tutorials have little substance and leave students feeling that they want more.  My goal is to introduce several hot-industry topics which could help beginners on the path to becoming a software programmer. Continue reading “Eclipse, Java and a Rest API – An introduction”

Should you fear QR Codes?

QR Code
Would you scan it?

Quick Response (QR) Codes allow you to scan a square image which resembles a bar-code to open web pages on a compatible device.  This means retailers can direct you to their websites without you having to type a long URL.  The trend to include QR codes on advertisements within magazines is pretty standard. Read more


Software Disconnect

The other day I attended a half-day (three hour) seminar on Practical Project Management. Although the seminar was very good the events of the day surrounding the seminar made me shake my head in disbelief. The disbelief came from my tendency to analyse and pick fault with computer systems: I am a computer programmer after all! Read more

BIOS Problems

BIOS gremlins

After fifteen years in the IT industry I find I’m always learning.  A year ago I was asked by a friend to look at his laptop as it would no longer power on.  Our course I accepted and I started to investigate.  The laptop was only three weeks out of warranty and as described did not work.  On powering the unit on the power LED lit, an internal fan spun and then nothing!  No beeps, nothing on the screen, and no clue to what could be the cause of the problem.  Screw driver at the ready I swung into action.  I removed the memory, wireless card, DVD-drive, battery and anything else that moved.  The laptop still would not function.  Thus, I assume the problem must be with the motherboard.  So, I told my friend the bad news and reassembled the laptop and place it in a draw.

Last week, I opened the draw for the first time in ages and spotted the laptop.  The demon’s in me could not resist giving it another go.  To my surprise the the laptop booted!  A week or two before this, I had fixed a PC with a similar problem by popping the CMOS battery.  And, before that I’d had to re-flash the BIOS on my own PC after it became corrupted.  Therefore, I can only assume the gremlins in my friends laptop were related to the BIOS, as when I powered it on I received a message from the BIOS that the factory defaults would be loaded and the time needed setting.  I can only conclude the problem was BIOS related.

Whenever I attempt to diagnose a computer fault in the future I’m always going to remove the BIOS battery: you never know it might just work!