Home | Blog Roll | Link Roll | Colophon/About


Archive for March, 2006

TorDemoCamp 4 : Geeks Gather in Toronto for Show and Tell

Tuesday, March 28th, 2006

was a great success with 150 signed up folks - and no doubt a few walkin’s ’cause it was full. The Demos was a great mix of differnet stuff, but all intesrting. The demo gods were kind (just as long a you didn’t want to use iPhoto!). The space at MaRs was very nice.

Highlights :

  • , a way to allow 2-d encoding of url’s to be read by camerahphones. I blogged about this on the old blog 2 years ago under , but is goood to see it’s still around, a camerahpone become almost common, and see this from the semacode designer himself, Simon Woodside.
  • Then there was ‘Hacking of Disposable Digital Cameras for Fun and Cheap Electrical Shocks’. I’d hear about this, but it’s fun to see it live. It’s like watching a ProtoType of ’s story
    . THanks Randy.
  • The Visual Search software by Idee was slick. I think the best part was when Leila Boujnane forgot to clear the sun flower picture, and typed “faces”, and it found all the sunny faces. It was a nice, unscripted(?) moment. I would be interesting to see this Mashed up with
  • , soon to be open, is a Social Networking take on Answers.com (Questions and Answers), will various “” like features (Voting), and very Ajax. It has potential. I don’t - yet- know what it was built with.
  • Outmailer is an mailing programing written in the lastest and greatest . (And I currently am getting a lot of experience with mailing) . Although it does not yet have all the features I might want, it looks very smooth and painless to use. And they are getting a huge education in Rails! Lucky them.
  • tag-Engine is a scripted templating engine built on top of PHP5 - wait a minute: a template engine on top of a template engine? Ok, the “PHP template assembly glue engine” looks to do try and make templating which is both simpler in syntax and at a higher level of abstration. (aiming at the excel crowd?) And it is look quite polished. Josh has picked a tough itch to scratch.

I’ll try to write up more when time, sleep wife/life allow.
They all had a lot of passion about what they were doing, and I’m not sure I would be able to Demo in front of 150 to 250 of my peers, or anyone for that matter.

I’m sure there will be more writing on these demo’s @ under the tag . Big Thanks to as (Big Giant?) Head of the Mob guy on all this!

Pirate Radio has some good sugestions for all.

..and the next (5) is called for Tuesday, April 25, 2006 (update you Google Calendar!) looking forward to on the power of RJS templates.

The Richness of Hong Kong, and Cantonese

Sunday, March 26th, 2006

In today’s New York Times is a great travel piece about hiking in Hong Kong’s, not something that first comes to mind we someone thinks of Hong Kong, in Green Trails Along a Chinese Frontier, which also introduces Danish Michael Hansen and his website Hansens Hikes for many beautiful images as well a info on the hiking excursions he runs.

Wired Magazine (Issue 14.04 | April 2006) has a article on “” (Inside Beijing’s global campaign to make Chinese the number one language in the world) (Not online yet now online), and the LA times has a story Cantonese Is Losing Its Voice from January 3rd, about the underside of the story.

Both the New York and LA Times story hint at the expressive richness of expression of Cantonese. For more look over BWG’s

Ai yah , such a dilemma! Improve my (poor, below 3 year old level) Cantonese - the better to catch dinner table gossip; Mandarin - the better take the orders of (and Kowtow to) our new overlords; our the improve my skills at the latest object oriented Meta programming language; the better to stay gainfully employed (and stay the “Golden Chicken”)?

Stopping Copy and Paste, in Lotus Notes

Thursday, March 23rd, 2006

( Time)

It is very useful for many kinds of Lotus Notes applications (like work flows), to stop users from being able to copy and paste a document into a database application. In R5 a new kind of Agent was introduced, trigger on the Run option ” “If Documents Have Been Pasted”.

from there it’s a little formalu language :

SELECT @All;
@DeleteDocument;
@Prompt([OK];”No pasting Allowed”;”Pasting documents into this database is not allowed. Action is cancelled.”)

If you what to selectivlty allow some documents to be pasted in add a line before the @DeleteDocument

SELECT @All;
@if(Form=”requestForm”;@return(”");”");
@DeleteDocument;
@Prompt([OK];”No pasting Allowed”;”Pasting documents into this database is not allowed. Action is cancelled.”)

Either way you can save your self from getting all kinds of junk documents in your database and views.

Avoiding Hard Coding of Group Names.

Tuesday, March 14th, 2006

Why? Because Group names change; over time, between your Development, UAT (User Acceptance Testing) and Production enviroments, between diffenet customers.

How? By far the best way to reduce hard coding is with a Global Profile Doc, that is a profile document without a username, to store information for all users of the database. Any and all piece’s of data from outside your application should be placed in a admin profile document, and a great many intianl peices as well, Wheather or not your applications bussiness users adminsrate them or a techinal adminstrator does.

As a demonstration, I’ll improve a previous entry, Using the Lotus DBlookup to better Leverage the Name and Address book and make it better.

In the Case of reducing the Hard Coding of group names, on your Admin Profile form (call it “profileAdmin”) add a Name field for the PHB approvers group called (what else) “Name_PHB_Approvers_GroupName” which use can populate with a standard “Use Address dialog for choices”.

then rather that using :

key :="Pointy_Hair_Bosses_with_Authority_in_this_Line_of_Business";

in your , use :

key := @GetProfileField( "profileAdmin"; "Name_PHB_Approvers_GroupName" );

to retrieve the value. Remember that you can also retrieve profile document field values in lotusscript as well.

A further feature to add to your profile documents, to make it “one place shopping”, is to make it easier to view or edit the group just selected by making a click-able (button or image ) to open, in read mode, the selected Group Document from the Name and address book (NaB).

I’ve done this by placing a image next to the field, surrounded by a action hotspot which calls a lotus subroutine :

OpenNabGroupforDisplay ("Name_PHB_Approvers_GroupName")

which calls this lotusScript:

Sub OpenNabGroupforDisplay (groupFieldName As String)
' pass the name of the field containing the group name, on the currently open document.
On Error Goto onError

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim nabDB As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim GroupName As String
Dim Guidoc As NotesUIDocument

if groupFieldName = "" then
messagebox "No FieldName supplied, contact your Notes Developer"
Exit Sub
end if

' get the value in the field name
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
groupName = uidoc.FieldGetText( groupFieldName )
If groupName = "" Then
messagebox "No value for " & groupFieldName & " supplied."
Exit Sub
End If

' get the group by groupName for this Server in the NaB.
Set nabDB = session.GetDatabase( db.Server, "Names.nsf")
Set View = nabDB.GetView( "($VIMGroups)" )
Set doc = view.GetDocumentByKey( groupName, True)
If doc Is Nothing Then
messagebox "Cannot find a group by the name " & groupName & "."
Exit Sub
End If

' open the group in read mode
Set GuiDoc = workspace.EditDocument( False, doc)

Exit Sub
onError:
Messagebox "System Error " & Err() & ": " & Error$ & ", line: " & Erl
Exit Sub
End Sub

Question: I have not been able to find the image (.gif) that the Notes client uses when you paste in a Doc Link (Document Link), which would be my preferred image in this case.

Saturday Night Hong Kong Films in Toronto (Omini TV ) Late Winter 2006

Sunday, March 12th, 2006

Update : Spring 2006

After an absence on my part since the Fall of 2005, exasperated by Omini TV’s changing of url (while keeping the old page up!), I’m back.

Omini’s 2 listing are ok for a quick advance glance over at . All Movies run on Saturday’s at 9:00 PM and go for 2 hours till 11:00 PM. Most films are Cantonese with English subtitles, although not all of the Korean, Mandarin language film include English as well as Chinese subtitles. They have marking some of them with footnote “Korean Movie With Chinese Subtitles And Lip Sync in Cantonese”.

If you’re looking for more Hong Kong films check past postings and Love HK Flim, or Koreanfilm.org


March 18
Drink, Drank, Drunk
Romantic Comedy, 2005 
Miriam Yeung Chin-Wah, Daniel Wu;  
Saw this in the Fall (September?) and it is a surprisingly good and enjoyable movie, with Miriam Yeung as a HK beer girl.


March 25
I Love How You Love Me
Taiwanese (?) Romantic Comedy 2005
Jimmy Lin, Hsu Ambrose, Yang Kung Ru, Liu Yi Fei; director: Chu Yan Ping


April 1
Oh! Soo-jeong (Virgin Stripped Bare by Her Bachelors)
Korean Romance, 2000 (NOT 2005, as claimed by Omini tv) -
Lee Eun-joo, Jeong Bo-seok, Moon Seong-geun; director: Hong Sang Soo.
Based on the review on Koreanfilm.org, it sounds interesting, but we may not have any English subtitles.


April 8
Bug Me Not!
Comedy, 2004
Isabella Leong (Leung Lok-Si), Wilson Chen Bo-Lin, Kenny Kwan Chi-Bun, Steven Cheung Chi-Hung, Gillian Chung Yun-Tung, Charlene Choi Cheuk-Yin
A CGI Comedy vehicle for various Cantonese pop stars (including the “Twins”).  Prepare for sugar shock! Isabella Leong did get a 42nd Golden Horse Awards Nomination for Best New Performer.


April 15
Love Message
Romance, 2005
Leo Koo Kui Kei, Angela Chang (Chiu Ham), Ren Quan (Yan Cheun)
Stars Hong Kong’s super star Leo Koo, Taiwanese Angela Chang, and from Mainland China Ren Quan.


April 15
Please Teach Me English (Yeong-eo-wan-jeon-jeong-bok)
Korean Romance, 2003
Jang Hyeok,  Lee Na-young, Nah Moon-hee, Kim In-moon, Kim Yong-geon, Jeong Sang-hoon, Jeong Doo-hong (Cameo), Jeon Jae-hyeong.
Korean Film.org calls it “Goofy”, so you’ve been warned. And again we may or may not have any English subtitles.

Toronto’s Global Divas Gala Concert March 30th

Sunday, March 12th, 2006

St. Stephen’s Community House is agian running The 4 th Annual Gala Concert, on Thursday March 30, 2006 at Kool Haus, 132 Queen’s Quay East.

is a unique, community-based social service agency that has been serving the needs of Kensington Market and surrounding neighbourhoods in downtown West Toronto since 1962.

This years Line up looks (and sounds) exciting : ; , “The Blue Flame of Cameroon”; , Inuk throat singer; Amanda Martinez ; Kellylee Evans; and Zaki Ibrahim.

The fourth annual Global Divas concert begins at 8:00 p.m, doors open at 7:30 p.m. Concert admission tickets are $30.00 and can be purchased by calling Ticketmaster at (416) 870.8000 or online at www.ticketmaster.ca. Concert tickets can also be purchased in advance by calling the Global Divas Info Line at (416) 925.2103, ext. 238, by email at: development@ststephenshouse.com, or at Toronto Women’s Bookstore (73 Harbord St.), Pages Books & Magazines (256 Queen Street West), Soundscapes (572 College St.), and Edward’s Record World (2283 Yonge St.). Gala tickets, which include reception, fine dining, the Globe Trotter’s Market and concert are also avaiable.

For a good time and a good cause.

Finding out if the current user has a given role, in Lotus Script

Wednesday, March 8th, 2006

Yet another Another . Please note some small corrections to last weeks examples (DBlookup’s to leverage the Name and Address book). Oh the dangers of coding when tried.

Now for this weeks mistake in progress tip:

In Formula language, when we want to have results (like hide-when’s) based on a role it’s common to use “@Contains(@UserRoles;”ADMIN)” , but there is no native LotusScript way to do this…however it is possible to use a simple Evaluate() to ask”does this user have the role [XXX]”

for example:

If IsInRole("[Admin]") then
' do stuff
endif

using this LotusScript function I’ve re-invented several times :

Function IsInRole (RoleName As String) As Integer
IsInRole = False
Dim userRoles As Variant
userRoles = Evaluate("@UserRoles")
Forall role In userRoles
If Ucase(role) = Ucase(RoleName) Then
IsInRole = True
Exit Forall
End If
End Forall
End Function

Two things to be aware of : A) for this to work on the web the agent has to “Run as user”, otherwise it will show the roles of the id that signed the web agent. B) On a a local database make sure you have “Enforce a consistent Access Control List across all replicas” in effect.

Beyond Sudoku, Benjamin Franklin’s Magic Squares.

Monday, March 6th, 2006

Looking for a challenge beyond Sudoku puzzles? Benjamin Franklin,born 300 years ago on 17 January 1706 (see SlashDot story) , also jotted down a couple of much more complex number puzzles of his own, so called .

Magic squares are characterised by having the sum of the elements of all rows, columns, and main diagonals having the same sum. Over the years, rows and columns were added to magic squares, rules developed around them as well as competition to figure out how many variations of each magic square are possible.

Counting the number of distinct normal magic squares is a difficult problem in combinatorics., and Benjamin Franklin’s variation on the 8×8 Magic Square, has defeated all such attempts untill now as reported in the Globe and Mail, a University of Manitoba’s department of physics and astronomy professor,Dr. Peter Loly, has computed how many permutations are possible under his distinct mathematical design, 1,105,920, in a paper published online by the Proceedings of the Royal Society :Enumerating the bent diagonal squares of Dr Benjamin Franklin.

Prof Loly was also interviewed by on CBC’s radio’s ‘As It Happens’ (Realplay Ram).

For related information checkout Ben Franklin’s 8×8 Magic Square by William H. Richardson of the Wichita State University.

Using the Lotus DBlookup to better Leverage the Name and Address book

Thursday, March 2nd, 2006

Another , more code…. In last weeks adventure our narrator talked about (note: there was a mistake in the example, now fixed), and as promised I am going to talk about how to leverage that lookup into the Name and Address book (the Domino directory - a LDAP before there was a LDAP).

Most organization use - or should - the Name and Address book (or NAB for short), as a place to put basic employee contact information (work location, phone(s), manager).

The NAB also have a number - sometimes large - of groups (list of persons or other group) associated with roles and responsibilities. This group information is used in the ACL of Notes applications, and for mailing to groups of individuals.

Wouldn’t it be nice to use this information in the applications you build? So here are my 2 examples, to get the ball rolling

1) Selecting Pointy Hair Bosses () to email from a existing group:
Create an editable field, drop down dialog, may or may not allow multiple values. On the value definition (2nd tab) populate it with this formula:

class := "Notes";
server := @Subset(@DbName; 1);
database := "names.nsf";
view := "($VIMGroups)";
key :="Pointy_Hair_Bosses_with_Authority_in_this_Line_of_Business";
fieldName :="Members";
value := @DbLookup( class : "NoCache" ; server : database ; view ; key ; fieldName );
@If(@IsError(value);@Return("");@Name([HN];Value));

So, what’s it doing? Looking at the names.nsf (the NAB) for this server, going to a view showing groups (but not all groups), finding the group of PHB’s and getting the member list. When a new PBH gets added to the NAB, it auto-magically available to this application.

Also a note about Reader and Author fields. Suppose the field above was also being used to identify the manager in charge of this document, and you wanted Reader or Author security. It would be tempting to had the editable field as a Reader or Author field, but please don’t. If they leave the organization, AdminP will strip the value out and a) screw up any categorizations that used that field value, b) remove access to the document if that was the only Reader field. Instead use a hidden Reader or Author field with the value from the above field, plus a “[Admin]” or other roles

2) My second exampe is leveraging that extra information in the person document. In workflow applications to is nice to inculde information to contact the person assinged or who made the request, right on the form. So in a computed field :

class := "Notes";
Cache := "NoCache";
server := @Subset(@DbName; 1);
database := "names.nsf";
view := "($VIMPeople)";
key :=@Name( [Abbreviate]; @UserName );
fieldname := "OfficePhoneNumber";
value := @DbLookup( class : cache ; server : database ; view ; key ; fieldname );
@If(@IsError(value);@Return("");Value);

This gets the Office Phone Number for the current user (@UserName). I wonder if you grab the @DocNumber and build a Doclink on my document, link back to the person document? What other things are on the person document that I could make use of?

What other things to grab in the NAB? How about “Holidays”? (Could I use that to figure out how many business days between 2 dates? Humm..) Anything else? So will this keep your users quiet (and you happy?) Now I have to think of something for next week!

Update: small corrections…in my first example I used the ($Groups) view which is too restrictive, rather than ($VIMGroups). I also used a @Name([HN];Value) ,which was pure moondust, rather than @Name([Abbreviate];Value).


Close
  • Social Web
  • E-mail
E-mail It