Wednesday 31 December 2008

The Danger of "Out of Office Messages"

Here is the story in full

Here is the Picture


Fair enuff you may say .. it is a road sign in English and Welsh .. however those eagle eyed taffyophones will notice that the welsh bit reads.

"I am not in the office at the moment. Send any work to be translated"

Which is good but not as weird as this sign

The welsh bit translates as "bladder inflammation upset"

I would SO love to work at a translation center for these things ... can you imagine the fun I could have!


Tuesday 30 December 2008

Drinking Heineken and reading Poetry

There are several things in life that are good both inside and out. A nice cold pint of Heineken is one and a good poem is another. Which is why I am combining both at the moment so here is a slug of heineken fueled ee cummings, two lines , 18 words, no punctuation .... GLORIOUS!

id rather learn from one bird how to sing
than teach ten thousand stars how not to dance

A feline post about misheard lyrics and unremitting tangential waffle

This morning I woke bright and early @ 7am mainly because one of the cats Fizz (a big orange very very stupid tomcat) was sitting on my chest and prodding me with a paw, claws out. This is the international cat language for "get up you lazy sod I need to have a pee". In the Feline GTD task list every day is :-
01. Get a human to wake up by the most painful means possible
02. Get said human to open the back door
03. Have pee
04. Go for a wander and see what the feline posse is up to
Having succeed in 01 and 02 the McDonagh cats went about their normal business of investigating everything in the back garden Can I F**K it? Can I eat it? Can it eat me? ~sigh~ the simple pleasures of feline existence.

The weather @ 7am in late December Ireland was officially "dark" and it has to be noted that opening the kitchen door wearing nothing but PJ bottoms and a barely awake bemused expression is not to recommended! Your neighbours may not relish either the view or the screams of pain as the cold causes every square inch of skin to contract to half it's size faster than ... well a very fast thing!

Most worryingly as I poured my Oatie Flakes (with cranberries and Sultanas) into a bowl I had an overpowering urge to sing "I wanna have boobies" whilst wearing a black lace basque. Thankfully this was an after effect of falling asleep in front of the TV and being subjected to 2 hours of subliminal Pussycatdolls on TMF tween 4 and 6am. I must have misheard the lyrics which on later investigation were "I wanna have groupies" which came as a great relief I can tell you!

But then I do seem to have a penchant for mishearding lyrics. It took several listens to the nerdy gnome Michael Snipe exhorting me to "Lets pee in the corner, lets pee on the spotlight" until it was pointed out by the Preforming Rights Society that REM's lead singer was not encouraging free range urination over very hot things. (which children is dangerous and should not be done even for a joke!)

This was much less worrying than the clammy hand of fear that grasped my nether regions when I heard Bryan Adams ditty that trucks along in the following vein.

Got my first real sex dream,
I was 5 at the time.
Played it till my fingers bled.
It was the summer of 69.

~shudder~

I am not alone in this malady, my good friend Robbo was wont to sing along to speccy doyen of C&W John Denver's smash hit Country Roads with the following refrain

"West Virginia, Mount yur Momma"

No amount of correction ever broke him of this habit!

Which brings me back to cats ... why is that fecking musical so fecking popular?

Time for Taggart on the tube! Nite All

6 Months with a Cheap(ish) NAS

It is now 5 months since I purchased and powered up my Buffalo Linkstation Live 500GB NAS and to be far it is has been more than man enough for the job.

A really neat option is the "one touch direct copy function" that is a means of taking pictures or movies from your digital camera, camcorder and storage device via USB port directly which is a lot easier than having to turn on a PC if you want to drop your Piccies to a drive quickly.

Stored data can be shared on your network and a built-in DLNA media server can stream it to a PC, a MAC an other DLNA CERTIFIED™ entertainment devices and it works like a dream to any attached device.

Note this is NOT the Wireless version!!

The Web Access feature enables you to access your data and media stored in the LinkStation via the internet by computers (and iPhone's I am reliably informed) via a portal run by Buffallo to which your Buffalo connects (if you confiure it to do so).

It also has a built-in BitTorrent Client, so it can download content without the requirement to keep your PC powered up if you are into such stuff as torrenting that is.

Intelligent Power Saving functions, timer power on/off and auto power on/off with your Windows PC all help towards power saving and eco in mind, don't know if this works with Mac's and I have had a few probs with my thinkpad not being able to wake it up if I fire it up on battery rather than on the mains.

I attach it on my gigabit ethernet and response is very good and I even have a 500GB WD MyBook USB drive attached which it sees and configures as another drive, although the perforamance to this drive does suffer a little, but is it still faster than direct USB connect to one of my PC's

It is not a bad box, does what it says on the tin and does it well with the minimum of fuss which at the end of the day is all you can ask for well worth the £130 I paid for it. I see Amazon have it on offer for £114 at the minute here

Music I got for Crimble

Mike, my sisters partner, seems to have a inherent ability to direct me to music and musicians I have never heard of or are very very new. Every birthday or Xmas he surprises me with yet more sounds that become firm favourites.

This year I got from him :

Phil Campbell "After the Garden"
Phil is a Scottish singer songwriter and "After the Garden" is his second album. Oddly, or perhaps not, there is town called Phil Campbell in Franklin County, Alabama so don't get confused as the town has not written any music at all as far as I know, neither is he the lead 'tarist with Motiorhead. The single "Cold Engines" can be found here on YouTube. He is quite hard to categorise (although he does look like Hamish Macbeth) he was according to his Bio notes ".. Campbell soaked up the religious ether of this existence and then ignored it as best he could." you wouldn't know it from his singing that's for sure. If you are looking for something to chill to after the party at new year you can't go far wrong with this chap! 9/10

Sea Wolf "Leaves in the River"

Hmmm another defies categorization band, you can go and have a listen here to Winter Windows
I have Genre-ed them as "low-fi" on the iPlod but that doesn't really describe their sound, they are their with Midlake and Cowboy Junkies in the innovative new indie world. It took me two or three listens to get to grips with this LA Based band fronted by Alex Church who I can come across before in the band Irving. They are deserving of your ears :-) 8/10

Perry Keyes "The Last Ghost Train Home"

This Ozzie is prob best described as "folk rock" but not of the finger-in-ear-hey-nonny-noe variety. His are the observations of the minutae of life in the working class suburbs of Sydney.
Take a plonk over to here and have a listen to the "Joe Strummer". He reminds me a bit of Elvis Costello with a hint of Tom Petty or more accurately the Wandering Willburys .. 7/10

Josh Rouse "The best of the Rykodisc years"

Now Josh I have come across before one of the few people I know from Nebraska. He has been around since '92 and has never failed to deliver good tunes to his waiting fans. This collection of stuff from the last 15 years is well worth a listen if you haven't heard of him. Have a listen/watch here to London Bridges 8/10

Monday 29 December 2008

Nature Draws Trees in the Sand


Winter rain runoff patterns in the sand mirror the shape of branches of pollarded willows.
Well I think so anyway :-)

Turin Trees escape the symmetry

This rather startling picture comes from the photo below and has been grey-scaled, rotated and edge enhanced. I don't know about you but there are "things" trying to escape from the symmetry. Things that want to be seen ...


Here is the original taken with a Sony Ericsson W810i Phone camera .. it is a place called "the camus" on the River Bann near Coleraine

Wednesday 24 December 2008

Merry Christmas one an all!

As "eve" slips into "day" with a single tick of the second hand and another day of family and friends is ushered into Ireland with the whisper of clouds moving across the star speckled sky, I am sat here in front of the PC with a coffee clacking a few lines into the blog to all my readers out there.

So have fun on the 25th, find your inner child and let he (or she) rip the paper off the pressies.
Be cool, be happy and be safe!

Merry Christmas All! :-)

The SI unit for cock

In our GONADly deliberations at the annual bacchanalian debauch Mr Mooney and I discussed the design and production of a device that will bring world peace, end poverty and solve all the problems people have with Vista ... "The Cockometer" (pronounced Cock-om-eater not Cock-O-meter)

However in hindsight we may have been premature because I have contacted NIST and they even came in on Xmas Eve to check for me but there is no SI unit forus to measure Cock on the Cockometer. They did suggest that we could have a derived definition for the "Unit of Cock" which is now officially "The Cock" and they provided this useful table for the Cockometric Spectrum complete with examples for calibration

10 to the 24 is a Yottacock - this is reserved for Scientologist meetings and General Tom Cruise-iness
10 to the 21 is a Zettacock - any group of more than 1 politician
10 to the 18 is a Exacock - Chris Martin
10 to the 15 is a Petacock - Bill Gate's Sweater Purchasing Department
10 to the 12 is a Teracock - a coven of sharepoint developers
10 to the 9 is a Gigacock - Robert Scoble
10 to the 6 is a Megacock - The guy who thought vista was a good idea
10 to the 3 is a Kilocock - A group of cornered Java Developers
10 to the 2 is a Hectocock - People who drive Audi's
10 to the 1 is a Deka Cock - Normal Background level of Cockiness
10 to the -1 is a Decicock - Normal Background of Cockiness
10 to the -2 is a Centicock - 4 Notesians only one of which is an Admin
10 to the -3 is a Millicock - 10 Notesians (5 Devs and 5 Admins)
10 to the -6 is a Microcock- 100 Notesians (All Devs)
10 to the -9 is a Nanocock - Worst Practises Session at LS
10 to the -12 is a Picocock - Any conversation about Bikes or Beer
10 to the -15 is a Femtocock - the average level of cock at the bar in ILUG @ 7pm
10 to the -18 is a Attocock - the average level of cock at the bar in ILUG @ closing time
10 to the -21 is a Zeptocock - One of the Marx Brothers
10 to the -24 is a Yoctocock - The amount of cock on the moon (between manned landings)

OK now we have an agreed spectrum of Cock we can look at what colour the gauges should be...
Hmmmmmmm

Tuesday 23 December 2008

Twitter "buddies" the proper way to mix Twitter and Beer

Gentle reader
Pull up your chairs and partake in the wisdom I am about to offer...

Comfy?

Good, then I will begin ...

Never take a twitter capable device into a bar or party at which strong liquor is about to be consumed UNLESS you have a "Designated Tweeter" with you at all times.

The DT (as they will henceforth be know) will have complete control of all TWITTER capable devices for the evening, and all updates will be routed through them and their (hopefully) better judgment.

This sage and timely advice comes from the bitter wine sack of mine own experiences of yesterday evening with the equally culpable Mr Mooney.

Last nite was a NotesBeer evening resplendent in in GONADly goodness. Held as per tradition demands in The Crown Bar Belfast. A place of long and majesterial history for in it's victorian tiled porcelain toilets such luminaries as John Wayne, Mother Theresa, Nelson Mandela and Shamie "5cocktele" Maginnes have taken a tinkle. We were indeed splashing our boots from the shoulders of giants!

Before I start I have to mention that as I wandered the streets of Belfast, lost in wonder at the size and glitter of the city that it is possible to buy crackers from Ann Summers (an emporium that purveys things that vibrate and clothes with way to many holes and lacy frippery for my tastes) I was led to wonder, all be it briefly and accompanied by much shuddering as to what the aforementioned crackers contained and how best to explain them to the vicar. Perhaps I would have just let him wear the crotchless panties as a hat.

I had great hopes for MrMooney when as an opening libation he went for a G'n'T however this was not to last as he quickly reverted to Coors Light but he had a note from his mummy and was thus excused detention.

The mandatory 1.5 pints an hour was met and surpassed with ease, not withstanding Mr Mooney's lack of stature in the ... err... stature department and many topics of great import and sagely wisdom were discussed.

An example of the deleterious effects of the credit crunch was noted in that we were able to get a seat in one of the snugs accompanied by 3 ladies of the opposite sex no less. These were not GONADs and wisely choose to ignore us as we went about the business of the day.

However , as the evening progressed it was decided that twitter was far to "nice" of late and that in the interest of livening it up a little we would act as agent provocateurs and add some spice to the mix. This resulted in ill advised tweeting about java and a poorly worded riposte to a post by John Head Mr Scoble re Lotusphere.

It has been decided that to avoid such things happening at NotesBeer and GONAD events that there will be a "Designated Tweeter" who will act as it were like a content control filter on all tweets from the more lubricated celebrants. However Points will be still be given for Inventiveness and gratuitous use of the words "Feck" and "Cock" in any 140 character missive.

That is all for now as my hangover has just faded and it is time for a wee Stella Act the Tw*t

PS Apologies were tendered by both participants to their respective family members for the total inability to talk sense or make tea when we arrived home.

Pope and Rabid Free Presbyterian Pastor find common ground!

To none Northern Ireland readers this will probably come as a surprise but the rest of the world it may need some explaining.. The Free Presbyterian Church is (or was) run by Rev. Ian Paisley and twas he that in a protest when the last pope spoke to EU called him an Antichrist so no great love lost there. The odious Rev David McIlveen whom I mentioned in a previous post here and the dried up auld bitch Iris "I know someone that can cure homosexuality" Robinson whom I was less than pleasant about here have a new supporter all be it not directly...Both Iris and David are members of the same coven as the aforemention ayatollal of twonk, the arch bishop of WooWoo "Big Ian".

So the antichrist himself Pope Bendy Dick the whatever has aligned himeself with the Norn Iron Twonk squad ... see here ... Since Iris got in early with "it is up there murder and child molestation" El Papa and the papal possee had to box clever and have joined in with " ....saving humanity from homosexual behaviour is more important than saving rainforests from destruction."

WTF?

Stop your priests fiddling with altar children and stop whisking the ones that do to the other side of the world when they are caught, until then do the world a favour and shut the fuck up unless you have something sensible to say!

Monday 22 December 2008

The Lotus Notes Client outside the Organisation - an Idea

I was having a bit of a chinwag with several of our Notesian colleagues around the letter published on the HMNL blog by Ian J Free addressed to Steve Mills of the IBM Software group. His open letter presents a case for IBM to transform the Notes.Domino product line into and Open Source, Community Developement Offering.

It is an interesting post that makes some challenging points, some of which I agree with other whilst interesting I cannot see either happening or being sucessful were they to be actioned by IBM but that may just be me being cynical ... but go have a read at the letter and make your own mind up.

However this did set me to thinking. I was asked on Thursday last week by a colleague at work "Is it possible to use Notes Client at home as his mail /PIM client?" when pushed for a reason why he wanted to do that his response was that he was used to using notes for email, tasks,calendar , journals and other out of the box templates at work and he would like to have continuity between work and home (where he used Outlook). Mostly he WAS that impressed with the Notes V8 client (V8.0.2). Needless to say the cost put him off.

Which made me wonder if this idea would fly?
When you get a proper license for Notes at work, why not have a "If-you-want-you-can-use-it-at-home" license as well, this would be a SMTP/POP client with no links into the company Notes domain(s).

With the advent of Symphony which I have installed on quite a few home PCs for friends and relatives as a much much more functional (and free) replacement for M$ Works (which seems to come bundled with every PC at the minute) why not have a SMTP/POP notes client in symphony with contacts,mail,tasks and calendar. It wont need all the bells and whistles of the full client as it is never going to talk to a server, but will allow the home user to build a relationship with Notes that moves beyond the @work sphere of their lives. It is the relationship that users have built with M$ products at home that is part of the interia that has and still slows acceptance of Lotus products in the work place.

I know I could "sell" this concept to lots of users at work and many more from home.

Anyway it was just a thought...

** Update ** I have popped an idea onto IdeaJam if you want to vote on this idea ..

Saturday 20 December 2008

A mediation for the solstice

It is the 20th December, tomorrow is the solstice, the shortest day, when the pulse of the world reaches it slowest and then quickens imperceptibly. It is a time when we welcome the comming of the new year by remembering the passage of the old. Hopefully learning from our mistakes and looking forward to the ones we will make in the next 12 months. ;-)

This is the mid point in the ancient Celtic quarter of Samhain, traditionally a time when ancestors recent and far removed are remembered. All the seasons were, it is believed, mapped to an "age" of man. Samhain equates to "old age" a time when wisdom, freedom of spirit and clarity are at their height. So as winter turns and and looks forward to the returning warmth of the sun, perhaps we should do the same ... some thoughts on how I might to do that.

Practice introspection, mediate, contemplate or just take a quiet time once a day.

Shift my burdens by doing something about them or by giving up the unnecessary.

Remember my absent friends and family separated by distance or death and celebrate what they have brought to the person that is "me".

Go for a walk outside at least once a day and allow winter to cleanse me as it cleanses the hedgerows in preperation for the explosion of spring.

Renew the source of my creativity and try be creative in different ways.

To all my readers, friends, family and all those people I ranted at, scolded and waved fingers at this past year I send my wishes that you all have a peaceful, prosperous and joyful holiday of whatever flavour you follow.

2009 here we come ready or not! :-)

Peace

Steve

Thursday 18 December 2008

Christmas Drinkies in "The Crown" Monday 22nd 4-9pm

Attention all Northern Ireland Bloggers, geeks and allied tradespersons!
Should you fancy a few pre-Christmas drinkies and don't mind joining a Coleraine Culshie Geek. I shall be propping up the bar in the Crown Bar, Belfast from about 4pm till around 9ish on Monday 22nd Decemeber, everyone welcome. Come along and lets drown out the credit crunchiness with a few brewski's!

Monday 15 December 2008

Is the DOM Female? or is the DOM not ready YET?

Sorry about the title but I couldn't help it! I am old and very un PC at times, I do try but sometimes (and this is one of them) my old 1970's self slips through.

This post and the last one came from an email I received asking for some advice. Not, I hastily add about how long it takes females to get ready (that is a subject for "The Troubled Geek" vidcasts) ;-) but testing for the DOM being ready before doing something. Notes comes with a built in event in FORMs and PAGEs that allows you to add code at that glorious moment when the browser has got everything it needs and is in a stable state. However this can be sluggish on some pages/forms depending on content.

Say you have a function called formInit() that runs when your form is loaded. The normal process would be to pop this in here










This is basically the same as
window.onload = function() {formInit};

Now that for most forms is hunky dory but sometimes there may be a period of thumb twiddling. This happens if the window has frames, iframes and/or Big or slow loading images
the good thing is that the DOM is ready long before all of this other stuff is finished and the window object returns "yes i am ready". Even better there is an alternate method to testing the window object which looks to see if the DOM is loaded and and not the more sluggardly window object.

As in most things there is a bit of xBrowser nonsense to work around.
In Mozilla browsers you can do it using the DOMContentLoaded keyword in place of an element in the addEventListener method.
if(document.addEventListener)
{
document.addEventListener("DOMContentLoaded", formInit, false)
}
Now IE is different as there is no direct way to detect the DOM being ready (Fecking redmond gnomes!) even all the way up to IE7. However there is a IE attribute of the "script" element that we can use in combination with the onreadystatechange event of an element. The attribute is called "defer" and this tells IE to defer the load of the JS until the DOM is ready. So we can have code like this.
if(document.all)
{
externalFile = document.createElement("script");
externalFile.setAttribute("type","text/javascript");
externalFile.setAttribute("id","amIReadyYet");
externalFile.setAttribute("defer","defer");
externalFile.setAttribute("src",javascript:void(0));
document.getElementsByTagName("head")[0].appendChild(externalFile);
var amIReadyYet = document.getElementById("amIReadyYet");
amIReadyYet.onreadystatechange = function() { if(this.readyState=="complete") {formInit()} }
}
OK! I know that is a lousy check for IE but i wanted to keep the code readable, please please please use a more robust method for checking for IE!
So what is this code doing?
I build a script object that effectively does nothing other than exist.
I insert it into the page with the defer attribute set to defer forcing it to load ONLY when the DOM is ready. I then set the onreadystatechange to test this element for readyness, when it is the DOM must be ready so I can run formInit()

That should allow you to make your window.onload run as efficently as possible particulary on BIG pages and forms that could take an age to load.

We all stand on the shoulders of giants and I first came across this solution with minor DYM tweaks from an article on Dean Edwards's blog back in 2005. I heartily recommend him! He ROCKS! (He hasn't posted since March 08 I do hope he is OK and continues to share his JS knowledge)

Loading an external JS or CSS file on the fly.

OK all you dev's out there are prob used to loading JS or CSS somewhere in your HTML this is generally hard coded and is something like this
[head]
[script type='text/javascript'm src='loadofstuff.js'][/script]
[/head]


However there may come a time when you want to bring in a JS file based on some criteria or process that is only resolvable at runtime. Localization for example, you want to bring in a JS file that has your lovely code rendered in glorious Polish or Tagalog or you need to change the CSS to facilitate Hebrew right to left alignment.

To do this you need to have some insertion fun with the DOM. Nothing like a good insertion if it is done well I always say!

For JS you would create a "script" element and for CSS you would create a "link" element .. yes it is that simple ... here is some code


function insertMyFile(whatIsIt,whatsTheFile)
{
if(whatIsIt == "js")
{
externalFile = document.createElement("script");
externalFile.setAttribute("type","text/javascript")
externalFile.setAttribute("src",whatsTheFile)
} else if(whatIsIt == "css")
{
externalFile = document.createElement("link");
externalFile.setAttribute("rel", "stylesheet")
externalFile.setAttribute("type", "text/css")
externalFile.setAttribute("href", whatsTheFile)
} else {
alert("You knob! Pass a file type please");
}
if (typeof externalFile!="undefined")
{
document.getElementsByTagName("head")[0].appendChild(externalFile);
} else {
alert("Bollox something nasty has happened");
}
}


Then all you need to do at some point in your code is go...
insertMyFile("js","myPolishCode.js")
or
inserMyFile("css","myHebrewCss.css")

Okey Dokey?

Friday 12 December 2008

Another wee blast from the past to help you fill your idle time

If you like me ever owned an Atari console, or more recently a Nokia phone you will have probably have a game or two of "Snake" well those very nice people at Neave.com have a nice wee flash version for your websites and blogs..

Go on you know you want to!

Use the arrow keys to move

Pause game – space key or P

Mute sound – M


Snake made by Neave Games

Thursday 11 December 2008

The Advertising Standards Authority's response to the offical complaint about "The word of god against Sodomy"

Belfast has an annual Gay Pride March which this year attracted 5-8,000 marchers from all over the province and Ireland. Nothing odd about that many cities have similar marches.

However this year Rev David Mcilveen and his church the Sandown Free Presbyterian felt they were "obliged under God to publicly challenge the vices of this generation" so they took out a full page ad in a local newspaper "The Newsletter". The 540 word advert was exactly the sort of intolerant bollox that you would expect .. it described homosexuality as an abomination, defined homosexuals as perverts and called on all religious followers to maintain a very public stance against the gay community. The church, led by the Rev David McIlveen, justifies its hostility towards the gay community by ‘quoting’ from the Bible and lambasting the need for a parade which celebrates a “profitable lifestyle”, (I think he may mean "profligate" rather than "profitable")

The ASA and The News Letter received complaints about the advert and it was then legally bound to investigate and report on the complaints which came in 2 parts

1. The ad's content was homophobic and, therefore, offensive
and
2. was likely to provoke hatred and violence against the lesbian, gay, bi-sexual and transgender (LGBT) community.

The ASA reported on the 3rd of December (full text here) but basically upheld complaint (1) and rejected complaint (2) . The Sandown Church's advert WAS homophobic and, therefore, offensive. Good for the ASA! Common sense at last!

Let us not forget the other "powerful" moral message the bible teaches in the whole Sodom affair. Just before God destroyed Sodom (from whence the act of Sodomy gets it's name) he sent two angels down to recce the lay of the land prior to sending the fire and brimstone. Lot puts them up for the night in his house... Genesis 19 takes up the story

4 But before they [the angels] lay down, the men of the city, even the men of Sodom, compassed the house round, both old and young, all the people from every quarter: 5 And they called unto Lot, and said unto him, Where are the men which came in to thee this night? bring them out unto us, that we may know them. 6 And Lot went out at the door unto them, and shut the door after him, 7 And said, I pray you, brethren, do not so wickedly. 8 Behold now, I have two daughters which have not known man; let me, I pray you, bring them out unto you, and do ye to them as is good in your eyes: only unto these men do nothing; for therefore came they under the shadow of my roof.

(emphasis mine)
Lot's daughters survived unmolested however in Judges 19:24-29 almost exactly the same thing happens to a different set of people. The ladies involved on that occasion were gang raped and unfortunately died after a long night of abuse, not that anyone god included (and he stuck his nose into human affairs a lot more back then) seemed to mind that much certainly it would appear that no-one was brought to account for gang rape and murder by human or divine entity.

The Rev McIlveen and his congregation are odious people with odious minds peddling an odious message which sadly is listened to more often than not.

Javascript and Christmas Queues

Gentle reader , another JS pearl of wisdom.

Today I was writing some code and i needed to use a "stack" to take values in and feed them out one at a time using the "Last In First Out" or LIFO paradigm. Now you could should the urge overtake you go down the C++ or Java route and build all sorts of interesting data structures to do this. However there is an easy way using Arrays, let me explain

The javascript array object comes with a couple of interesting methods, namely push(), pop(), shift() and unshift() .

[array object].push([value]) appends a value to the bottom of an array

[array object].unshift([value]) does the same as the .push() method and appends a value to an array.

[array object].pop() removes the top most value from an array (index = 0)

[array object].shift() removes the bottom most value from an array (index array.length-1)

Using push() and pop() for LIFOing an array

var pileOfData = new Array();
// ** So we now have an empty array
pileOfData.push("Roast Turkey");
// ** The array has 1 element containing the string "Roast Turkey"
pileOfData.push("Christmas Pudding");
// ** The array now has 2 elements "Roast Turkey" and "Christmas Pudding"
var whatWasLastIn = pileOfData.pop();
// the pop() method gets the element at index 0 and removes it
// Now the array has one element "Christmas Pudding"
// and the variable whatWasLastIn contains "Roast Turkey"
Using push() and shift() for FIFOing an array
var pileOfData = new Array();
// ** So we now have an empty array
pileOfData.push("Roast Turkey");
// ** The array has 1 element containing the string "Roast Turkey"
pileOfData.push("Christmas Pudding");
// ** The array now has 2 elements "Roast Turkey" and "Christmas Pudding"
var whatWasLastIn = pileOfData.shift();
// the pop() method zips down to the bottom of the array and removes the element it finds there and removes it
// Now the array has one element "Roast Turkey"
// and the variable whatWasLastIn contains "Christmas Pudding"
I used the top method to queue AJAX requests and then release them to the server in a timely manner once the previous request had completed.

Wednesday 10 December 2008

Making javascript remember things

OK Geek Post Alert!

If you have been following my JS posts you will know that I quite like it as a language .. now there comes a time in most coder's life when they get to a point in some code where they need a global variable and they have that "DUH!" moment and have to scoot back up to the top of their code to define a var in a place that will define it as global... well here is a way around that.

There is a global object in JS ... i'm waiting ... that's right Edgerton-Smythe the window object and can we use it? YES WE CAN ! Paulson PUT Bigglesworth down this instant or I SHALL send you to the padre!

Lets say we want to tweak a value the user has entered and come back to it later say in the form submission JS. I would use this bit of JS that I keep in my "tool box" javascript library.

function dontforget(theValueToRemember,theNameIWillCallIt)
{
      window[theNameIWillCallIt] = theValueToRemember;
}
For example I want to remember the pearson's age in years that I have calculated from their birthday which they entered in date format but I dont have a global variable to hold the age defined in my code so I use this :

      dontForget(56,"theirAge");

Then I go off do other things, slip out of the function I was in and come back to the value I memorized at any time by simply looking in window.theirAge or window["theirAge"].

Please be aware I am not advocating the fullscale use of this .. you should declare all your vars and scope them correctly, but if you have to write quick code for whatever reason and find yourself needing a global var, this is a method you can use.

Monday 8 December 2008

The Troubled Geek VidCast Episode 0

Gentle readers

Into a world populated by wise and wonderful Notes/Domino podcasts comes a new entry..
The Troubled Geek Vidcast!
(the "agony aunt" vidcast for geeks)

This is being a notes/domino production it is a collaborative project between myself and Francie Tanner-Whitlock were we attempt to answer any question, query or quibble you may have. This is our first go at Vid-Casting so the sound/video is a bit ropey but we are working on that...

Anwyay here is the first offering and remember if you want a question answered send it in to advice@thetroubledgeek.com and you will be included in the next episode.

Steve & Francie

Saturday 6 December 2008

A Saturday Dander around the North Coast

Greetings Gentle reader

I have just got back from my daily brisk wander and for a bit of a change I popped out to the wee town of Portstewart which is about 4 miles away.

It is a pretty wee place and today was bathed in weak December sun that shone from a Cerulean blue sky. It was the sort of day that makes you smile regardless of the crappy week you have had.


Wandering around a holiday town in the teeth of winter is an odd experience. The "Portstewart Promenade" is seldom empty at any time of year, people drive up from all around the north and park and watch the sea whilst licking a world famous Morrelli's ice cream.
A word of warning to any non-northern ireland tourists that might come by. Being accosted by a local asking you "do you want a poke or would you prefer a slider?" is not an invitation to fight or some form of sexual advance! A poke is and ice cream cone (cos you poke the ice cream into the cone) and a slider is an icecream sandwiched between two wafers.
Anyway, the "Prom" as it is known is where in the summer the youth of the area go to see and be seen, there are people ALL over the place. The local council has a kiddie play park where you can make sand castles, listen to music, paddle in the pools and generally have a good time. In the winter there is that tangible "lack" that comes from it being very cold and wet for 4 months that drives the laughter and craic indoors.

This track normally has wee go-karts for kids that whizz around from 9 in the morning till 10 at night. Today it is deserted. Storm blown seaweed litters the track and although it will be 5 months before life returns as return it will, it does make you stop and think "is it dead or just asleep?"
Oops getting moridbund! :-)




I wandered along what is known the "nuns walk" which joins the town with the main strand (beach) where I learned to surf many many years ago when you could have any colour of wet suit you wanted as long as it was black. It is a pleasant 2 miles with loads of up and down bits that act as .. errr.. what is it called .. Interval training???

Along the way you pass a small almost insignificant house, this is where the salmon fishermen lived during the netting season. The location actually has a name ... like most places in Ireland ... and this place is called "Berne" This small house as been there since 1600ish and has been in fairly continuous use, until fairly recently. I can remember walking along this path with my Mum and Dad and watching them pull in the nets replete with glistening salmon. Now it is all closed up, a target for Graffiti and is at the mercy of the Northern Atlantic Weather.

The machinery of fishing is still there. Like this winch that would pull the net in from the sea. It has not been used or maintained in 30 years and is moving from "useful" to "artifact" as the salt turns it slowly to rust.

This winch was used daily and had utility but that has now changed and its only reason to be there is to add character to the view .

Anyway just around the corner from Berne is the strand and it is 4 miles of sand, waves and strange people in wet suits these people are surfers and should at all possible be avoided. (see signage left) I always knew that I was mad bad and dangerous to know, but BEWARE OF SURFERS we arent that bad are we?
I suppose we could stuff sand down your shorts and make you chaff all the way home?


Time to get some perspective ;-)
Sorry couldn't help it.. These sticks mark the NO CAR area from the CARS ALLOWED area of the beach but on a day like today they look "real purty" don't they? ;-)

The waves are not big enough to ride but maybe in a day or two when the next storm comes .. this break is a surfer's paradise on a good day!

I love beaches, particular ones where I am the only one there.. there is something about sand unsullied by footprint that makes sense ;-) well to me anyway ... oh and there was a BITCHING sunset too!

It was when all said and done a "Good Walk"!

Thursday 4 December 2008

A Lotusbeer collaborative idea for 2009

Calling all LotusBeer'ers in the UK and Ireland.

I have a cunning plan for the relief of the post Lotusfear anticlimax - particularly for folks like me that can't go!

In the spring of the year what about a Tri-Nation Lotusbeer event. We have English, Scottish and Irish LotusBeers. (Is there a Welsh branch?) so it is only right and proper that we collaborate in some good natured national frolics.

I was thinking something along the lines of a team from each location plus supporters engage in some pub based sporting endeavour, some examples that jump to mind would be...

Darts
Snooker
Pool
Yard of Ale
Dominoes (the slam on the table and swear a lot variety not installing servers)
Pie / Pickled egg eating

Needless to say a suitable venue would need to be found suitable for all the attendees.

I am willing to run with this on an organizational level cos it sounds like fun.

Ping me a comment with your thougths

Monday 1 December 2008

The Agony Auntie Spot - Banana Query

Here in Dominoyesmaybe we received this worrying query from an geek in an equatorial clime :-

Dear DominoYesMaybe
Perhaps you can help me? I have been observing monkeys out of the office window and you seem to an expert in chickens so I have a monkey related question you may be able to help me with. When monkeys fart does it smell of bananas?

Perplexed Geek


Well Perplexed Geek whilst there are plenty of chickens there are sadly no monkeys in Ireland so I did not feel my expertise was up to as complete an answer as you would expect from these hallowed halls. However I did ask a colleague Dr Noogerty McToogerty of Cork University's Advance Poo 'n' Piddle research lab and his response was to ask you a question in return in the hope that you will gain more from the experince than were you to get a straight one word answer... Over to you Dr McToogerty

"If you eat oranges solidly for an hour and then take a piss does it smell like you are an idiot?"

Fair Enuff?

The BEST internet advert of all time - Ever!

This has to be the best Internet based interactive advert of all time -

Upload a document to two phones in Nokia and watch their robots mangle it
bloody marvelously weird! and very satisfying on a Monday morning!



Thanks to twitbuddy @reivax for the heads up!

The Agony Aunt Spot -The Thorny Matter of Pointer Size Pressure and Quantum Chickens

Dear DominoYesMayBe HELP!

I am an iSeries developer and I have a problem with my enormous pointer size.  My colleagues giggle behind my back and strangers point and laugh when they see me. I am very depressed.

Please help iSeries Geek
PS Sienna Millar... why?


Dear iSeries Geek

Stand proud! Let the world see your 16 byte pointer and let them bask in its teraspaced loveliness. You can be secure in the knowledge that those that laugh, smirk and make your life miserable are in fact suffering from intractable Pointer Size Envy.  Pity them, with their measly little 8 bytes flopping around in their parameter space! 

As to your query about Sienna Miller - Why not I know I would.


DominoYesMaybe


Dear DominoYesMayBe

I have a problem that is causing me nights of lost sleep
What came first the chicken or the egg?

Island Girl


Dear Island Girl
Rest easy! The answer is explained by the Quantum nature of chickens. The men with large brains and well starched white coats in CERN when  not trying to destroy the world have found evidence that Chickens exist at two quantum levels.

The chicken (or Gallus Gallus as we swots like to call it)  is in the same taxanomic group as Schrodingers Cat. Simply put the chicken shows Quantum Decoherence, as you (the observer) approach a chicken/egg complex it is flipping between it's quantum states. The wave funciton that describes the chicken/egg will then collapse in a therodynamically irreversable way into one or the other. It has been postulated that this collapse is effected by the theoretical "ommlette" force. This force acts on the Chicken/Egg complex and forces the resolution of a wave collapse that will result in an egg. When this force is not present the wave will collapse into a chicken just in time for you to observe it. 

The blinking monks of western nepal have developed a form of yoga that allows them to observe the chicken/egg wave complex in its unresolved form. However their technique involves learning to blink 15,000 times a second so this should not be attempted by the laity.

DominoYesMaybe

Sunday 30 November 2008

SHOCK!!!! HORROR!!!! REVELATION!!! Bill Buchan is Welsh and NI Toy Tractor Collectors go mad for Billy Ray Sirus and chicken curry

As I mentioned in the last post Bill Buchan PDF (Portly Domino Fellow) and fellow GONAD came to DYM's stomping ground in the frozen foggy tundra of North Derry. I recommended he stay in the Magherabouy Hotel, Portrush a hotel used by my company when we have folk visiting from the 4 corners of the coorporation. It is a nice wee hotel, free WiFi, decent beer in the bar and a rather nice view out over the Atlantic when not shrouded in freezing fog!

When I wandered out to the hotel on friday evening for some pre geek beer, I was rather surprised to find the hotel HEAVING with people, anoraked people all clutching toy tractors. 1:32 scale models of John Deere, Massey Ferguson, Fords and Izuzu's tractorial goodness were seen in large numbers and the dull rumble of half heard conversation in the bar was of die cast representation of Powertrain Doobries and the relative horsepower of whatever was considered the "ferrari" of the tractor world. There even was a martial dispute behind me over the fact that "she" couldnt get an iPhone because "he" had spent all their money on a 1956 Dinky Massey Ferguson 350 "still boxed" in immaculate condition. I felt she was making a fair point but as a Blackberry chappy I felt it was not my place to comment.

Bill arrived in good time and we had a few beers with the good people of "The Northern Ireland Toy Tractor Collectors Christmas Party and Curry Night" (F**K you couldn't make something like this up, I live a weird life that surprises even me from time to time) It soon became clear that they had organised a full evening of entertainment and had not cut back on the expenses in this credit crunchie time for they had both Country AND Western music!

Now Bill and I both possess savage, uncultured souls and our ears are not tuned correctly to appreicate the the delights of Billy Ray Sirus, Setsons and going YeeHA! Rather than spoil the tractor-o-phile's evening by singing along with "Achie Breakie Heart" we departed in a taxi for the throbing heart of Portrush.

Now I have long held the view that the Harbour Bar is up there with Sloppy Joes in Key West as a bar you HAVE to do before you die. They tried to change it a decade ago but there was such a public outcry that the pub has been left alone, although there is a fine bistro behind it and you no longer have to go outside to pee on a wall. (Well you had to pee on a wall if you where a chap, lassies I am reliably informed had normal sit-upon thrones) Basically the Harbour Bar has "character" lots and lots and lots of character which when combined with lashings of Guinness, Black Bush and the odd song equates to Craic in abundance.

I delivered Bill back to his hotel at midnight were the Toy Tractor Liberation Army had consumed their chicken curries and line danced themselves into a disel powered stupor. We had a wee whiskey and had an early and sober - ish night. Well i was in bed before 1am and I managed the stairs which for me is a symptom of sobriety.

Saturday arrived frosty and foggy and Bill did his geek stuff which he posted about here and after a quicky spot of retail therapy we repaired to the Harbour Bar Bistro for a spot of grub.
Mr Buchan was instroduced to CHAMP one of the 1001 things Irish people do with potatoes
and was scared shitless by the cheesecake, which initially he felt he was morally obliged to try but when push came to shove he decided that a Harbour Bar Cheesecake was a delight best left for another occasion.

Having satisfied our calorific requirements for the day, we repaired to the snug for more Guinness and Bushmils's. Beside a roaring fire we fell into the company to two lassies orginally from Glasgow or in their delightful patois "fray glazgay". Sensing a dialectic similarity they engaged us in conversation and rather worryingly assured me that Bill was infact Welsh. This was a startiling revelation as there were no sheep (either real or inflatory) in the vicinity of Mr Buchan and his usual dulcet tones hinted broadly of kilts, shortbread and skirl of the pipes (Bagpipes that is .. not the plumbing). They were "waking" an absent friend and had perhaps consumned a wee bit too much funerial punch which goes some way to explain their inability to correctly pin the sporran on a highlander ... metaphorically.

Our slightly sozzeled comapanions departed in search of champagne and were replaced in short order by The London Irish Veteran's Rugby Team and the birthday celebrations of a lassie called Wendy, whose daughter Laura had the voice of an angel and really really really needs someone to sign her up for a recording contract!

The Rugby chaps, having beaten Ballymoney's finest were in fine fettle and treated us to rousing renditions of "Four and twenty virgins came down from Inverness" and "Father Chistmas do not Touch Me" It has to be said that these songs that require no great skill to sing but they do need nerves of steel to listen to. The birthday party responsed with a medelly of Queen's greatest hits, American Pie (who was that... Don McLean??) some Abba and a dash of Muppets

Not to outdone it was decided that Notes World would be represented by Mr Buchan who gave a resounding and well received rendidtion of My Brother Bill - The Fireman Song. Much cheering ensued both because I had not joined in and caused people's ears to bleed and the fact that mr Buchan IS the lost celtic tenor!

Several Irish traditional songs were then sung, accapella , by Laura, the pub (and it was crammed to the rafters with revellers) was suddenly quiet and grown men were seen to weep! She really did have the voice of an angel!

The evening closed at 2am with demands that Bill sing again, and this time on bended knee Mr Buchan and myself seranaded the birthday girl with a rousing chorus of "happy birthday". People had consumed enough alcohol to blunt the effects my voice usually has, although the bar staff had to hide behind several full barrels of Gunniess and cover their ears.

I must have got home because I woke up in my own bed....although the details are some what hazy.

So all in all another unexceptional weekend in Northern Ireland ;-)

ohhhh and remember it is considered rude to hang your sporran on an Elks Antlers without asking

Two useful tools for IE web devs

I was joined by "Wild" Bill Buchan this weekend for a spot of iSeries Geekery, Guinness,champ and Harbour Bar frolicary but more of that later.

Whilst Bill was saying "oh my life" and having pointer size issues. I did a couple of wee changes to some CSS on an app that was having IE issues. I am sure you know the type, looks fine in FF, Safari, Opera but goes tits up in IE. Now I have been using 2 wee tools that helps me with such things. Bill had not come either tool and suggested I throw it out to the web dev horde.

I am as I am sure you all are users of Firebug in FF and long for a similar product for IE. Well Companion.JS from the very nice people at MyDebugBar is a free product that "faces" the Microsoft Script Debugger in a very Firebug way. Full install instructions can be found at the link above, oh and did i mention it is free :-) we here at DYM like free! Free is good!

The other tool comes from the same crowd and is called "My Debug Bar" and although you have to pay for it, you can download it try before you buy.
Summary of features
* Menu to customize the DebugBar and check updates.
* Toggle the Development bar
* Alert on javascript errors
* Send page screenshot by email
* Color picker
* Resize IE window
* Zoom page
* View source code
* View MSHTML integrated ActiveX source code
* View HTML DOM Tree
* View original ad interpreted source code
* View tab attributes
* Edit tab attributes
* View HTTP and HTTPS headers
* View page cookies
* Validate html code for main page and frames/iframes
* List all javascript functions
* View javascript function code
* Execute javascript code in the currently loaded page
* Get information about currently loaded page


Now it doesn't debug JS (Companion.JS does that) but it does have a real whiz bang DOM inspector.. you can drag the inspector onto the browser pane point it at an element and get all the details about it. The CSS the element has (and has inherited)
for finding the source of those annoying glitches that make your web page look like shite it is invaluable. The HTML checker is pretty cool too and I use it frequently

Like I said previously you have to pay for MyDebugbar and it is 59 euros and if you do a lot of IE development this tool will pay for itself very quickly.

Thursday 27 November 2008

Interesting Notes Based Application - DOCOVA

All Notes-ers

I have just had a chat with a Canadian chap Gary Walsh from DLI who have a very interesting product called Docova I must add at this point that this post is not an advert or endorsement! However I did have a few "wow" moments when Gary Demo'ed it for me on Tuesday.

It is a Document Management System that is back ended by Notes NSFs and can be accessed thru the Notes Client and from a browser. It comes with a host of interesting bells and whistles and is priced very reasonably and it is well worth the time to have a look at their site. Particularly the 3 videos in the panel on the right that give a high level explanation/tour of the product.

If you are interested Gary does a good presentation and does not play the "pushy salesman" (an instant turn off for me) so don't be afraid to give him a buzz or drop him a line (contact details on the Docova site)

The "current economic climate" does not allow me at this time to think about a budget for Docova for my own Notes domains but Gary's contact details have gone into the "definitely keep" folder

Wednesday 26 November 2008

I have become to busy to care.

Gentle reader ,

I had a bit of a shock today. It happened when I was listening to one of the podcasts I download weekly. A fine program called "Everyday Ethics" produced by the BBC and available here. It looks at local Northen Ireland and World problems with a Christian perspective but is accessible even for an apostate heathen like myself.

One of the articles on this weeks show was "Do journalists believe in poverty" and from this topic came my shock. To precis the questions the article poses ...
Do journalists accept that many people in the UK really are poor? Or is it the case that many journalists believe that people on benefits are working the system to their own advantage? How well does the media report on the realities of poverty in the UK today? Is there enough exploration of the causes of poverty, social deprivation and inequality? Are journalists at times part of the problem by re-presenting stereotypes and caricatures of poverty where they could be challenging myths and false portrayals? Are stories about poverty presented to broadcast, print and online audiences as though poverty was someone else's experience? Can a moral distinction between the 'deserving poor' and the 'undeserving poor' be detected in some media portrayals?

It would seem that we, the reading and watching public, are served up a mish mash of stereotype and urban myth more often than the actuality of poverty. Poverty is not NEWS it is OLDS... it has always been there and looks set to stay. My shock came not from the frightening figures that in 2006-7 there were 13 Million officially "poor" in the UK or that of that 3.9 million of them were children but from the fact I had forgotten was it actaully was to be poor.

Don't get me wrong I have never been poor. I came from a middle class family that wanted for little and my current situation is far from fiscally challenged. My experience of poverty was only as an observer. When I was involved with the Corrymeela Community (an organisation that my Mum and Day were and are actively involved with) and then later as a Nurse in Belfast I came across the sort of poverty that slowly grinds the soul until there is little left but a husk.I did come across the odd person who was working the system so they do exist but in general most were just poor, alive and supported by the state but mind numbingly poor. I had forgotten the truth about poverty that had motivated me to get involved in activities 30 years ago. I had forgotten the fire that observed social injustice had lit and had made me join the JCSS (Junior Council of Social Services) at school, I even won a prize in my upper sixth year. I had forgotten that ..
Poverty is not simply about not having enough money. It is about struggling to get through each day. About constantly making sacrifices. About living in a state of worry verging on perpetual fear ...
In starting a career, getting married, starting and bringing up a family I moved in a different direction and to be blunt I became to busy to care ... for that I am ashamed ... It is all to easy to get sucked in to the sterotypes we are fed by the media. In the run up to the election in America I heard on several occasions opnions posited that Obama's taxes and social reforms were "socialist" and "evil" or "Why should someone take my money (in taxes) and give it to someone else?" When I was in my late teens I would have not stood for rhetoric like that. I would have made a noise and got annoyed, 30 years later .. not a peep from yours truly .... for that I am ashamed.

I am not talking about the poor in Africa or some far distant "other country" who are also deserving of our help. What is more frightening is the fact that I am talking about that "far off country" that starts not far from the house where I live.

In the run up to the holiday season when the darkness of winter ends and the days start to get longer and bring the promise of Spring, I am going to remember that for every fraud and sponger "outed" in the press there are 100's if not 1000's who who are living day in day out in a condition that leads to misery and an early death. I WILL remember that this is happening in my own community. I will do something to make a difference.

I don't want want to be to busy to care.

Monday 24 November 2008

Friday 21 November 2008

Happy 230th birthday Voltaire from a world that thinks "The Shack" is wonderful literature

Ah yes gentle reader sorry for the gap in posts, last weekend was a trip down to watch Ireland get their bottoms slapped by the all blacks and this week was cram packed with work work work and more work.

Anyhow - today 21st November is the 230th birthday of one of my heroes, Francois Marie Arouet or as he is more commonly remembered Voltaire. We geeks, nerds and techie nere-do-wells are not known for our philosophical leanings ... well at least when sober. My father introduced me to the scribblings of this writer, philosopher, and wit many years ago.
Like any gael whether French,Scots or Irish Voltaire had an opinion about just about everything and was able to express it with a wit and style that has yet to be surpassed.

Do not be put off by his supposed atheist reputation, whilst he is credited with the tongue in cheek expression "Si Dieu n'existait pas, il faudrait l'inventer" ("If God did not exist, it would be necessary to invent him") he found fault not with a deity but with organised religions, those that did the organising and those that allowed themselves to be organised.

Whilst for some reason people are going mad to buy and read that deeply irritating, cloyingly sentimental, shallow, mediocre, heap of crap that is "The Shack" do yourself a favour, nip down to your local library and see if you lay you hands on a modern translation of "Candide".

Oh If anyone wants to pass on a copy of "The Shack" to me this Christmas because "it is a beautiful book" that "will teach me things about the nature of God" , please please please please take the money you would have spent and give it to Medicne Sans Frontiers or Oxfam you will then be actually helping people rather than supporting the sort of mediocre writing that is best left inside Hallmark greeting cards.

Wednesday 12 November 2008

Have a wee game - Go on you know you want to

Control Keys are ... left and right arrows to move and space to fire
You need to get at least 300,000 to get on the high score!

Tuesday 11 November 2008

Coding for the Mouse Wheel in Javascript

This is quite an esoteric post for those JS heads out there ... how do you code for the user using the mouse wheel?

I was working on Name Picker V2.0.0 tonight and one of the "improvements" is that there will be both cursor key and mouse key support on the new format list (which is basically a vertical array of [div]s rather than a select object.

Most of the default form objects that support scroll bars will have mouse support. But what about [li] or some interesting nested [div]s or a [table] construct? With all this Web 2.0 stuff out there you may need to get to grips with doing something with the mouse wheel to allow the user to move to some element on your page. Here is how to do it ... (The O'Reilly Javascript Definitive Guide came in VERY handy for the event properties!)

Mozilla based browsers have a built in event called DOMMouseScroll YIPPEE! I hear you cry but guess what IE doesn't! Instead IE has onmousewheel on both the window and the document object. Browser compatibility don't you just LOVE it to bits!

Now I am going to get all Greek on you and talk about "Delta". Delta is the 4th letter of the greek alphabet and is used by math and other hard sum geeks as the symbol for some form of change. In this instance the change is the direction a user whizzes the mouse wheel and based on that direction the mouse wheel whizzing perform some wondrous code of your own devising.

OK there are some more gotchas for the JS coder.
IE stores delta in event.wheelDelta and positive values are UP negative are DOWN
Opera stores delta in event.wheelData and positive values are DOWN and negative are UP
Mozilla stores delta in event.detail and positve values are DOWN and negative are UP

Right first thing to do is write your handling code
function myWheelHandler(D)
{
  if(D<0)
  {
     ... do some DOWN code ...
  } else {
     ... do some UP code ...
  }
}

That's your bit done, now we have to bend the browsers to our will by writing some code to use instead of the default code
function myWheelFunction(event)
{
  var D = 0;
  // Catch the event for butter fingers IE
  // as it doesnt send event as an arg
  if(!event)
  {
    event = window.event
  }
  // if this is IE or OPERA delta is in wheelDelta
  if(event.wheelDelta)
   {
     D = event.wheelDelta
     // If we are in OPERA change the sign
     if(window.opera)
     {
     D = -D
     }
   } else {
   // OK I am going to assume Mozilla if not IE or OPERA
   // correct the signage to - is down and + up
    D = -event.detail
   }
  // Perform my fantastic wheel mouse code
  myWheelhandle(D)
   // Stop the default actions happening
   if(event.preventDefault)
   {
     event.preventDefault();
   }
   // needless to say IE needs this to cancel default actions
     event.returnValue = false;
   }
}

Right all that is left is to put some code somewhere in your code to override the default with your code.

// For Mozilla
  if(window.addEventListener)
  {
    window.addEventListener("DOMMouseScroll",myWheelFunction,false)
  }
  // For IE and Opera
  window.onmousewheel = document.onmousewheel = myWheelFunction


So there you go, you can now code loads of lovely things for your mouse wheel operations on your web pages.

Monday 10 November 2008

Name Picker V2.0.0 Update

Name Picker 2 didn't quite get as much work this weekend as I had planned due to some family commitments but work resumed today with the reformatting of the Name picker Type 1 "Single" was joined with Type 2 "Multiple" formats. These were achieved with the following code


myPicker = new NP_object();
myPicker.type=1;
myPicker.create();










myPicker = new NP_object();
myPicker.type=2;
myPicker.create();






I am no longer using a [select] to hold the found data but I am injecting [div]'s into the document and planting then in a reception [div] . Using this method gives me more control over the format of the item.










Particularly the extra data like phone number, email address, etc that are returned from the server. This data can now be shown/hidden by clicking on the twisty on the left of the name. I think this method is a more efficient use of the screen real-estate and allows the user to visually access the extra data without having to move their eye line away from the item they are clicking on.


More later .... time for tea!

Sunday 9 November 2008

Rememberance Sunday

It is rememberance sunday here in the UK and on the way to a family gathering in the south of the province and there was a programe on the radio which took my attention. It is 80 years since the end of the The Great War and the show focused on a group that became known as the "war poets".

I have never been able to put my finger on why the works of these poets attracted me even when at school when poetry was considered to be a necesary evil within English classes. There is one poem in particual that has stuck wth me. Written by Wilfred Owen whose poems where written in the trenches and who died only a week before Armistice -

Anthem for Doomed Youth

What passing-bells for these who die as cattle?
Only the monstruous anger of the guns.
Only the stuttering rifles' rapid rattle
Can patter out their hasty orisons.
No mockeries now for them; no prayers nor bells;
Nor any voice of mourning save the choirs, -
The shrill, demented choirs of wailing shells;
And bugles calling for them from sad shires.

What candles may be held to speed them all?
Not in the hands of boys, but in their eyes
Shall shine the holy glimmers of good-byes.
The pallor of girls' brows shall be their pall;
Their flowers the tenderness of patient minds,
And each slow dusk a drawing-down of blinds.


Thursday 6 November 2008

Name Picker V2.0.0 started

I recently got two messages on OpenNTF informing me that there was a bug in the multiple selection section code of my AJAX Name Picker and after some checking indeed there is! I had made a fairly minor change in a bit of what I was "sure" was unrelated JS and managed to duplicate all the data in an array. So sure was I that it was fine I didn't test all 3 types of name picker ~hangs head in shame~ I really should know better!

Anyway, it was a bit of code I wrote back in 2006 and as such it is starting to look a wee bit tired (as well as buggy). So I have started tarting it up and foremost amongst the changes will be that it will be a JS class NP_object and you will need only to instantiate a Name Picker object on the form onload event to create a Name picker that can be used anywhere on the form by attaching it to a form object event.

This evening I wrote the "injection" mechanism that creates and adds the Name Picker objects to your form/page's DOM. The default picker (single selection popup) looks like this and is fully drag and dropable.
So to the 2 people that are waiting for my fix to Name Picker V1, please be patient rather than fix the bug in the current release. You will be getting a "fully" tested newer version hopefully with more features.

I hope to also release this as a Google Desktop widget to allow your users to be able to get vCard like information from your PAB without the need to have the notes client active, but more on that later.

Wednesday 5 November 2008

ILUG 09 - uniform (Male) beta 0.0.1 created

This will be the new face , or bottom half, of the ILUG gentle-person's apparel for 2009. Should you wish to appear at ILUG as a speaker this year you will have to provide your measurements well in advance.

So like Wild Bill, Coatsie and myself you might need to think about those extra pounds!

The kilt is black leather and will be worn with the prerequisite green polo shirt. The Sporran comes complete with hip flask and spare remote for the projector

Tuesday 4 November 2008

Dominoyesmaybe's new job as an agony aunt for geeks

In the current economic climate (oh I am starting to hate that phrase) we are all faced with uncertain times and as of last weekend I have started offering myself as an Agony Aunt for all your geeky angst. No problem is too icky or horrible for the dedicated and professional team of fellow geeks who will give you grounded and well thought out advice. We have so far helped Mr X with his microwaved cheesy bagel problem (melted cheese is SO hard to get out of nylon!) Mr Y with his compulsive administration disorder and Ms Z from her fear of airport security checks.

This week we look at interpersonal relationships

Dear Dominoyesmaybe,

Last year I upgraded from Boyfriend 5.0 to Husband 1.0 and noticed a distinct slow down in overall system performance, particularly in the flower and jewelry applications, which operated flawlessly under Boyfriend 5.0.

In addition, Husband 1.0 uninstalled many other valuable programs, such as Romance 9.5 and Personal Attention 6.5, and then installed undesirable programs such as

Fishing 5.0,
Rugby 3.0 and
Golf Clubs 4.1.6a

Conversation 8.0 no longer runs, and Housecleaning 2.6 simply crashes the system.

Please note that I have tried running Nagging 5.3 to fix these problems, but to no avail.

What can I do?

Signed,

Desperate.



DEAR DESPERATE,

First, keep in mind,
Boyfriend 5.0 is an Entertainment Package, while
Husband 1.0 is an operating system.

Please goto: ithoughtyoulovedme.html and try to download Tears 6.2 and do not forget to install the Guilt 3.0 fixpack. If that application works as designed, Husband 1.0 should then automatically run the applications Jewelry 2.0 and Flowers 3.5

However, remember, overuse of the above application can cause Husband 1.0 to default to Grumpy Silence 2.5, Happy Hour 7.0 or Beer 6.1.
Please note that Beer 6. 1 is a very bad program that will download the Farting and Snoring Loudly Beta.

Whatever you do, DO NOT under any circumstances install Mother-In-Law 1.0 (it runs a virus in the background that will eventually seize control of all your system resources.)

In addition, please do not attempt to reinstall the Boyfriend 5.0-program .These are unsupported applications and will crash Husband 1.0.

In summary, Husband 1.0 is a great program, but it does have limited memory and cannot learn new applications quickly. You might consider buying additional software to improve memory and performance. We recommend
Cooking 3.0 and
Hot Lingerie 7.7

Best of luck to you!
The Dominoyesmaybe Team



** Thanks to relationship specialist "Jim T" for his email input into answering this cry for help **

The ILUG 09 "fringe" preparation begins

Even though ILUG 09 is stil at least 7-8 months away, preparation is everything and at several previous events it has been noted that the local Celtic males did not appear in Kilts. Much thought and research has gone into the reason for this and in order that ILUG become more KILT-friendly we have taken delivery of several kilt friendly seats.

Now Wild Bill, Mr Mooney and Myself have no excuse not to startle the ladies and scare dogs that are small enuff to get a good upward glance.

Sunday 2 November 2008

How to install Ubuntu on XP as a Virtual Machine

Ok gentle reader

Last night I geeked out and stuck an UBUNTU V8.10 new VM on my thinkpad
Now I know that there are a large number of folk out there that know how
to do this but there may be those out there who have gone "eh?" every time
they hear one of the illuminatii mention that they have this or that as a
virtual machine. This was brought up clearly to me when sprog asked me
what I was doing and I found out he was unaware that you could do this.

So this is a "HOW TO DO" for those of you out there that might want to have
a look at Linux in general and Ubuntu in particular but you haven't got
a) The spare hardware to do it on another machine
b) The budget to allow you to get new hardware
c) The "I [heart] Ubunto" factor isn't strong enuff for you to drop your
XP or Vista partitions.
d) You don't know your arse from your elbow when it comes to "Virtual Machines"

Well I am here to tell you it is free, it is reasonably easy to do and should
take no longer than an hour or so. The longest task are the downloads.

Right! I did this on a Thinkpad T60 with 1Gb of memory, 40gb of free space on
my HD and XP SP 2 as the parent Operating system and this is the way I did it.

Step 1 :- Download QEMU from here
This little program allows you to create a "virtual disk" on your hard drive.

Step 2 :- Install this program. I installed it into a dir called c:\Ubuntu and this is reflected below

Step 3 :- Open a command window in XP
START / Programs / Accessories / Command Prompt
Type cd\
Type cd\Ubuntu
Type qemu-img.exe create -f vmdk Ubuntu.vmdk 10G
Type exit
This will create a file called ubuntu.vmdk which will be used as your "virtual disk" for your ubuntu install.

Step 4 :- Download the ubuntu ISO image file from here and save it in c:\Ubuntu . The file name will be ubuntu-8.10-desktop-i386.iso

Step 5 :- Download VM Player from VMWare here, it is free but you do have to register

Step 6 :- Install the VM Player, just accept all the defaults

Step 7 :- Create a text file in the c:\Ubuntu directory and paste the following into it
config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "Ubuntu.vmdk"
memsize = "500"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"

#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"

ide1:0.fileName = " ubuntu-8.10-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Ubuntu"
guestOS = "ubuntu"
nvram = "Ubuntu.nvram"
MemTrimRate = "-1"

ide0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d 80 3e f2 32 56 75-44 a6 45 89 2b 4a 03 4b"
uuid.bios = "56 4d 80 3e f2 32 56 75-44 a6 45 89 2b 4a 03 4b"
ethernet0.generatedAddress = "00:0c:29:4a:03:4b"
ethernet0.generatedAddressOffset = "0"

tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"
uuid.action = "create"
checkpoint.vmState = ""
tools.remindInstall = "TRUE"
#gui.fullScreenAtPowerOn = "TRUE"
Step 8 :- Save this file as c:\ubuntu\Ubuntu.vmx
*NOTE* the memesize=500 can be changed to reflect
your currently memeory. I use 1/2 my 1Gb and allocate 500mb
*NOTE* the line below should reflect the file you downloaded in step 4.
ide1:0.fileName = " ubuntu-8.10-desktop-i386.iso"

Step 9 :- Start the VM Player, there will be a shortcut on the desktop

Step 10: - Select "open" and browse to c:\ubuntu and click on ubuntu.vmx

Step 11:- A VM Window will open and the UBUNTU install will start Enter all data you are asked for and you can just accept the defaults and all should be well.
*NOTE* the disk format instal will install into the Virtual disk so your PC and it's current install will be totally safe. You will see that UbUntu.vmdk gets bigger and bigger.

Step 12: Let Ubuntu restart itself, this will only happen within the VM window as soon as you get the reboot screen close the VM window

Step 13: Open c:\ubuntu\ubuntu.vmx and change these lines
#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"
ide1:0.fileName = "ubuntu-8.10-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

to

ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"
#ide1:0.fileName = "ubuntu-8.10-desktop-i386.iso"
#ide1:0.deviceType = "cdrom-image"

This will give you an ordinary CD drive rather than the ubuntu install iso

Step 14: You can now delete the ubuntu install ISO image in c:\unbuntu

Step 15: Restart the VM Player open c:\ubuntu\ubuntu.vmx

Step 16: Logon to Ubuntu with the user name and password you created during the install
You may need to press + to use your keyboard in the VM window.

Step 17: Once Ubuntu starts, it will automatically start updating itself, as long as you
have an internet connection that is up and running the VM will use it and
you will be able to update your install with the most recent code. Let this
finish and perform an reboot when required.

Step 18: You are done, you have a running VM of Ubuntu on your PC running in a 10GB
hard drive in 500 mb of memory ... enjoy

Disqus for Domi-No-Yes-Maybe