What does the += operator do?

It sets the value on the left to be itself plus the value on the right (for example, i+=3 is the same as i = i+3). It’s called the addition-assignment operator.

what does the the -= operator do

It sets the value on the left to be itself minus the value on the right (for example, i-=3 is the same as i = i-3). It’s called the subtraction-assignment operator.

Using a for loop, print the numbers from 0 to 5

I’ve been training for a ZCE certification, and found myself getting quite annoyed with some of the more obvious questions. One of the questions in the beginning of the test was which of the pieces of code would output the numbers 0 to 5 using a for loop. I mean, come on! I present some of my more creative and twisted ways of completing said task.

Operator precedence – what does (i=1)*i-- - --i*(i=-3)*i++ + ++i equal and why?

I was looking at some code from a number of years ago and was horrified by the amount of ‘clever code’ in there. After decoding it, I immediately rewrote it. Then I set myself a challenge. Write the dirtiest expression ever to besmirch a hard-drive, then decode it in a blog post. I present to you with the fruit of my labour.

AJAX is easy, but remember accessibility

AJAX is easy. It’s just javascript talking to your server to grab a little bit of content instead of the browser grabbing the whole thing. With this in mind, let’s get to work and build a simple AJAX application that will work with javascript turned off. We’ll do this by assuming that there is no javascript in your user’s browser, then use jQuery to change the DOM to add in the behaviours.

10 Biggest Milestones in Web Development

Net-tuts shoots and scores yet again with this interesting article about the biggest moments in history which have influenced the internet. It covers everything from Amazon to Linux, PHP to CSS. Great read!

Number to words function in PHP

You know those ‘I have nothing to do this-afternoon so I want to waste some time making something utterly pointless’ moments? Well I get them too. Fortunately however, it turns out that my moment of inspiration led to a very useful script to turn ’123′ into ‘One hundred and twenty three’. Bargain!

Intelligent objects

Please note!! I have shamelessly stolen this article from my old and (even if I do say so myself) rather boring blog. So please ignore the terrible writing style! I’ll rewrite this article in the future, but until then, I present you with version 1.0 Anyone who has worked with the PHP/MySQL duo will no-doubt [...]

Singletons in PHP

Design patterns can be boring things. Especially when the language you’re using keeps changing syntax. I had a bit of trouble implementing a Singleton in PHP, and so I have written this tutorial to explain the errors of my ways.

Me on the intertubes

It wouldn't be right to have a web site, be a nerd, and not take this opportunity for a bit of shameless pluggery.

If you like all these weird and magic internet page things, you should try Coaster Nerd, Oxford Bloggers or, if you'd really like some unexplainable sourcery, is it the weekend yet.

Also you should follow me on Twitter ;)

Where to find me

I can be found fairly regularly at Oxford Geek Nights, OxTuttle and other general nerding out activities in and around Oxford.

I am also often found in my natural habitat which is anywhere that you can find an adreneline machine. I frequent English theme parks more often than is healthy, and take trips abroad to sample foreign rides.

From the aviary

Was having a decidedly crap day of development. Just got much better. It's nice when things go your way. #win 1 day ago

Subscribe

Slightlymore Posts RSS feed

Comedy disclaimer

These posts were written at the time of writing and may not still be accurate or reflect my opinions any more. In fact, they may not even be correct or representative at the time of writing. You see, when I write, I just write. I don't do that thing which they always told you to do at school and plan what you want to write first. Because of this, there will almost certainly be a load of typos, grammar errors and incorrect facts and references. If this makes you feel queasy, I apologise that you had to get to the bottom of the page to read this, and hope that some day, you'll learn to forgive me.

What's this site?

Slightlymore started off all too formally for my liking. In the depths of the archives, you'll find tutorials. However if you read the more recent posts, you'll find them a lot more playful and about fun and interesting stuff.

Annoyingly difficult to use tag cloud