Saturday, August 16, 2008
Cool Tools for MySQL
When I first started out I tried a whole bunch of different tools, downloaded from the web. Nothing worked the way I wanted. Some were just too buggy, others were cripple-ware. And others were just too expensive to a lowly paid developer just starting out.
MySQL talked about building a GUI, but that was years away. So what was I to do?
Well it’s obvious – build my own damn GUI. And that’s what I did. And it has served me very well. It works the way I want t to, and if there are any bugs in it, it’sMY fault!!
But for the project I’m working o at work I needed a tool the clients could use that did things my development interface doesn’t (yet).
So it was off to my mate Google to see what was out there.
And surprise, surprise, MySQL had got their GUI going. And it’s good!!!
The MySQL GUI Tools app rocks!! There is an administration interface for managing the server and databases including backup and resorting. I was really impressed with this. A full backup of the database I’m working on took about 20-30 seconds, and it’s not a small database!!
Restore took about 13 seconds!!
The Query Browser application is also quite nice. It’s not quite what I need sometimes in that the queries are displayed using tabs, so you can’t have two queries side by side. This is something I can do with my interface, and I use it a lot to run scenarios and compare results.
But despite having my own interface, which I admit I might be a bit biased towards, I still find myself using the MySQL tools more and more.
There is also an application called Workbench for doing database design. It’s also nice and easy to use and is just what I was looking for.
And what’s the best thing about all these tools? They are FREE!! For no money, no ads, no popups, no cripple-ware, just all the good stuff and none of the bad. How cool is that?
So if you use MySQL and you don’t have a copy of the MySQL GUI Tools run don’t walk to the MySQL site and get your copy today. You’ll be glad you did.
Saturday, July 26, 2008
Coming up for air...
Good because it means I’m busy doing stuff.
Bad because I was trying to be consistent in my writing.
So what have I been doing, besides working like mad?
Well, I’ve been building my own Content Management System (CMS). I got so annoyed at having to work on open source CMSs that are badly coded, difficult to modify and so full of
security holes that you could never rely on them to keep any data safe.
So I’ve built my own one with security designed in from the start. It has a different focus than the other CMSs on the web. This one is designed to be hacked. It’s for developers to use as a core for their project, knowing that it is secure, stable and standards compliant.
This weekend was the big breakthrough. I finished including the last major component and got al the code validating.
The PHP validates in Zend, the HTML validates using HTML Tidy and the CSS validates also. It was a good process to go through as it highlighted several potential bugs and I could deal with them before they ever became a problem.
I was delighted as I was going through the process at how quickly the number of errors came down, and at how easy it was to find the cause and code a solution.
It confirmed the ideas I had at the start – this should be easy to modify to suit any project.
So now I’ve got a few bugs to fix, like dealing with dates in my calendar. And finishing off a few small features that make it easier and then it will useable.
So while it has been a bit of a long hard road to get here, I’m very happy with what I’ve got to work with now, and there is a strong sense of pride in being able to build something that ‘just works’.
Check back soon if you’re interested in the progress of it. I’ll put some more info up as I get time.
Saturday, June 28, 2008
Problems with AVG 8
Last week I upgraded to version 8 of the AVG Free suite and that’s where the problems started. Things were a little slow for a bit and the whole system seems a little buggy. Then on Saturday the whole thing fell over.
Shortly after booting up my PC would seize up and would require a hard boot to get it back going again. My first suspicion was AVG, and it turned out I was right. I tried turning it off, but every time I clicked on the tray icon to try to access the program using menus, it locked my PC up, and you guessed it, I had to reboot it.
I tried to uninstall it, but that locked it up too. I also tried killing the AVG processes using Task Manager, with the same results. So I was a bit stuck. Short of deleting the folder with the program in I had limited options as I generally had about 1 – 2 minutes of operating time before the PC had to be rebooted. And that was if I didn’t touch AVG.
So I tried to stop it from stating up on a reboot.
In the Start menu I clicked on Run and typed in ‘msconfg’. This brought up the config dialog box. On the Startup tab I unchecked avgTray. Then I saved the changes and rebooted.
This time AVG didn’t start up and I was able to uninstall it, and get my PC back to good running order. Whew!
There is apparently a way to install version 8 without it giving you such a headache, but I haven’t had a go at it yet. When / if I do I’ll let you know how it goes.
Friday, June 13, 2008
Portable applications running from a USB drive
I went to Portable Apps.com and downloaded the application suite and platform. I installed everything into a folder, aptly named – USB and then tried out the various applications to see how they worked.
I was very impressed. Pretty much everything worked fine. The things that needed a bit of work were XAMPP, and Base. (I’ll explain a bit about them later.)
Then I copied the contents of the USB folder onto a 1gig USB drive. It took up about 600mb with all the extra apps I had installed. Then I plugged the drive into my laptop and away I went. All the programs worked fine. This is exactly what I was looking for!!
So what do you get? Quite a lot really.
- Firefox – web browser
- Thunderbird – email client
- Sunbird – calendar
- ClamWin – anti-virus
- Pidgin – instant messenger
- Sumatra – a PDF reader
- KeePass – a password manager
- Sudoku – game
- Mines – game
- CoolPlayer – an audio player
- OpenOfiice – an office application suite
- Writer – word processor
- Calc – spreadsheet
- Impress – presentation application (like PowerPoint)
- Draw – a drawing program
- Base – a database application like Access
I also added:
- FileZilla – FPT client
- GIMP – graphics manipulation application
- Notepad++ - text editor that does syntax highlighting
- VLC Media Player – media player for music and video
- XAMPP – a web-server suite including:
- Apache2
- MySQL5
- PHP5
As I said, for the most part the apps work great. When you plug the USB drive in, if you’ve got the autorun enabled you’ll get the usual window popping up asking you what you want to do. Running the StartPortableApps.exe should appear as the selected option. If not you can navigate to the .exe file and double click it to start the apps menu.
Then you just choose the apps you want to run from the menu. Easy really.
You can surf the web, create documents etc and save them all on the USB drive. When you get home, to work, wherever you can just plug the drive in and access all your files no problem. If you want to copy and paste them to your hard drive, that’s just a normal operation as you would from any removable drive. So there are no nasty hooks that say you can only access the files using the applications on the drive.
Ok so onto the problems I encountered, and their solutions.
Firstly Base, the database utility.
This needs a Java runtime environment which is not part of the download. But no problem. Just go to Sun.com and download the latest JRE. Then put it into the \PortableApps\OpenOfficePortable\App\Java folder and you’re sweet.
Setting up XAMPP took a bit more work.
The main problem is that when you first install it the directory paths are put in as absolute URLs. This works fine until you try to move to a different machine.
So after you install it go to the following files and change the paths as described below. Then it should work fine.
For Apache web server
\PortableApps\xampp\apache\conf\httpd.conf
All the files in the \PortableApps\xampp\apache\conf\extra folder
Find all the places where the URLs are expressed, e.g.
ServerRoot "C:/USB/PortableApps/xampp/apache"
And change it to:
ServerRoot "/PortableApps/xampp/apache"
There are quite a few of them.
This will make it insert the drive letter that corresponds to the location of the apache .exe file, effectively mapping the URLs to use the drive letter assigned to the USB drive.
PHP
Look in the php.ini file in \PortableApps\xampp\apache\bin and remove the drive letter in the URLs for importing packages etc.
MySQL – database sever
This one too uses absolute URLs in the \PortableApps\xampp\mysql\bin\my file.
The only way I could find to edit this file was to open Notepad and then drag the file into it.
As before go through and remove the drive letter.
Once you’ve done that try starting the servers using the batch files in \PortableApps\xampp
apache_start.bat to start the webserver, and apache_stop.bat to stop it.
This will inform you of any errors. If it just says Apache is starting and then seems to hang, that’s a good thing.
Open Task Manager and look under the running processes to see if Apache is listed. It will probably be listed twice. If it is in there, then it is running.
Do the same with mysql_start.bat. If it says it is running and waiting for connections then you’re good to go.
If you’ve missed a URL then it will display an error in the command window. Simply go to the file and change the URL so it does not have a drive letter specified.
Open a web browser (try using the portable Firefox) and type 127.0.0.1 or localhost into the address bar. You should get the XAMPP welcome page. Click on the phpinfo() link to see the settings for PHP. Click on the CD Collection link to check that the database is working. If you get three records displayed, then it is working fine.
If found that clicking on the XAMPP_start menu item in the Portable Apps menu sometimes seemed to take quite a while to start things up, so be a little paitent.
One other problem I encountered is if you already have Apache (or another webserver) running or you’ve got MySQL running, then the portable apps won’t work. So the solution is to make sure the other apps are not running. Check in the processes list in the Task Manager to make sure they are not running before you start your portable webserver.
The possibilities for this are endless!!
My next task is to get my MySQL Interface software (that I wrote) and port it to run in the Portable Apps environment. It should not be too difficult to do given that it is a Java app the does not use absolute URLs.
Well I hope this has been helpful. I’m off now for a well deserved glass of wine.
Sunday, June 8, 2008
XmlHttp ajax style code to call a script without reloading the page
style requests.
I’m using it more and more for all sorts of stuff. I’ve found it to be pretty bomb-proof so far. It’s been tested in Firefox and IE, and I think Safari also, and it always works.
I’d love to credit someone for it, but I have no idea where I got it from. (it was quite a long time ago)
So here’s how it works…
First of all you need the to build the object to run the request.
That’s done with the xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); bits. Depending on the browser, it makes an ActiveXObject or an new XMLHttpRequest();
Then you specify the script you want to execute. I’ve found it works best if the script is in the same folder as the calling page.
The xmlHttp.onreadystatechange = whatHappened; line specifies the function to call when the script has executed.
Note you don’t put the ‘()’ after it yet.
Then you open the connection - xmlHttp.open("POST", url, true); you can specify GET or POST to send your info into the script. I use POST pretty much all the time.
Then set up the parameter list to send to the script. It’s just like setting up the parameters to send through as GET variables – parameterName=value.
You then set up the headers to send, and then send the request.
In the whatHappened() function (which you can call whatever you want) you test for the ‘readyState’. 4 means that the script has finished executing and has returned.
Then you can do whatever you want with the returned data.
To return from a PHP script make sure you use an echo statement, not a return statement.
Because you’re using an echo the returned data is in the form of a string. You can set up the format of the string so that it is delimited, making it easy to split into variable to use in the Javascript function.
Try it yourself. You’ll find this is a handy little script to have in your arsenal.
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != "undefined") {
xmlHttp = new XMLHttpRequest();
}
// Build the URL to connect to
var url = "scriptToExecute.php";
xmlHttp.onreadystatechange = whatHappened;
// Open a connection to the server
xmlHttp.open("POST", url, true);
//get values from the form
var parameters = "parameterName=" + encodeURI( parameterValue);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", parameters.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(parameters);
return false;
}
function whatHappened(){
if(xmlHttp.readyState==4){
// do stuff
}
}
Sunday, June 1, 2008
Learning something new
Unfortunately what I had to integrate was not a standard Joomla template. It had some changed functionality and layouts etc. because the HTML and PHP are mixed up across so many different files in so many different places, it was pretty much impossible to do it the Joomla way. So I didn’t.. sort of.
But that’s not what this blog is about. If you have worked with Joomla code you will already know what a nightmare it is, and you don’t need me to tell you that trying to do anything non-standard is just like trying to get Catherine Zeta Jones to ask me out on a date – extremely difficult, but may be possible if I can just figure out how…
No, this is about learning something new.
Our front end developer, who made the templates, also changed the Javascript that generates the popups. His popups contained different information from the standard ones and presented it in a nicer way. It was also more efficient and less buggy.
Fair enough. So I slogged through shoehorning the templates into Joomla, sort of. But when it came to integrating the Javascript I was stumped. Where were the onmouseover calls?
There was no Javascript at all in the templates. But I had working copies of them so I knew it worked. In the end I had to Skype the developer and ask him how he did it.
What he had done was register events on page load, using a function call onLoad() in the Body tag to register event handlers on the various element on the page that required them. I’d not seen this done before.
But when I looked at what he had done and followed the logic of it, it made a lot of sense. All the Javascript is in the .js file, all the HTML is in the HTML file, all the CSS is in the CSS file and all the PHP is in the PHP file. With due care and consideration it would be trivially easy to change any part of the system without breaking the rest of it.
This really peaked my interest, especially since I was not enjoying working in Joomla and was looking for some way to put a silver lining in the whole miserable experience.
Now I don’t claim to be a Javascript guru, or even adept, but I do know how to write good code, and I’m always happy to learn new and better ways of doing things. That’s one of the things I really like about programming; there is always something new to learn, and there is always a better way to do what you’re doing now.
In my old job I was constantly being told not to re-invent the wheel. But that’s what we do. We look for better ways to do things. Smarter, faster, more robust, more secure… better. And it doesn’t matter where or how that knowledge comes to us, we can accept it, shape it, improve it. That’s why we are not travelling on wooden wheels with iron rims. Some smart-arse sod re-invented the wheel and put a tire on it.
I have always maintained the all learning s good learning. It’s what you do with what you’ve learnt that matters. I’m going to take a deeper look into this new way of triggering and handing events with Javascript and see what I can do with it.
So remember, just when you think you’ve got the best wheel ever invented, take a look at other people’s wheels. You might just find a better one. Or, someone else’s wheel might give you an idea which improves your wheel. And your wheel might help someone else come up with a better wheel. And that’s important. The only thing higher than learning is teaching. So learn from others and also teach others. In the end it will make for a much smoother ride for all of us.
Saturday, May 17, 2008
My new Fujifilm Finepix S100fs
But since them I’ve been without a ‘big’ camera. I’ve got my Fujifim Finepix Z3 (can you spot the pattern here?) and its fine for snapshots at parties etc. but it’s not something that you can really use for doing creative stuff.
So last weekend I went to buy a new camera. I had seen a newer version of the one I had but with a much longer zoom (18x!!) and I was determined to have it. It was only $600 which I thought was an absolute bargain.
So I bought the S8000sd from Wellington Photographic Supplies and raced home eager to try it out. The day was not really suited to photography, rainy and dark. But my old camera worked quite well in low light conditions, so I was not too bothered.
I took some test shots out my front door of tress and flowers and stuff, and some inside both with the flash and without. Basically I was having a ball zooming in on things and clicking and zooming back out again and playing with the settings.
Then came the moment of truth. I downloaded the photos onto my computer to see what they looked like.
I was stunned.
They were absolutely crap. Every one of them. They looked like cellphone pictures. All of them were grainy, the focus wasn’t right, they were overexposed…. It was very disappointing.
At that stage it was about 2.30pm. The shop closed at 4pm. So I jumped back in my car and raced back to the shop.
I have to say they were quite helpful when I explained the problem. The sales assistant took some photos with my camera and printed them out. She agreed that they were not good. So they grabbed another camera and tried that one. The results were a little better but still much the same as a cellphone picture. So then we went outside nd took a picture of a street sign with the offending camera and the S100. Both shots were printed out for comparison.
The difference was startling.
It was one thing to see the grainy photos on their own, but to see the same picture side by side with a crisp clear correct photo really told the tale.
I have to say, as you’ve probably guessed, I’m a real fan of the Finepix cameras. They have wonderful colours, are reliable, useable and generally fun to use. So when the camera I had bought let me down so badly I was quite surprised.
So in the end I swapped the S8000sd for the S100fs. It cost me an extra $650, which I didn’t really want to spend right at that moment. But at least now I know I’ve got a good camera.
I took a bunch of test shots when I got home (just to make sure) and the results were exactly what I expected. Much better.
I have since played with the features a bit including the 14x zoom and my all time favourite, manual focus. It was the only thing about my old S5000 that I didn’t like. But the S100 has a proper manual focus and a manual zoom which is just awesome.
So I guess the lesson in all this, is that when you are looking at buying a digital camera take some photos with it in the shop before you part with your money and get them printed out. It might cost you an extra couple of dollars (if the shop is a bit stingy) but at least you will know what you are letting yourself in for. And if you do take your camera home without testing it and then find it is not as good as you hoped, take it back. Most places will at least try to help. You’ve spent a lot of money to buy the camera you want to make sure you get one that you will enjoy using, and that you will enjoy showing the results to all your friends, family and anyone else you can rope in.
Saturday, May 3, 2008
The war with Drupal
I’ve been building a site using the Drupal CMS over the last week.
The build was not helped by me having a cold and feeling miserable. And I have to say that for the first couple of days it was a real struggle.
I knew a little about Drupal from a familiarisation play around a little while ago, and that really helped me get going. But I found that in order to do what I wanted I had to download and install a bunch of modules.
Another problem I’m faced with is the nature of the site, which is largely brochure-ware. While Drupal can handle a site like that, that’s not really what it was designed for. So that means doing a bunch of customisation to get things working the way the client wants.
As I say, I really struggled early on to get it all working the way I wanted, until Wednesday.
After reading lots of tutorials and trying all sorts of different strategies, I finally figured it out. The big secret to getting things working is the Views module. And this is not part of the core build!! But using the Views module let me display the dynamic content on pages and in widgets that I wanted. And once I’d figured this out, it was all on for young and old. In no time at all I had most of the important parts of the site built and operating exactly the way it was supposed to. I only had to add one line of code to the template file to get a specific layout, and apart from that the site is all built with standard module code.
So if you’re looking at building a site with Drupal and you’re struggling to get it to work the way you want, check out the Views module and combine it with the Blocks to put the content you want in the places you want. Once you get that sorted you’ll be surprised at just how easy it can be to get a site up and running.
Monday, April 21, 2008
PHP Search engine
I have a reasonable good search script that performs AND, OR and quoted string searches and ranks the results. This is a live search on the data in a MySQL database not an indexed search. This has worked quite well for me in the past, and I’m sure it will continue to work and get better as I refine the script.
But I was looking through a bunch of search engines seeing how other people did things to try and get some pointers on a better system of ranking search results than I was currently using. And what should I stumble across; Sphider.
Sphider is a PHP search engine that indexes a site and then runs the search queries over the index. It’s a little different than what I usually do, but I thought I’d take a look at it anyway. And I was quite pleasantly surprised.
It installed really easily and was no trouble to set up. After a quick read of the online docs (which are a bit sparse in places), I was able to get it to spider the site and index the content. The search results were relevant and the ranking quite good. It supports robots.txt files, meta tags, and you can tell it not to index parts of a page, like navigation menus and such.
I ended up spending quite bit of time just playing around, indexing and re-indexing the site I was working on with different settings to see what effect the changes had.
The conclusion I came to was that this is actually quite cool. It seems to do a good job of indexing, it’s easy to use, and it gives relevant results. Unfortunately the specs of the project I’m working have since changed, making it mandatory to have a live search of the database, so I won’t be using it this time. But I will be keeping it in the wings ready and waiting for any site that needs a good search engine.
Check it out yourself and see how good it is on your projects.
Sunday, April 13, 2008
Static CSS Div at the bottom of the screen
I was also keen not to use Javascript to do it, as this has all kinds of issues cross browser.
I had a chat to my mate Google, who knows everything. It seems this is not a trivial thing.
The different browsers support CSS differently (of course) and although getting it to work in Firefox is pretty easy, IE throws a whole toolbox worth of spanners into the mix.
After a bunch of research, and a bit of playing around I found a way to do it in Firefox and IE without using Javascript (sort of).
Here’s what I did:
Create the CSS for Firefox
#footer{
POSITION: fixed;
height: 100px;
LEFT: 0px;
border: solid 1px black;
bottom: 0px;
width: 100%;
background: #C2DFFF;
}
Then the CSS for IE
* html div#footer {
position: absolute;
top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));
}
Then another Div to go at the bottom of your content.
#content-padding{/*this should be the same height as the footer to enable it to be visible once Firefox scrolls to the bottom of the page*/
bottom: 0px;
height: 100px;
clear: both;
}
This is rock solid in Firefox and a little jittery in IE, but not at all bad really. It also works better than anything I found on the web
Feel free to have a go with it and see how it turns out for you.
Sunday, April 6, 2008
Encrypting your data
Fortunately for me I didn’t have to. A couple of hours research came up with some off-the-shelf options. I tried out one called Cryptainer from Cypherix, and I have to say I’m pretty impressed.
It’s a small download (I grabbed the free version for testing purposes) and it installs easily.
Setting up the container on the USB drive was no sweat and took less than a minute. I could then run my application, which runs in a browser, and copy files into the container. They were encrypted on the fly and as soon as the container was unmounted everything was nice and secure.
Getting the files back out again was just as easy.
Simply plug the USB drive in, mount the container, and then the application can access and use the files.
The learning curve is really small, which is good because this will need to work for users with minimal computer literacy.
So if you need something to secure your files and you can’t be bothered investing lots of dollars or brainpower, give Cryptainer a go.
Saturday, March 29, 2008
What’s your data backup solution?
There are many horror stories of people loosing precious data, like a fellow student when I was learning programming who lost his project.
We were both working on our Java project for our programming major. I had just completed mine and was documenting it, and he was putting the finishing touches to his code, checking for bugs etc. It had been a really good session for him, he was on a roll. He had gone hard and written he entire program in one go, without saving it. As Mr. Murphy predicted, just as he hit the save button the computer crashed. He lost everything.
I’ve been there done that also, unfortunately.
I had just finished a whole bunch of bug fixes, updates and improvements to my MySQL interface software, and it rocked! Just as I was finishing it the phone rang. It was my sister, and we started chatting about stuff. While we were talking I began to hear a strange ticking noise coming from the computer. At first I thought some dust or something had got into the fan. But then, it all went black – no more hard drive. I not only lost my software, but everything else on the hard drive. At about that point I thought ‘ Hmmm…. I wonder if I’ve backed any of that up anywhere.’ The short answer was ‘no.’
I managed to get some of the data back thanks to the wonderful people at Quay Computers here in
So I got an external hard drive and began doing irregular backups on that. It worked fine, sort of. I’ve since had numerous OS failures (thanks
So I came up with a cunning plan, thanks in a small part to my father. He was going overseas and needed a way to store and carry video and picture files. Potentially a lot of data. We ended up buying a portable hard drive – the Western Digital Passport portable hard drive. At 120gig it had enough capacity, and being powered via USB made it easy for him to carry around and plug into a machine in an internet café and download all his pictures. It’s nice and small so it does not take up a lot of room in his luggage etc. it worked flawlessly for him, so I thought I’d give it a go as well.

Where this is better than my old hard drive is that it is powered via USB, I don’t have to plug it in and turn it on. It just turns on when I turn my PC on.
I also don’t have to decide what to back up. It knows what files have changed and what is new etc. all I have to do it click the .exe to launch the synchronisation software and then forget it. All my selected folders, including email, browser favourites, music etc are al encrypted and copied to the hard drive.
It’s a very simple elegant solution that means no mater what happens to my OS or my hard drive, I’ll always have my data backed up. And as a bonus I can just plug the drive into my laptop and carry on working on the same files, including all my development files, which is a huge bonus.
So when you’re thinking about how to back up your data, have a good look at an external portable drive. They come in many flavours and sizes and most offer encryption. I’d recommend getting one the is USB powered as it saves having to remember to turn it on etc and you can set your PC to run the synchronisation software on startup.
But not matter what strategy you use, make sure you DO have a strategy, and that your strategy works.
And always remember – save early, save often.
Sunday, March 23, 2008
High school reunion
I say ‘a number’ because I don’t know what the years were. I’m crap like that. I got my starting dates wrong and then had everyone scratching their heads wondering why I spent 2 years in the third form.
I had been a bit nervous about going back and seeing all the people I grew u with. I cut pretty much all ties to my home town when I was 22, and apart form a couple of short stints, I’ve only really gone back to visit my folks. So the thought of seeing my old mates and catching up was great. But I also was worried that I had not done enough in the 20 odd years I’ve been away.
Certainly I’ve been out and travelled, seen a bunch of the world and done some weird and wonderful things. But at 42 I’m still single with no kids, no house and I’m not ‘part’ of a community. I do have a good job, earning good money and I’m damn good at what I do. So I guess on balance I could turn up and at least not be a dismal failure.
So on Friday after dropping a mate at the airport, I drove up. And as I travelled, with hits of the late 70s and early 80s on the stereo I began remembering all the adventures I’d shared with the guys I grew up with. By the time I drove up my parents driveway I was keen to see all the guys and relive the days of my youth. All doubts about being there were gone.
After a quick cuppa with my folks I went up to the school for a look around. So much had changed, and yet so much was the same. There were tall trees where before there was just grass. I spent some time wondering if there was a tree when we used to play bulrush here…
But a tree can grow quite big in 25 odd years, so I’m sure it wasn’t there when I was at school.
Some of the old buildings were gone, sadly. The technical studies block where the older boys used to hang my upside down from the cloak pegs by my socks was gone.
Another block where we used to hang out in a sun trap now has an extra building in front of it, effectively killing off the spot where were used to spend our lunchtimes.
The pre-fabs which were falling down when we were there, were still there, and had even had a coat of paint!!
And then I started bumping into people I knew…. And who knew me.
I was talking to one guy I was in the third form with, and who was now the official photographer, when I got a slap on my bum and a grinning face said ‘we’re over here’.
One of my high school crushes had recognised me, from behind and had come over to drag me back to the group.
That might sound like a great feat of recognition, in a crowded marquee, to spot me in a crowd, but not really. I was only 4 feet tall at high school, the shortest person there. I was still the sorted person in the tent, so it didn’t take a rocket scientist to figure out who I was.
But it was nice to be recognised and to catch up and find out what she had been up to. Married, 2 kids, living up north and looking happy with her life.
And there was so much of that. Everyone I saw from my year looked great. They all looked so young and happy. There was such a positive feeling the whole weekend and it was just like sitting around at lunchtime after exams, when there was nothing left to worry about except what to do over the summer holidays.
Many had moved away, to nearby cities, some had moved further afield and more than a few had stayed and raised families. But they were all pleased to see old friends and classmates, even if it took some time to place the names and faces.
There was so much head bobbing to check name tags that we looked like a flock of flamingos grazing the waters edge. And so many cries of ‘Oh my god, you haven’t changed a bit!’
In my case it was true. Once a short arse, always a short arse. But it was true of so many others as well. And it was the smiles that did it for me.
Someone would be standing chatting and I would know that I knew them, but could not place them. And then they would smile, and that would key the memory and I would know exactly who they were, and what we’d got up to, and even the excuses we came up with when we got caught.
And I think that is a marvellous thing. The key was smiling. For that to be imprinted as the most effective path to my memories must mean that we did a lot of smiling way back then.
I met people that I didn’t even remember that I knew until some mentioned their names.
In my third form year, my form teacher was a young woman in her first year, fresh from teacher’s college. She was the not-so-secret crush of just about every boy in my year. And we had all read that she would be attending the reunion and it didn’t take long for the guys to start asking if anyone had spotted her.
No-one had, and pretty soon we had organised search parties to track her down. Even the girls in our year got in on it, because she was a great teacher and popular with everyone. We never found her, sadly, but shared many great stories of her classes, and some of her out-of-school escapades.
I also was lucky enough to see my favourite teacher – Mrs. B. (and that’s what we called her)
It was after the official opening, which was just like most of our assemblies. So nothing much had changed there.
She walked up and gave me a big grin and said, ‘I know that face’. I couldn’t place her for a second and then it hit me. I gave her the biggest hug and was suddenly very glad that I had made the trip. At 70 she looked great. She was happy and smiling and still the same lovely person that I remembered.
More memories were shared and I got the opportunity to thank her and to tell her that she made a difference. She instilled in me an abiding love of science and made me see that learning was not always a chore that had to be done because ‘it had to be done’. It can be a fun experience too.
The only negative part of the weekend was the failure of so many locals to turn up. Many of the kids who had stayed behind simply didn’t attend. Perhaps feeling less than adequate, or somehow feeling they would be looked down on for staying put.
I can understand that. I had those same fears. But they needn’t have worried. There was no pretentiousness, no ‘Well I earn so much more than you…’ or ‘I’ve done this and this and this and you’ve done nothing’.
Everyone was just excited to hear what their friends had been up to, and many were disappointed that so many people they were hoping to see hade not made it.
Myself included. As more memories surfaced I found myself asking ‘where is .. so and so’. Often the answer was, ‘Oh he’s around but not coming’.
It was a shame, and they missed out on what was a great weekend.
I’m very glad I went. It was worth making the effort, spending the money, dealing with the doubt.
So many of the people I lost touch with are now just a txt or an email away. The ties that I cut were renewed so easily, it was as if they were just waiting for the chance to be revived.
If you get the opportunity to get together with old friends, no matter what the event, do it. Don’t worry that your life is not a shining example of achievement. None of us became rich and famous. But it didn’t matter. As soon as we started talking we were all back in school, talking about what we’d got up to over the weekend, laughing and singing along with the band.
Thursday, March 13, 2008
Silver Stripe wins big!!
Its great when a local company that seems to have its heart in the right place, produces good gear and is out tackling the big bad world, pull off a big win like this.
It will certainly be one of the most watched elections in
They will be yet another kiwi flag flying on the internationally stage, highlighting that the brain drain hasn’t taken all the talent to
That mean we’ll have a CMS we can source from ‘guys just down the road’ and know that it is good.
I’ve already done a bit of testing on the system for work, and it looks quite good. With the push to be 100% for the
To the team working on the CMS, I don’t envy you the overtime, but I do wish you very good luck and I hope it all goes as smoothly as any important IT project can go J
Monday, March 10, 2008
Reinventing the wheel
It’s usually in response to the fact that innovation takes time and effort. While it may be true that using tried and tested code can save time and effort, it does not advance anything. And if you’re not advancing you’re going backwards.
I used to get told this all the time, ‘just download something off the net’, usually by people who didn’t understand coding, innovation or the cost involved in trying to shoe-horn someone else’s code in your application. Not to mention the ongoing support and security issues.
It has to be said however there are limits. I mean if you innovated every time you did something you’d probably never complete anything. There is certainly a place for using what others have done before if it will make your life easier, but it’s never as good as getting the old grey matter working away at doing it better yourself.
I use code, frameworks etc all the time, and I re-use stuff I have written previously as much as possible. But I’m always thinking of better ways of getting the job done.
A good example of that it what happened today –
I was working on a web-form template. This template is designed to be able to take just about anything you want to throw at it and it will build a cohesive form for you.
So far so good.
Last week I had it all going well, it was doing just what I wanted it to and I was quite happy with it. But then today I was adding a select box control that had to be coded differently from the other controls (text, checkboxes etc), and I looked at a different way of doing it.
I figured out a way that worked really well and then it occurred to me my other controls could be coded this way and it would be heaps better. (It solved a problem I had with multiple controls with the same name accessing the database).
So I spent the afternoon re-coding my code from last week to reflect the evolution of the select box control.
I ended up with a form that is much more robust and flexible.
So if you have to opportunity to innovate, don’t waste it, get in and see if you can come up with a better way. You’ll b glad you did if it works out. And f you don’t, the mental exercise is always good :-)
Saturday, March 8, 2008
Don’t trust the experts
Sometimes they get it wrong, sometimes they don’t know the answer and sometimes they just don’t care.
Often though, instead of telling you they don’t know, they will give you an answer to make you go away and stop hassling them.
Now I’m not suggesting this is a malicious thing, more that a lot of people can’t admit they don’t know the answer so they’ll either have a stab at getting it right or make something up that sound plausible.
A couple of recent examples of this are when my Vista PC went on the fritz and when I got digital TV installed.
My Vista PC was working fine (well as fine as it gets for
When I would boot it up things would be fine up until it went to display the login screen, then my monitor would display a ‘no signal’ message and go into hibernation. The hard drive was still merrily spinning away and as far as I could tell the OS was loading properly.
I’d re-boot into safe mode and it would work fine. After playing for a bit I figured it was the Nvidia video card drivers causing the problem.
Things continued on until I got fed up with it and took it into the computer hospital (it was still under warranty).
They had a look at it and ended up re-installing the OS and everything was fine. Apparently the OS was totally corrupted.
I figured ‘fair enough’ it was not something I would have been able to fix by tweaking stuff.
The initial diagnosis of faulty RAM (made when I dropped the PC off proved to be wrong).
So I took my fixed PC home and eagerly plugged it in (I’d been without it for a whole week!!)
It booted up and bugger me…. Same problem!!
Since it was the weekend I decided to try a re-install myself. After all I had nothing to loose. So I re-installed
Right up until I installed the Nvidia drivers. Then guess what….. ‘no signal’.
So into safe mode I went, rolled back the driver to the Microsoft generic one, and then rebooted back into normal mode.
Everything was fine. My PC hummed along quite happily. (apart from the screen saver not working because I have a wireless mouse etc.)
Then Windows did an automatic update and whopps!!! Those damn Nvidia drivers were back in charge. We battled for a bit with the drivers taking over every time windows even thought about updating.
Long story – short, I buggered things up trying to disable the drivers.
Now I’m back using XP and I’ve had no trouble at all.
The lesson in this is that my first instincts were correct. The experts said I had faulty RAM and then a corrupt OS. Now to be fair they guys where I took my PC are great. They give the best service ever and a probably one of the cheapest places to get things fixed.
I’ve bought 3 PCs and a laptop from them and you can bet my next PC will be coming from them also.
But in this case they got it wrong and I was pretty sure I was right when I told them what was happening.
Wednesday, March 5, 2008
Regular expressions in PHP
I know I should use them more, but they just do my head in.
Every now and then though I come up against a problem that really should be done with a regular expression and I make the effort to get my head around the weird syntax and come up with something to solve the problem.
I did that the other day at work where i wanted to clean input parameters from a URL when a form is submitted.
Now, I've done this many times before an a number of different ways, but I think my latest attempt is the best I've come up with so far.
Here is the expression I came up with (and a couple of variations) -
$myVariable = eregi_replace("[^a-z]", "", $HTTP_GET_VARS['form-variable']);
What this does is strip out anything that is not a letter from form-variable, which means no nasties like SQL injection and cross-site scripting attacks will be able to play.
Using eregi_replace means it is not case sensitive, so you don't have to worry about capitalization.
The [^a-z] part specifies what to look for. The '^' at the start of the class (the [] bit) means look for everything that is not in the following list. So you just have to put in the characters you want to let through in the list.
The "" part specifies what to do with the characters the expression finds that are not in the list. It this case I've set it to replace them with nothing - effectively deleting them.
And the last bit id where you get the string to be evaluated. In this case the GET variable.
This has worked really well for me. It strips out all the bad characters and leaves the good ones.
Here are a couple more variations of the expression that are really useful.
$page = eregi_replace("[^-a-z.0-9\\/_:?=]", "", $_SERVER['REQUEST_URI']);
I use this one to check for correctly formed URLs. As the URLs I'm checking are all part of a CMS I'm building I can determine exactly what should be in the URL.i.e. hyphens, letters, numbers, slashes, underscores, colons, question marks and equals signs.
Anything else will be stripped out.
$myVariable = eregi_replace("[^0-9]", "", $HTTP_GET_VARS['form-variable']);
This is useful for checking that the variable is numeric. Things like ID values etc.I still have trouble with getting my head around how the expressions work, but at least I'm making small steps and figuring out how to get them working for me.
If anyone has any good expressions feel free to add them in the comments section. All help is good help. :-)
Sunday, March 2, 2008
Cool software

Screenshot from Jing
What is the craziest thing software vendors have tried to get away with?
Saturday, March 1, 2008
Security on broadband
I'm one of the last people in the world to do it, but I'm a slow learner.
And I have to say it's great. We had a broadband connection at my previous job, and that was one of the reasons i wasn't in a hurry to move. It was marginally faster than my dial up for surfing.
Granted, when you wanted to download large files it was quite a bit faster. But how often do you download 800mb files?
But I'm very impressed with the speed of my connection at home. I can now watch stuff on YouTube etc and it actually works!!
One of my big concerns now that I'm 'always on' is security. I don't want my PC to become a bot to send out spam from some guy named Boris promoting willy enhancing apparatus.
So I did a bit of research and the consensus seems to be that since the hackers use blended strategies to get in, it makes sens to use blended strategies to keep them out.
So what am I using?
Well lets start with the firewall:
I've got the free version of Zone Alarm running and I've locked out pretty much anything that should not have access to the Internet. i.e. my browser (Firefox) and email client (Outlook). The only other stuff that has access by default (i.e. I don't get a popup every time they go and access the Internet) are my other security programs.
Anti-virus - I'm running NOD32. This came pre-installed so I left it there. It had good reviews, so no worries. This looks for viruses etc the traditional way, using signature files that it updates regularly.
That is backed up with ThreatFire, which also scans for suspect activity based on what programs should be doing. It's a different approach to the same problem.
I've also got Spybot Search and Destroy - because it's good.
And to make the mix just slightly more interesting I also run my web browser in Sandboxie. So anything downloaded, installed etc by the broswer only plays in the sandbox and does no alter settings in my OS. It seems to work fine.
All the programs work together without much hassle, and they were all pretty easy to download, install and configure.
I don't think in this day and age that you can be 100% secure, but at least you can make a determined effort.
This blended defense has worked well so far, with no infections or problems reported.
If anyone has any other strategies, feel free to post them in the comments. I'm always interested to find better ways of keeping my PC safe.
Time to get on board...
I've been writing and expounding on theories (some conspiracy some not) for a number of years, and while I've read blogs and been involved in various communities on the web, I've never really had a good crack at blogging myself.
So here I am getting on board with actively blogging.
I'll try yo keep this from degenerating into something like a slagging session and try to post things that might be helpful or at least thought provoking.
Feel free to post comments, but please no spammers, you're not helping anything.
I get into some interesting things with my work, and do a bit or research on the web, mostly to do with code, and when i find something that I think might be useful I'll inclue it here.
Well now that I'm on board it's time to get to it. :-)