Great come back to Brown at the EU

March 25th, 2009 by Richard No comments »

and

Update: Dan Hannan has made a blog entry about his video going viral and how the main stream media no longer control the news.  It’s definitely worth a read.

Conservative Logo Generator

March 16th, 2009 by Richard No comments »

…brought to you by the Labour Party.

Make your own logo, except hilariously they haven’t bothered to filter, check or prevent abuse of it

Try it yourself

http://torylogo.com/

1603092232_330220266

Grammatical irritations

March 16th, 2009 by Richard No comments »

We are not all grammatically perfect but when it comes to advertising you would have thought someone would check.

Advert on the tube for Nivea for men beginning with:

“who would of thought…”

Changing browser loyalties

March 11th, 2009 by Richard No comments »

internet_explorer_7_logoI’m a web developer and unlike a lot of developers I have been a big fan and user of Internet Explorer 7 and now version 8.

However the standards compliance of Internet Explorer has always left something to be desired.  With the introduction of 7 a few years back the job of making sites work in Internet Explorer became a whole lot easier, but there is still a lot missing that really ought to be included, and thank goodness transparent PNG support was added.

Recently I switched to using Internet Explorer 8 RC as my main browser and whilst I like it there were a number of failings I found.  The first is the so-called standards compliance.  Well seeing as it doesn’t support lots of CSS 3 properties doesn’t really make it standards compliant, but I digress. Mainly my issues were with it’s rendering of pages that looked great in Firefox, Chrome, Opera and Safari but just didn’t work properly in Internet Explorer 8.  The sites weren’t even using browser sniffing to load different stylesheets.  Quite simply IE’s implementation of the standards was different to all the other major browsers.  Sorry Microsoft, must try harder!

Over the past month or so I’ve suddenly discovered that I now use Firefox 3 as my primary browser at work (I still use Safari 4 at home as I’m a mac person) and combine it with Firebug and it’s simply stunning.

Spreadfirefox Affiliate Button

What actually prompted me to write about this was a story I picked up upon this morning entitled ‘IE8 May Be End of the Line For Internet Explorer‘.  It discusses the fact that Microsoft might be considering using Webkit (the engine behind Chrome and Safari) for Internet Explorer. In an article on AppleInsider Steve Ballmer is quoted as saying

Addressing a developer conference in Sydney Australia, Microsoft CEO Steve Ballmer said the idea of using WebKit as the rendering engine within its web browser was “interesting” and added “we may look at that.”

The fact that Ballmer would even mention using WebKit is very interesting indeed as you’d expect such a thing to be dismissed out of hand.  WebKit quite simply has the fastest and best rendering engine of any modern browser.  Just try Safari 4 on Windows or a Mac to try it out for yourself

Living without Windows

March 10th, 2009 by Richard No comments »

Quite possibly the best article I’ve read about living without Windows and using Linux instead, and just why Linux still has a long way to go when it comes to desktop usage for non-techies.

http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=Operating+Systems&articleId=9126042&taxonomyId=89&pageNumber=1

Fixing other people’s code

March 10th, 2009 by Richard No comments »

Well I’ve spent a very productive afternoon fixing CSS bugs in jQuery UI http://jqueryui.com, to make a very specific set of conditions work under Internet Explorer.

If you’re interested, basicaly putting an overflow inside the dialog overlow causes the first overflow to render incorrectly if the positions are relative.

The great thing, though about the open source community is I can now help my fellow programmers by submitting my findings (and fixes) back to the UI dev team.

This is where I have mixed feelings about open source, as in GPL style open source. If I write software as a sole developer what can I realistically offer than a small amount of support in addition to effectively giving my code away for free to anyone who buys a licence. Then for them to be able to resell it and I don’t make money anymore.

The GPL is great for big projects or simply hobbies but it isn’t all that great for sole developers. I much prefercthr method of giving source with the application but don’t give distribution rights away.

Understanding the recession

March 6th, 2009 by Richard No comments »

A great graph showing the current state of the economy against other crashes.

Via dshort

Why clubbing isn’t, and never will be, a “laugh”

March 4th, 2009 by Richard No comments »

Found a great post on a web forum and to me it just about summed up clubbing.  I must be getting old!

It’s Saturday night. You’ve finished your work for the week, you’ve watched something during the day on TV – a football match or an old film, for example – you’ve just eaten a fairly easy meal, and now you’re ready. For what? Why, to go out. Out into the anonymous streets (all with generic high street chains and plenty of fast food places) to find something to do your friends. Pub? Too crowded. Meal? Well, you’ve eaten, and to sit there whilst everyone else is having chicken in a white wine sauce or seafood pasta is a bit off-putting. So where do you go. Only one option – clubbing.

Yes, the c-word, and not the one you usually think of. This is the phenomenon that has been going for years with steadily increasing popularity, particularly during the 90s and the Nu Rave movement (no, it’s not cool to spell “New” correctly, and yes, I’m a killjoy), and is now a regular feature of people’s lives up and down the country. As you can guess, I am not a fan of this feature. I would quite gladly find a semi-comfortable seat in a pub and have a quiet drink with somebody and put the world to rights, as Peter Cook and Dudley Moore often did back in their sketch show. But clubbing is a different animal entirely.

Firstly, you have to pay to get in, and it is always guarded by an extra from Lock, Stock and Two Smoking Barrels. I’m sure they are very friendly when not on the job, but come Saturday, you wouldn’t go near them even if your mother asked you, nay, demanded you to pick up your baby sister’s prized doll which was accidentally thrown from her pram and landed by their feet. But back to the first point – you have to pay? Why? We don’t pay to go into most other public places – pubs, shops, restaurants, even banks for goodness sake. Well, the reason why is because as soon as you enter one of these nightclubs, you are bombarded with so many things that you need perhaps 10 minutes to register what planet you are on. It feels like a Disneyland attraction gone wrong.

The music is probably the worst aspect. It is so loud that it can cause tremors to be felt as far east as Kobe in Japan (maybe that’s what caused that earthquake…). And it’s relentless because it is the same pounding beat over and over again for 7 minutes before it “effortlessly” fades into the next equally irritating remix. A headache is as bad as this – you wouldn’t want to dance to a headache, would you? But as well as that, the lighting is all over the place. I wouldn’t be surprised if an octopus on LSD was operating the rigging up there. Blue over there, green on his T-shirt, red against her jeans, purple on the DJ…just not white, because, you know, you don’t actually want to discover where you are exactly.

Accompanying this nauseous atmosphere is the sheer number of people, packed in like sardines in a tin. In a clown car. In a phone box. That’s how cramped it is, and that’s what makes it highly probable that you will inevitable lose your phone, prompting the creation of yet another Facebook group dedicated to re-discovering 70 of your friends’ numbers. But wait, you could always ask your friend there where it’s gone to, couldn’t you? No, that option went out the window long ago (if there is a window there), because they have not been deafened for the rest of the evening, as have you. The result of this should be that you each act like Wile E. Coyote and hold up wooden signs to communicate what you’re trying to say, but since no timber is available in the facility, you soldier on like a trooper, randomly shaking your arms in a fashion similar to someone suffering from an epileptic fit, and simultaneously sweating more than a pig in a sauna so that you produce body odour which will stink out not only your seminar the next afternoon, but every other room on the same floor.

So how do you combat this? By drinking of course! Not just drinking, but drinking so much that you can’t utter a single word without foaming at the mouth or vomiting down your front like a cheerful baby. Now admittedly, I am not a heavy drinker, but of course you can still have fun with just a couple of drinks every now and again. So why does someone insist that they will be getting “sooooo wasted tonight”, just to ruin your evening? There’s always one, and it’s often your friend’s friend, because they’re only young once, so they say. True, but I, for one, don’t want to spend my younger years being the subject of several embarrassing blurry photos where I was unstable, both physically and emotionally, and possibly responsible for ruining a nice friendship. But I am not this person, and this person being akin to someone playing dead in front of a grizzly bear, they need help getting back to their house.

Thus, you head for the car park, filled up by the endless streams of taxis awaiting these unfortunate, misguided innocents, all eagerly accepting the fare to take them halfway across town to their required destination. Since they’ve already attempted (and failed) to find a drain by the side of the road, just out of sight of the police car, to throw up in, they need help getting back safely. The friend is held over your shoulders, and whilst you wouldn’t find shoving them through the letterbox in the front door, they somehow fumble in their pockets and produce the keys and fall inside before crawling slowly up to the safety of their bed, where they will be sick even more. Finally, mission accomplished, you find your own way home, drag yourself upstairs and collapse in bed. Somehow, I’m not so sure the phrase “it’ll be a right laugh” can lend itself to what you have just experienced.

Obviously, I’m biased. I would much rather enjoy a night in with the company of a pizza, ice cream and a good long film. It’s relaxing, and if you didn’t order the pizza, it’s free. You can hear what another person is saying, the light is stable, and you don’t end up so drunk that you might contract liver disease. But I couldn’t possibly convince some people. They like letting their hair down and just having “a laugh”. Well, if that’s their idea of a laugh, then I’m very sorry, but I don’t find it funny. Maybe just funny to look at.

Two days with PDO and my lack of faith in the PHP extension developers

February 25th, 2009 by Richard No comments »

OK let me first start by saying, I absolutely love PHP, I tend to compile my PHP from source and for the most part have absolutely no issues with it whatsoever.

Now for work I needed to install PDO extensions to PHP with Microsoft SQL Server support (PDO_DBLIB). I shall also start off by saying that I currently use the standard sqlite extensions to PHP.

Now PDO is actually available on Linux as pdo.so in the modules directory usually by default so let’s actually just try to run

pecl install pdo_dblib

Can’t do that we get the error

“pear/PDO_DBLIB requires PHP extension “pdo” (version >= 1.0)”

OK well we had PDO installed but clearly the wrong version.  First up I recompiled PHP adding in the following configuration lines

–with-zlib –enable-pdo=shared –with-pdo-sqlite=shared –with-sqlite=shared

I actually already had zlib compiled, I just reference it here as it’s required. That all worked great, without errors.  So now let’s run

pecl install pdo

we should get the right version, correct?  No we still get the same error.  This led me to the following bug report.  Note that this bug was opened in May 2006 and is still unsolved at the time of writing.  What we have to do is manually download the package, edit package.xml and remove the PDO dependency line.  Install as usual and restart apache!

These are the steps that work

pecl download pdo_dblib

This will download a tar ball of the extension. Extract the tar ball.

tar -xzvf PDO_DBLIB-*.tgz

That will uncompress the package in to a standalone file, package.xml
and a folder containing the extension, in my case it was, PDO_DBLIB-X.X.
Where X was the version number. Open package.xml using your favourite
command line editor. Find and remove the line,

<dep type=”ext” rel=”ge” version=”1.0″>pdo</dep>

Save the package.xml file, and move it in to the PDO_DBLIB directory.

mv package.xml ./PDO_DBLIB-X.X

Navigate to the PDO_DBLIB directory, then install the package from the
directory. You may need root access for this step.

cd ./PDO_DBLIB-XX

pecl install package.xml

After editing php.ini to load

extension=pdo.so
extension=pdo_dblib.so

phpinfo() reported that the DBLib driver was available as was PDO, all was great. Now I tried to run sqlite_open and it refused to work.

I thought maybe it was the pdo sqlite extension that was conflicting, as I don’t actually use the pdo version of sqlite, just the main function library I decided to reconfigure php without the sqlite options.

Then I get an error saying that I had configured PDO as a shared object but sqlite was static.  Hmm the PHP manual tells me something different though and I quote

In PHP 5, the SQLite extension and the engine itself are bundled and compiled by default. However, since PHP 5.1.0 you need to manually activate the extension in php.ini (because it is now bundled as shared). Moreover, since PHP 5.1.0 SQLite depends on PDO it must be enabled too, by adding the following lines to php.ini (in order):

So this is telling me that SQLite is enabled by default and is installed as shared.  Well the PHP installer just told me different, that it’s installed by default but as static!

OK so back to configure PHP again but this time with the sqlite shared options.  Then we’ll reference sqlite.so in the php.ini extensions and restart apache!

Oh no we can’t load apache because the version of sqlite.so is incompatible with the version we need for pdo_dblib.so.

Let us run

pecl install sqlite

Running that gives us the following error

tmp/tmp8laqB1/SQLite-1.0.3/sqlite.c:125: warning: initialization from
incompatible pointer type
/tmp/tmp8laqB1/SQLite-1.0.3/sqlite.c:126: warning: initialization from
incompatible pointer type
*** Error code 1
make: Fatal error: Command failed for target `sqlite.lo’
ERROR: `make’ failed

The PHP bug report at http://pecl.php.net/bugs/bug.php?id=8181 that was opened in July 2006 tells us this has all been fixed, but with numerous responses telling the developers that it’s still broken.  At the time of writing, this is still broken!

This then leads me to the following fix

$ pear download sqlite
then unpacked and began to compile it
$ tar zxvf SQLite-1.0.3.tgz
$ cd SQLite-1.0.3
$ phpize
$ ./configure
$ make

edit sqlite.c, comment out the following line:
/* static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; */

And then change these lines
function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, arg3_force_ref)
PHP_FE(sqlite_popen, arg3_force_ref)
to:
function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, third_arg_force_ref)
PHP_FE(sqlite_popen, third_arg_force_ref)

$ make
$ make install
$ cp modules/sqlite.so /usr/lib/php/modules
$ /sbin/service/httpd restart

Why oh why do I have to edit the c source code to get this working?   Which by the way DOES actually fix the problem and now I have PDO, SQLite and PDO_DBLIB working on the same system.

This is why I’m starting to loose faith in the open source PHP community, not because they do a great job in the first place, but because bugs like this exist for well over 2 years!

The response from the Open Source community will be, fix it yourself.  That simply isn’t the point, I’m not a C developer, nor do I have the inclination to be.  I also do not know the inner C workings of PHP to easily fix these issues.

I’ve just wasted two days of my life researching, testing, debugging PHP extensions, I hope it helps anyone else with these issues!