10 April, 2008

Grep with Perl objects

I was having trouble getting grep to work today. I'm a bit of a perl newbie so still unfamiliar with many of perls basics. Anyway I was trying to loop through a list of objects, get the id of the object and see of that was in another list. Looking through as many tutorals as I could find They all had the same basic example:
    @foo = grep(!/^#/, @bar);    # weed out comments
Or elaborated on the regexp theme. So I wrote the equivalent with a comparison operator instead of a regexp.
    my $temp = grep ($object->{'id'}eq$_, @object_id_list');
No, no, no, no! says the compiler, I don't like this at all! Talking to my colleague revealed one small fact. For regular expressions there is no problem with using
    grep(EXP, @array)
But, if you want to use a block expression then you must use
    grep {BLOCK} @array
So my line becomes
    my $temp = grep {$object->{'id'}eq$_} @object_id_list';
I know perl is a very revered language amongst it regular users, but little things like this are very frustrating and not clearly explained in the documentation. Sometimes more elaborate examples in perldoc would help to clarify a lot of confusion to the perl beginner.

02 December, 2007

Louise's wish list

Here is a link to Louise's Amazon wish list, for those who may want to buy her a Christmas present.

Louise's wish list

Unfortunately she has lost her password so cannot update the list.
She no longer wants:

  • The Kite Runner,
  • Jane Austen: A Life,
  • Mao: The Unknown Story
  • Agnes Grey and the Tenant of Wildfell Hall.

14 September, 2007

STYLING FILE INPUTS WITH CSS AND THE DOM

Shaun Inman Has an excellent post on styling file input buttons

http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom

Make sure you check out the comments for similar techniques.

31 August, 2007

T-Shirts

Not been here for a while but I wanted to post some cool t-shirts I wouldn't mind getting.

Product_Images/290c3a743a61.jpg @ SplitReason.com
Run R2 t-shirt design @ © SplitReason.com
Product_Images/229ff957355a.jpg @ SplitReason.com
Bad Motivator t-shirt design @ © SplitReason.com
Product_Images/6613e2a3906b.jpg @ SplitReason.com
Robot Lovin t-shirt design @ © SplitReason.com

If you like these as well, then check out the rest of the site.

01 May, 2007

HD DVD key

Just had to keep this somewhere. 1A 0A 22 13 AE 85 F4 6C E9 52 67 D6 74 67 99 D1 It's the HD-DVD processing key you can use to decrypt and play most HD-DVD movies in Linux. However I've encoded it slightly so the AACS can't find it here so easily. Just take a 1 from each digit (F->E, A->9, 0->F). There's some open source software that can play HD-DVDs if you enter the code (and you have a HD enabled DVD player in your PC) Have a look at the Doom9 forums for more details.

30 January, 2007

Wii Browser

Some details on the Wii Opera Browser thanks to Shaun Inman
  • Window size: 800×500
  • User Agent: Opera/9.00 (Nintendo Wii; U; ; 1309-9; en)
  • JavaScript works (including alert() and XMLHttpRequest())
  • Cookies work
  • Flash version: 7.0 r68 if you believe in JavaScript (Wii 7,0,70,0 if you believe Adobe)
The buttons on the wii-mote result in the following JavaScript keyCodes:
CodeKey Press
170-
171B
1732
174+
175up directional
176down directional
177right directional
178left directional
The browser doesn’t recognize the nunchuk.

04 January, 2007

Puzzle Games

A web site full of logic puzzles. Could almost be heven on earth. http://www.conceptispuzzles.com/puzzlecenter/free_weekly_puzzles.asp

01 November, 2006

New Hertsdirect Interactive Map

The new map has just gone live on www.HertsDirect.org It's only a soft launch so not advertised yet until we are convinced of its robustness but here is a link for beta testing (because all things web 2.0 have to have a beta) New Map If you don't want to search just hit 'Go' and it will go straight to the map Compare it to the old map to see why we changed. Look out soon for more updates, Ian

Labels:

03 October, 2006

Javascript Objects and the button element

Just wanted to link to some fantastic articles about the slightly more advanced elements of Javascript hosted on digital-web magazine

The first one is a guide to creating and using javascript objects and what the different methods mean in the real world. Objectifying Javascript

This second one is about the HTML button element, showing its versatility compared to the standard input element. Push my button

That's all for now but until next time try having a look at some more of digital web. Especially if you've not been there before.

Labels: ,

21 September, 2006

Iliad Is out!

Well after waiting for ages the iRex Iliad is now out, but at a whopping price of £4. Is it worth the wait? Maybe I'll find out at Christmas.

On another note. I've just downloaded the Aspell extension for Firefox and it will definitely make an improvement to this blog. the home page is here

Labels: ,

01 June, 2006

The race for the first eInk eBook Readers

Have now been waiting patiently for 4 months now for the iRex iLiad. Originally they announced a launch in April, then they put it back to May due to technical problems on their online shop. Now they're saying that they will prioritise B2B customers and the general consumer will have to wait until September! Well some of are getting impatient. So I did a search on the blogosphere and found this TeleRead.org - Irex Iliad postponed.... Again! which lead to this MobileRead And, a Google search later, this Jinke It looks like Jinke will be releasing samples of their V2 eReader near the end of June. The hardware doesn’t look as good as the iLiad but it's running on Linux so perhaps overall it might be cheaper. It also comes with an API so customisations galore! (Note the V2 is a later version than the V8) The race is getting closer now and chances are, who ever releases first will get the clear advantage. Personally I'm not looking to get the Sony reader, partly because of the promised DRM and the fact that Sony always over price their products, esp in the UK. If Jinke can get their V2 out by July/August then they will win it for me. Edit - Here is a link to E Ink, the company providing the ePaper for all three companies E Ink.com.

30 May, 2006

My Home Page gets a refresh

I've finally made changes to my Wanadoo site to bring it up to standards compliance. The Qazzian.co.uk doesn’t exist yet but will in time. For now I'll have to put up with Wanadoo servers Unfortunately there's only two pages up at the moment Overview & News, both under Home. When I've got more time i will add the rest of the content. For now if you have any comments email Qazzian at hotmail dot com
Qazzian.co.uk > Qazzian.co.uk

17 May, 2006

AJAX Debugger

Curiosity is bliss: AJAX Debugging with Greasemonkey This is a pretty cool site for all those AJAX developers. It's a Greasmonkey Script which instals a HTTPObject sniffer as a floting layer in your browser. It's great as you can see all the Posted and Recieved files from the HTTPObject, can also copy and past them into your editor. no more alert(responseText) lines in your code! To use it you need FireFox and the Greasmonkey Extension. Look at the home page for a MSIE version and any updates.

04 April, 2006

IIS & Tomcat cont.

Unfortunatly we never did discover what happened to IIS. In the end Tech support had to reinstall it and copied the config file from the production server. It's a good job they were set up the same way!

29 March, 2006

XML Editors

Interested in an xml editor ? Have a look at the following link for excellent reviews and comparison tables of most of the available editors. http://ahds.ac.uk/creating/information-papers/xml-editors/