Archive for May, 2005

Finally bought something off iTunes

Friday, May 27th, 2005

I´d already got a large mp3 collection so buying an iPod Shuffle was mainly about having an mp3 player that did everything I wanted. Plus the iTunes software is pretty good as well as far as organising your music and copying it to the iPod goes.
 
I was at the gym yesterday though and a song was on MTV that I like so I thought I´d go to the iTunes Store and download it. We´ve got wireless broadband at home so I got the laptop out and sat on the sofa watching TV. Within a few minutes you can enter all your details and set up an account. You then just browse the store looking for what you want. All you do then is click on the "buy" link and confirm and it downloads the track and imports it into your library. A couple of seconds later its copied to your iPod and you´re good to go. Easy.
 

Ignore the fact that it could be a bit cheaper and I think that this is a good service. There´s also the DRM issue. Fair enough, they´re trying to protect themselves but I store all my mp3s on my laptop and have a second copy on a secured share on a server at work. This means I can listen to them on any of the half dozen PCs or servers I might be using at one time. Even though there is nothing illegal about this I can´t do it cos of DRM. So I´m gonna burn any tracks to CDRW and then rip them again to mp3 to get rid off the DRM restrictions then keep the original in a safe place.
 
I get the feeling that a lot of technical people will be doing this. If the music industry doesn´t like it, come round and stop me you arses!

IE and the CSS em measurement

Wednesday, May 25th, 2005

I´ve come accross two groups of people when talking about Internet Explorer as a browser. There´s the usual "IE is shit, use Firefox" or "everyone has it so you know your web pages work". I tend to agree with both of these points and design and test using IE then run through it with Firefox on my Linux test box to make sure things are working OK.
 
The one thing that most experienced designers will agree on though is that IE is absolute arse when it come to CSS. A friend of mine had been looking at one of my sites and the next time I saw him in the pub he mentioned that he could hardly read it cos the font was so small. Another friend suggested he sit nearer to the monitor but I thought that I had better find out what was going on.
 
I tend to use pt or px for css measurements but the one that was being used on this site was using em all the way through. Em basically tells the browser to multiply the nearest exact font size in the style sheet by the em value. If there is no value set (if all the font sizes in this case were ems, as in this case) then it uses the default font size for the browser. For some reason on some systems this seems to break and default down to a really small font. Weird.

 
Gonna have to go through and put a definate font size in the body tag of all of my css files just to make sure.

Windows XP and the bloody registry

Friday, May 20th, 2005

Now it may be true that Windows is supposedly getting more and more stable and secure all the time, but it is still reliant on what is, in my opinion, one of the stupidest ideas in the history of computing: the Registry.
 
Now it may have seemed like a good idea to someone to store all the settings for a user and the machine in one large database spread accross five files, but if one of these gets corrupt and you haven´t got a backup then you´re screwed.
 
Compare this to a *NIX based system (Linux,  UNIX, Mac OS X, etc) where the settings for a particular bit of software or sub-system are usually stored in a text file or custom database which is used only for that system. This means that if one of these files gets damaged in any way then they are a lot easierto fix and probably won´t bring down the whole system. It does mean your settings are spread accross the entire system but they can still be backed up.

 
In case you were wondering why I´m having a rant, it´s because someone handed me a laptop with a corrupted registry and no backup. Oh and they would like it back as soon as possible and exactly how it was before. Great!

Another interesting way to crash a server

Thursday, May 19th, 2005

I was setting up another site with a paid for membership system and since I´m reeeally lazy I just get the server to do all the admin stuff through cron jobs and php scripts. One of these does a daily check to find the users that signed up a year ago and then generate a new invoice and print it out in the office.
 

Since I´d done this before on other projects I just went and copied the file over and then made a few changes to the database details and the folder info in it. As I was just checking through the code I noticed the way that it checked for the users that needed renewing was, well… stupid.
 
I wrote the code ages ago when I were but knee-high to a grass-hopper type thing, plus I might of been hung over. Insted of sending a mysql query asking for a list of users whose sign up times fall between two times (ie now and 24 hours from now) and then dealing with them, I was asking for ALL the users, seeing if the sign up time fell between the two values and then if it did, do the whatever.
 
Since this code gets used on about 10 sites which are all hosted on the same server, and all the scripts get run at the same time daily, it puts a bit of a strain on the server. Luckily I found this out while most of the sites only had about 500 members so the server could take it. Could have been fun when they were up in the thousands though.

Who needs an Antivirus program really?

Wednesday, May 18th, 2005

… well every-fucking-one!!! One of our clients brought in his laptop cos it was disconnecting from the internet and then shutting down. Hmm… might have the blaster worm methinks. I asked him what antivirus prog he had and was totally unsuprised by the answer of "none". I told him to bring it in and I´d have a look.
 
After a good six hours of installing and running virus scans, spyware removal tools, virus removal tools, updates, blah, blah, blah, it was finally up and running again!

 
Next job - go and hunt down every single system builder that provides PCs that can connect to t´internet but don´t have antivirus, firewalls and spyware removal tools installed as standard, and beat them to death with their own recoery CDs. And I mean the full version, not just this "15 day trial" shit that some of them try.
 
Its stupid to assume that everyone who needs to use a PC knows how to use a PC safely and fix them if something goes wrong. If the big system builders want to reduce support costs (and make my life easier, please) then they should provide the tools and just up the cost a little. If I can pick up a copy of Norton for ?15 then they should be able to include all the tools you need at very little extra cost.
 
It just makes sense people!!

Cross Platform, Cross Browser Testing

Tuesday, May 17th, 2005

I had just finished working on Mark´s 3D Modelling site and asked him to look it over for me. He said it wasn´t displaying properly on his boss´s Mac using Safari so I thought I´d check it out.

 
I don´t normally do too much in the way of testing with more than IE6 since it´s still the most widely used browser, so if the main page looks right in Firefox and IE then I assume the rest of the site will work OK (I mostly hand-code and try to use only accepted standards).
 
This site is a bit different though since its highly CSS dependant, using a lot of absolute positioned Divs. It was fine in the usual setups I use for testing but thought I´d try and get hold of a copy of Safari and see what was going on. Unfortunately we haven´t got a Mac and I don´t know anyone else who has either. Time to try and find another way of getting a copy.
 
There was no way I could get a copy on Windoze so I decided to hit t´internet to look for alternatives. I eventually came accross a solution called iCapture which I a free service that seems very popular. I couldn´t try it though as the queue wasn´t accepting requests and I was in a hurry.

 
After a bit more research I then found out that Safari is based on the KHTML engine. Another browser based on this engine is Konqueror, part of the KDE desktop environment. All my Linux servers don´t have X-windows or any other GUI installed but I did have a spare box so I went for a freah install to use as a test box.
 
An hour later I was testing the site on a new Fedora install and after another hour of screaming at the screen cos of ever more complicated CSS hacks, my Windoze box crashing and general interuptions, it was all running fine.
 
Hopefully they will report back that it´s all good now and I´ve got something I can test on for all you people in Mac-land.

Really cool image stuff with OverLIB

Thursday, May 12th, 2005

We do a variety of sites that involve listings of some kind, where you search by town or type or soemthing and then get a list of cars, companies etc. The latest one which is a training & meeting venue directory site has the usual lists that eventually end up with a full page ad for a certain venue.
 
From here there is a link to the individual rooms at that venue. We wanted to include a photo of the rooms along with it´s description, costs, etc. Only problem was that including a decent sized photo takes up two much room. There was always the option of using hidden DIVS and toggling whether the display with a simple link,  but this time I decided to give OverLib a try. 

 
I´ve used this before for displaying simple text on our appointment reminder system´s calendar page to display the appointments for a certain date, but after a bit of digging and messing around I managed to get it to display the pictures in the popup as well. You just have to be careful about putting " or ´ in the image path as it can screw up the entire page.
 
Have a look, you can get the code off the site and it might come in useful.

CGI limits reached, please try again later

Wednesday, May 11th, 2005

I noticed that we were having trouble with our automated appointment reminders system recently in that very occasionally the site would just crash displaying "CGI limits reached. Please try again later". Not a good thing on a live production server.

 
After doing a bit of checking I found that it was one of the admin scripts that runs by cron job every few minutes was using all the resources available to PHP. There are only four of these and they are responsible for sending out emails, sms messages and then checking that these are being sent.
 
I added some code to each of them to get the execution time and then email me with the results. Time to get a cup of coffee, sit back staring at Outlook and wait for the results to come in. First off: 0.082 secs, no problem there. The next two were 0.246 and 0.132 seconds. So far so good. The last one came in at 583.456 seconds. This one might be the problem….
 
I had a look at the script which checks that email messages are definately being sent. When the original email is sent it sends an email with the message ID in the subject to a admin mailbox. This script checks this mailbox by IMAP and reads the subject, updates that email in the database as being checked then deleted the email.
 
I decided to check the mailbox using webmail and see what was going on. It crashed the webmail application while trying to read the inbox. OK. So I set up a server to go grab all the messages by pop3 and Outlook Express. 15 minutes later it was still downloading the 3000+ emails. Hmmm, might have founf the problem.
 
I checked the PHP manual to try and fund out why the PHP function imap_delete wasn´t deleting them. It turns out that it marks them for detetion and you need to run the imap_expunge funtion before closing the connection to delete the messages.

 
So, a simple case of RTFM. I´ve left the timing code in to email me if the scripts take longer than 20 seconds to run, but hopefully I won´t have any more problems.

Dont ask…

Friday, May 6th, 2005

… was just talking to a mate about the internet and ways to improve search engine rankings. I then noticed the page with his contact info on was left as "Untitled Document".
 
So here you are Dr Beany

Macromedia taken over by Adobe

Tuesday, May 3rd, 2005

Being a Web Developer I use a fair few Macromedia programmes. Most of the work I do in Dreamweaver. I could actually work on an old 386 running Dos, Edit and a FTP program since most of what I do is pure coding. The reason I use Dreamweaver is because it makes things a lot easier for me. The FTP side is integrated, as is a file browser and then the colour coding is simply a life saver when your reading through a couple of hundred lines of code…
 
I can even live with the fact that Dreamweaver very rarely displays any of my pages correctly since it´s a bit unreasonable for it to interperate the heavy levels of database driven coding in them. In short, I love this program. I also do a bit of Flash development every now and again, and when I need to do any image manipulation I tend to use Fireworks. Quite a happy Macromedia customer.

 
And then there´s Adobe… With them traditionally having a print based product line I don´t really use many of their programmes and the ones I do seem to be a bit buggy and bloated. With Adobe now holding the reigns of Macromedia´s development, I hope they don´t have this effect on the current Macromedia product line. I could switch to Illustrator without complaining too much. And I can´t see them discontinuing Flash. But if they screw up Dreamweaver, I am going to be pissed….