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

Disqus for Domi-No-Yes-Maybe