Wednesday, March 30, 2011

Maximum Compatibility My Ass

I'm looking at a welcome email I've been sent, for a website I need to join up for work related stuff.

In there is this notice, slightly modified to protect the website identity:
Please be advised that has been designed to operate with Internet Explorer being the software of choice.  Therefore to ensure maximum compatibility, please do not try and access via another Web Browser i.e. Safari or Mozilla Firefox
Have I mentioned how much it shits me when I see notices like this?

Maximum compatibility is when the website works on all browsers, not just that one that will support that nifty mouse over thing that you couldn't get to work anywhere else.

Perhaps "Therefore to ensure the website actually works, please do not..." would be more appropriate.

I'm sure it's just a throw away statement, anyway.  The primary users of the website are probably still running IE6 or IE7 on Windows XP machines anyway, and it's only pure luck that it still works under IE9, and would probably work just fine under Safari, Firefox and Chrome, if it wasn't for a Javascript or server side agent check that deliberately fails processing for any browsers other than Internet Explorer.

endrant;

Friday, March 25, 2011

Because 5.2 is the new 4.4 (follow up)

Just as a quick follow up from the previous Because 5.2 is the new 4.4 article.

Migrating to a VC9 Apache build ended up being a pretty simple thing to do.

Start with the initial VC9 Apache install from Apache Lounge, as recommended by PHP. Make sure you don't overwrite your VC6 build, if you still need it.

Then do the PHP 5.3.6 install.  For this, I didn't bother doing the web server setup, since I wasn't sure which installation of Apache it would end up modifying.

I then backed up the apache/conf directory, and copy the version from the previous apache version I was using for PHP 5.3.5 into the new apache install.  Then remember to update httpd.conf to point to the new PHP version.

I also did a compare of the php.ini files between PHP 5.3.5 and 5.3.6 using DiffMerge, so I could make sure all my major settings were the same, without missing out on any new directives that may have been introduced.

After that, I stopped and uninstalled the VC6 Apache build service, and installed the new VC9 Apache build service ("httpd -n wampapache2 -k uninstall" and "httpd -n apacheVC9 -k install", although that uninstall command will not stop the service before uninstalling it).

I'm sure many fun times will be had in the future when I start adding in the various PHP modules needed across the many projects I have, like Firebird, MS SQL, etc.

Thursday, March 24, 2011

Because 5.2 is the new 4.4

I was doing a quick technology update today, checking out some of the websites of some of the tech I was using in my day to day projects, when I came across the quote in the title.  It was found on the website of Andy Dawson, otherwise known as AD7six. It's referring to PHP versions, and how PHP 5.2 is going to be defunct.

Yeah, see that strike through?  My next visit was the PHP.net site, and with their announcement of PHP 5.3.6 is also the announcement that PHP 5.2.x is no longer supported, making PHP 5.2.17 the final stable release of the PHP 5.2 series.  This was announced on 17 March, 2011.

So what does that mean for me?  Well, all of my projects are written in PHP 5.2.  At a guess, none of our production environments are running the latest of the 5.2 series.  This means I need to come up with a development environment that can support both versions of PHP, and start doing new projects in PHP 5.3, and also migrate some of our maintained projects to PHP 5.3.

So, today, I started with the development environment task of running PHP 5.3 and PHP 5.2 at the same time.

First things first, you can not run two versions of PHP 5 in the same Apache installation.  So, my solution is to create two Apache installations on my machine.  Given that I use the office DNS to allow unique host names for all my projects, and I don't want to have to specify a different port for one or the other Apache installations, I opted for installing a second IP on my NIC.

When specifying a second IP, they'll both need to be static.  If your IP was previously dynamic through DHCP, make sure you take your nominated IPs out of the dynamic range, and document the static IP allocation.  Now go to your Properties for TCPv4, and specify the primary IP address, mask and DNS servers.  Then click Advanced and enter the second IP.  In my case, both IPs are in the same subnet.  Remember to enable NetBios over TCP if this was something typically enabled by your DHCP server.

Next, you'll want to configure your Apache installations.  Because each installation will be listening to a specific IP, you'll need to specify that IP where ever you see the Listen directive.

So in my primary Apache installation, I used to have "Listen 80".  I replaced that with "Listen 192.168.174.8:80" and because it's my primary install, I'd also follow this up with a "Listen 127.0.0.1:80" to catch localhost traffic.  Remember to do the same thing with any other Listen directives, including the SSL config file.

In my secondary Apache installation, I replaced "Listen 80" with "Listen 192.168.174.88:80" and did the same thing with the other Listen directives.

I make extensive usage of virtual hosts in my development environment.  I'm also lazy and copied my primary Apache installation to be my secondary Apache installation.  Make sure you comment out any vhost entries that you don't need, change any references to the old PHP version, to the new PHP version and copy the appropriate programs from the PHP install to the Apache/bin install.  If you use a PHPIniDir directive, remember to update that.  Also remember to rename any log files that may clash between the two Apache installs.

I had a bit of trouble with IP and port clashes.  I had port 7000 used in a couple of my projects, but had not altered the Listen directive.  To help see what was going on, I used the SysInternals TCPView to view what processes were listening to what ports, and which IP addresses they were bound to.  If you're still having troubles starting one of the web servers, try starting it from the command line to see what the issue is.  Also, when you install the second Apache install as a service, remember to give it a different name.

With my recent Windows 7 install, I've been using WAMP instead of XAMPP.  In this particular installation, I have PHP versions 5.2.11 and 5.3.5.  With the recent PHP announcement, I'll be looking to update to 5.2.17 and 5.3.6 respectively.  But here's the rub.

The PHP team have also announced that they will no longer be providing PHP builds using Visual Studio C++ 6.  It will all be done with Visual Studio C++ 9.  This means I'll also need an Apache install that has been built with VS C++ 9 as well.  At least PHP have recommended Apache Lounge to source this from, but it's going to be a major spanner in the works for the likes of WAMP and XAMPP who typically provide VC6 builds.

I'm not looking forward to doing another Apache install, just so I can update to 5.3.6.  At least the PHP 5.2.17 binaries will be staying at VC6, but have no option for VC9 (so you will need two separate installs of Apache, and wont be able to get away with copying one install for the other version of PHP).

Monday, March 21, 2011

Training with Astro

This Sunday just gone, we started a new training course with Urban Dog Training called Clicks and Tricks.

Clicks and Tricks is a bit of a fun training course where we use positive re-enforcement and shaping to teach our dog some new tricks, and to let the dog develop some new tricks for themselves by offering movements and behaviours.  The movements and behaviours that we find desirable are rewarded with an unambiguous click from a clicker, and are rewarded with food.

We've been using a clicker with Astro since we started Advanced Puppy Training with Astro about 5 or 6 weeks ago.  It's great for conveying a positive "yes!", for when he does things that we want to re-enforce, and is always accompanied by a high value food reward.  Whilst Astro is used to my "yes!" and Annikas' "yes!", he's not used to it from other people.  However, one clicker sounds much the same as any other clicker, and will allow relative strangers like our dog trainer to convey a job well done without Astro getting confused by the different sound in their voice.  And once again, each click must also be accompanied by food, if it's going to stick.

In training, our trainer Paul, was able to simply look at something, and have their dog Stevie interact with it in some manner.  For each movement or interaction that Stevie offered, he was rewarded with a click and some food.  Paul started Stevie down a path of interacting with a dropped key, with initial sniffing, then pawing and an end goal of picking the key up and returning it.  Stevie is a pretty smart dog, but even that would take more time than we had available in our 5 minute demonstration.  Nonetheless, he also had Stevie jumping up on to a bench and interacting with his crate.

Our homework is to have Astro interact with a box of some description, and then to bring that box in the next week and give a demonstration of what has been learned.

So last night, we had a little training session, interacting with our laundry basket.   Ideally, I'd love to teach Astro to put things in the basket, or move the empty basket around.  Astro loves taking off with socks!

Just by looking at the basket, and appropriately rewarding Astro, he got to a point where he was pawing the basket for rewards. Getting him to put things in the basket is a big task, so I'm going to be happy with a paw, nosing it around, and even jumping in.  The great thing about the exercise is that all these things will be behaviours that he has offered, instead of me showing how it's done or luring him.

And just to mix it up a bit, we also tried the same game with his new bean bag.  It's a bit full of beans at the moment, even though we've only put 2 out of the 3 bags of beans in it, but I'm sitting on it when Astro is in bed to compress them.  Anyway, we'd eventually like the bean bag to be Astros preferred place to sit inside, when we're watching TV and having some quiet time.  Very quickly, Astro offered jumping up on to the bean bag, and lay down on it.  Awesome!

After a few goes of that, I moved on to a netball that we'd got for him.  It's a cheap Crazy Clarks netball that's made from basketball material, so it's probably a bit harsh on his nose.  So far, he hasn't paid it a lot of attention.  However, it didn't take long for Astro to offer a paw on the ball to move it around.

Training sessions should be short, to keep the dogs attention.  I probably went for a bit longer than was needed, so after a quick revisit to all the toys we'd played with, I put the remainder of his reward food (chicken and capsicum) in his crate, but left the door open on it.

Astro has improved his behaviour in his crate, but I'd like it to be a place where he will hang out voluntarily.  Offering food in the crate will associate it with being a good place to be, not just the place where he has naps and sleeps at night.  To this end, every time I take him out for a bathroom break, I'll be putting 4 or 5 bits of kibble in his crate with him, when he goes back in, and I'll be making sure to let him in through the front door on the crate, instead of the roof.

Sunday, March 6, 2011

Pathway

I did a little bit of yard work today.  Mowing the lawn and laying some temporary pavers.  Sounds exciting, huh.

Pushed over by wind because of
fungus in the root ball.
That's our house in the background.
The lawn was a bitch.  I have a nice lawn mower that also does mulching.  Normally, it's great.  I just put the mulching attachment in, forget about the catcher, and mow, mow, mow with the occasional stop for fuel.  However, this summer has been pretty wet.  You know, Queensland floods and all that.  I've been pretty lucky.  A fast growing lawn and collection of weeds cut to look like lawn is the worst I've had to complain about.. oh, and there was that tree that fell and broke the back fence.

Anyway, so after a while, the mulching attachment doesn't cut the mustard, or the grass.  For the last month, I've had to put the mower up to the highest setting (10), to mow the pretty much most of the front yard.  Normally, the setting should be at 6, and I've been able to maintain that with the backyard, and a couple of spots out the front.  So today, the mulching attachment got side benched, and the catcher went on.  I guess you could say the grass was at about level 11 or 12.  It had been two weeks since the last cut, and it was getting reduced to 6.  I filled my garden bag that gets collected every month or so, and had enough spare for the compost tumbler and some dips in the fence line that I can't mow in because of the change in elevation.  Anyway, hopefully I'll be able to get away with the mulcher when I have to mow again, in two weeks time.

It's my pathway (and I'll cry if I want to)
So after that awesome fun, I decided to get a little temporary side project done.  And that side project is the front pathway.  We have a little dirt pathway that leads from the front corner of the house to the car port.  It had difficulty growing grass because of the high traffic, and every time it rains, it gets a bit muddy.  So today, I laid some pavers to provide us with a solid step and mud free walk, and to let the ground around it grow some grass, or weeds, or whatever can step up and grow there.  Lacking bedding sand, I just made do with the dirt and a little cut and fill to set them into the ground, so at least people walking down them won't stub their toes or trip.  But it's just temporary.

Despite having put a new bathroom in, and replacing the 40 year old roof, lifting up two crap driveways, and getting one good one with car port, and building a retaining wall down the side, there is still work to be done.

So this is the story of the work left to complete.  I almost have it memorized, and can get it out faster than the eyes glaze over (oh, and they do glaze over, eventually).  In some particular order, but not necessary the one I've used here the following needs to happen:
Redirect water from both back downpipes to the front
More drainage, a pathway and a new wall
  • The storm water drainage from the back of the house needs to be routed to the front.  At the moment, the back high side just flows to the back low side, tries to go down a drain, then bubbles back up and floods that corner.  I suspect it's a dispersion drain, instead of a proper storm water drain that's actually connected to anything, since I found similar happenings in the front yard when I digging the trenches for the storm water there.
  • While doing that particular bit of piping, I'll also put in a gravel pit and aggregate pipe running from the back to the front as well.  This will prevent water from collecting on the high side, then spilling over to flood the house.  But don't worry, the house is raised, and specifically designed to have water and air flow underneath it.  I'd just like there to be a whole lot less water flowing underneath.
  • The run off from the back retaining wall needs to be connected to the storm water also.  At the moment, it just bubbles up from the hole it comes out of, though it usually takes a lot of rain before it's noticeable.
  • A second mini retaining wall needs to be built, with perhaps a widening of the stairs that separates the current retaining wall, from what we like to call "The Rock Garden".  The Rock Garden is a collection of rocks, concrete, gravel, weeds and pepper tree.
  • Drainage from second retaining wall also needs to be connected to the storm water.
  • A water trap needs to be installed in the front corner of the car port, on its' high side.  All that water flowing from the high side of the property tends to collect along the concrete slab, that is the carport.  Luckily, we installed a join in the storm water pipe that runs along there, just in case this sort of thing should happen.
  • Rip up my temporary path, and the concrete path and replace the whole lot with gravel and very similar pavers that will run from the carport to the main entrance at the side of the house.
  • Replace rotting wood in side deck at the main entrance.
Anyway, that's the work I'll be doing sometime in the future, but not this year.  This year shall be a non-work saving year.  Yeah, right.  The trickiest part is going to be doing the back drainage in such a way that we don't have Astro digging his way out of the backyard.  And perhaps dealing with water that may not want to flow the way I want it to flow.  Fun times ahead, I'm sure.

(I had a bit of fun with Paint.NET, putting those pictures together).

Astro

Astro at Xmas, 2010.
It's high time I introduced Astro, our pet poodle cross American cross English spaniel, commonly referred to as spoodles or cockadoodles, depending on which side of the pond you're on.

We've had him since shortly before Xmas 2010.  Back then, he was a tiny 3kg, and a little ball of fluff.

Astro is lots of fun, but also a lot of hard work.

We go to Urban Dog Training.  So far, we've done Urban Puppy School and Urban Advanced Puppy School. He just graduated from his Advanced Puppy School today, but we've got to do a make up class tomorrow night, because we missed a class two weekends ago.  Today we started training in High Fives and Roll Overs using shaping.  We're going to enroll him in the next available Clicks and Tricks, which will be fun for him, and help us all do learning via shaping.

At night, Astro sleeps in a soft crate.  He takes a little while to settle, but once he's down, he's down.  Especially if he's been for walks or play groups.  I get the lucky job of staying up at late as possible to give him regular bathroom breaks.  I say lucky, because Annika gets to wake up early and let him out.  He's getting a lot better about holding on to his business until he can get to some place he's allowed to do it.

Astros' "uncle" lives next door as our back neighbour.  His name his Harvey, and one of his brothers from another litter is Astros' dad.  Harvey and Astro often have play dates together.  Sometimes Harvey is the fun police, but it takes a lot of energy to keep up with a boisterous puppy.  We've been surprised at how good Harvey is with him, because sometimes Harvey doesn't like to share.

We got Astro from Rivergum Designer Puppies.  We wanted to get a spoodle because of the lack of hair that they drop, and because Annika has dog allergies.  We really liked Harvey's nature as well.

We go to Greencross Vets for checks ups and vet stuff.  Moo Moo goes to the Brisbane Birds and Exotics for her vet stuff in the same building.

Today, he's a bit bigger, at 7kg.  Here are a couple of snaps of him, playing in the yard today.


A rare photo of Astro awake and still Because normally he's running around And making funny faces