wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

By Date: May 2009

Java ClassLoader fun with getResource()


DXLMagic will have a Java UI. To be flexible I store my UI definitions inside the JAR file and load them at runtime. I learned a few lessons in the process:
  • When you use Class.getResource() inside a static method of a class you won't get access to any of the resources in the JAR. You need to have a normal instance of a class.
  • Instantiating an object inside a static method doesn't help either.
  • Class.getResources("*") doesn't return anything even if you have valid resources in the JAR. So wildcards either don't work or work very different.
  • It really pays off to change the editor preferences in Eclipse to nag more about coding style and potential code problems
  • Crap4J and PMT are your friends, as are Coverclipse
  • Debugging in fun in Eclipse unless you only have one smallish monitor
As usual: YMMV.

Posted by on 25 May 2009 | Comments (0) | categories: Software

Solving (Math) Problems


Over the weekend Anthony and I tried to figure out why his latest Math test results didn't match his grasp of Mathematics (nice way to say: he did badly and had a lot of "slips of the pen"). He loves to jump right into the calculation skipping the "Due diligence" part. So we came up with a mind map to outline the steps he needs to take. It turns out, that this map serves as a general guideline to problem solving (admitting high level). Here you go:
8 Steps to solve a math problem
Update: Forgot one rule (thanks to Steve Pridemore): Don't do mental math at 1am

Posted by on 25 May 2009 | Comments (0) | categories: After hours

On the hunt for the perfect travel backback


I travel a lot. When I travel there is mostly a flight and one or more overnight stays involved. So far I was using a Tumi backpack, which served me well. After 10 years of service it is showing its age and I'm looking to retire it. Turns out the hunt for a replacement is far more difficult than I expected. I'm looking for the ultimate backpack for the frequent traveller. I thought my criteria are not uncommon:
  • Robust and torture resistant: I carry heavy loads and long distances (mostly running to gates to catch that flight) and don't need a strap coming off. It also shouldn't look -after a month of use- worn out like 19th century gold digger equipment.
  • Fit under an airline seat (which is kind of a contradiction to the amount of stuff I need to carry
  • Carry the corporate Lenovo T61 (no Macbook anytime soon) and its little brother
  • Well organized space for: 2 power supplies, 2 international adapters, various cables, business cards, phone, passport, wallet for second currency, tickets, external disks, iPod etc.
  • Carry a folder with reference materials (and the bill collection) and a book
  • Have space for shirt, underwear and toothbrush (many trips are overnight)
  • Umbrella -- best outside so it doesn't soak the stuff inside after use
  • Ability to be locked
  • Needs to offer service/warranty in Singapore (I can buy it anywhere)
  • I like black, but that's optional
  • Needs to be sold in a place I can have a look (means: any airport/city in AP). Singapore would be an advantage
Meet the contestants, the first two come from the luggage industry, the later a backback experts:
  • The incumbent brand sends its model Alpha T-pass Business Class Briefpack:
    Tumin Alpha
    Having a track record and an excellent customer service is clearly and advantage. Tumi is in the upper price quadrant.
  • Samsonite offers the Pro-DXL2 Laptop backpack
    Samsonite Pro-DXL2
    The Samsonite offers a dedicated garment compartment that even features a hanger for a jacket.
  • Booq sends in 2 models which I quite liked and examined yesterday: the BOA3M and the Phython XM:


    Problem with both of them: Since Booq has no luggage heritage they don't feature zips that can be locked. A big disadvantage for international travel.
  • Timbuk2 Patrol
    Timbuk2 Patrol
    The website states it is sold in Singapore, but I haven't found a shop yet.
  • Others (seen online, but haven't touched them yet): Spire Meta, Megalopolis Aero, Brain Bag and Wenger's Swiss Gear
On the hunt I came across a number of interesting looking messenger bags too. Should I challenge my assumption that a backpack is best for my needs? What's your take? Backpack yes/no and what model to pick?
Update (14 July 2009): A new contestant entered the race which looks like a good compromize:

Travelpro executive first backpack
. It features 9 externally accessibe compartments, 2 of them lockable, plenty of storage space and TravelPro's sturdy ballistic nylon. I already have one of their products and was quite happy, so I'll go with that for now.

Posted by on 24 May 2009 | Comments (9) | categories: Travel

Using the IBM OneUI in your XPages applications - now with CSS class picker


In his outstanding XPages tutorial Declan Lynch used IBM's OneUI for designing the layout and colors. This is very smart since it releaves you from thinking about all this and allows you to focus on the functionality. If you haven't worked through that tutorial, go there now and have a look. One thing Declan had a hard time with is to figure out what exactly the CSS classes are that the OneUI makes available - He did a great job here - (and then what to use where) since the CSS style picker doesn't show the classes available in the Themes, but only in the CSS you added to the page directly.
I thought that's not that nice and needs fixing. And here you go: Import the OneUIDummy.css into your database and add it to your pages. The file contains all classes used in the OneUI version on the Domino 8.5 server but no style definitions by its own. You now can pick the classes from the style picker and actually use the definitions in the server-side OneUI Theme. A little step for a developer and a big step for convenience. (You still need to learn what class to use where).
oneUICSS.gif
As usual: YMMV.

Posted by on 21 May 2009 | Comments (4) | categories: XPages

XPages advanced challenges (at least for me)


I pride myself with being able to help students quickly over their stumbling blocks. But is made me stumble:
Domino Designer for Eclipse Traditional Chinese
A good spatial memory and an aptitude for icons helps a lot. We are definitely having fun here.

Posted by on 21 May 2009 | Comments (1) | categories: XPages

Help needed: copy Eclipse IResource from/to files using ANT


In Eclipse 3.0 one big change was the transition from a physical file system to a virtual file system. Instead of Java File Eclipse is using IResource to access file systems. Of course using files still works. As far as I know the Eclipse ANT task is working on files not on IResources. I'm looking for a way to use Ant to copy from IResource to File and back. Could be a custom ANT task. If someone wants to write it (and contribute it back to the ANT contrib project) I'm willing to make a donation <g>. Ideally it would use the same syntax as the ANT copy task.
Update: It is done, not in a generic way but suitable for Domino Designer. One can download the Import/Export Plug-in for Domino Designer from OpenNTF. The plug-in has an ANT interface.

Posted by on 20 May 2009 | Comments (0) | categories: Software

XPages Workshop in Taipei


The XPages workshop in Taipei is well under way. We have 32 participants at the IBM Education center happily coding away on Domino Designer 8.5. The joy of travel is to experience all the little cultural differences. Like the coffee bar:
What type of tea would you like?
Only one of the cans actually contains coffee. The other 3 (x2) cans offer you different sorts of tea freshly brewed. I like that much better than the tea bags you find in other locations. Maybe that's the reason why the class is so fully focused.
A full classroom of future XPages developers
There will be more workshops in Taiwan, Cory Ma knows the details.

Posted by on 20 May 2009 | Comments (2) | categories: XPages

?????????????????????????????? - All Germans are Terrorists


There has never been an international planned terrorist attack in Germany (we had our share of domestic terrorism). But now it became clear that Germany is housing 82 million terrorists, at least when you gauge it by the level of observation these 82 million are subjected to. See for yourself:

Du bist Terrorist (You are a Terrorist) English subtitles from lexela on Vimeo.

Via vowe

Posted by on 19 May 2009 | Comments (1) | categories: After hours

How CRAPpy is your Java code?


I do a lot of code review lately. LotusScript, JavaScript, Java etc. When I encounter code that is difficult to understand I'm usually met with the defence "But it is working". Funnily it is self-defeating. I never do code review (short of the we-have-fixed-it-now-have-a-look types) of code that works well. Asking us to do code happens because there are problems (I really would love to do a the-proud-code-parents-want-to-show-off-their-really-pretty-baby review once in a while). The typical problems are:
  • Poorly documented code
  • Lack of decomposition
  • Slow code (e.g. getNthDocument)
  • Lack of separation between user time and backend time
  • Lack of caching/object reuse (e.g. Connection pools, Profile Fields)
For LotusScript there is Teamstudio profiler. For Java you can use Crap4J. Crap4J is not a profiler but analyses your code complexity and coverage. Complex code translates into application risk. You get a nice benchmark and a detailed report on the individual methods, so you know how to fix it. Crap4j runs as an Eclipse plug-in. Go get it.

Posted by on 14 May 2009 | Comments (2) | categories: Software

Example of a sidebar helper


Once you work for/with an international community or organization time zone pain becomes immediately a pressing problem. In Firefox I use the FoxClocks plug-in. In Notes 8.x I just got a new alternative for the sidebar:
When is it now
It is an IBM internal plug-in named "When-is-it-now" that not only shows you the current time at your selected locations, but also indicates with a traffic light how likely it is to reach someone based on business hours. Nice touch. The brain decodes a color signal so much faster than the time mixed with the question "is this a business hour".

Posted by on 05 May 2009 | Comments (6) | categories: IBM Notes Lotus Notes

SmartDraw


I've been asked by various people what I use to create the diagrams and illustrations in my blog here. I am using SmartDraw. It makes it easy for people like me (who know what they want to show but lack graphical talent) to create stunning resonably good looking business graphics. Have a look at some samples, their tutorials or follow their blog. My only grieviance is, that they don't have a Mac or native Linux version (and it doesn't work with Wine either). The other graphical tools I use regularily are Shutter for screenshots and Buzan's iMindMap for mindmaps. While SmartDraw does mindmaps too, iMindMap draws that wonderful organic connectors - and runs on Mac/Linux too. Occasionaly I also use Dia, Inkscape or Gimp.

Posted by on 05 May 2009 | Comments (6) | categories: Software

Notes pattern : Inversion of logging


A typical requirement in applications is to keep a log of changes. The simplest form is to keep fields with the author and date/time of the latest change (which has the distinct disadvantage not knowing what has been changed by whom). The next level would be to keep the list of all authors and change times (still leaving the question " what unanswered) followed by very sophisticated tools like Audit Manager or similar home grown solutions.
All these solutions have in common, that they "merely" record changes made (typically in a query or post save event) after they happened (From a big picture perspective, a log on query-save is technically before, but after the trigger that will commit the change). While this works reasonable well for audit, adding another typical requirement calls for a different solution. More often than not the parts of a (workflow) document which can be altered by any given user change in the course of an [workflow] application. While Author fields protect a document at large, safeguarding individual fields becomes more tedious, especially when you can't group them in access controlled sections (e.g. in a web application).
In a related use case: documents could be updated by users, who have current information, but don't "own" the documents. Typically they send an email to the document owner (if that is visible) asking for the update of that information. Asking somebody to update data into some other system, that involves copy & paste from an eMail *is* a sign of a broken process. The solution to that seemingly contrary requirements: "update of certain fields" only and "update by anybody" can be solved using a pattern that I christianed " Inversion of Logging":
Instead of logging what has changed an application using this pattern creates a change request, stating what will be changed. This request is then processed by a central system and checked against system constraints. If an authorized user requests a change, the changes are applied without further user interaction. The change request is kept as record. If an unauthorized user requests a change a workflow is kicked of to determine if the request is suitable for approval to be then routed to the data owner (or data guardian) for approval. Once approved the changes are applied to the main document.
Flow of Inversion of Logging
To make this internal flow transparent and pleasant to the users a few considerations need to be made:

Read more

Posted by on 03 May 2009 | Comments (c) | categories: Show-N-Tell Thursday

Delivering Outstanding Presentations


(Technical) professionals are caught in an interesting dilemma. We are asked to contribute to events, customer meeting or internal presentations because we know a lot about a topic. We are supposed to transfer this wealth of knowledge to our customers, audience and participants. We love to show [off] our knowledge. In lucky places like Lotusphere this works well. For everywhere else however human attention span, especially in a crowd, is severely limited. Ten minutes is all you got. One-Zero minutes. After 10 minutes the crowd moves on. If you are lucky - or smart - the crowd moves on to your next topic (like the Lotusphere speed geeking sessions <g>).
But where do that 10 minutes come from? The present moment is 3 seconds and attention spans are reported from 3-20 min. I picked the 10 minutes rule from the book Brain Rules after having seen it in a number of places. So if 10 minutes is all you got, how to fill the remaining 35-50 minutes your are given to present? The conclusion is simple: you have to deliver a new presentation every 10 minutes. That doesn't mean you have to pull a new slide deck out of your presentation software or start with your introduction. You just have to introduce a new tiger every 600 seconds (because that is what our brains are watching out for anyway - and they are not too far in my part of the world). Loaded with technical details and deep knowledge limiting ourself to 5 big ideas forms a nice challenge. The solution is to pack all the details into the umbrella of an idea. You need to tell your audience upfront what it is, so your audience doesn't get lost in the details (believe me *nobody* is interested in your setup screens or installation prompts, skip them). Just ask the preacher at [insert-favorite-place-of-worship] how a sermon gets delivered: " Who doesn't walk in the light of [insert-subject-of-worship-here] will go to hell. To hell you will go because [insert-long-list-of-misdeeds]. But there is hope, [insert-subject-of-worship] offers salvation... ". While you don't need to summon Angels and Demons to make your point you can learn from the structure:
  1. Summarize your statement
  2. Expand the problem challenge at hand
  3. Offer the solutions
  4. Expand the solution
  5. Tie back to your summary
The above structure is part of your presentation body. It is wrapped into an introduction in front as well as a preliminary conclusion Q & A session and final conclusion at the end. This is called a "classical" speech structure (anybody wants to claim presentations are not speeches?). One of the best investment you can make is LeeAundra Temescu's "The Contrary Public Speaker" eBook (also available as audio-book). Helped me to score high even deep in " enemy territory". As LeeAundra urges: keep your slide decks light. I second that and add: get ZEN inspiration and get extreme.

Posted by on 02 May 2009 | Comments (0) | categories: Business

Fixing a Notes database - Addressing Fragementation and a Linux edition


One popular entry in this blog is " Fixing a Notes database" Which provides a small MS-Windows command file to clean-up a notes database when your server or client isn't running. While it works very well, it has two caveats: For one on a MS-Windows system you might encounter severe fragmentation on your drive (thank NTFS for that), two it is MS-Windows only.
For the first problem you have three possible actions short of moving to an OS with less fragmentation problems for large files:
  1. use Windows build in Defrag
  2. use DominoDefrag on OpenNTF
  3. use Defrag.nsf from our Australian Business Partner Preemptive Consulting
I haven't used the later two (since they were not available when I left the MS-Windows camp). Both apparently use the Windows defrag API while defrag.nsf also does some clever things around size and index allocation (so they claim). I'll report on my experiences soon.

So where does that leave a Linux user? There is a lot of discussion around the need, or the lack thereof for Linux defragmentation, so I leave that to the individual reader. It isn't as easy on Linux, since you have a choice of file systems: EXT3/4, Raiser, JFS, XFS, ZFS etc. (I run JFS). However having that little script mentioned in the post above comes in handy, so here we go:
Notes Edition
/opt/ibm/lotus/notes/fixup -L -F -Y $1
/opt/ibm/lotus/notes/compact -D -c -i  -n -v -ZU $1
/opt/ibm/lotus/notes/updall -R $1
/opt/ibm/lotus/notes/updall -X $1
Domino Edition
/opt/ibm/domino/bin/fixup -L -F -Y $1
/opt/ibm/domino/bin/compact -D -c -i  -n -v -ZU $1
/opt/ibm/domino/bin/updall -R $1
/opt/ibm/domino/bin/updall -X $1
You might need to adjust the path to the executables if you have installed them elsewhere. Create a file in /usr/local/bin with the above content and make it executable (you don't need a file extension):
gksu gedit /usr/local/bin/fixnotesdb
sudo chmod +x /usr/local/bin/fixnotesdb

Make sure that your notes.ini contains CREATE_R85_DATABASES=1 or CREATE_R9_DATABASES=1
As usual: YMMV.
Update: There is a Mac version too

Posted by on 02 May 2009 | Comments (0) | categories: Show-N-Tell Thursday