Saturday, 5 February 2011

Crappy code

I spend way too much time dealing with other peoples' crappy code. To that end, a very long time ago, I wrote a quick script that would help me navigate around a PHP source file in order to work out what it's supposed to, and what it actually does.

It generates a call graph of the functions and methods in a PHP file, example shown below.



It had been sitting, festering on my HD for a while, and I thought "Hey, maybe someone else might find this helpful" so I uploaded it to phpclasses.org

So blow me, not only do they find it useful - but they want me to support the damn thing too! And then I get nominated for an award! I had a quick look at the source code. OMG - it's a mess!

So a couple of late nights were spent cleaning it up until the API is at least usable.

You can get the (cleaned up, slightly) source code here

Friday, 14 January 2011

Keyboard not detected. Press F1 to continue

I don't moan all the time.

Once in a while someone goes out of their way to be helpful, or technology works the way it should or I find something which is useful / good value.

Today I bought a new keyboard.

Like many computer people I know, I've had the same PC for the last 15 years or so. In that time the motherboard has been replaced a few times, disk drives have come and gone, graphics cards and monitrs have been swapped. But the oldest component was an HP keyboard which has been putting in sterling service for the last 8 years.

So while I was in PCWorld/Curry's today, I picked up a Sandstrøm keyboard for £15. This has the nicest action of any keyborad around this price I'd seen, and has the added bonus that the keys have LED illumination.

The reason I was in Curry's was to pick up a simlarly branded HiFi for my daughter's birthday. Again which I thought good value.

Despite the scandinavian looking name, not surprisingly both are made in China, and although time will tell regarding the quality of the electronices, both seem to be reasonably solid construction.

I suspect that the manufacturer / importer / retailler are currently discounting heavily to establish the brand in the UK.

Getting all the keys to work on my home machine (currently still with Fedora 9 - a Linux distribution) was surprisingly easy (most of the extra weeks worked as soon as it was plugged in anyway).

It does have a somewhat compressed physical layout (the space bar is only 60mm) so I'm still hitting thEWRONG Kets some if the time but I@m sure that will pass/

Wednesday, 23 June 2010

Where can I get away from them

The internet is great - everyone has access

The internet is terrible - everyone has access

When I first started using online systems (some time before the arrival of the internet - but I'm not saying how long) people I met online always seemed so knowledgeable and helpful. As I progressed through my studies, and the internet became available I was getting at least as much out of newsgroups and mailing lists as I put in. But gradually the balance shifted - increasingly I saw people asking dumber and dumber questions. For a brief period Stack Overflow seemed to be the new hope, before it became as bad as anywhere else (although the rating system bolstering my ego still tends to outweigh my disappointment at the quality of the questions nevermind the "answers".

While I'd like to think I know what I'm talking about in the forums I participate in regularly, I don't think I'm any sort uber-guru (yeuch - what a horrible term) but primarily I go there to learn - and I'm not learning anymore.

Of course the same questions come up again and again:
  • How do I make this pattern fit this problem?
  • Do my Class Assignment for me
  • The people I pay for support won't answer the phone any more so I'm posting my question here
  • It's broken, I don't know why, but I expect you to fix it
Am I just getting too cynical in my old age? Maybe I'll take up nuclear physics as a hobby so I can go back to being a newbie and asking stupid questions on the internet myself.

C.

Monday, 24 May 2010

Little furry babies need adopted!

For those of you whom I've not met, my daughter breeds and shows rats. She's done very well winning several best in breed and couple best in show at national level.

The reason I mention this is that we also provide short-term fostering for rescue rats - and we're currently trying to find homes for 13 rescue rats. If you live in the West of Scotland, and are interested, please visit our site at www.ralstonrats.co.uk

Tuesday, 6 April 2010

Dokuwiki is smarter than I am

In a previous episode, I was moaning that I couldn't get my DokuWiki RSS feed to display using the RSS parser - it was my wetware which was not up to the job!

I'd configured this Dokuwiki to disallow any anonymous access - and the RSS generator (feed.php) was correctly showing all the items which the anonymous user was allowed to see - i.e.none!

I didn't realise this until I'd downloaded the latest stable DokuWiki and ported the hacks I've applied to it, then patched my installation - which obviously did not fix the problem.

In the meantime, I've created a new user with read access to the entire wiki - then changed my RSS wiki syntax to pass the auth details:

{{rss>http://www.mysite.com/dokuwiki/feed.php?u=anonymousRss&p=s3cr3t}}

Apologies to the DokuWiki team!

Thursday, 1 April 2010

New Site Up

I've setup a website for my daughter's business (well the whole family are involved really). Its at http://www.ralstonrats.co.uk

Does DokuWiki eat its own dog food?

In the last exciting episode I wrote about my troubles setting up blogging/RSS in Dokuwiki - I eventually gave up and installed Serendipity to handle this.

Having done that, I've now gone full circle and am publishing the blogs as an RSS in DokuWiki. I wanted to provide a single news list, so I had a look at integrating the 'recent changes' feed from DokuWiki on the same page as the serendipity blog - however the DokuWiki RSS feed works with every reader I've tested except the one built into DokuWiki!!!!

AAAAARRRGGGGHHHH!