Friday 29 February 2008

ILUG 08 a guide to Irish Idiom for our non-irish guests Part 2

Gentle reader we move on to some situational examples that you may,as an ILUG attendee, encounter. Dublin, as indeed most of Ireland, is well equipped with pubs. Pubs are an essential part of Irish life and not just for the disposal of brain cells. The are “Public Houses” and as such are an extension of your home. They provides a wide range of homely activities like conversation, eating, drinking, dancing, singing and even on occasions sleeping. It is vital that you have at your disposal the where with all to truly enjoy the experience.

Dublish

English

Will ye go fur a jar?

Would you like to go to the pub for a pint?

Will we go for a few scoops?

Perhaps the trip to the museum could be done via O’Malley’s Pub?

Are ya on for one?

Do you feel up to the consumption of one pint? *
*Note this is the use of the Irish plural form of “one”

Responding to the above these are acceptable responses

A bird never flew on one wing

Yes Please

Yeron

Yes lets do so right away

Im yer mon

What a wonderful idea please lead the way

As long as there are no culchies

I am undecided, can you assure me the conversation will be sparkling and not be about sheep or cows?

Roysh!

I am half way there already why are you so slow?

It is vital that you know the scale of inebriation so as to be able to place your self on it should you be asked your current state by a local … our ye rightly?

Well on

I am relaxing and getting into the swing of the evening

Well oiled

I am now fully relaxed and willing to entertain conversation

Half pissed

I am now so relaxed that my “talking shite” brake has been released

Pissed

Freely talking shite

Flootered

Talking shite to some damned attractive 18 year old ladies

Maggoty

Surprised that the attractive 18 year old ladies have wandered off

Locked

Talking shite to some passing polish tourists

Legless

Sudden need to sit down whilst drinking

Langered

As your Pint to Piss ratio has now passed 1:1 Beer looses its charm and that bottle of Bushmills is calling you seductively.

Bolloxed / Bollixed

The need to eat a 13 Chilli vindaloo appears in your mind

Paralytic

Legs appear to belong to someone else as does your mouth after the 13 chill vindaloo!

Stocious

All higher brain centres have shut down to prepare for the morning

A special note to speakers – it is strongly suggested that you aim no higher that “Pissed” if your session is first the next morning.. But if you succumb to more that Pissed, buckets and sawdust are provided behind the lecterns in all session rooms.


There is a special tourist attraction to be aware of now before you attempt any ascent of the inebriation scale because it is easy to miss it. The Liffey Magic Bus Company is a fantastic if highly mysterious service run by Bord Failte that between 10pm and 11pm most nights visits all the pubs in the city (usually when you are in the toilet after your 8th pint) and it removes all the unattractive women / men (*delete as gender or sexual orientation demands) and restocks the pub with sparkling witty, stunners ! This is a free service provided to make your stay more enjoyable.

We want you to enjoy your stay in Ireland so I do need to stress the importance of adhering to the new
GUSSET* Act 2007
*(Gratuitous Use (of) Stereotypic Speech (by) Eejit Tourists)

Use of the following phrases is now strictly controlled :

Bejaazus!
Begorrahh!
Top o’ the morning!
To be sure to be sure!
You will, you will, you will, you will!

An undercover branch of the Gardai, the “Gusset Guards” (or “panty liners” as they are known) enforce this act. They are empowered to give you an on the spot fine of 50 Euros for the slightest infringement unless you can provide proof you or your parents were actually born in County Leitrim OR you are in fact a leprechaun ..... You have been warned!!

More later.
Slaun

ILUG 08 a guide to Irish Idiom for our non-irish guests Part 1

I see from the buzz on the blogs ILUG 08 is going to be the glorious multicultural affair it was in previous years. Even for the natives attending, the odd conversation with a local can be difficult, as Oscar Wilde once said.."Britain and America .. two nations separated by a common language". So in an effort to improve the entend cordial I lay before you a short course in understanding the locals.

Greetings
Greetings are always accompanied or immediately preceded by the "head lift". This is a lowering of the chin and then raising like a slowish upward nod. Practicing this will not only improve neck muscle tone but helps dislodge stubborn ear wax. This nod is usually combined with one of the following greetings or icebreakers about weather or health.

Dublish

English

How's the craic [pron. 'crack] ?

Are you currently having as much fun as you can?

How's the form ?

Are you feeling at the peak of physical wonderfulness

How's it goin' ?

Are you at one with your place in the universe

Anything strange ?

Please divulge all the juicy details of your tryst with the lady i saw you with last night?

bout ya?

Are things in the environment you find youself in to your liking?

Hard at it?

Are you working hard

Well, is it yerself?

Ah yes i recognize you but i cant remember your name.

Yer luking well, are you sick?

You look to be in such good health it cannot be true!

Did ya see Mooney with that yellow and black yoke he was talking about?

Did you happen to catch the session with Paul Mooney where he told us about the yellow and black box whose name i cant remember at this time. (prob a Foundations Box)

Many conversations start with a query about the weather, a topic the irish are fascinated by

and is generally responded to with the single word "aye" and a nod.

Durty auld day

The weather is somewhat inclement today don't you think

Soft

Rain that you would hardly notice

Mizzly

Light Rain

Mizzly Pish

Slighty heavier Rain

Pishing

Moderatly heavy rain

Lashing

Deluge

Breezy

Storm

Blowy

Gale

Windy

Hurricane

'tis despera

The weather is absolutely awful is it not?


It is probably best to give, particularly our American first timeer guests, a rough guide to irish weather so they can pack accordingly.

40 degrees: Californians shiver uncontrollably.
Dubliners sunbathe.

35 degrees: Italian cars won't start.
Dubliners drive with the windows down.

20 degrees: People in Florida wear coats, gloves and woolly hats.
Dubliners throw on a T-shirt.

15 degrees: Californians begin to evacuate the state.
Dubliners go swimming.

Zero degrees: New York landlords finally turn up the heating.
Dubliners have the last BBQ of the summer before it "gets a tad cold".

10 degrees below zero: Californians fly away to Mexico.
Dubliners throw on a light jacket.

50 degrees below zero: Santa Claus abandons the North Pole.
Dublin Boy Scouts postpone "Winter Survival" classes until it gets cold enough

173 degrees below zero: Ethyl alcohol freezes.
Dubliners get frustrated cos they can't thaw their Guinness.

297 degrees below zero: Microbial life start to disappear.
Dublin cows complain of farmers with cold hands

460 degrees below zero: ALL atomic motion stops.
Dubliners start saying "Is it just me or is there a wee nip in the air?"

500 degrees below zero: Hell freezes over.
Dubliners support England instead of Brazil in the World Cup.


Watch this space for Part 2 - Situations you may find yourself in .


Thursday 28 February 2008

Harry Pothead and the Widget of Desire

Well i wrote my first widget today !
A most gratifying feeling well done IBM a wonderful addition to the client.
Thanks to the various bloggers that posted a HOW TO in the past few days.

My widget recognizes one of our part numbers, can when clicked calls a Domino Web Agent
that nips off looks up various tables in our DB2 tables and Notes Applications and presents the user with a nicely formated page of HTML that summarizes stock sales and the like. Into a nice wee graph (courtesy of YUI's charting library) and a clatter of tables.

Now Chris Blatnik has set me thinking in this post what about splitting it into several widgets and having a dashboard..... oooooooooo..... i see some fiddling coming at the weekend.

I soooooo want one .... NOW!

Go here and drool , well if you like very very very fast things that aren't planes,
do 340mph and get 100mpg at 100mph (get the green bit in).. I have to have one! After twenty [cough] years of marriage I am sort of entitled to 3 seven year itches, could I persuade her?

Terry Pratchett - Nightwatch on the Beeb

For all you Pratchett fans BBC Radio is dramatizing TP's "Nightwatch". The first episode was this evening (Wed) and can be listened to here (i don' think non British Isles folk can listen but it might be worth a try)

Tonight was episode 1 of 5 and the next one is at Wednesday 05 March 2008 @ 23:00 GMT
I can heartily recommend it for anyone who enjoys the discworld and it's inhabitants and for those of you that have not yet dipped your toes in that particular oeuvre this is an excellent place to start.

Corporal "Nobby" Nobbs sounds just like a BOFH I used to have in Operations, thankfully the attendant Parfume de Nobbs was absent on our stalwart Operator.

Wednesday 27 February 2008

I just chatted with 2 folk on the YellowBleeders ST group!

Denny Russell, a very nice chap at Sherpa Software made .. well I will call it a mistake ... by saying on his blog that we his readership should not be afraid to say HI if we saw him online :) So he got pinged by me just to basically to say hello as per his invite and we had as they say around here "a nice we chin wag"

I also said "hi" to Bruce Elgort, who I met, all be it briefly at ILUG 07, another nice chap who said hello back to a complete (nearly) stranger from the other side of the world.

Gentlemen should you make ILUG 08 the first drinkies are on me :) particularly for putting up with a strange Irishman (that isn't Paul Mooney) saying hi to you on Sametime. And to all the folk at Bleedyellow.com... WELL DONE .. FANTASTIC JOB!

And the same invite that Denny made is hereby made by me .. if you see me online on the bleedyellow ST server please dont be afraid to say Hi :)

Another Server up on V8.0.1 - Problem with backup (resolved)

3 down .... 14 to go.
For those of you interested in such things the server is a X3400 Quad-Core Intel Xeon Processor E5430 2.66 GHz with 4Gb of RAM. Running Windoze 2003 Server. Upgrade was from V7.0.2 to V8.0.1 and the NAB has approx 5000 folk in it. (The nab was already at V8.0.1 prior to upgrade) from server down to up again took just under an hour.

This one gave a wee bit of concern because this is one of the backup servers that actually takes archival stuff off to near-line storage and tape. We were told the backup software would work fine and we did some tests on a small test server and it seemed to go OK. However on the production server the backup just stopped, refused to cancel and resolutely refused to eject the tape unless the server was rebooted.

We use Backup Exec 11d for Windows Servers revision 7170 with Service Pack 1.

A trawl thru the symantec support found this and this although this does not reference V8.0.1 we were at a loss to find another solution so popped on Hotfix 28 and the problem appears to be resolved.

Tuesday 26 February 2008

How addicted am I?

Oh god the shame.. only 64%!

...o0(image link removed)0o...
Feed validator didn't like it at all !

V801 client / Zipmail requirement

If you are thinking about going to V8.0.1 and use the wonderful ZipMail product you will need to be on Version 10 of Zipmail otherwise the automatic UNZIP in the client doesn't work, Zipping on creations still works a treat at V9 but unzip opens whatever zip client you use normally

Another Picture - 3 seagulls to a double take when Gandalf ....


The full title is "3 seagulls do a double take when Gandalf, Bilbo and Frodo moon Sam from the Elfin Ship as it leaves for the Undying lands"
Nothing like a pretentious title for a painting I always think! MInd you doesnt seem to make them sell any faster.

Monday 25 February 2008

V8 LOCK screen

All you nice folk out there who are on V8 or V8.01 do you have a way back to the naff Politically picture that appeared when you hit F5 (now CTRL+F5) or when the client session timed out?

We have a potential SOX compliance issue of not leaving things on the screen when you wander off. the V7's - F5 was a beauty and fitted the policy like a glove. Now the users need to remember to go somewhere innocuous on the client and then lock their systems. Not a show stopper .. but if anyone has a suggestion it would be very welcome.

ILUG 2008 - Registered!

Yes indeed .. registered today for ILUG 2008 having been last year I got early registration :)
look forward to seeing you all there!

Painting in winter.

Here is another of my paintings, acrylic on board 18"x24" and at the minute it has no name.

There is a part of me that around this time of year needs to be reassured that spring is just around the corner and that is I think where this picture has come from.

Sunday 24 February 2008

AJAX and viewing very large datasets (50K+ documents)

Problem: How to facilitate a user request to get rid of the "paging" options at the bottom of a AJAX enabled web view and allow them to use only the scroll bar to navigate very large datasets (50k + documents).

I have been thinking about this all weekend and have drawn numerous wee drawings trying to get my head around what is required. The bull in a china shop approach would be download the 50k+ view data and then allow the JS or XSLT to render 50,000 documents .... Tried it .. OOOOO it was slow and required lots of answers to "this script is taking a long time it may be looping do you want to end it?" messages.

So the next option and the currently active one is to have 20 records per page and have the standard sort of page that has Page x of 2500 and allows the user to set x the background process goes off gets that page from the server and displays it. This has the benefit that the browser only has to get 20 documents from the server and render them which is quick and easy. BUT the user group doesn't really like this and reports back that they prefer a UI that has a scroll bar. Their main complaint is when you are looking at a Categorized view and the category is large when expanded then the data may be take several pages which you have to shuttle back and forth between.

And finally the last option.. what the user wants... a scroll bar option like in the client...This is the idea I am playing with at the minute,all be it as a mind game. My thoughts are these.

  1. To ensure the Scrollbar accurately reflects the size of the dataset the holding element must be as near as possible the correct size to contain the dataset, but it does not necessarily need to be full of data. The size of this containing object will equal
    height of a single row * total number of rows in the dataset

  2. The viewport need only contain the grid of Visible Rows say for example a table of 20
    rows. The size of the viewport if defined in rows is
    height of a single row * total number of rows in the viewport

  3. When a scroll bar is clicked on either the down or up arrows the viewport is moved up or down by one row.

  4. When the scroll bar is clicked either above or below the scroll tab the viewport is moved up or down by one page.

  5. The current pixel position of the scroll bar in the holding element is returned by the scrollTop value. This can be used to work out the row that is at the top of the view port
    current position as returned by scrollTop / height of a row given as an integer value
that need to have a height of 50,000 *14 = 700,000px
So...lets say we have a view that is 50,000 rows long, we want to display this in a grid that has 20 visible rows and each row has a height of 14px.

Step 1 - Create a viewport which we know needs to have a height of 20*14 = 280px
Step 2 - Inside the viewport create a holder [div] which has a height of 700000px (50,000*14)
Step 3 - Place a grid inside in the Holder [div] which contains 20 rows 14px high
Step 4 - Register an event handler on the "scroll" event of the Holder [div]
Step 5 - When this event is triggered return the scrollTop and calculate the new starting row.
Step 6 - Ask the server to return 20 view entries from this starting row
Step 7 - Populate the table with these entries.
Step 8 - Position the table at scrollTop,0 within the holder [div]

Basically this will move the table which holds only the data visible in the UI to be centered in the viewport [div], the holder [div] has a height of 700,000px but only contains the table of visible data thus preserving the scale of the scroll bar without the requirement for having it full of data.

I have had a play and this seems to be "do-able" although there are some browser specific niceties that I have to get my head around as well as how to do interesting things like sortable columns, searches and how to return categorized views.

Has anyone else done something similar I wonder or would anyone be interested in the proof of concept I am working on? If so let me know ....

Ohh I wonder ...how does Ext.ND cope with large datasets?

UPDATE - In the comments below Joerg Michael didn't think this was a good idea...and Nathan Freeman followed up with the the point that ... perhaps the Notes Client view should be redesigned too.. :) Bum.. I was distracted by a user saying something that sounded like a good idea.. LOL...
Oh well ...being distracted are sunday afternoons in Feb are for :) However a non-notes solution of a similar nature has been looked at and put forward as a user extension for Ext as pointed out by Rich Waters as something to look at and as a point to think on... :)



Never ask an Irish man to tell you his deep and sensitive thoughts.

There is a very good reason for the title of this Blog entry.. you should never ask this question of an Irish male because generally he wont have any .. well that is not strictly true, he will have but they will be mainly deep and sensitive thoughts about himself.

The idea for this wandering thought came to me in the post match thirst-quenching session . (The match in question was Ireland vs Scotland 6-nations rugby .. we won .. sorry Bill) There we were, maintaining the fiction that should the Irish Rugby Football Union have rung we would have stubbed out or ciggies, downed the last dregs of our current pint, thrown on the green jersey and taken to the field and shown those young whippersnappers how rugby should be played. The conversation turned to the current captain and official Irish-"tottie magnet"-in-chief Brian O'Driscoll and how it would be rather nice to be him for a few days. A general consensus was reached that yes it would be rather fun. One of our number, a single gentleman, articulate, bright and relatively rich was the only dissenting voice. Had he pranged his Porsche? Was he not able to fit in his skiing trip to the Alps this year? Had his portfolio sustained substantial losses?
No, twas his girlfriend....
"She is clever than me" he told us, grimacing into his Guinness, "She earns more money that me. she's more interesting that me. She can explain the offside rule in soccer and damn it she is hornier than me! ... So sod being Brian O'Driscoll I would much rather be a woman!"

The world turns and the weird just gets weirder.

Friday 22 February 2008

An embarrassing lapse into adolescent bad behavior

One of these days I will post about something Notes'y but apart from having just upgraded to V8.01 on two of our 15 server and a host of clients, which was remarkable in in unremarkabilty. I fear that is more a comment on the ease of upgrade than on any professionalism on my part.Not, I hasten to add that myself and my team are not professional at all times (just in case any management types are reading this).

To the topic in hand or at least in the title above ... I am a heathen, heretic and potential spawn of Satan to many up here in Northern Ireland. Which is odd, because were I the fruit of Beelzebub's loins I wouldn't believe in my father which could lead to certain Freudian problems in by psyche.

Psychiatrist: Well Mr McDonagh did you love your parents?
Me: Well no, my father was the first lord of Sheol, Guardian of Gehana and nemesis of Jesuits everywhere. But as there is no such thing as hell or demons my father is a logical impossibility and therefore so am I.

I can hear the little cash registers go KERCHING as I type this.

I digress ....

Needless to say I am not demon spawn even if the local pastor of the Free Presbyies may think that I am. I am merely an "Evangelical Agnostic" spreading the good word of being un-convinced of the benefits of bathing in blood of the lamb or the probity of a wrathful god, talking snakes, the occasional talking donkey and chatty if inflammatory shrubbery.

A conversation at lunch yesterday turned from EDI to things spiritual and I was asked was I saved ....Rather than answer yes or no, I made he mistake of pointing out to the "more-convinced-person-of-belief-than-me" person that he was, as a percentage, more of an atheist than I am. Since I am officially unconvinced I give the benefit for the doubt to Ahura Mazda, Brahma , Al'lah, Daanau, Odin and the plethora of other deities. Whereas he denies the existence all of them with the exception of his brand of celestial CEO. This basically makes him 99.9999% atheist and me 50%.

This was of course said with my tongue (both ends of the fork) jammed firmly in my cheek. However for some reason, his reply that I was destined to spend eternity in a lake of fire with tearing out of hair and gnashing of teeth (teeth will be provided for those dentally challenged - like me and most other rugby forwards). This reply, which normally follows such flippancy, for some reason rankled more than normal. I am sorry to say I got on my high horse and things got perhaps a little too heated. He was only a young chap and the sort of critical thought I was espousing was perhaps not something he had come across before certainly not at the speed and with the vehemence I used.

As a result last night I did feel rather bad about the grilling I gave him. T'was then I recognized that I had reverted just for 5 minutes back to the adolescent hot headed oaf I thought I had left behind in the early 70's .... I apologized privately this morning.

Hey ho ... I am adding be "more tolerant" to my list of new years resolutions even though it is nearly the end of Feb.

Tuesday 19 February 2008

NiftyFifty - I have finally started something

After my comversation with Chuck re the niftyfity on lotusmb
Having been delayed by a recalcitrant server at work and the start of a major project I eventually got around to starting to think about what Chuck#s suggestion should look like. He thought that a simple something that fell between a blog and a wiki.

I started with the front end UI yesterday and have a fair bit of the HTML and JS sorted at least in my head. You can have a look at the rough start i have made here
Please note the following..
1. This is not yet "notesed" it is a static page with a 1000 record data island and some JS
2. You can log on either as admin with a password of admin or as user1 with a password of user1
however nothing much will happen other than the menu bar changing :)
3, The navigation buttons dont work yet.. but the search selects do and number of records per page do if you click on the arrow that points right after the selects


Have a look see.. and if this grabs your fancy as an idea for a nifty-fifty app let me know.. infact let me know if you hate it as well... LOL...

Steve

GoatWhackery - kicking up the dust on a Bodhran

I just had a pleasant exchange with Bruce Elgort and Nathan Freeman about drumming of all things ... and rather than clutter their sites with links to sites... here for the delectation of the masses is a Bodhran duet from those terribly nice people in the "everygreen" band...

For those of you not in the know the Bodhran is an Irish hand drum .. and the playing of same is affectionately known as GoatWhackery ...

Take a stroll to here
and have a look see at two chaps GoatWhacking with style.. and Bruce & Nathan if you are reading this you haven't seen the one above

And here
To see the world master IMHO doing his thing

Sunday 17 February 2008

JavaSlabber (tm)

Bout Ya!

A lovely Sunday morning the sun shines and there is a warmth to the proceedings that hints at springness. :) Being involved in the arts (on an amateur basis) I was having a look at some arts related sites and came across this...

Apen Discoorse

Tha Airts Cooncil o Norlin Airlann haes trystit a Wechtin an Waants Spierin o tha Airts o Airisch an Ulstèr-Scotch. A hinnèrmaist Fynnin is jist new gat an ower tha monds incumin, tha Cooncil is fur pittin ower tha fynnins tae tha Airisch an Ulstèr-Scotch leid shaidins tha baith, forbye tae tha hale feck o resydentèrs.

The’r fur fettlin a rin o gaitherins fur apen discoorse an tha Cooncil is fur awnin straucht wi tha effeirin curns an boadies thir lane. Wurd o thae gaitherins wull be gien oot wi advert?semenn forbye.

Tha Cooncil wud be hairt-gled o aa scrievit repones tae tha Fynnin gin Frideh 15 Uptober 2004.

Ye’ll can hae scrows o tha fu Fynnin, forbye tha Throchin Jimp Wittins in Airisch an Ulstèr-Scotch, frae www.artscouncil-ni.org (PDF) ur frae tha awnin boadie condescendit oan ablow. Gin ye spier, ye’ll can hae this rede in tha follaein lay-oots forbye: Bäg Prent, Computèr Däsk, Soon Tape an Braille.

We’d be ableeged gin ye’d lat ken gin ye wad hae a fen furtae inpit a repone.

Now you may be wondering if this is in English well it is and it isnt. This is the "offical" Ulster-Scots dialect that we heathen northern irish speak. Not the soft brogue of the Paul Mooney's nor the casually rolled R's of Will Bill Buchan's of the world. This is proper spak nane o this nansence spak forby heddins.

It has long been my aim to port javascript to Ulster-Scots and coming across this has stiffened my resolve to move this one step further to realization. JavaSlabber V1.0 is now officially in developement!

Slaun!

Nostaglia and Daddy's taxi

I had to sit up this evening until after 1:30, not because I was cutting code or engrossed in some painting project .. but because I was being Daddy's taxi for my son and his friends. Ferrying them to an from Kelly's Nightclub in Portrush.

Now I really don't mind this, it is after all considerably safer if I pick them up and redistribute them back to their beds, doubly so if they are "tired and over emotional"

However I was sitting the car park thinking of how it hadn't really changed since I was their age ... 1.30 am in the car park, once again bereft of female company and munching down on a Kebab with extra chili and garlic. Then it occurred to me it HAD changed at my son's age we were going to Kelly's of a Saturday Night but unlike now our parents were not outside in a nice warm car waiting to take us home. In fact our parents didn't even know we were there and would have had canipitions had they found out that their darling children were "shaking the stuff to the funky funky beat" in a sink hole of depravity like Kelly's NiteClub!

Ah the world turns and things change ~sigh~ gone are the days when we as young Irish lads wondered if this would be the Saturday night where at LAST we would find what delights lay beneath Siobhan McNally's cheesecloth shirt. Delights so tantalizingly hinted at by her more than adequate curves. In those days lassies moved in packs like she-wolves but instead of circling prey they circled their hand-bags on the dance floor as we fellas got down to the serious business of the evening which largely involved beer, purchase and consumption of same.

10pm,11pm and Midnite would pass and then at 12:30 PANIC another Saturday Night was nearly over and female company had eluded us once again. Once the panic subsided it was followed by a mass stampede of fellas from the bar. The hall would echo not only with the latest ditty by T-Rex but also with the phrase "Are you dancing.?" which was responded to with a nod which equated to success or "nah i'm not THAT desperate"
After 4 or 5 rejections, the siren call of the bar once again worked it's magic and twas there we were found when the lights came on. Our illusions of stud-dom shattered, broke, drunk and wondering how we were going to get home.

This usually involved walking the 8 miles back to town .. Hey ho! Sometimes I wish I could go back to that time ... but on an icy Feb night with a long trudge down the roads of north Antrim ahead i think i prefer the here and now :)

Now it is time to head off to bed I think...

Friday 15 February 2008

AJAX YAHOO Domino - a Beginner's Guide Conclusion

OK in the Previous posts in this thread I worked my way thru a worked example of using the YAHOO UI framework to get data from a domino server. In summary what you do is

a. Place the required Yahoo JS files in your application (or access them from the YUI site)
b. Create a global Var to hold your returned data in
c. Create the SUCCESS var containing the code to run when you get data
d. Create the FAILURE var containing the code to run when the connection fails
e. Create the CALLBACK var containing the vars from (c) and (d) above along with any arguments
f. Create an agent to do the work on the server
g. Create a JS function to process the data when you get it back.

And that is really all there is to it.
This was a very simple example but you can, like in the case of the Ext.ND project on OpenNTF get really clever with the YAHOO UI's myriad of other capabilities. But if all you want is data the method I described below should be ample to get you started.

So all you V5 and V6 people out there that would like to try your hand at AJAX don't be shy, it isn't that hard and if you get stuck ... well please drop me a line and I will do what I can to help. :)

AJAX YAHOO DOMINO - A beginners Guide 7

Righty Ho!

We have built the AJAX objects
We have built an event that instantiated the AJAX objects and passes the request to the server
We have built a Web Agent that catches, processes the request and returns it to the browser.When When the data comes back it is picked up by the success function code which loads the JS we prepared on the server into the DOM.... what now?

Well lets do something with the data!

Cast your mind back to this bit of code

var mySuccessCode = function(o)
{
ProcessMe = evaluate(o.responseText);
RunMe = evaluate(o.argument.nextFunction);
}


The second line RunMe= is the important bit here, once again we use the JS evaluate function to "run" whatever is in o.argument.nextFunction. Which if you remember we set here

myCallBack.argument.nextFunction="dspCars(o.argument.target);"


The last bit of coding we need is the dspCars() function. As you can see the function is passed o.argument.target which was set to be "fordinfo" back in the getData() function.The code looks like this : -


function dspCars(target)
{
myHTML = "";
myHTML = myHTML+"[table border='0' cellpadding='0' cellspacing='0']";
myHTML = myHTML+"[tbody][tr][td]Model[/td][td]Year[/td][td]Price[/td][/tr]";
for(t=0;t[cardata.length;t++)
{
myhtml=myHTML+"[tr]"
myHTML = myHTML+"[td]"+CarData[t].Model+"[/td]";
myHTML = myHTML+"[td]"+CarData[t].Year+"[/td]";
myHTML = myHTML+"[td]"+CarData[t].Price+"[/td]";
myHTML = myHTML+"[/tr]";
}
myHTML = myHTML+"[/table]";
document.getElementById(target).innerHTML = myHTML;
}


(remember to replace all the [] with <>)
This simple agent build a text string of and HTML table with the contents of the CarData array and then "injects" it into the target element.

and as Elmer Fudd would say ... thats all folks...

AJAX YAHOO DOMINO - A beginners Guide Part 6


Continuing with the worked example .. the next thing we need is an agent to do the work If you remember back in Part 5 we created a URL that called an agent called getDataLS and that is what you want to create next.

Create an agent and give it the details opposite
and make it a lotusscript agent








Then in the INITIALISE section code something like this

Dim ThisSession As New NotesSession
Dim ThisDoc As NotesDocument
Dim ThisDB As NotesDatabase
Dim ThisView As NotesView
Dim ThisCollection As NotesDocumentCollection
Dim CarDoc As NotesDocument
Dim ParmString As String
Dim ParmArray As Variant
Dim MakeKey As Variant

Set ThisDoc = ThisSession.DocumentContext
Set ThisDB = ThisSession.CurrentDatabase
Set ThisView = ThisDB.getView("autos")

ParmString = ThisDoc.Query_String_DeCoded(0)
ParmArray = Split(ParmString,"=")
MakeKey = Split(ParmArray(1),"&")
Set ThisCollection = ThisView.GetAllDocumentsByKey(MakeKey(1))

Print |Content-Type:text/plain|
Print |CarData.length=0;|
If ThisCollection.count <> 0 Then
Set CarDoc = ThisCollection.GetFirstDocument()
Do While Not (CarDoc Is Nothing)
Print |CarData.push( { Model: "|+CarDoc.Model(0)+|",Year: "|+CarDoc.Yead(0)+|",Price:|+Format(CarDoc.Price(0),"#####0")+|} );|
Set CarDoc = ThisCollection.GetNextDocument(CarDoc)
Loop
End If

Lets look at this agent.

The DIMs are doing what DIMs always do
The SETs similarly are SETing things. of note is the view, this is a standard notes view that selected Car forms and has the first column set to the MAKE field and it is sorted

I load a CGI field, these fields are automatically added to the document extractable by the session's documentcontext. Query_string_decoded holds the data passed using the URL
from the ? onward.

Query_String_Decoded(0) in this instance will hold
openagent&key=Ford&seed=1234567890

I then SPLIT this on the & Character into an array called ParmArray
So ParmArray now contains

ParmArray[0] = "openagent"
ParmArray[1] = "key=Ford"
ParmArray[2] = "seed=1234567890"

The bit i am interested in is in ParmArray[1]
So I split this down on the = character into array MakeKey which now contains

MakeKey[0] = "key"
MakeKey[1] = "Ford"


As I now have the Key with which to search my view I create a NotesDocumentCollection
using that key.
 Print |Content-Type:text/plain|
Print |CarData.length=0;|


The lines above are the start of the data that will be returned to the browser. The first line tells the browser to expect plain text. You could set this to use XML at this point, but for the sake of this example we are using plain text.

The second line sets the public array to have no entries (0 length)

Then I loop around the documentcollection and for each document found I return using PRINT a raw javascript statement. If i substitute the field names for values the browser would get something like this

CarData.length=0;
CarData.push( {Model: "Focus",Year: "2005",Price: 2500) );
CarData.push( {Model: "Puma",Year: "2007",Price: 3800) );
CarData.push( {Model: "Granda",Year: "1973",Price: 100) );
CarData.push( {Model: "Ka",Year: "2006",Price: 1500) );


When the loop finishes and all the PRINT statements processed the agent finishes
and the PRINTed data is returned to the browser by the HTTP server.


Because data was successfully received by the browser the CallBack.success code is triggered and the data returned (which is in o.responseText) is "evaluated" which in effect runs all the lines of JS that you sent back from the server.

Once this has happened the DOM now contains a popluated CarData array which you can
do something with which i will talk about in the next post.

Howard Rheingold: Way-new collaboration

Was broswing the TED web site ... and came across this lecture by Howard Rheingold. I read his book Smart Mobs back in 2003 and as a modern "prophet" he saw the advent of Web 2.0 ... however before I start waffling on let me (like Duffbert) recommend the book.I would give it 4 out of 5*'s.

This lecture isn't directly about what we as Domino geeks do, but it is a very pleasant and challenging 20 minutes and perhaps does have ripples that will affect us in our chosen professional niche.

Go have a listen, you can down load it for your iPod on this page to. Got to Here

If you haven't come across the TED website I also cannot recommend it highly enough!
These others i found interesting too.

Jeff Han's Mutli Touch Interface


Golan Levin's Scribble


Jeff Bezon on Innvovation

Enjoy

Wednesday 13 February 2008

AJAX YAHOO DOMINO - A beginners guide Part 5

Asking the server for data ...

OK for the sake of this example lets say we want to get some data on Fords from a database of used cars. So we put a button on our web page and when a user clicks a button it will go off to the server and return a list of data about all the documents relating to Ford cars.

First we place a [div] on the page to put the data in followed by a button that the user can click to get the data from the server.
<div id='fordinfo'></div>
<input type='button' onclick="getData('fordinfo','Ford')" value='Get details of Fords'>
Then we go back to the JS header of our page and code up the getdData() function
function getData(target,myKey)
{
uniqueSeed = new Date().getTime();
myCallBack.argument.target=target;
myCallBack.argument.nextFunction="dspCars(o.argument.target);"
url = Location.href.substring(0,location.href.indexOf(".nsf") + 4);
url = url+"/getDataLS?openagent&key="+escape(myKey)+"&seed="+uniqueSeed;
request=YAHOO.util.Connect.asyncRequest("GET", url, myCallBack)
}
Ok what this bit of code is doing line by line
Line 1: uniqueSeed = new Date().getTime();

I build a uniqueSeed value from the current time. I do this so that i can add it to the end of the url so that the URL becomes unique and is never (esp in IE) retrieved from the cache. It plays no part in getting the data other than to ensure "fresh" data.

Line 2: myCallBack.argument.target=target;
I am storing the ID of the DIV i am going to populate so that I can use it later.

Line 3: url = Location.href....
I am building the URL that i am going to pass to the server. This line gets me everthing up to and including the .nsf from the current URL.

Line 4: url = url+"/getDataLS?openagent&key....
I add the agent that I am going to call to the URL along with the key string (which in this example will be FORD along with the unique seed to fool IE into ignoring the cache.

Line 5: request=YAHOO.util.Connect.asyncRequest ...
This is the call to the YAHOO process that will send the request to the server. Note the parms that are passed to it
"GET" means that it is GET rather than a POST operation.
url is the url i have constucted along with the key pairs
myCallBack is the CallBack object I built earlier.

When this function invokes the YAHOO.util.Connect function control returns to the browser and we wait for data to be returned.

...next... the LotusScript Agent

OH BOY do i need a life!

Interesting factoids

Did you know that in the UK ...
In 2001 - 303 people died or were seriously seriously injured by a brillo pad
In 2000 - 781 people died or were seriously injured by a biscuit
In 2002 - 202 people died or were seriously injured by their trousers
In 2002 - 12 people injured at least one foot in a mangle

Thanks to the nice people at http://www.rospa.com for collating such a treasure trove of
inconsequentia ,well at least for us that have not been injured or killed by the Rambo of the biscuit world - Tesco's Custard Cream

Søren Kierkegaard - is my teenage son!

Flicking, as you do, through the bookshelf in the study I fell across some old philosophy text books from back in the day when I was exploring the big "WHY?" questions that come along from time to time. Letting once particular book fall open i read this.

"Any rational system cannot explain reality, in that it would have to incorporate that which is contingent alongside that which is necessary. Likewise the reduction of reality to that which logically constituted fails to account for that which is imminent. Dread arises from the erosion of the conceptual by the perceptual, by which the unreasonable intrudes within consciousness disrupting rationalising order"

...so basically lets stick My Chemical Romance on the iPlod , put on too much black eye make-up and refuse to make our beds!

AJAX YAHOO DOMINO - A beginners guide Part 4

... Continuing on from the last post ...

OK you have now got your NSF with the YAHOO UI files imported and embedded in the form or page you want to have some AJAX functionality on ... what now?

Part 4. Creating the YUI AJAX objects you will use

There are a couple of Javascript objects you have to create before you can "talk" to your server

1. Some code to run when you get data back from the server
2. Some code to run when the call to the server errors
3. A place to hold information you may rely on later

The important thing to remember here is that A of AJAX stands for Asynchronous. Which means in basic terms when you send your request to the server the calling JS ends
and the browser sits twiddling its thumbs. Because the calling procedure has ended any variables you set up inside that calling function disappear. Which is rather unfortunate if you are relying on them in the code you use to process the data you get back from the server.

So your AJAX objects need to be defined so that they are global and not private to a particular function. Generally you do this by defining them before you define any functions. They can exist as explict vars or as part of a JS class but either way you need to ensure that they are globally available in the DOM or you will run in to problems.

If you are not familiar with JS the next bit may be a bit difficult to follow.
JS variables can hold just about anything ... including code ...
Soooooo you can set up a variable that rather than hold a number or the name of your pet cat holds a chunk of executable code ... OK?

Before we do the AJAX objects we have to create a global variable to store the returned data in in this instance i will use

var CarData = new Array();



The first variable you need is one thats holds some executable code. You can call it whatever you want so it will appear as something like this. Dont worry about what the code does just at the minute

var mySuccessCode = function(o)
{
ProcessMe = evaluate(o.responseText);
RunMe = evaluate(o.argument.nextFunction);
}
This is the code that will run when data is returned from the server.
Please note that the (o) is a lower case letter o not a zero!
Next comes
var myFailureCode = function(o)
{
alert(" **AJAX Error ** \n_
Please report this error\n"+o.tId+"\\" _
+o.status+"-"+o.statusText);
}
This is the code that will run when something nasty happens to the AJAX request, like the server is down or the user has pulled the network cable out of their PC.Again ... Please note that the (o) is a lower case letter o not a zero!

And Lastly, we wrap these two vars up in another object that we will pass to the YUI connection function.
var myCallBack = {
success: mySuccessCode,
failure: myFailureCode,
argument: {
target: "",
nextFunction: ""
}
}
As you can see this object has 3 Properties, success, failure and argument.

success and failure hold the code we have already defined in the mySucccesCode and myFailureCode variables.

The last property argument is another object which is entirely user definable. You can create as many properties as you need. For the sake of this example I am using 2 target and nextFunction. You will see how these properties are used shortly.

And those are all the JS objects defined and they should look like this .. for now put this code in the JS header section of the page or form you want to have an AJAX function on.
var mySuccessCode = function(o)
{
ProcessMe = evaluate(o.responseText);
RunMe = evaluate(o.argument.nextFunction);
}
var myFailureCode = function(o)
{
alert(" **AJAX Error ** \n_
Please report this error\n"+o.tId_
+"\\"+o.status+"-"+o.statusText);
}
var myCallBack = {
success: mySuccessCode,
failure: myFailureCode,
argument: {
target: "",
nextFunction: ""
}
}
and now on to Part 5: Asking the server for data ...

Tuesday 12 February 2008

AJAX YAHOO Domino - A beginners "how to" guide Parts 1-3

Whilst browsing the blogsphere recently there has been much chat about the wonderfullness of all things V8. In amongst all these posts i have come across some quiet voices saying "yes yes we know but we are still on V6 and it will be a while before we can get upgraded to V7 let alone V8.... WHAT ABOUT US?"

OK point taken. I work at the top end of V7 and we are about to plunge head-long into the V8world. However I have been following the developements of AJAXy stuff and done some fairly extensive fiddling. This fiddling has been mainly V6/V7 oriented but most of what can be done in V6 or V7 can be done in V5 too... and it is not that hard to get a whizzy AJAX script talking to your domino server domino in your own applications. So if you want a step by step guide and are not too worried about the detail of what goes on behind the scenes. I am your man, so to speak :)

Part 1 - Getting your framework code
There are several AJAX-enabled Javascript frameworks out there on the web, Dojo, Prototype and the one I will be talking about ...the YAHOO UI. These frameworks are opensource so theyare FREE!

They are all good ... I choose to use YAHOO a long time ago and it is the one I am most familiar with ... but feel free to choose whichever one you want once you have dipped you toe in the water.

The Yahoo UI web site can be found here http://developer.yahoo.com/yui/ and the most recent version can be downloaded from the link on the home page or from here

The code arrives as a ZIP file... simily unzip it onto your hard drive, when complete you will have directory which contains the full YAHOO UI source code.

Part 2 - Getting the code into your App
Having downloaded and unZipped the YahooUI files you will need to get some of them into your application so you can use them. If you have a friendly ADMIN you can load them in the /domino/html/ directory on the server and access them directly. I prefer to keep the code in the NSF file so that if the files is distributed over many servers, each with their own admin it is easier to deploy updates to the code across these replicas.

Since we are looking only at the AJAX connection we dont need all the files you downloaded there are only 3 you definitly need.

So do the following :-

01. Open your NSF file in Designer
02. Open the Shared Code Section
03. Open the Script Libraries Section
04. Create a new JAVASCRIPT library
05. Select FILE
06. Select IMPORT
07. Open the YAHOO UI top level folder
08. Open the BUILD subdirectory
09. Open the CONNECTION subdiretory
10. Open the CONNECTION.JS file
11. Save the library as CONNECTION.JS
12. Create another Javascript Library
13. Select FILE then IMPORT as before
14. Open the YUI./BUILD/EVENT directory
15. Import the EVENT.JS file into your libray
16. Save the library as EVENT.JS
17. Create another Javascript Library
18. Select FILE then IMPORT as before
19. Open the YUI./BUILD/YAHOO directory
20. Import the YAHOO.JS file into your libray
21. Save the library as YAHOO.JS

You should now have the following in your NSF's Script Libraries section
CONNECTION.js
EVENT.js
YAHOO.js
These are all the files you require for AJAX communication with the server

You may have noticed there were other files in the directories you loaded the scripts from .. i would avoid the *-debug.js ones unless you want to get down and dirty with the source code ... the other file *-min.js is optimised for size and has all the comments and line feed removed. If bandwidth is an issue for your network.. simply import the *-min.js into your application.

Once you have these files loaded into your app you need to embedd them in the pages and forms that you want to build some AJAX functionality into.

Again there are several ways of doing this, the easiest I find is to Insert the file as a resource like this

01. Open your page or form
02, Goto the JS HEADER Section
03. Click somewhere in the content panel
04. Go to CREATE
05. Go to INSERT RESOURCE
06. When the JS libraries appear select YAHOO.js
07. Repeat (04) and (05) for EVENT.js
08. Repeat (04) and (05) for CONNECTION.js

You should load the files in the order above so that the DOM get loaded in the correct order otherwise strange things may happen!

OK you are ready to start coding which I will cover in the next post.

Steve

ILUG 2008 dates announced

YIPPEE

Mr Mooney and the rest of the team have ILUG 2008 on the go .. no details as yet just the dates See Here.

Was very nearly tempted to sign up as a speaker, I think I would be able to chat for at least an hour on the joys of localising the Notes Mail client so that it was compliant with the good Friday agreement and was translated into UlsterScots

Or "The pitting o the mither tang inta collaboreayshun" project as it more fondly known.

I was going to call my fully illustrated session "Lets tuk a wee dannèr in till the wunnerful lan a collaboreaysshun" with musical accompaniment from the Macosquin Fiddlers and their whistling sheep. However I fear the Lotus world is not yet ready for the dizzy heights of such excitement so I think I will wait another year before unleashing the power of "JavaSlabber" into the general population.

For example.. the "Try ... Catch" Statement becomes

HayAGo{.........}NayItsBajaxed(e) { ... }

Fun Init? :)

Monday 11 February 2008

Nifty-Fifty Redux

Reading this on Chuck Dean's blog brought it all flooding back. Those heady days of migrating 30 cc:Mail users to Notes 3 on a sever with 512M of memory ... ooh sweet nostalgia ...

However what a good idea! Let us bring back the "Nifty-Fifty" there have to be enough of us older notes geeks and uber geeks out there with ideas and half written apps that need a good home. In the V5 V6 V7 real slight tarnished by age world as well as the new shiney V8 world were all is sweetness and light ;)

I am putting my thinking head on as I sit here and I have several ideas ... perhaps this weekend (if SWMBO does not have me painting the hall) I will put something together ...

More Later

Welcome Chuck Dean to the Blogsphere

When reading my RSS feeds i came across a link on Duffberts Random Musings to a new blog LotusSmb.

Welcome to the merry throng Chuck!

Disqus for Domi-No-Yes-Maybe