<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>722</title>
	<atom:link href="http://722.kalaari.net/b/lang/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://722.kalaari.net/b</link>
	<description>f 722 t 722 p 722 oxygen 722 722 722</description>
	<lastBuildDate>Sat, 24 Dec 2011 11:56:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jsr107 javax.cache annotations with Google Guice</title>
		<link>http://722.kalaari.net/b/lang/en/2011/12/23/jsr107-javax-cache-annotations-with-google-guice</link>
		<comments>http://722.kalaari.net/b/lang/en/2011/12/23/jsr107-javax-cache-annotations-with-google-guice#comments</comments>
		<pubDate>Fri, 23 Dec 2011 21:00:41 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[guice]]></category>
		<category><![CDATA[jsr107]]></category>
		<category><![CDATA[lombok]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=108</guid>
		<description><![CDATA[I&#8217;m using Google Guice as my Dependency Injection framework. I wanted to use the javax.cache api aka JSR107 (with EHcache as implementation). If you want to learn more about this famous JSR107, it could be a good idea to go &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2011/12/23/jsr107-javax-cache-annotations-with-google-guice">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a title="Google Guice" href="http://code.google.com/p/google-guice/wiki/Motivation?tm=6" target="_blank">Google Guice</a> as my Dependency Injection framework. I wanted to use the javax.cache api aka <a title="JSR107" href="http://jcp.org/en/jsr/detail?id=107" target="_blank">JSR107</a> (with <a href="http://ehcache.org/" target="_blank">EHcache</a> as implementation). If you want to learn more about this famous JSR107, it could be a good idea to go to <a href="http://gregluck.com/blog/archives/category/jsr107/">Greg Luck blog</a> to get some more infos about it.</p>
<p>In my case, I wanted to use the annotations part of the JSR107 because I find them to be more elegant than a pure code solution (understand, you can put cache in your app without changing the logic, you just annotate your business methods, and <em>woosh</em>, you have cache set up).</p>
<p>But the JSR107 annotations implementations are DI framework dependant. And untill some days ago, only Spring and CDI implementation were provided.</p>
<p>I <a href="https://twitter.com/#!/cfurmaniak/status/147052796154359808" target="_blank">twitted</a> to search any volunteers that might be interested in contributing (with or without me) to a Guice implementation.</p>
<p>Some hours laters, some commits from Michael Stachel were <a href="https://github.com/jsr107/RI/tree/master/cache-annotations-ri/cache-annotations-ri-guice" target="_blank">pushed by Alex Snaps to the github repo</a> and here they are, the JSR 107 annotations for Guice were available.</p>
<p>I&#8217;d like to show you how you can use them.</p>
<p>The full source code is available <a href="https://bitbucket.org/looztra/guicyjsr107app/src">here</a> as a <a href="http://mercurial.selenic.com/">Mercurial</a> repository on <a href="http://bitbucket.org/">Bitbucket</a>.</p>
<p>I&#8217;m using <a href="http://maven.apache.org/">Maven</a>, so here is the dependency part of the pom</p>
<pre class="brush:xml">
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>${guice.version}</version>
        </dependency>
        <!-- cache jsr107 stuff -->
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-jcache</artifactId>
            <version>1.4.0-beta1</version>
        </dependency>
        <dependency>
            <groupId>javax.cache.implementation</groupId>
            <artifactId>cache-annotations-ri-guice</artifactId>
            <version>0.5-SNAPSHOT</version>
        </dependency>
</pre>
<p>You can see here that I&#8217;m using the latest snapshot of the <strong>cache-annotations-ri-guice</strong> artifact (<em>0.5-SNAPSHOT</em> as I&#8217;m writing this post). I don&#8217;t know if the snapshots are available somewhere, so I just cloned the corresponding <a href="https://github.com/jsr107">git repositories</a> and installed the snapshots locally. To be more precise, you will need to clone the <a href="https://github.com/jsr107/jsr107spec">jsr107-spec</a> repo to build and install locally the jsr107 api artifacts that are needed by the <a href="https://github.com/jsr107/RI">jsr107 Reference Implementation</a> artifacts, among which you&#8217;ll find the <strong>cache-annotations-ri-guice</strong> artifact.</p>
<p>Now, let&#8217;s write a basic <em>UserService</em> interface (ok, you don&#8217;t need an interface actually):</p>
<pre class="brush:java">package net.awl.ismp.guice.jsr107;

import java.util.List;

/**
 *
 * @author looztra
 */
public interface UserService {
    public User getUserById(int id, int callId);
    public List&#60;User&#62; getUserByLastName(String name, int callId);
    public boolean calledBy(int callId);
}</pre>
<p>The <em>UserService</em> makes reference to a <em>User</em> class:</p>
<pre class="brush:java">package net.awl.ismp.guice.jsr107;

import java.io.Serializable;
import lombok.Data;

/**
 *
 * @author looztra
 */
@Data
public class User implements Serializable {
    private int id;
    private String firstName;
    private String lastName;
    private int age;
}</pre>
<p>People that follow may have spotted that I was too lazy to write the accessors and that I chose to use the <a href="http://projectlombok.org/">Lombok</a> <strong>@Data</strong> annotation instead.</p>
<p>Here is the main part of a simple implementation of the basic UserService:</p>
<pre class="brush:java">package net.awl.ismp.guice.jsr107;

import java.util.*;
import javax.cache.annotation.CacheKeyParam;
import javax.cache.annotation.CacheResult;
import lombok.extern.slf4j.Slf4j;

/**
 *
 * @author looztra
 */
@Slf4j
public class SimpleUserService implements UserService {

    private Map&#60;Integer, User&#62; users = new HashMap&#60;Integer, User&#62;();
    private List&#60;Integer&#62; callers = new ArrayList&#60;Integer&#62;();

    public SimpleUserService() {
        initContent();
    }

    @Override
    @CacheResult(cacheName = "getUserById")
    public User getUserById(@CacheKeyParam int id, int callId) {
        log.info("getUserById(): business method called for id (" + id + ") and callId (" + callId + ")");
        registerCaller(callId);
        if (id &#62;= 0 &#38;&#38; id &#60; 100) {
            return users.get(id);
        } else {
            return null;
        }
    }

    @Override
    @CacheResult(cacheName = "getUserByLastName")
    public List&#60;User&#62; getUserByLastName(@CacheKeyParam String name, int callId) {
        log.info("getUserByLastName(): business method called for name &#60;" + name + "&#62; and callId &#60;" + callId + "&#62;");
        registerCaller(callId);
        List&#60;User&#62; matches = new ArrayList&#60;User&#62;();
        for (Map.Entry&#60;Integer, User&#62; entry : users.entrySet()) {
            User potentialMatch = entry.getValue();
            if (potentialMatch.getLastName().contains(name)) {
                matches.add(potentialMatch);
            }
        }
        return matches;
    }
...
}</pre>
<p>The initContent() an the registerCaller() method are only utilities methods (full source code available <a href="https://bitbucket.org/looztra/guicyjsr107app/src/54a8fd3cd8be/src/main/java/net/awl/ismp/guice/jsr107/SimpleUserService.java">here</a>).</p>
<p>The interesting parts are the two annotations <a href="https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/annotation/CacheResult.java">@CacheResult</a> and <a href="https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/annotation/CacheKeyParam.java">@CacheKeyParam</a>.</p>
<p>Straight from the javadoc: <span style="color: #ff6600;">When a method annotated with <em>@CacheResult</em> is invoked a CacheKey will be generated and javax.cache.Cache#get(Object) is called before the invoked method actually executes. If a value is found in the cache it is returned and the annotated method is never actually executed. If no value is found the annotated method is invoked and the returned value is stored in the cache with the generated key.</span></p>
<p>The @CacheResult is then a very simple way to set up a <a href="http://ehcache.org/documentation/user-guide/concepts#read-through">Read-Through cache</a>.</p>
<p>The <em>@CacheKeyParam</em> is used to specify which subset of the method params are to be used as part of the CacheKey (by default, all the method params are used).</p>
<p>Those 2 annotations are not the only one existing of course. You could use @CachePut to implement a Write-Through cache for instance.</p>
<p>Before it can work as expected, don&#8217;t forget to register the <a href="https://github.com/jsr107/RI/blob/master/cache-annotations-ri/cache-annotations-ri-guice/src/main/java/javax/cache/annotation/impl/guice/module/CacheAnnotationsModule.java">CacheAnnotationsModule</a> so that Guice injector can use the jsr107 annotations.</p>
<pre class="brush:java">...
@BeforeClass
    public void setUp() {
        Injector injector = Guice.createInjector(new MyModule(),new CacheAnnotationsModule());
        service = injector.getInstance(UserService.class);
    }
...</pre>
<p><em>MyModule</em> being a very simple Guice module matching my simple needs:</p>
<pre class="brush:java">package net.awl.ismp.guice.jsr107;

import com.google.inject.AbstractModule;

/**
 *
 * @author looztra
 */
public class MyModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(UserService.class).to(SimpleUserService.class);
    }

}</pre>
<p>A simple unit test to see it in action</p>
<pre class="brush:java">
    @Test
    public void testGetIdTwice() {
        Assert.assertNotNull(service);
        int callId = getCallerId();
        log.info("testGetIdTwice(): calling the service the first time with callerId &#60;" + callId + "&#62;");
        User found = service.getUserById(testGetIdTwice_SEARCHED_ID, callId);
        Assert.assertNotNull(found);
        log.info("testGetIdTwice(): found user &#60;" + found + "&#62;");
        // check that we went through the business method the time
        Assert.assertTrue(service.calledBy(callId));
        //
        int callId2 = getCallerId();
        log.info("testGetIdTwice(): calling the service the second time with callerId &#60;" + callId2 + "&#62;");
        User found2 = service.getUserById(testGetIdTwice_SEARCHED_ID, callId2);
        Assert.assertNotNull(found2);
        // check that we did not go through the business method this time
        Assert.assertFalse(service.calledBy(callId2));

    }
</pre>
<p>Feel free to get the full source code that is available <a href="https://bitbucket.org/looztra/guicyjsr107app/src">here</a> as a <a href="http://mercurial.selenic.com/">Mercurial</a> repository on <a href="http://bitbucket.org/">Bitbucket</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2011/12/23/jsr107-javax-cache-annotations-with-google-guice/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial : track changes to a repository with RSS</title>
		<link>http://722.kalaari.net/b/lang/en/2010/10/15/mercurial-track-changes-to-a-repository-with-rss</link>
		<comments>http://722.kalaari.net/b/lang/en/2010/10/15/mercurial-track-changes-to-a-repository-with-rss#comments</comments>
		<pubDate>Fri, 15 Oct 2010 12:06:06 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Hg]]></category>
		<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=101</guid>
		<description><![CDATA[If you are used to CVS or SVN notifications, you may want to reproduce the emails that you received each time a commit is made by a developper. You can do that using Hooks with mercurial but the built-in mercurial &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2010/10/15/mercurial-track-changes-to-a-repository-with-rss">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>
	If you are used to CVS or SVN notifications, you may want to reproduce the emails that you received each time a commit is made by a developper.</p>
<p>
	You can do that using <a href="http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html">Hooks</a> with <em><strong>mercurial</strong></em> but the built-in mercurial web server provides <a href="http://mercurial.selenic.com/wiki/TipsAndTricks#Track_changes_to_a_repository_with_RSS">RSS feeds</a> of changes in every repository. Simply subscribe to the rss feed provided at your <strong>repository url</strong> + <strong>/rss-log/</strong> and that&#39;s it.</p>
<p>
	Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2010/10/15/mercurial-track-changes-to-a-repository-with-rss/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WTF? my keyboard layout changed while I was working under Eclipse!</title>
		<link>http://722.kalaari.net/b/lang/en/2010/03/15/wtf-my-keyboard-layout-changed-while-i-was-working-under-eclipse</link>
		<comments>http://722.kalaari.net/b/lang/en/2010/03/15/wtf-my-keyboard-layout-changed-while-i-was-working-under-eclipse#comments</comments>
		<pubDate>Mon, 15 Mar 2010 13:17:31 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=96</guid>
		<description><![CDATA[Just happened again to me. Once again. And I had to search once again how to fix it. Actually, I was playing with Eclipse shortcuts&#8230;and I fired Alt+Shift several times&#8230;which seems to be the default shortcut under windows to switch &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2010/03/15/wtf-my-keyboard-layout-changed-while-i-was-working-under-eclipse">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Just happened again to me. Once again. And I had to search once again how to fix it.<br />
Actually, I was playing with Eclipse shortcuts&#8230;and I fired <em>Alt+Shift</em> several times&#8230;which seems to be the default shortcut under windows to switch between registred keyboard layouts. I don&#8217;t remember why but I registred a <em>QWERTY</em> layout (but can&#8217;t remember when I could have use it), but I always work with an <em>AZERTY</em> layout.<br />
2 solutions:</p>
<ul>
<li>change the windows shortcut (that is global to windows, i.e. that will surcharge any application shortcut)</li>
<li>unregister the layout that you never use</li>
</ul>
<p>In both cases, go to <em>Control Pannel > Regionnal Settings > Languages > Details</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2010/03/15/wtf-my-keyboard-layout-changed-while-i-was-working-under-eclipse/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Some jRRD news</title>
		<link>http://722.kalaari.net/b/lang/en/2010/02/17/some-jrrd-news</link>
		<comments>http://722.kalaari.net/b/lang/en/2010/02/17/some-jrrd-news#comments</comments>
		<pubDate>Wed, 17 Feb 2010 17:23:31 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jrrd]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jrobin]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[rrd4j]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=90</guid>
		<description><![CDATA[Some (old) news about jRRD, a pure java library that allows you to read Round Robin Database files created by rrdtool. The project has been &#8220;mavenized&#8221; and moved to SVN (ok, maybe we should have switched directly to Git, please &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2010/02/17/some-jrrd-news">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Some (old) news about <a href="http://jrrd.sourceforge.net/index.html">jRRD</a>, a pure java library that allows you to read <a href="http://oss.oetiker.ch/rrdtool/">Round Robin Database</a> files created by rrdtool.</p>
<p>The project has been &#8220;mavenized&#8221; and moved to SVN (ok, maybe we should have switched directly to Git, please <a href="http://vodpod.com/watch/65074-tech-talk-linus-torvalds-on-git">don&#8217;t tell Linus we are still using SVN</a>).</p>
<p>A <a href="http://jrrd.sourceforge.net/download.html">version 0.3</a> has been released, a full changelog can be found <a href="http://jrrd.sourceforge.net/news.html">here</a>. The main changes are:</p>
<ul>
<li>a patch to fix the case of multiple datasources has been applied (initialy provided by Juraj Sucik).</li>
<li>supports version 3 rrd files (jRRD v0.1 only had support for version 1 rrd files)</li>
<li>x86_64 files (only tested on linux 64bits plateform, if you have access to other 64bits plateform, please contact us)</li>
</ul>
<p><br/><br />
The project is not really active because in its current state, it fits our needs, so fill free to wake it up and send us your feature requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2010/02/17/some-jrrd-news/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cygwin rxvt under windows Seven</title>
		<link>http://722.kalaari.net/b/lang/en/2010/02/17/cygwin-rxvt-under-windows-seven</link>
		<comments>http://722.kalaari.net/b/lang/en/2010/02/17/cygwin-rxvt-under-windows-seven#comments</comments>
		<pubDate>Wed, 17 Feb 2010 16:11:46 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[rxvt]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=77</guid>
		<description><![CDATA[Ok, you&#8217;ve not been blessed by the MacOS Spirit so you don&#8217;t have a MBP but you&#8217;d like to have a decent *nix term under windows Seven. You tried the same shortcut that worked previously under XP: C:\Cygwin\bin\rxvt.exe -g 120×70+75+-1 &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2010/02/17/cygwin-rxvt-under-windows-seven">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Ok, you&#8217;ve not been blessed by the MacOS Spirit so you don&#8217;t have a MBP but you&#8217;d like to have a decent *nix term under windows Seven. You tried the same shortcut that worked previously under XP:</p>
<pre class="brush:shell; gutter: false">C:\Cygwin\bin\rxvt.exe -g 120×70+75+-1  -sl 1500 -fn courier -bg black -fg grey -sr -e bash –login -i</pre>
<p>but all you get is big window with strange spacing between chars:<br/><br />
<a href="http://722.kalaari.net/b/wp-content/uploads/2010/02/cygwin-rxvt-seven-bad.png"><img class="alignnone size-medium wp-image-84" title="cygwin-rxvt-seven-bad" src="http://722.kalaari.net/b/wp-content/uploads/2010/02/cygwin-rxvt-seven-bad-300x118.png" alt="" width="300" height="118" /></a>.<br />
Ok, it&#8217;s time to customize some stuff. Open a cygwin shell (or an ugly uncustomized rxvt), go to your home directory, and create/edit your <em>.Xdefaults</em> file to fit this one:</p>
<pre class="brush:shell; gutter:false">
#Rxvt.reverseVideo:      true
Rxvt.scrollBar_right:   false
Rxvt.saveLines:         2048
Rxvt.font:              "Lucida Console-12"
</pre>
<p>Then edit your shortcut to something similar to this one:</p>
<pre class="brush:shell; gutter:false">
C:\cygwin\bin\rxvt.exe -display :0 -bg black -fg grey -tn rxvt -sr -sl 1500 -g "140x60+1+-1" -e /usr/bin/bash --login -i
</pre>
<p>If you need to adjust the size of the window, you can change the <em>-g &#8220;140&#215;60+1+-1&#8243;</em> values.<br/><br />
You should now get something much more like that:<br/><br />
<a href="http://722.kalaari.net/b/wp-content/uploads/2010/02/cygwin-rxvt-seven-good.png"><img src="http://722.kalaari.net/b/wp-content/uploads/2010/02/cygwin-rxvt-seven-good-300x129.png" alt="" title="cygwin-rxvt-seven-good" width="300" height="129" class="alignnone size-medium wp-image-85" /></a><br/><br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2010/02/17/cygwin-rxvt-under-windows-seven/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piwik Analytics plugin for Hudson</title>
		<link>http://722.kalaari.net/b/lang/en/2009/11/02/piwik-analytics-plugin-for-hudson</link>
		<comments>http://722.kalaari.net/b/lang/en/2009/11/02/piwik-analytics-plugin-for-hudson#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:44:56 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[piwik analytics]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=63</guid>
		<description><![CDATA[Piwik is an open source (GPL licensed) web analytics software program (similar to Google Analytics). Hudson is a continuous integration server. If you want to track visits on your Hudson server using piwik, you need a Piwik Analytics plugin for &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2009/11/02/piwik-analytics-plugin-for-hudson">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://piwik.org/">Piwik</a> is an open source (GPL licensed) web analytics software program (similar to Google Analytics). <a href="http://hudson-ci.org/">Hudson</a> is a continuous integration server. If you want to track visits on your Hudson server using piwik, you need a Piwik Analytics plugin for Hudson. None exists officialy. I had a look at the Google Analytics plugin and adapted it to Piwik.</p>
<p>All you&#8217;ll need is a piwik siteId, the piwik server name and path of your piwik installation. And the Piwik Analytics plugin for Hudson that you can <a class="piwik_download" href="http://722.kalaari.net/b/wp-content/uploads/piwikanalytics.hpi">download here</a> (<del datetime="2009-11-03T08:48:14+00:00">save as&#8230;</del>) till there is an official version available (maybe some more tests needed, any feedback will be appreciated!)</p>
<p><em>Update 2009-11-03</em>: I fixed the mime type for hpi files so no more Save as should be needed.<br />
<em>Update 2009-11-04:</em> some minor changes: french translations and the possibility to add download extensions (see <a href="http://piwik.org/docs/javascript-tracking/"></p>
<p>http://piwik.org/docs/javascript-tracking/</a></p>
<p><em>Update 2009-11-06</em>: fixed the package to be compatible with jdk 1.5<br />
<strong>Update 2009-11-07</strong>: the plugin has been <a href="http://wiki.hudson-ci.org/display/HUDSON/Piwik+Analytics+Plugin">officially released</a> and should be available in you admin plugin list.</p>
<p><img border="0" src="/b/wp-content/uploads/2009/11/Capture-1.png" alt="Hudson Piwik Analytics plugin" /></p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2009/11/02/piwik-analytics-plugin-for-hudson/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Core 11 &amp; VMware Player 2.5.2</title>
		<link>http://722.kalaari.net/b/lang/en/2009/06/23/fedora-core-11-vmware-player-2-5-2</link>
		<comments>http://722.kalaari.net/b/lang/en/2009/06/23/fedora-core-11-vmware-player-2-5-2#comments</comments>
		<pubDate>Tue, 23 Jun 2009 19:49:23 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[fedora vmware player]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=40</guid>
		<description><![CDATA[Si vous venez comme moi de mettre à jour votre fedora vers la version 11 et que vous utilisez VMware player (par choix ou sous la contrainte, alors que VirtualBox fonctionne très bien), vous allez vous confronter à un petit &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2009/06/23/fedora-core-11-vmware-player-2-5-2">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Si vous venez comme moi de mettre à jour votre fedora vers la version 11 et que vous utilisez VMware player (par choix ou sous la contrainte, alors que VirtualBox fonctionne très bien), vous allez vous confronter à un petit problème: les modules supplémentaires compilés par l&#8217;installeur de vmware ne compilent pas justement.</p>
<p>La raison est simple, le kernel livré avec la fc11 est un 2.6.29, qui n&#8217;était pas encore sorti lorsque le player 2.5.2 est sorti.</p>
<p>Toutes les infos et le patch a appliquer se trouvent <a href="http://communities.vmware.com/thread/203231" target="_blank">par là</a>.</p>
<p>Après application du patch, ça devrait donner:</p>
<pre>Starting VMware services:
Virtual machine monitor                                 [  OK  ]
Virtual machine communication interface                 [  OK  ]
Blocking file system                                    [  OK  ]
Virtual ethernet                                        [  OK  ]
Shared Memory Available                                 [  OK  ]
</pre>
<p>et zou.</p>
<p><a href="http://722.kalaari.net/b/wp-content/uploads/2009/06/vmware-6.5.2-modules-2.6.29-fix.sh">vmware-6.5.2-modules-2.6.29-fix.sh</a><br />
<a href="http://722.kalaari.net/b/wp-content/uploads/2009/06/vmware-6.5.2-modules-2.6.29-fix.patch">vmware-6.5.2-modules-2.6.29-fix.patch</a></p>
<p>If you&#8217;ve just upgraded your fedora install to version 11 and that you (have to) use VMware player (despite VirtualBox works very well), you will encounter a small problem: additionnal kernel modules needed by the vmware install won&#8217;t compile.</p>
<p>Indeed, the kernel bundled with fc11 is a  2.6.29, that wasn&#8217;t out when vmware player 2.5.2 was released.</p>
<p>All informations and a patch to apply are provided  <a href="http://communities.vmware.com/thread/203231">here</a>.</p>
<p>Let&#8217;s apply the patch and enjoy:</p>
<pre>Starting VMware services:
 Virtual machine monitor                                 [  OK  ]
 Virtual machine communication interface                 [  OK  ]
 Blocking file system                                    [  OK  ]
 Virtual ethernet                                        [  OK  ]
 Shared Memory Available                                 [  OK  ]

that's all folks!</pre>
<p><a href="http://722.kalaari.net/b/wp-content/uploads/2009/06/vmware-6.5.2-modules-2.6.29-fix.sh">vmware-6.5.2-modules-2.6.29-fix.sh</a><br />
<a href="http://722.kalaari.net/b/wp-content/uploads/2009/06/vmware-6.5.2-modules-2.6.29-fix.patch">vmware-6.5.2-modules-2.6.29-fix.patch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2009/06/23/fedora-core-11-vmware-player-2-5-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jrrd TODO List</title>
		<link>http://722.kalaari.net/b/lang/en/2009/06/20/jrrd-todo-list</link>
		<comments>http://722.kalaari.net/b/lang/en/2009/06/20/jrrd-todo-list#comments</comments>
		<pubDate>Sat, 20 Jun 2009 20:12:00 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jrrd]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=33</guid>
		<description><![CDATA[update website release 0.2 use maven and SVN explain the differences with other java rrd tools (jrobin, rrd4j, see https://wiki.man.poznan.pl/perfsonar-mdm/index.php/RRD_Java_libraries)]]></description>
			<content:encoded><![CDATA[<ul>
<li><span lang="en">update website <img src='http://722.kalaari.net/b/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></li>
<li><span lang="en">release 0.2</span></li>
<li><span lang="en">use maven and <span style="text-decoration: line-through;">SVN</span></span></li>
<li><span lang="en">explain the differences with other java rrd tools (jrobin, rrd4j, see https://wiki.man.poznan.pl/perfsonar-mdm/index.php/RRD_Java_libraries)</span></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2009/06/20/jrrd-todo-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java: auto-initialisation des variables d&#8217;instance&#8230;ou pas</title>
		<link>http://722.kalaari.net/b/lang/en/2009/06/11/java-auto-initialisation-des-variables-dinstance-ou-pas</link>
		<comments>http://722.kalaari.net/b/lang/en/2009/06/11/java-auto-initialisation-des-variables-dinstance-ou-pas#comments</comments>
		<pubDate>Thu, 11 Jun 2009 08:42:46 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java initialisation variable]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=28</guid>
		<description><![CDATA[A chaque fois que je crée une nouvelle classe, je me demande si je dois forcer la valeur par défaut des variables d&#8217;instance. La plupart du temps je me dis &#8220;je ne veux pas dépendre d&#8217;un comportement par défaut, je &#8230;<p class="read-more"><a href="http://722.kalaari.net/b/lang/en/2009/06/11/java-auto-initialisation-des-variables-dinstance-ou-pas">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">A chaque fois que je crée une nouvelle classe, je me demande si je dois forcer la valeur par défaut des variables d&#8217;instance. La plupart du temps je me dis &#8220;je ne veux pas dépendre d&#8217;un comportement par défaut, je vais forcer explicitement la valeur par défaut de la variable d&#8217;instance, ce sera plus lisible&#8221;. C&#8217;est peut-être discutable mais je n&#8217;ai jamais eu l&#8217;occasion d&#8217;en discuter avec des java-gurus, ni d&#8217;ailleurs de réellement me poser des questions sur le bien-fondé et la justesse de ce choix.</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Jusqu&#8217;à ce jour. Je viens de découvrir (shame on me?) qu&#8217;il est parfois nécessaire de ne pas explicitement forcer la valeur par défaut.</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span id="more-28"></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">1er cas:</span></p>
<blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial;">public class MotherClass {</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public MotherClass(String&#8230; args) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;MotherClass(): [BERORE CALL TO PREPARE] this:&#8221; + this);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">prepare(args);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;MotherClass(): [AFTER CALL TO PREPARE] this:&#8221; + this);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public void prepare(String&#8230; args) {</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member0_1 = args[0];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member0_2 = args[1];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;MotherClass.prepare(): this:&#8221; + this);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public String toString() {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">return &#8221;MotherClass &lt;member0_1=&#8221; + member0_1 + &#8221;, member0_2=&#8221; + member0_2 + &#8221;&gt;&#8221;;<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">protected String member0_1;<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">protected String member0_2 = &#8221;initialized&#8221;;<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public static void main(String[] args) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">MotherClass mc = new MotherClass(new String[] { &#8221;first&#8221;, &#8221;second&#8221; });<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;main(): mc:&#8221; + mc);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" />}</span></span></p>
</blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">Si on lance le <em>main</em>, ça donne:</span></span></p>
<blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">MotherClass(): [BERORE CALL TO PREPARE] this:MotherClass &lt;member0_1=null, member0_2=initialized&gt;<br style="padding: 0px; margin: 0px;" />MotherClass.prepare(): this:MotherClass &lt;<span style="margin: 0px; padding: 0px; background-color: #57ff00;">member0_1=first, member0_2=second</span>&gt;<br style="padding: 0px; margin: 0px;" />MotherClass(): [AFTER CALL TO PREPARE] this:MotherClass &lt;member0_1=first, member0_2=second&gt;<br style="padding: 0px; margin: 0px;" />main(): mc:MotherClass &lt;<span style="margin: 0px; padding: 0px; background-color: #02ff00;">member0_1=first, member0_2=second</span>&gt;</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;">
</blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">Dans ce cas, rien de particulier, la classe se comporte comme on peut s&#8217;y attendre, que la variable d&#8217;instance ait été initialisée (<span style="margin: 0px; padding: 0px; font-family: 'courier new'; font-size: 13px; font-style: italic;">member0_2)<span style="margin: 0px; padding: 0px; font-family: 'Times New Roman'; font-size: 16px; font-style: normal;"> ou pas (<span style="margin: 0px; padding: 0px; font-family: 'courier new'; font-size: 13px; font-style: italic;">member0_1</span>).</span></span></span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Etendons maintenant cette classe:</span></p>
<blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public class ClassThatExtends extends MotherClass {<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public ClassThatExtends(String&#8230; args) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">super(args);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;ClassThatExtends(): [AFTER super()] this:&#8221; + this);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public void prepare(String&#8230; args) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">if (args.length == 4) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member0_1 = args[0];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member0_2 = args[1];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member1_1 = args[2];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">this.member1_2 = args[3];<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;ClassThatExtends.prepare(): this:&#8221; + this);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public String toString() {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">return &#8221;ClassThatExtends &lt;member0_1=&#8221; + member0_1 + &#8221;, member0_2=&#8221; + member0_2<br style="padding: 0px; margin: 0px;" /> </span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">+ &#8221;, member1_1=&#8221; + member1_1 + &#8221;, member1_2=&#8221; + member1_2 + &#8221;&gt;&#8221;;<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">private String member1_1;<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">private String member1_2 = &#8221;initialized&#8221;;<br style="padding: 0px; margin: 0px;" /></span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">public static void main(String[] args) {<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">ClassThatExtends cte = new ClassThatExtends(new String[] { &#8221;first&#8221;, &#8221;second&#8221;, &#8221;third&#8221;,<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">&#8220;fourth&#8221; });<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">System.out.println(&#8220;main(): cte:&#8221; + cte);<br style="padding: 0px; margin: 0px;" /></span><span style="margin: 0px; padding: 0px; white-space: pre;"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"> </span></span><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;">}<br style="padding: 0px; margin: 0px;" />}</span></span></p>
</blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Si on lance le <em>main</em>:</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;">
<blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>MotherClass(): [BERORE CALL TO PREPARE] this:ClassThatExtends &lt;member0_1=null, member0_2=initialized, member1_1=null, member1_2=null&gt;</em></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>ClassThatExtends.prepare(): this:ClassThatExtends &lt;member0_1=first, member0_2=second, member1_1=third, member1_2=fourth&gt;</em></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>MotherClass(): [AFTER CALL TO PREPARE] this:ClassThatExtends &lt;member0_1=first, member0_2=second,<strong><span style="margin: 0px; padding: 0px; background-color: #00ff54;">member1_1=third</span></strong>, <strong><span style="margin: 0px; padding: 0px; background-color: #00ff54;">member1_2=fourth</span></strong>&gt;</em></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>ClassThatExtends(): [<strong>AFTER super()</strong>] this:ClassThatExtends &lt;member0_1=first, member0_2=second,<span style="margin: 0px; padding: 0px; background-color: #00ff54;"><strong>member1_1=third</strong></span>, <span style="margin: 0px; padding: 0px; background-color: #ffaa00;"><strong>member1_2=initialized</strong></span>&gt;</em></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>main(): cte:ClassThatExtends &lt;member0_1=first, member0_2=second, member1_1=third, member1_2=initialized&gt;</em></span></p>
</blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><span style="margin: 0px; padding: 0px; font-family: arial,helvetica,sans-serif;"><br />
</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr"><em>WTF</em>? member1_1 qui n&#8217;a pas été explicitement initialisée dans la classe fille a gardé la valeur fixée lors de l&#8217;appel du constructeur, par contre, member1_2 qui a été explicitement initialisée a été écrasée après avoir été valorisée dans le constructeur!</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Les variables d&#8217;instance d&#8217;une classe &#8220;fille&#8221; sont donc initialisées <strong><em>APRES</em></strong> la chaîne des appels des constructeurs.</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Dans le cas où la variable n&#8217;est pas explicitement initialisée lors de sa déclaration et que la variable est valorisée dans le constructeur, la valeur de la variable d&#8217;instance sera conservée. Dans le cas où la variable d&#8217;instance est explicitement initialisée lors de sa déclaration et qu&#8217;elle est valorisée dans le constructeur, la valeur est écrasée par la valeur d&#8217;initialisation spécifiée!</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; text-align: justify; line-height: 1.52em; padding: 0px;"><span lang="fr">Fichtre! En voila donc un comportement pas forcément trivial&#8230; Si quelqu&#8217;un arrive à me trouver le bout de doc chez Java (ou ailleurs) que j&#8217;ai du louper, je suis preneur.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2009/06/11/java-auto-initialisation-des-variables-dinstance-ou-pas/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparaison de frameworks web</title>
		<link>http://722.kalaari.net/b/lang/en/2009/05/26/comparaison-de-frameworks-web</link>
		<comments>http://722.kalaari.net/b/lang/en/2009/05/26/comparaison-de-frameworks-web#comments</comments>
		<pubDate>Tue, 26 May 2009 11:20:19 +0000</pubDate>
		<dc:creator>Christophe Furmaniak</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[java web framework]]></category>

		<guid isPermaLink="false">http://722.kalaari.net/b/?p=25</guid>
		<description><![CDATA[Plus on lit d&#8217;articles à ce sujet, plus on trouve de nouveaux liens. En voici quelques uns (des liens): http://internna.blogspot.com/2009/04/web-framework-comparison-prototyping.html http://java.dzone.com/tips/java-web-frameworks-survey http://docs.google.com/Doc?id=ajgdx7ccvkxg_50ccp25f]]></description>
			<content:encoded><![CDATA[<p>Plus on lit d&#8217;articles à ce sujet, plus on trouve de nouveaux liens. En voici quelques uns (des liens):</p>
<ul>
<li><a href="http://internna.blogspot.com/2009/04/web-framework-comparison-prototyping.html">http://internna.blogspot.com/2009/04/web-framework-comparison-prototyping.html</a></li>
<li><a href="http://java.dzone.com/tips/java-web-frameworks-survey">http://java.dzone.com/tips/java-web-frameworks-survey</a></li>
<li><a href="http://docs.google.com/Doc?id=ajgdx7ccvkxg_50ccp25f">http://docs.google.com/Doc?id=ajgdx7ccvkxg_50ccp25f</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://722.kalaari.net/b/lang/en/2009/05/26/comparaison-de-frameworks-web/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

