Happenings

Magnetic Challenges

It seems that I’m not the only one challenging people this week. Mark Pilgrim is playing with fridge magnets. My entry?

The greatest person returns the shortest challenge

Seemed astute at the time.

Incidentally, this is the first time I’ve used an image on this site (in the content). Don’t know how it’ll look.

PHP Challenge #1

If you don’t know what PHP is, ignore this post and all others like it. If you do know, welcome to the VKPS PHP Scripting Challenge. Each week I’ll be asking people to create a script that solves a particular problem using the PHP scripting language. Quite simple really. It should help people think about efficient coding and improving their skills generally.

The first challenge is: Create a function that takes in two positive integers (whole numbers)and returns the greatest common divisor (GCD) of both. For those who don’t know, the GCD is the largest whole number which will divide another two integers exactly.

For example, 2 and 4 have GCD 2 (since 2 is the highest integer that divides them both exactly). 3 and 10 have GCD 1 and so forth.

So, any 2 positive integers will be passed in as parameters and your function should return an integer that is the GCD of them both. Send your functions to me at Solitude@vkps.co.uk. Easy!

Here are the rules:

  • The winner is the person who writes the shortest script that works on sample integers that I will run on it,
  • All functions must return a value,
  • All functions submitted are considered public domain and hence can be reproduced and used with or without credit to anyone by anyone (so no bitching if someone rips off your script after the challenge finishes),
  • The winning script will be archived here for prosperity and to help others,
  • New rules may be added here at any time,
  • GCD(0,0) is technically odd to define (some argue it should be 0), and hence ANY returned value for this case will be accepted (including no returned value),
  • My decision is final, but the shortest (file size) script will be the winner

Closing date is: Monday, 24th February 2003. But if a better script is submitted over time it will be archived too (just not acknowledged as winning). Have fun.

One Day Change

So, if you’re looking at my site on the day this was posted, you’ll notice a slightly different style from usual. Why? Because it’s Valentine’s Day!

The important things about this (one-day) change is the time it took to implement. If you’ve got a site covered in tables, style throughout the mark-up and/or poorly conceived class names, an overhaul can realistically take a few days. I did this change in under 5 minutes.

How? If you look at my mark-up (View->Page Source, or the equivalent in your browser), you won’t see a single reference to colours or important images. All you will see is the basic information that makes up the page. That’s a good thing!

It means I only have to go into my stylesheets and change a few numbers to get a brand new design. Expect something more extreme for Easter.

GeoURL Update

One last post for the day: GeoURL have added Glasgow to their city database so I’m now listed as being near that (rather than Edinburgh). Click the green GeoURL button on the navigation section of this site to see other sites nearby me.

I-Spy

I-Spy (starring Eddie Murpy and Owen Wilson) is another black-white buddy comedy. That says almost everything you need to know. So I’ll just say how much I hate Owen Wilson.

How did this man become an actor? He has exactly one acting style: goofy-dazed. Now that might work the first time he does it. But once you see him in at least 3 separate movies that he does the exact same “I’ve no idea what’s going on” routine, it gets painfully annoying.

His voice grates. Every word, every syllable is a burden to hear. And when he tries to talk in a “down with the kids”-stylee… urgh!

OK, I’ll drop it now.