Archive for the ‘english’ Category

An exercise in solitude

I was experiencing mixed feelings today as, for the first time this year and not since a long time I took my slick road bike cycling. It was the dust, the cars, the lack of nice and near places, the pain in the knees and the so much more rewarding mountain bike trips which kept this bicycle hanging it it’s special place in the cellar.

Today it started differently, there where so many flowers and cyclists as I was exiting the city that for a moment I thought it was a different place. But soon I hit the main road and the dust was there again, smelling gasoline. And there was another smell, so familiar when cycling on romanian roads. The smell of death, putrefying dogs, road kills dragged aside or just dried on the hot asphalt. The spring has revived this smell with a vengeance after the long winter. (more…)

Apples and nuts cake

My neighbor which I occasionally help with PC problems seeing me in the street Friday gave me a bunch of apples saying these are “bio”-apples from his house in the mountains. I should take some since he has just picked up his apple tree and has too many apples and no idea what to do with them.

Starting with the apples and the sour cherry (or bilberries) cake recipe this was the result:

Apples and nuts cake

Apples and nuts cake

(more…)

Disciplined or tamed

In the first day at Nice we went into a shop for children. Most of them where soundless, quiet. Alex tried to play with one of them. He seemed the same age but his face was tired, aged. He had circles around the eyes and made no sound. When he fall he did not scream. He did not cried. His father raised him but his expression was still, petrified. (more…)

Radio button renderer in a datagrid

Using a radio button as a data grid cell renderer is an example of a more complex usage of data grid cell renderers. This is one way to achive this in a not very complicated way:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
 <![CDATA[
 public var dp:XML = <users>
 <user>
 <name>one</name>
 <main>true</main>
 </user>
 <user>
 <name>two</name>
 <main>false</main>
 </user>
 <user>
 <name>tre</name>
 <main>false</main>
 </user>
 </users>;
 ]]>
 </mx:Script>
 <mx:VBox>
 <mx:DataGrid dataProvider="{dp.user}" width="400">
 <mx:columns>
 <mx:DataGridColumn headerText="Name" dataField="name"/>
 <mx:DataGridColumn headerText="Main">
 <mx:itemRenderer>
 <mx:Component>
 <mx:HBox horizontalAlign="center">
 <mx:Script>
 <![CDATA[
 private function changeMain(event:Event):void{
 if(data.main == 'true'){
 //nothing
 data.main = 'true';
 }else{
 for each(var u:XML in (data as XML).parent().user){
 u.main = 'false';
 }
 data.main = 'true';
 }
 }
 ]]>
 </mx:Script>
 <mx:RadioButton click="changeMain(event)"  selected="{(data.main == 'true')}"/>
 </mx:HBox>
 </mx:Component>
 </mx:itemRenderer>
 </mx:DataGridColumn>
 <mx:DataGridColumn headerText="Main value" dataField="main"/>
 </mx:columns>
 </mx:DataGrid>
 </mx:VBox>
</mx:Application>

And the example in action:

[flash http://www.len.ro/hidden/flex/testRadioRenderer/TestRadioRenderer.swf w=400 h=200]

Flight

Since the trip to Bulgaria a lot of discussions where opened on the subject of paragliding and almost never I felt I have given a complete answer. So here I try to put together some of the things I have in mind on the subject. As usual a subjective structure based on subjective and incomplete informations.

“Flight (paragliding) consist of hours (and days) of complete boredom followed by minutes of total terror or total bliss” said a friend to me and I think it describes very well the subject even if I was not exposed to the terror part.

Yes, I liked the experience very much and I will like to repeat it. No, it will probably not be very soon. (more…)

Tapestry, hibernate application (no.5)

A few years ago I was writting some simple tutorials about using hibernate with tapestry to build a simple application. I’ve used Tapestry 3, 4 and I found it reliable to build applications which are still in production. I could consider myself a Tapestry fan and as such I am disappointed a bit to write this article since I was expecting to find no need for it. My goal was to build a simple example of Tapestry – Hibernate application using Tapestry 5. (more…)

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.cache.use_second_level_cache, which stores objects by id
  • query-cache, controlled by: hibernate.cache.use_query_cache ,which stores query results

However, enabling these properties does not has any effect on the application usage of a cache.

(more…)

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:

java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1)
Classic VM (build 1.3.1, J2RE 1.3.1 IBM AIX build ca131-20030630a (JIT enabled: jitc))

Solution?

  • upgrade JSSE. No. JSSE is in EOL for some time now.
  • try to use the JSSE from 1.4.2. No, this version is not pluggable.
  • upgrade to java 1.4.2 which is not an easy task in these conditions
  • you soon realize that the IBM java has a special implementation of JSSE found in the ibmjsse.jar file so the code written in java 1.3 for the jsse plugable module is not working with the ibmjsse implementation with error:
Classe java introuvable :  com/sun/net/ssl/internal/ssl/Provider
  • finally the solution is to remove from your code the following part:
 Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
 System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
  • it only remains the problem to compile 5 years old code :)

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. The binary autopano-sift does not exist. I had to dig a bit into the scripts to find the proper configuration, shown in the image bellow. (more…)

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

Budget - entries

First approach

In hibernate usual approach this is done most of the time as something similar to: (more…)