by Craig on 12/18/2010
What has happened to 2010? It seams to have flown by! Its not been a bad year, but I will go on about that in another blog post
I was on WLM the other day, and one of my close friends said to me “You haven’t posted on your blog for a while… The last post was on the 12th” This slightly amazed me, do people actually read the drivel I write on here? But being in the line of work I am, I should be posting every day or so. This is something I am hoping to change in 2011, as well as a few new years resolutions I have planned. They wont work though, they never do.
Currently, I am sat on my sofa in my room watching the 10 o’clock news sipping a hot chocolate (made with milk). I am astounded about the amount of snow that has fallen over the UK, airports closing, and one airplane getting stuck taxying to its stand! But, here, in good old Boston, we have yet to see anything on par with the rest of the UK! I do like the snow, but not some of the issues it brings with it.
Anyway, I best head off, got a day full of University work tomorrow
by Craig on 12/8/2010
As 2010 draws to a close, it still ceases to amaze me that my mobile broadband is miles faster than my ADSL connection. Granted the ping is double, but even then it isn’t that bad…

I would love to have a half decent connection at home, and be able to download an TV program via iPlayer in less than 2 hours.
We can all have dreams, but here is to 2011!
P.S. I managed to get 83% on my first TMA on M150. I missed 2 questions damn it! But I have pre-registered for 2 more OU courses, one starting in Feb alongside M150 and one starting in October. Next year is going to be big education wise!
by Craig on 11/29/2010
At work today I made a continued work on the new website (for launch in Jan 2011). I thought it best to check that the site works in Internet Explorer 6-9 before continuing. I know that 6 is 10 years old, but its still being used by some of the biggest networks out there.
After establishing that it doesn’t work in 6 or 7, I decided to re-write the code. After hours of battling with elements not lining up and z-index’s not working I decided to start again, and then a hour later again. Then over dinner, I hit a milestone! I wanted to write unified code, so one works for all, but this flaw was planned from the start.
Microsoft believe that standards should be written by them, and everyone should follow suit. With the web this isn’t the way, the web industry has not followed Microsoft’s “standards” and this is why we developers/designers have so many issues making sites cross-browser compatible (this maybe is also a reason why companies refuse to upgrade, because the web app only works with Microsoft’s flawed standards).
Anyway, I decided it was time to go and have lunch. Over dinner, I thought why not make as much of the code as cross-browser compatible as possible (so the site would work in Chrome, Safari, Firefox and IE 8 and 9) then add browser specific CSS for IE6 and IE7. This is going to make the website more complicated, but at least it will gracefully degrade as the browser gets older.
For those of you interested, the browser specific code I used is:
<!--[if IE 6]>
<link rel="stylesheet" href="/_styles/css/hacks-ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="/_styles/css/hacks-ie7.css" />
<![endif]-->
by Craig on 11/27/2010
If any of you follow Apples products you may have heard that Orange UK are going to be releasing a deal with subsidized iPads on their data plans. I thought this would mean that you are going to end up paying double the cost of the iPad over the term of the contract. But this isn’t so.
I got this in an email from Orange

As you can save £330 on the initial cost of the iPad, but then have to pay £25 a month for 24 months. For 2GB of data this isn’t to bad. But what about the total cost of ownership?
The total cost of ownership of the iPad on Orange (lowest contract) is £799, £600 for the contract alone! This isn’t too bad when you think you would have paid £529 for the same iPad from Apple without data! If you was to buy the same iPad from Apple, I bet you would struggle to find Orange’s offerings for £11.25 a month (£13.25 for new customers)…
If you want to save even more, you could just get a WiFi iPad and a MiFi
That way you can use it on anything. But anyway, kudos to Orange! They might have a winner here
by Craig on 11/25/2010
Having different files for functions and classes makes maintenance a piece of pie. But how do we include the files? How do we make sure all new files get included into the site?
I know I am not alone on this, but here is my solution.
<?php
if (!(defined(‘projectName’))){
die(“Illegal Include”);
}
$root = $_SERVER['DOCUMENT_ROOT'];
$incpath = $root.’/includes/’;
// reguire the .inc.php files
foreach(glob(“$incpath*.mod.php”) as $filename){
require_once($filename);
}
// reguire the .ato.php files
foreach(glob(“$incpath*.ato.php”) as $filename){
require_once($filename);
}
?>
- The first if in the code basically checks to see if projectName has been defined. Ifit hasn’t the script exits. This basically stops any includes from other sites and pages where projectName isn’t defined.
- $root and $incpath are pretty self explanatory.
- The first foreach statement scans the $incpath for any files ending in .inc.php using requiring them once.
- The second foreach statment scans the $incpath again, and now includes any files ending in .ato.php. Because these files are included after the .mod.php they can call functions and classes that are in these files. The .ato.php is every handy for running functions on page load. For example, checking user permissions.
by Craig on 11/25/2010
As some of you will know my main language is PHP. I have been learning this language since I became interested in Web Development. I can’t remember ever sitting down and trying to decide what language to learn, for some reason PHP just seemed like the right language.
Now, I believe I am quite fluent in it. However, I am now coming across problems when applying for other jobs as they list ASP.net/ASP as a requirement. Even for Assistant/Junior positions.
Is PHP a “dying language” and should I get learning another language before its too late?
by Craig on 11/23/2010
I am currently in the process of rewriting the Endeavour Online website (the one that is in my portfolio). My vision for the site was that everything would “fade/slide in” in a iPad-esque style. This means that I will probably need the help of jQuery + plugins.
My first hurdle setting up the webcam stream. The software hasn’t changed, it basically just uploads a jpg image via ftp every 10 seconds. I used fancybox to make the pop-up and load the first image, but the problem was “How do I reload the contents, using AJAX, without closing the fancybox popup?” I already knew that I could use the $.PeriodicalUpdater() jQuery plugin, but just needed to find a way of using it inline with fancybox.
After much playing, I finally got it working, AND the webcam refresh actually stops when the fancybox window is closed.
$("#listenNow .webcam").click(function(){
$.fancybox({
'type' : 'ajax',
'href' : '/ajax/webcam.php',
'onComplete' : function(){
$.PeriodicalUpdater({
url: '/ajax/webcam.php',
method: 'GET',
minTimeout: 10000,
maxTimeout: 10000
}, function(data){
$("#fancybox-content").html(data);
});
},
'onClosed' : function(){
clearTimeout(PeriodicalTimer);
}
});
});