Integrating Lightbox into Tapestry 5

This show a basic way of using Lightbox 2.03 (wiki) into Tapestry 5. First step Just copy the css, images and js/lightbox.js into the web directory. Note: the scriptaculous.js, effects.js and prototype.js are not required as they are already included in T5. Modify the .tml file <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>My app</title> <link rel="stylesheet" href="${context:css/style.css}" type="text/css" media="screen" /> <script type="text/javascript" src="${context:js/lightbox.js}"></script> <link rel="stylesheet" href="${context:css/lightbox.css}" type="text/css" media="screen" /> </head> …...

August 18, 2009 · len

cx_Oracle on ubuntu 9.04 jaunty

Update 11.11.2011, for ubuntu 11.10 oneiric oncelot: you will need version: cx_Oracle-5.0.4-11g-py27-1.x86_64.rpm if using 64bit and you installed oracle on 32 bit thus also installed libaio1:i386 the replace /lib/libaio.1.0.1 32bit with the corresponding version for 64bit or you’ll get: ``` import cx_Oracle ImportError: libaio.so.1: wrong ELF class: ELFCLASS32 ``` - if you try to use a newer version of cx\_Oracle you will get ``` import cx_Oracle ImportError: /usr/lib/python2.7/cx_Oracle.so: undefined symbol: PyUnicodeUCS2_AsEncodedString ``` End update....

August 5, 2009 · len

Hibernate localized data

Here are some reflections and solutions on how to localize strings in hibernate objects. The model I am assuming the localized strings will be stored in the database in a structure similar to: Table MY_OBJECT: … LOCALIZED_FIELD … Table LOCALIZED_DATA: CATEGORY (object type) LOCALE LOCALIZED_FK (stores the id of the localized object but without foreign key restrictions) FIELD (field of the object) DATA (the actual localization) First ideea (bad) Create a bag of composite elements with the actual localizations:...

June 18, 2009 · len

Nautilus templates

I have been trying to help my mother by adding a document templates to right click -> create document nautilus menu. Here is the procedure to add new templates: 1. edit the file ~/.config/user-dirs.dirs and change: XDG_TEMPLATES_DIR="$HOME/" to XDG_TEMPLATES_DIR="$HOME/Templates" 2. create the Templates folder 3. in the Templates folder just create whatever document you like. The name of this file will appear in the right click -> create document menu....

March 10, 2009 · len

A bit about hibernate cache

One of the common mistakes when using hibernate is to think: “no problem, hibernate handles the cache for me”. Wrong! By default hibernate does not cache anything. Well, as far as I understand it cache things in the session cache, but this is usually not relevant. First here is what cache refers to in hibernate: session cache, enabled by default, but with a lifetime equals to the session second-level cache, controlled by: hibernate....

March 4, 2009 · len

Enhancing a web application with jquery

I’ve decided to use jquery for the first time in order to implement in the simplest possible way the following problem The problem I wanted to use an existing search/navigation mechanism to select the value of a new input field by making as little modifications as possible to the existing code. Since searching for the item implied navigating a few pages passing information along all the submits or links was impossible without extensive changes....

February 27, 2009 · len

unsupported keyword OID.2.5.4.17

The problem Exception in thread "main" java.io.IOException: unsupported keyword OID.2.5.4.17 at com.sun.net.ssl.internal.ssl.AVA.<init>(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.RDN.<init>(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.X500Name.a(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.X500Name.<init>(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(DashoA12275) What’s your fault when a client running your application for more than 5 years is now receiving this error when its security provider finally upgraded it’s certificates to include: OID.2.5.4.17=<9 digit zip> now standard in almost all certificates. Upgrade you might say but this is not simple considering that the client is AIX based:...

February 27, 2009 · len

Linux barcode reader

I was a bit sceptic about how easy is to use an usb barcode reader (Motorola Symbol LS1203) but it was a pleasant surprise. Just plugged the reader in the usb port and was detected as a input device: black kernel: [ 2273.692061] usb 3-1: new full speed USB device using uhci_hcd and address 2 black kernel: [ 2273.909811] usb 3-1: configuration #1 chosen from 1 choice black kernel: [ 2273....

February 23, 2009 · len

Panotools

Update 2009-07-19: for jaunty refer to this track to solve the stitch now problem. I’ve known for some time about hugin and panotools but never got to use them. This is a very short list of steps to build a simple panorama image on linux (note that my Canon A1000 does not have a panorama assist mode so the source images where a bit deviated). Install apt-get install hugin apt-get install autopano-sift Configuration To my disappointment hugin did not worked out of the box since it had some problems finding the proper autopano-sift tool....

February 20, 2009 · len

A bit of hibernate optimization

The context Assume you are dealing with a hibernate operation which requires to copy a lot of objects in the database. For instance you are having 2 objects as described in the diagram bellow: budget and entries and you want to duplicate the budget and all it’s entries for some operation. There are several way to do this. Budget - entries First approach In hibernate usual approach this is done most of the time as something similar to:...

February 10, 2009 · len