Back under my mums wing

I was away for close to four years, three of which were in the UK and one in Australia. I now find myself back in my mums house. It’s only temporary until myself and two buddies move into a friends house for at least a year (the house owner [Dan :)] is on a whopping two year honeymoon).

Last weekend was one of the most hectic and emotional of my entire life. On thursday I left the office in Karova to work remotely here in Dublin. I also handed bobby (my dog) over to his new owners. I collected my brother in Liverpool airport as he came over to help me pack.

On friday we collected the hire van and began packing until about 8pm. We then decided to go for a chinese and a couple of pints. We arrived home at 3.30 am.

Saturday we were mightily hungover – jaegerbombs will do that to you. We packed until about 5pm and had a dirty kebab. We got the 10pm night ferry from Liverpool to Dublin.

On sunday morning we arrived in Dublin at 7am and began unloading the van which took a couple of hours. I crashed/unpacked for the rest of the day until 7.30 when I went back to dublin port to  get the 10pm night ferry back to Liverpool to retutn the van and pick up my car.

On monday morning I arrived at 5am and after retutning the van I began packing the rest of my half of the house into volvo. At 1.30 pm I said my final goodbyes to my house (which is still for sale) and to Gillian and drove to Holyhead for the 5pm Swift to Dublin. The swift is not so swift and is always late (in all it’s pretty shit) so I arrived in Dublin at 9pm. I am now an official Irish resident once again. It’s not a woohoo moment and it’s definitely not a boohoo moment. I’m looking forward to taking some RnR time with my mates.

Ajax header image rotation

Previously on Philroche.net, the header images were populated from a PHP Array which generated a ul with javascript links to change the header image. Not nice as it relied on javascript. After some ajaxian fun, the list is now generated from an XML playlist and the list is fully accessible with click events attached to each link to change the header image. You can view all the source below but there’s also an example page. Please note that this is version 0.1 (read- possibly buggy) so if there’s any problems let me know and I’ll debug.

Source code

Property for sale in Shotton, Deeside (Mine)

Property for sale in Shotton, Deeside (Mine)Some of you might not know yet, but I am moving back to ireland and as such my house is for sale, you can view the full brocure and view it on Rightmove.

Stunning original features mixed with modern conveniences, this three bedroom semi offers a sizeable and well maintained home. Having original features including: leaded and coloured pannels, dado and picture rails. Modern features include, gas central heating, Upvc double glazed windows and stunning kitchen with display units and butchers block worktop. The accomodation briefly comprises: porch, hallway, living room, reception room, kitchen, utility, three bedrooms and bathroom. Externally there are low maintinance gardens and vehicular access to the rear.

Room Dimensions

  • Hallway
  • Living Room 13’0 into bay x 11’4
  • Reception Room 12’8 x 102
  • Kitchen 16’2 x 10’9
  • Utility 9’0 x 8’4
  • Landing
  • Bedroom One 16’3 x 13’5
  • Bedroom Two 12’7 x 10’2
  • Bedroom Three 10’9 x 10’8
  • Bathroom

Full Details Provided

Thomas C Adams provide full property details to rightmove.co.uk . If you have other questions, please telephone 0845 338 1102 (low call rate).

Disclaimer

Property reference TSP00639. Details provided and maintained by Thomas C Adams, Shotton. Rightmove.co.uk makes no warranty as to the accuracy or completeness of these details.

Sold my iBook

When I lived in Sydney, I bought an iBook and I loved it, loved it, loved it. It served me well traveling and as a test and “in front of TV” machine.

Sadly, I have sold it. To my colleague Joel, so it’s in good hands.

I am now in the market for a new personal laptop. I’ve been looking at 12″ 13″ and 14″ models. Dell, Samsung, Sony, Apple. I cannot decide and it’ll be down to price and battery life I reckon. I do like the MacBook Pro but it’s 15.4″ and pricey. There’s also the Sony Vaio G1 but it’s only Intel Core solo.

I’ve also sold my Libretto L5 so it’s getting a little urgent. Any suggestions?

Airport observations and a tonka truck of a hangover

I went home last weekend to visit my pals and family. It was awesome. For various reasons, I needed to go home and get pissed and good lord, that I did.

This is what I can remember from Saturday night-

  • Leaving twelfth lock
  • chatting to conor on train
  • going into odeon
  • Dancing by the table
  • Dancing my ass off on the dancefloor – alot of which involved kneeling or lying on floor
  • buying shots for everyone – €60
  • drinking quite a few of those shots
  • someone taking a picture of the shots
  • chatting for ages with the aftershave guy in the toilets
  • eating a hotdog
  • singing oasis on grafton street with buskers
  • sitting on bottom step of nightlink stairs
  • getting sick in some clonsilla road garden
  • crawling up endas stairs

Quite good really but these are my flashbacks – I can rememember nothing in between. All evidence points to it being a great night.

Sunday was not good. Enda very kindly fed me bacon which helped but I felt like crap for a day and a half after that. It’s a sign of age I think (I’m a whopping 27 now).

On my way home on Wednesday morning I made a few observations at the airport.

  • Nobody seems to notice the cone instructing not to walk beside the killer jet engine
  • The best seat to get on a Ryanair flight is the very back seat. It means you’re first off and it’s always free when you wait till the end to board.
  • 5.30am chicken salad sandwich for breakfast is fucking disgusting
  • Ryanair have no clue about organising the boarding of flights – it’s a bloody free for all
  • Despite their flaws – Ryanair absolutely rock. £48 return within one week of flying. Awesome

I’ll be back in Eire next weekend and hopefully my body will be more accustomed to the onslaught of Guinness it shall receive (it is Paddys weekend and Guinness must be drunk (as must I)).

The importance of an email’s subject

All too often, I get emails with one word subjects. It has always annoyed me and I have always edited the subject in my reply. It’s even worse if the subject makes no sense, has nothing to do with the content or the worst, no subject at all.

With several thousand emails in many folders, finding an email with a dodgy subject is a nightmare. I can search the content of the emails, but the result list shows me only subject so I’m none the wiser.

The importance of an email's subject

Please people, take care in writing your email subjects. In my opinion, it is the single most important thing when communicating via email. If you recognise one of the emails above, sorry but it does need addressing-
Rant over.

Extend Your Browser

Tuesday 6th (the day of my presentation) eventually rolled around. Due to a crazy machine rebuild and re-install fest, I only finished writing the presentation at 1:30pm on the day. It went really well, some very good questions at the end. As I mentioned in my previous entry – the description of the presentation was –

Firefox and the Gecko family of browsers are not simply web browsers, they can be extended to provide custom functionality, and used as platforms for building standalone applications. During the presentation I will discuss the anatomy of the Gecko engine and the Firefox browser, extensions and how to create an extension for the Firefox 2.0 browser using Aggreg8 (http://aggreg8.mozdev.org ) as an example.

Philip is a 2003 Software Engineering graduate of Dublin City University. He has been working at Karova Ltd for two years, on ecommerce and custom web applications, and now holds the position of Senior Developer. Outside the office, he hacks on Firefox extensions and small Python or Perl based open source projects. He loves C#, XSLT, Python, MySQL, WxPython, SVG, XUL, Gecko, Javascript, RSS, CSS, his Labrador puppy, Ubuntu and Mono.

You can now download my preentation-

In MP3 audio format – (no pen clicking this time 🙂 )
ITWalesExtendingYourBrowserPhilipRoche.MP3 [mp3 31 MB – 1 hour 2 minutes]
PDF of my presentation slides
ExtendingYourBrowser-Slides.pdf [pdf 501 KB]
PDF of my presentation slides – including my notes
ExtendingYourBrowser-Notes.pdf [pdf 548 KB]

Enjoy

Extend your browser – ITWales

Snippet from Extend your browserLast year I gave a presentation to the ITWales group on Content Syndication. I have been bullied into giving another presentation next Tuesday. I have entitled it “Extending your browser”. Directly from the flyer –

Firefox and the Gecko family of browsers are not simply web browsers, they can be extended to provide custom functionality, and used as platforms for building standalone applications. During the presentation I will discuss the anatomy of the Gecko engine and the Firefox browser, extensions and how to create an extension for the Firefox 2.0 browser using Aggreg8 (http://aggreg8.mozdev.org ) as an example.

Philip is a 2003 Software Engineering graduate of Dublin City University. He has been working at Karova Ltd for two years, on ecommerce and custom web applications, and now holds the position of Senior Developer. Outside the office, he hacks on Firefox extensions and small Python or Perl based open source projects. He loves C#, XSLT, Python, MySQL, WxPython, SVG, XUL, Gecko, Javascript, RSS, CSS, his Labrador puppy, Ubuntu and Mono.

You can also download a PDF version of the flyer. I’m even half way through writing the presentation so this weekend will be a busy one. Once I’m done, I’ll upload the PDFs of the presentation.

Halfviking get’s videos (ffmpeg, convert, flvmdi, flvplayer)

I’ve always wanted my online gallery export script to handle videos and last weekend, I bit the bullet and wrote it. I used quite a few Open source projects to accomplish this which means that PEAExport has a few dependencies but I think it’s worth it. My Canon Ixus takes AVI movies. The sizes of the movies range from 1MB to 50MB. To upload these would just be silly and each viewer would have to have an AVI viewer, which probably wouldn’t load in the browser. I really like flash movies players like those found on YouTube and Google Video so I anted to find a free one to use, I found the wonderful flvplayer @ http://www.jeroenwijering.com/. It’s an excellent player and free for non-commercial use.

So at this stage, I have my Videos in AVI format and a flash video (flv) player. I need to transcode them from AVI to FLV to work with the player. In work a few weeks ago we came across the SUPER application. This is a GUI front end to FFMPEG which is an absolutely wonderful utility, It handles tens of formats and hundreds of options. I used the FFMPEG.exe bundled with SUPER to tanscode them from AVI to FLV

ffmpeg.exe -i 'video.avi' -y -ab 64 -ar 22050 -b 200 -r 25 -s 650*450 'video.flv'

The options above (full list of options):

  • -i ‘video.avi’= input file is video.avi
  • -y = overwrite existing file if it exists
  • -ab 64 = audio bitrate is 64 kbit/s
  • -ar 22050 = audio sampling rate is 22050 Hz
  • -b 200 = video bitrate is 200 kbit/s
  • -r 25 = frame rate is 25Hz
  • -s 650*450 = rame size is 650 pixels by 450 pixels (WxH)
  • ‘video.flv’ = output file

Running this converts the hefty AVI video to a lightweight (relatively) FLV video. I then need to get the flvplayer playing this newly generated FLV.

<object data=”flvplayer.swf” type=”application/x-shockwave-flash”>
<param value=”file=video.flv&image=medium.jpg&linkfromdisplay=true&link=../14″ name=”flashvars” />
<param name=”movie” value=”flvplayer.swf?file=video.flv&image=medium.jpg&linkfromdisplay=true&link=../14″ />
</object>

There are many options for the flvplayer (full list of options). I only needed a few –

  • file=video.flv = input file is video.flv
  • image=medium.jpg = the loading image before you press play is medium.jpg
  • linkfromdisplay=true = when the user clicks directly on the movie area then they will be redirected to another page
  • link=../14 = when they click on the video, they will be redirected to the relative link “../14”

This plays fine but the progressbar isn’t running, This is a known limitation of FFMPEG (it’s fixed in the SVN version), FFMPEG does not write the metadata like video length etc to the FLV file. To do this, I was able to use another free utility called FLVMDI

flvdmi.exe video.flv video.flv

Running this inserts all the required metadata into the FLV video. The progress Bar now works perfectly.

You’ll notice that in the options for the flvplayer, I included “image=medium.jpg”. I could have used any image here but I wanted to use a frame from the video. Fortunately FFMPEG can do this.

ffmpeg.exe -i 'video.avi' -y -vcodec png -vframes 1 -an -f rawvideo -s 650x450 'videoimage.png'

The options above (full list of options):

  • -i ‘video.avi’= input file is video.avi
  • -y = overwrite existing file if it exists
  • -vcodec png = force video codec to png
  • -vframes 1 = set the number of video frames to one
  • -an = disable audio
  • -f rawvideo = force format to rawvideo
  • -s 650*450 = frame size is 650 pixels by 450 pixels (WxH)
  • ‘videoimage.png’ = output file

This results in a PNG file, quite a big one, taken from the first frame of the video. The file was too big for web use so I needed to convert it to JPEG. I could have used the Python image library PIL to do this (PEAExport already uses PIL) but I was already using some command utilities utilites to create videos and images. I thought, there’s no harm in another. That other was Convert.exe from the ImageMagick Library.

convert.exe -quality 75 videoimage.png videoimage.jpg

The options above (full list of options):

  • -quality 75 = compression level set to 75%
  • videoimage.png = videoimage.png is the input file
  • videoimage.jpg = videoimage.jpg is the output file

Excellent, I now have a lightweight flv video but I want a thumbnail to display in my gallery index pages. I ran the FFMPEG fram grap command but with “-s 250×186” to reduce the size to thumbnail size. I also want to indicate that it’s a video that the users is going to see and not another photo. So I need to Annotate it with the word “Video”

convert.exe -quality 75 -gravity South -font C:WINDOWSFontsGOTHICB.TTF -pointsize 50 -fill black -annotate +1+1 Video -fill white -annotate +0+0 Video videoimage.png videoimage.jpg

The options above (full list of options):

  • -quality 75 = compression level set to 75%
  • -gravity South = direction primitive gravitates to when annotating the image – In this case, we want the annotation loacted in the South of the image
  • -font C:\\WINDOWS\\Fonts\\GOTHICB.TTF = The font for the annotation. In this case I am using Century Gothic Bold
  • -pointsize 50 = The font size is set to 50 points
  • -fill black = The fill of the annotation is to be black
  • -annotate +1+1 Video = Annotate the word “Video” plus one pixel in both directions from the base position of “South”
  • -fill white = The fill of the next annotation is to be white
  • -annotate +0+0 Video = Annotate the word “Video” plus zero pixels in both directions from the base position of “South”
  • videoimage.png = videoimage.png is the input file
  • videoimage.jpg = videoimage.jpg is the output file

This creates a thumbnail image with the word “Video” in white with a black drop shadow, in Century Gothic Bold font, size 50 points.

thumbnail image with the word Video

And that my friends is it. Enjoy all my vidoes @ http://www.halfviking.com. I have also created a new page @ http://www.halfviking.com/videos using flvplayer’s playlist feature. My favourite single video is Bobby very bemused as to what on earth is planted in the ground at Crosby beach north of Liverpool.