Category Archives: life

Graham Coxon at the Barbican

Bronwyn and myself went to the Barbican, London, on Saturday to watch Graham Coxon perform.

We both enjoyed the event. Bronwyn was excited to meet friends she had only spoken to online. Well, she’s been excited for the whole of the last week, but it’s all related!

London is big.

The weather was ok for the Friday and Saturday while we were wandering around taking in sights and sounds. We visited the National Gallery, and were handed a sheet saying a candle-lit baroque concert would be happening later, but it clashed with our previous plans.

Arrived at the Barbican. Bronwyn didn’t see any of her friends. We said we’d meet up around the bar, so that’s where we went, and sat opposite it.

We were there about five minutes when I spotted a huge amazing monstrosity of a drum-machine, Felix’s Machines. You have to see the videos of that thing!

As I stood there, Simon from Resigned (also the admin of the Graham Coxon forum) noticed me and waved to get my attention – ah, that’s where they are! We joined a group of Coxon fans.

We had two hours, so we gently infused ourselves thanks to the bar, with some opting for chips and complaining that you shouldn’t need to buy fish&chips just to get some chips (as a vegetarian, I agree wholeheartedly with this, and not just through a hatred of waste).

The show was to start at 8, so we headed down and got our seats.

Simon had thoughtfully gotten us row G (haha – G for Graham. very good. ahem…), which had a walk-space directly in front of us, meaning we could stretch our legs and walk to the toilets without stepping on people’s heads.

Bronwyn decided a new piece of policy was to be created henceforth: when purchasing tickets, people should be measured for height, and really tall people should be confined to the back of the auditorium.

The band came out and the place became loud with cheers.

The sound engineers didn’t do the best job in the world. The band played brilliantly apart from a few minor hiccups, but some of the sound problems were distracting.

When Graham spoke, it was difficult to hear. I was afraid that his singing would be the same, but when he sings, he crouches close to the microphone, and when he talks, it’s like he’s unaware the mic is there.

Some of the songs were technical, involving a lot of finger-picking. An example is Sorrow’s Army. Graham started out on that one, then Robyn Hitchcock joined in a few bars later. Robyn’s guitar, though, was louder, so it drowned out Graham’s playing. This was pointed out independently to me by Simon later on, so it wasn’t just my ears playing tricks.

There was a feedback problem later on at the beginning of one tune, which was quickly and cheerfully quelled and restarted.

One of the three female singers was very loud at points. I didn’t like that – it was like she was stealing the spotlight.

On the far left of the stage, Max Eastley was playing the Arc. At most points in the concert I couldn’t hear anything of what he was doing. Only in quiet songs with only one or two other instruments.

When the songs got loud, they got very loud. Graham was unintelligible at some points as he tried to sing above the sound of the other instruments.

Apart from these gripes (and they’re minor – Bronwyn doesn’t agree with any of the above points), I enjoyed the concert.

I think the only tune I didn’t like was the ending of Caspian Sea, where the band appeared to get stuck in a rut, repeating the same bar over and over and over.

I liked how the music was not perfectly in-tune or perfectly rhythmic, but was just a little off here and there. This gave the music a more natural and “used” feel, like an old rickety piano which is played when the pianist is surrounded by friends – you feel like he’s playing personally to you and it’s not a surgical procedure.

The concert was basically Graham’s latest album, The Spinning Top, with a few extra old songs played at the end.

One of the things I like about this album is the finger-picking. Graham has recently been trying to increase his finger-picking skills, inspired by his love of old blues and folk. His interest in Nick Drake really shines through in the singing, and Bert Jansch (of Pentangle) in the playing.

In a lot of the songs, there is not just one finger-picking “voice”, but two. This could be seen obviously at the concert where Graham was playing one finger-picking riff and Robyn was playing another, yet they meshed nicely.

Overall, I enjoyed this concert and if he does it again with another album, I’m sure we’ll be going over again.

resigned – the band

We were sent an invite to come see Resigned play (interesting name – does it mean “gave up”, or “was signed again”? I’ll ask them tomorrow) at the Water Rats Theatre.

Bronwyn commented, on seeing the dance-floor, that it was “very like Fibbers, except for the smell”. ;-) Fibbers (Parnell st) has a bit of a reputation – especially among those of us that have been frequenting the place more than 15 years.

I visited the toilet at one point there and can confirm that it out-fibbers’s fibbers. It was rank.

Having said that, the people that were there were eclectic. There were punks, industrials, grungers, rockers – hard to put a label on the place when everyone is so different!

Anyway – back to the band – I enjoyed it. I was expecting some hard punk, as “resigned” is a very serious name, but the music was actually quite interesting and not as harsh as I expected. There were interesting rhythms (listen to their track “Hangover”) that make you feel like you need to dance or at least admire it, and at no point did I feel they were copying anyone.

Their last track was dedicated to “someone in the audience”, and they played “Advert” by Blur. It was aimed at Bronwyn and a few other Coxon fans.

We spoke to Simon, Gary and John. The playing was perfect – no sign of effort from anyone; everything was “to a tee”. For example, while playing some tunes, I noticed Simon fiddling around with his effect pedals /at the same time/ as playing his part. Very cool. Not a beat dropped – I liked it.

John said that there was a bad gig a few weeks back where there wasn’t enough practice beforehand and it all fell apart, but it didn’t show tonight at all. Solid playing, and I’d love to see them play again.

We were handed a CD of their album which they refused to accept payment for, for reasons which agree almost with my own philosophy.

My belief is that people should be paid for what they do. Royalties are a bonus, but should not be considered as “earned”.

As an author of a book, this might fly in the face of reason, but the thing is – I wrote my book because I wanted to, and I enjoyed the act of its creation. Anything afterwards that I get paid is a bonus, but I don’t feel I’ve earned it (Yes, I’m very grateful for it (thank you!!), but I don’t feel I should demand people pay me if they accidently find my words online).

I suggested this to Simon, in the case that musicians should be paid for the gigs they play, and everything else is a bonus.

This appears to be the same model that large bands such as Nine Inch Nails and Radiohead are following recently – basically, it’s all free, but there’s really nothing that compares to seeing it live.

We haven’t gotten to listen to the CD yet, as this laptop does not have a CD drive, but I’m sure Bronwyn will have it on repeat for the next few weeks.

Well done, Resigned, on providing a very good night out, and we’ll talk to you tomorrow before Graham’s gig!

fanfic

I’m really sorry about this break in the usual service. This came to me as I was walking to work and I had to get it down.


Wilson spotted House and ran up to him. “Doctor, I have an interesting one for you!”

House looked up from his TV. “How long?”

“What?”

“How long have you been seeing Clare?”

“A week. Wait, how did you know??”

“Your sleeve. There’s a faint red smudge on it. That says lipstick to me. The fact that it’s on your uniform means it is someone at the hospital. The nurses and doctors do not wear cosmetics in case they interfere chemically with the patients, which leaves secretaries or janitors. We have no female janitors, and none of the janitors wear lipstick anyway, which leaves Janine, Clare, Rose and Sarah. Only Rose and Clare have been on-duty for the last few hours, and Rose is over 50.”

Before Wilson could reply, House added “You should probably break up with her. Clare has an incurable disease and will be dead within a month.”

“How do you know that?” asked Wilson.

“I’ll explain later. Now, what have you got for me?”

They walked in to look at some X-rays.

“The patient was brought in an hour ago. He’s wheezing, complained of diarrhoea and double vision and collapsed. We thought it was food poisoning until we took these photos. That’s when we knew you’d be interested.”

“These photos are backwards.” said House, instantly.

“No – I checked; they’re actually the right way around. I’ve ordered an MRI for him.”

“Don’t bother. I can see what the problem is. It’s food poisoning. Bring me to him.”

They entered the patient’s room, where he was getting undressed. House looked at his shoes, and then his chart.

“Professor Grant? What is it that you do?”

“Physics. Specifically working on teleportation.”

“I’ve heard that only works for small elements. You need to link them together somehow?”

“Yes. Quantum entanglement. But that’s not what I do. What you’re talking about is actually the cloning of attributes between two remote particles. Not true teleportation. How mine works is that we ‘map’ one part of the underlying foam onto another, and the originator ‘snaps’ into the new position.”

“Foam?”

“Yes. See the universe is built on a network of tiny nodes, and all points are connected to all other points through these nodes. We have come up with a way to realise teleportation by controlling those nodes. We’ve even tested it successfully with large living bodies such as dogs and monkeys. You see, …”

“You can explain on the way. We can’t treat you here. We need to get to your lab.”

“What? Then you know what’s wrong?”

“Yes. Food poisoning. But it’s more serious than that. Wilson, look at his shoes.”

Wilson looked at the professor’s shoes.

“What? Oh!” he glanced towards the X-ray room, and looked startled.

“Get your car keys, Wilson – we need to get him to his lab quickly.” House held out the professor’s coat.

They were soon in the car.

“You couldn’t resist testing it yourself, professor, and that’s what caused the problem.” said House, as they drove.

“What? Explain.”

“As I understand it, your teleportation works by ‘shortcutting’ the distance between nodes in the universe. To put it in a simple way, it’s like taking a piece of paper making two dots on it, then realising the shortest way to get from point A to point B is to fold the paper in half so the dots are touching each other.”

“Yes, that’s right. But I don’t see…”

“Have you tried doing this with anything other than dots?”

“No… it’s just a thought experiment! Turn left up ahead.”

“Turn right, Wilson”, corrected House

House reached over and pulled a small notebook from Wilson’s inner chest pocket. He drew a large R on a page.

“What will this look like when the page is folded?”

“Ah. It’s so simple.”

They got to the lab, where an experiment was about to take place. A monkey was in a cage on a platform, and another platform was in a separate room, separated by a glass wall.

“Stop the experiment,” said Grant, “the good doctor’s diagnoses is correct, and his treatment involves me taking the experiment myself.”

“What? Are you insane? You can’t do that!” cried out one of the lab assistants.

“Yes I can. I did it myself last night after you’d all gone home. How could I resist? Besides, we know from all of our experiments that it works. Now, take the monkey away and start it up again.

A few minutes later, a hum gathered, and the cage was suddenly gone. In the other room, the cage and the professor reappeared.

“How did they do that?” exclaimed Wilson.

“Quantum electro-dynamically, my dear Wilson”, said House.

The professor stepped out of the cage, and strode purposefully towards to coke machine in the corner of the room. “I am famished!” he said.

“Okay,” said Wilson, “now explain what that was all about.”

House took out the page he’d been drawing on.

“See the ‘R‘? When you fold the page over, and “push” the R through to the other side, you get this:”, House drew я onto the page.

He continued, “The analogy passes into reality. When Professor Grant ‘folded’ in space from one platform to the other, what he did not realise was that he was reversing himself at the same time. He would have been immediately disoriented, and the air in the atmosphere would have started subtly poisoning him because it was now ‘backwards’ compared to what he was used to.”

Wilson said, “So, the food poisoning?”

“Life’s molecules have a certain ‘handed-ness’ to them. The proteins found in food are all oriented in a certain direction. When he ingested the food, his body was not able to handle it because all of the proteins were mirror-images of what were expected. If he had not come to us, then he would be dead within hours or days.”

Professor grant, stuffing chocolate into his mouth, came over and thanked House profusely.

“Thank you so much. It was such an obvious problem, given hind-sight, but we didn’t spot it with any of our test animals because we always did the experiment twice – teleport them from one room to the other, and then back. We’ll have to figure a way of doing this without the mirror-imaging if we’re to make this useful. I’ll have to think how to do that.”

“That’s easy! Your problem is that the particles – the protons, electrons and neutrons, are all arriving the wrong way around” said the doctor, who added “you just need to reverse the polarity of the neutron flow.”

jQuery 1.3 With PHP: cover mockup

6989_MockupCover

I’ve been sent a mockup for the book’s cover. The suggested title of the book is “jQuery 1.3 with PHP”. The working title was “PHP and jQuery”. Which do you prefer?

The book has been completed, in that all the chapters are written, and it’s in the final edit phase at the moment. This involves Packt having a technical editor try everything in the book just to iron out any kinks. It’s already been gone over by three other reviewers, and the only problem appears to have been with the File Management chapter, where the web-server was IIS on Windows. That should be solved by the time the book comes out.

I’ve learned a lot while writing this book. A major point that keeps raising its head is that I keep using colloquialisms and aphorisms (ha! “raising its head”), and those are not globally understood. Another is that I keep using British spelling, but it’s expected that most readers will be American.

From a coding point of view, I tend to write compact code with comments only appearing where something is obviously confusing, but I’ve tried to put proper comments in the book whenever any reviewer asked a question about the code.

Anyway – I expect it will be in PDF form in only a few weeks! I’m looking forward to hearing what people think of it.

On a funny note, I was working on something in work recently, and was trying to figure the best way to do it, when I suddenly remembered I’d written a whole chapter on it, so went and read what I’d written! I’ll be keeping a copy of the book on my own shelf ;-)

This kind of thing is always happening to me – I would need to solve some problem (hooking an OKI B2200 printer to Linux over Samba, for example), go searching for the answer, and find that I’d written the solution for it a year or two previously…

By the way, KFM 1.4 will be released next week. It will be the last 1.x version. We (Benjamin and myself) are starting a total rewrite after that, which will become KFM 2. It’s going to be massive!

EDIT: 2009-09-18 Wow, that was quick! The book is already available to pre-book

goodbye Andy

bollox

During my late teens and early twenties, I lived in a series of houses with Andrew Niland. We went to the same bars, had the same friends, and were into the same things (computers, body modification, “banned” films, industrial music).

In fact, I ended up going out with and eventually marrying his ex-girlfriend, Bronwyn, after living in the same house as the two of them for more than two years.

Andy was always into piercing, and spent a lot of time at Glen’s piercing parlour, learning from him.

After learning enough from him and experimenting enough that he was confident in his abilities (it didn’t take long; Andy was always brilliant, and very quick at learning what he was interested in), Andy left Ireland and went to Canada, where he ended up working for the Sacred Art tattoo parlour in North Bay, Ontario.

By that time, we’d lost touch with each other over after an argument where we all ended up moving house (we drank a lot, were young, and seriously, don’t go out with your best friend’s ex-girlfriend while living in the same house as him because that’s a recipe for disaster).

Andy had been in court in Ontario over a really stupid law which claims that some body modification is ok, but others should be regarded as “aggravated assault”, even though it’s all done consensually.

A few weeks ago, he vanished. On August 4th, he was last seen at 6.30pm. When he was missing for a while, his apartment was searched and it was found that he’d left his wallet there. A lot of fuss was made over this online, but this was not unusual for Andy.

The police searched for him for a while, and a Facebook group kept all of us uptodate.

Yesterday, Andy was found. The police won’t confirm it’s him, but how you could not identify a guy who has distinctive piercings and huge stars tattooed on his forehead, is beyond me. Besides, people close to him have confirmed it’s him.

An autopsy is to be held on Monday. At the best, this was a camping accident. At the worst, it was murder. We’ll have to wait and see.

Update (Sep 2): Police in North Bay have said that “there is no foul play suspected“. As usual with police, they have not offered any of the other pieces of information which people would really like to know, like “what actually happened?”.

jQuery 1.3 With PHP: chp7, image manipulation

I’ve submitted chapter 7 of jQuery 1.3 with PHP to Packt, which involves image manipulation. The editor I build in that chapter allows you to non-destructively manipulate an image in the most commonly needed ways – resize, rotate and crop.

The idea is that when you upload an image, it’s usually not yet right to include in a website. People tend to upload massive photos (3000×2000 or so) and resize it down using the <img> attributes, which is the wrong way to do it (see here for a solution to that particular problem).

However, once you’ve resized an image down, you can’t change it back.

The solution is to make copies of the image with your manipulations applied to them. That lets you make multiple versions of the same image.

But again, there’s the problem that if you change your mind about the original image, you can replace that, but the others all need to be redone.

Yet another problem is that unless you’ve kept records, there’s no link from the new images back to the original, so if you need to make space on the server by removing files that might not be in use anymore, you can’t be certain what thumbnails are still relevant and what are not.

The solution is to not actually create copies, but to record the changes applied to the original image in the URL of your manipulated image. When the server is asked for those URLs, it runs the manipulations on the original image and gives you back the new image. Of course, we will cache the new manipulations so this doesn’t need to be done every time, but this now allows you to replace the original image, then clear the cache, forcing all the variants of it to refresh, without you needing to do it again.

What this means, is that when the manipulation is recorded in the URL, no new copy is actually created until some browser actually requests it. This means that you can periodically clear your old thumbnails, safe in the knowledge that if they were still relevant, they will be recreated from the archived originals automatically the next time they’re needed.

Enough talk.

demo

This is, as usual, just a demo. It’s not designed to be impressive, but just to show how to do manipulations.

A permanent URL is provided, in the same manner as google maps – it updates itself as you manipulate it. To see the actual cropped, resized and rotated image, try opening that permanent URL in a different tab.

The GUI here is a means to an end (the permanent URL). In your own CMS, you might force a certain width/height for uploaded images automatically using the URL for example.

The example image I manipulated in the chapter is the IMG_0134.JPG in chp7. Try rotating, resizing, and cropping (drag your mouse on the image).

example:

Little thing to note about that URL – there’s no query indicator. Standards-compliant browsers treat the ‘?’ mark in a URL as an indication that the result should never be cached, but that would be pretty expensive for the server, so we remove that. The get.php file rebuilds the query from the $_SERVER['REQUEST_URI'] and sends out the manipulated image with caching headers.

The graphics manipulation was done using Imagick, which is a PECL extension that allows PHP to run ImageMagick functions internally.

In Fedora, you can install Imagick with yum install php-pecl-imagick. In CentOS, follow these instructions.

CentOS users might have a problem with the latest Imagick (2.2.2), so change the pecl install imagick line to pecl install imagick-2.2.1.

download the demo

Make sure to edit the images_libs.php file to point to your own image repositories. The images don’t need to be in a web-accessible directory.

I’ve a bit of work to do now, and then I’ll be applying the tricks in this chapter to our own CMS, WebME.

jQuery 1.3 With PHP: Calendars

I was supposed to write about Datatables for chapter 6 of jQuery 1.3 with PHP, but the website of the plugin I was going to use (http://www.datatables.net/) was down for about a week, and so I wrote about Calendars instead.

I used Red3‘s jquery-week-calendar plugin for a recent project in work, and was so impressed I really had to write about it.

In chapter 6 of the book, I’ll walk through how to build a simple calendar, including creation and editing of events, and including once-off and recurring events.

demo

The demo is a session-based calendar, which records only for the duration of your browser session. It’s for demo purposes only, obviously. If you want to use it in a larger project, you would need to adapt the PHP so that it records to a database or files or something.

Download

Here’s an image of it in use:

fig_6_0

Only four or so chapters left and then I’m done with the hard part. After that, is rewrites, then you can all throw your money at me.

iphone

Okay, I succumbed to the temptation and got one.

A number of annoyance have presented themselves already, in just the few hours that I’ve owned it.

First off, when you get the thing, it’s in a fancy box with all the bits and pieces in it. I took all of the bits out, and found a nice rectangular cardboard box which when opened, held the documentation. I took out the documentation and read through it, discarding the box. Couldn’t figure out how to install the SIM card into the machine, as the documentation did not mention it anywhere. After an hour or so of puzzling over it, I finally noticed that the documentation box, which I had discarded, had a weird little diagram on it, which when deciphered, explained how to do it. Way to go Apple – in this case, I did RTFM, but TFM didn’t have the instructions I needed.

Secondly. After going through the jumpy-hoopy thing of filling in a form and waiting 24 hours to be allowed to own the machine (for some reason) and then waiting another hour for the receptionist at the shop to finally get through to O2 to activate the SIM, I was just picking up everything and the guy said “ok, now you just need to activate it through iTunes”. Excuse me?? It’s a fucking phone! I can’t get iTunes running on any of my computers at home anyway because I don’t have anything that runs Windows or Mac! I spent hours trying to get Wine to install iTunes, but finally had to give up and do it on an old WinXP machine in the office the next day.

Then, I wanted an SSH client for the thing. There is a cool store for the iPhone called appStore, and there were a number of SSH clients in there. In order to get one of them, though, you need an account and some cash.

First off, I tried to just create an account. This went okay, up until the point where iTunes asked what my credit card number was. I don’t have a credit card, and don’t want one. After a while, I figured out that the only way to get an account for free (or at least, without giving Apple credit card details), is to apply to download an app which is specified as free – for some reason, in that case, Apple adds a “none” option to the list of payment methods.

So I had an account, but still couldn’t pay for anything. Apple claim that they accept PayPal, and even supply instructions on how to do it. Unfortunately, it falls down immediately, because step two says to click Edit Credit Card or Add Credit Card in your iTunes account page, but those links don’t exist! Maybe they exist if there is already a credit card attached to the account, but that defeats the entire purpose!

But it’s a nice phone, really.

error logger, mantisated

The plugin architecture for Mantis is not yet mature, so I’ve bypassed it in this. Instead, this script will inject issues directly into the Mantis database.

The following script will load up all errors aggregated with the last post’s script, and will add them as Mantis issues (or update existing issues if found).

<?php
$t=time();
$project_id=6;
$error_urls=array(
  'http://the.url/error_checker/?password=abcdefg&maxlines=5000&last_date_read='.($t-3600)
);

require 'config_inc.php';
$db=new PDO($g_db_type.':host='.$g_hostname.';dbname='.$g_database_name,$g_db_username,$g_db_password);
$db->query('SET NAMES utf8');

foreach($error_urls as $eu){
  echo $eu."\n";
  $errors=json_decode(file_get_contents($eu));
  foreach($errors as $err){
    $md5=addslashes($err->md5);
    $q=$db->query("select id,summary from mantis_bug_table where summary like '$md5 %' limit 1");
    $r=$q->fetch(PDO::FETCH_ASSOC);
    $cnt=(int)$err->count;
    if($r){
      $id=$r['id'];
      $cnt=preg_replace('/.* \(([0-9]*)\)/','\1',$r['summary'])+$cnt;
      $db->query("update mantis_bug_table set status=10,summary='$md5 ($cnt)' where id=$id");
      $btext=addslashes($err->log);
      $db->query("insert into mantis_bugnote_text_table values(0,'$btext')");
      $btext_id=($db->query('select last_insert_id() as id')->fetch());
      $btext_id=(int)$btext_id['id'];
      $db->query("insert into mantis_bugnote_table set bug_id=$id,bugnote_text_id=$btext_id,date_submitted=now(),last_modified=now()");
    }
    else{
      $db->query("insert into mantis_bug_table set date_submitted=now(),summary='$md5 ($cnt)',project_id=$project_id");
      $id=($db->query('select last_insert_id() as id')->fetch());
      $id=(int)$id['id'];
      $db->query("insert into mantis_bug_text_table set id=$id,description='".addslashes($err->error)."',additional_information='".addslashes($err->log)."'");
      $btext_id=($db->query('select last_insert_id() as id')->fetch());
      $btext_id=(int)$btext_id['id'];
      $db->query("update mantis_bug_table set bug_text_id=$btext_id where id=$id");
    }
    $db->query("update mantis_bug_table set last_updated=now() where id=$id");
  }
}

Note the bold lines – the first indicates what Mantis project to place the issue under. In my case, I created a new project named “httpd errors”, which had the ID 6. The second is an array of URLs pointing to where the error aggregators can be found. In this case, the Mantis injector is going to be called from cron every hour, so the URL includes a time limit looking for errors only in the previous hour (3600 seconds).

Victor Borge – absolute comic genius

I’d never heard of this guy until very recently, but now I can’t get enough of it.

Here he is with Zhahan Azruni doing the most amazing version of Liszt’s Hungarian Rhapsody #2.

And here he explains what a conductor does.