<?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>Anthony Dahanne&#039;s blog</title>
	<atom:link href="http://blog.dahanne.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dahanne.net</link>
	<description>Open Source Software, Java, Android, Continuous Integration</description>
	<lastBuildDate>Mon, 07 May 2012 13:35:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Dynamically proxying annotations to avoid inducing API dependency</title>
		<link>http://blog.dahanne.net/2012/05/07/dynamically-proxying-annotations-to-avoid-inducing-api-dependency/</link>
		<comments>http://blog.dahanne.net/2012/05/07/dynamically-proxying-annotations-to-avoid-inducing-api-dependency/#comments</comments>
		<pubDate>Mon, 07 May 2012 13:35:11 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[terracotta]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=652</guid>
		<description><![CDATA[<p>Annotations are API, and as API they need to be on the classpath at compile time. And usually, you do not want your (portable) business code to depend on yet another API.</p> <p>In this article, I will present you how to allow your library users not to depend on the library API just for the [...]]]></description>
			<content:encoded><![CDATA[<p>Annotations are API, and as API they need to be on the classpath at compile time. And usually, you do not want your (portable) business code to depend on yet another API.</p>
<p>In this article, I will present you how to allow your library users not to depend on the library API just for the annotations you provide, using java.lang.reflect and its proxy facilities.</p>
<p>My examples will be based on <a title="EhCache official website" href="http://ehcache.org">Ehcache</a> source code, since<a href="https://jira.terracotta.org/jira/browse/EHC-938"> it is for the @IgnoreSizeOf annotation that this whole idea of annotation proxying came up</a> ! (for reference, @IgnoreSizeOf is the <a title="EhCache SizeOf documentation" href="http://ehcache.org/documentation/configuration/cache-size#built-in-sizing-computation-and-enforcement">annotation used by Ehcache to filter out classes from the SizeOf computation</a>)<br />
Doing this on the Ehcache @IgnoreSizeOf annotation will allow framework developers, who embed Ehcache in their framework (and want to benefit from the sizeOf feature), to not introduce a dependency on Ehcache for their users.</p>
<h3>Our use case : you want to use the original annotation but not to depend on it.</h3>
<p>Instead of using and depending on Ehcache&#8217;s <a href="http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/annotations/IgnoreSizeOf.java">@IgnoreSizeOf (net.sf.ehcache.pool.sizeof.annotations.IgnoreSizeOf</a>) :</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.sf.ehcache.pool.sizeof.annotations</span><span style="color: #339933;">;</span>
@Retention<span style="color: #009900;">&#40;</span>RetentionPolicy.<span style="color: #006633;">RUNTIME</span><span style="color: #009900;">&#41;</span>
@Target<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>ElementType.<span style="color: #006633;">FIELD</span>, ElementType.<span style="color: #006633;">TYPE</span>, ElementType.<span style="color: #000000; font-weight: bold;">PACKAGE</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> @<span style="color: #000000; font-weight: bold;">interface</span> IgnoreSizeOf <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">boolean</span> inherited<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">default</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>you want to annotate your classes with your custom com.myproject.ehcache.IgnoreSizeOf annotation , which of course has no relationship (well, it looks like it, acts like it; but it is not the same, see this as <a title="duck typing" href="http://en.wikipedia.org/wiki/Duck_typing">duck typing</a>) with the original @IgnoreSizeOf annotation :</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.myproject.ehcache</span><span style="color: #339933;">;</span>
@Retention<span style="color: #009900;">&#40;</span>RetentionPolicy.<span style="color: #006633;">RUNTIME</span><span style="color: #009900;">&#41;</span>
@Target<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>ElementType.<span style="color: #006633;">FIELD</span>, ElementType.<span style="color: #006633;">TYPE</span>, ElementType.<span style="color: #000000; font-weight: bold;">PACKAGE</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> @<span style="color: #000000; font-weight: bold;">interface</span> IgnoreSizeOf <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can notice that the inherited method is missing in the custom annotation, more on this in the next chapter.</p>
<h3>The big picture : use java.lang.proxy to transform the type of your annotation</h3>
<p>Once you have scanned your class or field or package (any <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/AnnotatedElement.html">AnnotatedElement</a>) for your custom annotation :</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Annotation</span> customAnnotation <span style="color: #339933;">=</span> element.<span style="color: #006633;">getAnnotation</span><span style="color: #009900;">&#40;</span>com.<span style="color: #006633;">myproject</span>.<span style="color: #006633;">ehcache</span>.<span style="color: #006633;">IgnoreSizeOf</span>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It is as simple as writing those 2 lines of code :</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.sf.ehcache.pool.sizeof.annotations.IgnoreSizeOf</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* some class and method declarations here */</span>
        <span style="color: #003399;">InvocationHandler</span> handler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AnnotationInvocationHandler<span style="color: #009900;">&#40;</span>customAnnotation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        IgnoreSizeOf proxiedAnnotation <span style="color: #339933;">=</span> <span style="color: #003399;">Proxy</span>.<span style="color: #006633;">newProxyInstance</span><span style="color: #009900;">&#40;</span>IgnoreSize.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000000; font-weight: bold;">Class</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span>referenceAnnotation<span style="color: #009900;">&#125;</span>, handler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Well not exactly&#8230; all the interesting code is actually in the InvocationHandler, that will redirect method calls to our custom annotation methods or, if it can&#8217;t, to the reference annotation methods.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> AnnotationInvocationHandler <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">InvocationHandler</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Annotation</span> customAnnotation<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> AnnotationInvocationHandler<span style="color: #009900;">&#40;</span><span style="color: #003399;">Annotation</span> customAnnotation<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">customAnnotation</span> <span style="color: #339933;">=</span> customAnnotation<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> invoke<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Object</span> proxy, <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Method</span> method, <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Throwable</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//trying to call the method on the custom annotation, if it exists</span>
            <span style="color: #003399;">Method</span> methodOnCustom <span style="color: #339933;">=</span> getMatchingMethodOnGivenAnnotation<span style="color: #009900;">&#40;</span>method<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>methodOnCustom <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">return</span>  methodOnCustom.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>customAnnotation, args<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #666666; font-style: italic;">//otherwise getting the default value of the reference annotation method</span>
                    <span style="color: #003399;">Object</span> defaultValue <span style="color: #339933;">=</span> method.<span style="color: #006633;">getDefaultValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>defaultValue <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000000; font-weight: bold;">return</span> defaultValue<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">UnsupportedOperationException</span><span style="color: #009900;">&#40;</span>
                        <span style="color: #0000ff;">&quot;The method <span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
                         <span style="color: #339933;">+</span> method.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                         <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> does not exist in the custom annotation, and there is no default value for&quot;</span>
                         <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; it in the reference annotation, please implement this method in your custom annotation.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Method</span> getMatchingMethodOnGivenAnnotation<span style="color: #009900;">&#40;</span><span style="color: #003399;">Method</span> method<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">Method</span> customMethod <span style="color: #339933;">=</span> customAnnotation.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getDeclaredMethod</span><span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, method.<span style="color: #006633;">getParameterTypes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>customMethod.<span style="color: #006633;">getReturnType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isAssignableFrom</span><span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">getReturnType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">return</span> customMethod<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">NoSuchMethodException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>One method to implement here : the invoke method, called on our proxied annotation every time we call a method on it.<br />
If the method called on the proxy matches a method in our custom annotation, it just delegates the call to it.<br />
But if not (for example remember our custom annotation does not have the inherited() method, but the reference one has), and this is where the JDK annotations are cool, the reference annotation default return value will be returned instead.<br />
What if there is no default value in the reference annotation ? In that case you need to provide this method in your custom annotation (with a default or you can force your consumer to provide a value for this method).</p>
<p>In this example the consumer of Ehcache does not even need to write a complete annotation to mimic the original one ! (since the only method in the original annotation has a default value)</p>
<p>Actually, even in the Oracle JDK they use proxying to resolve annotations, in sun.reflect.annotation.AnnotationParser</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Returns an annotation of the given type backed by the given
 * member -&gt; value map.
 */</span>
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">Annotation</span> annotationForMap<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> type, <span style="color: #003399;">Map</span> memberValues<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Annotation</span><span style="color: #009900;">&#41;</span> <span style="color: #003399;">Proxy</span>.<span style="color: #006633;">newProxyInstance</span><span style="color: #009900;">&#40;</span>type.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000000; font-weight: bold;">Class</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> type <span style="color: #009900;">&#125;</span>, <span style="color: #000000; font-weight: bold;">new</span> AnnotationInvocationHandler<span style="color: #009900;">&#40;</span>type, memberValues<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<p>using their own <a href="http://www.docjar.com/html/api/sun/reflect/annotation/AnnotationInvocationHandler.java.html">sun.reflect.annotation.AnnotationInvocationHandler</a></p>
<h3>Conclusion</h3>
<p>Even if this code was written specifically with Ehcache @IgnoreSizeOf annotation in mind, it is generic enough for any framework authors to use (even more since it is Apache 2 licensed)</p>
<p>You can checkout Ehcache source code from <a href="http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/">http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/ </a>and look for <a href="http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/filter/AnnotationSizeOfFilter.java">AnnotationSizeOfFilter</a> and <a href="http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/filter/AnnotationProxyFactory.java">AnnotationProxyFactory</a> (or, even better, the test class : <a href="http://svn.terracotta.org/svn/ehcache/trunk/ehcache/ehcache-core/src/test/java/net/sf/ehcache/pool/sizeof/FilteredSizeOfTest.java">FilteredSizeOfTest</a>) to learn more detail on how to provide a mechanism for letting your consumer not depend on your annotations !</p>
<p>Special thanks to <a title="Alex Snaps" href="http://www.codespot.net/blog/">Alex Snaps</a> and <a title="Chris Dennis" href="https://twitter.com/#!/tall_chris">Chris Dennis</a> for their guidance !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/05/07/dynamically-proxying-annotations-to-avoid-inducing-api-dependency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting and publishing an Android application (.apk) to run on PlayBook 2.0 (.bar)</title>
		<link>http://blog.dahanne.net/2012/05/02/converting-and-publishing-an-android-application-apk-to-run-on-playbook-2-0-bar/</link>
		<comments>http://blog.dahanne.net/2012/05/02/converting-and-publishing-an-android-application-apk-to-run-on-playbook-2-0-bar/#comments</comments>
		<pubDate>Thu, 03 May 2012 02:59:15 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=599</guid>
		<description><![CDATA[<p>Since its version 2.0 the RIM BlackBerry PlayBook OS acccepts now slightly modified Android application. Here are the steps to convert your Android application to run on PlayBook OS 2.0 and to publish it on BlackBerry App World.</p> Convert your Android application to run on PlayBook OS 2.0 <p>Requirements for your Android app :</p> Your [...]]]></description>
			<content:encoded><![CDATA[<p>Since its version 2.0 the RIM BlackBerry PlayBook OS acccepts now slightly modified Android application.<br />
Here are the steps to convert your Android application to run on PlayBook OS 2.0 and to publish it on BlackBerry App World.</p>
<h3>Convert your Android application to run on PlayBook OS 2.0</h3>
<p>Requirements for your Android app :</p>
<ul>
<li>Your Android application must be targeting version 2.2.3 (API level 10) or earlier to be converted</li>
<li>It must not use the Camera permission (not supported)</li>
<li>The icon (res/drawable/icon.png)  has to be converted to 86&#215;86 pixels</li>
<li><a href="https://bdsc.webapps.blackberry.com/android/apisupport">There are plenty other requirements, you can read on following this link if you run into trouble</a></li>
</ul>
<p>If  you can convert your Android app using an eclipse plugin provided by RIM, I preferred to use their online packaging tool, which actually worked great and did not force me to add yet another plugin inside my IDE <img src='http://blog.dahanne.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>So, from the <a href="https://bdsc.webapps.blackberry.com/android/bpaa/">Online Packaging Tool page</a>, follow the instructions :</p>
<ul>
<li>After accepting the agreement, specify the location of your Android app (.apk) and your Android SDK folder, if everything went OK, you should get this confirmation message :</li>
</ul>
<p><a href="http://blog.dahanne.net/wp-content/uploads/Compatibility-BlackBerry®-Packager-for-Android™-Apps-Mozilla-Firefox_2012-02-22_15-36-44.png"><img class="size-medium wp-image-600 aligncenter" title="Compatibility - BlackBerry® Packager for Android™ Apps - Mozilla Firefox_2012-02-22_15-36-44" src="http://blog.dahanne.net/wp-content/uploads/Compatibility-BlackBerry®-Packager-for-Android™-Apps-Mozilla-Firefox_2012-02-22_15-36-44-300x130.png" alt="" width="300" height="130" /></a>If you have a warning or error message, it means your app does not meet the requirements, then , <a href="https://bdsc.webapps.blackberry.com/android/apisupport">have a look at the list of requirements</a></p>
<ul>
<li>Request your signing keys to RIM, they&#8217;ll then send you (it takes few hours) emails containing 2 certificates : 1 client-RDK-xxx.csj certificate (Rim  Development Key) and 1 client-PBDT-xxx.csj certificate (PlayBook Debug Token)</li>
<li>Then configure your computer to actually generate a developer certificate (.p12), still using the online tool</li>
<li>Finally, you can go to the Packaging and Signing section, to sign your application using your developer certificate (.p12)</li>
</ul>
<p>You finally obtained your BAR archive, ready for submission to BlackBerry App World !</p>
<h3>Publish your converted Android application (.bar) to BlackBerry AppWorld</h3>
<p>You must register to the vendor portal first (they will ask you to provide an official id such as a passport or driving license), it is free (actually all steps are free), then you&#8217;ll receive a notification by email (few days later) telling you your account is approved (<a href="http://supportforums.blackberry.com/t5/BlackBerry-App-World-Development/quot-Vendor-account-status-is-disabled-quot/m-p/1552943/highlight/true#M9793">read on this post to have some feedback about registratio</a>n)</p>
<p>Once you are able to login,</p>
<ul>
<li>you&#8217;ll have to create a new product : for that you will need to submit a series of forms about your app (description, screenshots, audience, etc&#8230;)</li>
</ul>
<p><a href="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-24-07.png"><img class="wp-image-601 aligncenter" title="Vendor Portal for BlackBerry App World™ - Mozilla Firefox_2012-02-22_16-24-07" src="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-24-07-300x163.png" alt="" width="300" height="163" /></a>Unfortunately, they impose you with image resolutions.. oh well&#8230; gimp is here <img src='http://blog.dahanne.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p><a href="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-32-47.png"><img class="wp-image-602 aligncenter" title="Vendor Portal for BlackBerry App World™ - Mozilla Firefox_2012-02-22_16-32-47" src="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-32-47-191x300.png" alt="" width="191" height="300" /></a></p>
<ul>
<li>Now add a release of your product, this is where you are going to upload and publish the bar version of your Android app (file bundle), target it for Tablet PlayBook 2.0 All</li>
</ul>
<ul>
<li><a href="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-38-38.png"><img class="size-medium wp-image-603 aligncenter" title="Vendor Portal for BlackBerry App World™ - Mozilla Firefox_2012-02-22_16-38-38" src="http://blog.dahanne.net/wp-content/uploads/Vendor-Portal-for-BlackBerry-App-World™-Mozilla-Firefox_2012-02-22_16-38-38-300x85.png" alt="" width="300" height="85" /></a>And finally submit it for review : the first time I did that, they got back to me more than a week after &#8211; well, it was during the period of the promotional PlayBook giveaway in exchange of a new app submission <img src='http://blog.dahanne.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   &#8211; to finally deny my submission because there were some Android logos in the screenshots</li>
</ul>
<p>I finally received a playbook after my app was accepted on the app world; it does not run as smoothly as the original android version, but is still usable.</p>
<p>All in all that was a pretty good experience, I only regret the long time I had to wait between all the validations; it seems that it&#8217;s getting better (according to the positive tweets I read on this subject); so you&#8217;re an Android developer and want to gain a (even) broader audience, go for it !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/05/02/converting-and-publishing-an-android-application-apk-to-run-on-playbook-2-0-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : notes about the conference</title>
		<link>http://blog.dahanne.net/2012/03/08/confoo-2012-notes-about-the-conference/</link>
		<comments>http://blog.dahanne.net/2012/03/08/confoo-2012-notes-about-the-conference/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 06:08:56 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=634</guid>
		<description><![CDATA[<p>From Wednesday 29th February to Friday 2nd March 2012, took place Confoo 2012, a major conference in Montréal, mainly focused on web technologies; but I could also attend some real cool sessions about Java / JVM, Android, (J)Ruby, TDD, Continuous Integration, software architecture, and Agile/ Scrum / Lean ; talks were given mainly in English [...]]]></description>
			<content:encoded><![CDATA[<p>From Wednesday 29th February to Friday 2nd March 2012, took place Confoo 2012, a major conference in Montréal, mainly focused on web technologies; but I could also attend some real cool sessions about Java / JVM, Android, (J)Ruby, TDD, Continuous Integration, software architecture, and Agile/ Scrum / Lean ; talks were given mainly in English and some in French too.</p>
<p>Here are some extensive notes I took while attending those talks :</p>
<ul>
<li><a href="http://blog.dahanne.net/2012/02/29/confoo-2012-continuous-delivery-at-speed/">Continuous delivery at speed</a></li>
<li><a href="http://blog.dahanne.net/2012/02/29/confoo-2012-implanter-laop-comment-partir-du-bon-pied/">Implanter l&#8217;AOP&#8230; comment partir du bon pied ?</a></li>
<li><a href="http://blog.dahanne.net/2012/02/29/confoo2012-tdd-and-getting-paid/">TDD and getting paid</a></li>
<li><a href="http://blog.dahanne.net/2012/03/07/confoo-2012-regular-expressions/">Regular Expressions</a></li>
<li><a href="http://blog.dahanne.net/2012/03/08/confoo-2012-jruby/">JRuby</a></li>
<li><a href="http://blog.dahanne.net/2012/02/29/confoo-2012-jvm-internal-for-dummies/">JVM internals for dummies</a></li>
</ul>
<p>And below, some quicker notes (really too busy listening !) on some other talks :</p>
<ul>
<li>I presented a session on <a href="http://confoo.ca/en/2012/session/continuous-integration-for-android-apps">Android Continuous Integration</a></li>
<li>Virtualize your environment by Sean Coates was an interactive session where the speaker would poll the audience about which virtualization environment they are familiar with, on which system (he introduced some tools such as <a href="http://vagrantup.com/">Vagrant</a> to administer Virtual Box VMs with the command line, <a href="http://puppetlabs.com/">puppet</a> to centrally configure your system configurations, and <a href="http://openvpn.net/">OpenVPN</a> for a robust VPN solution, accessible from even poor internet connections)</li>
<li>Propulsez votre architecture grâce aux mocks : Félix Antoine a présenté au public un TDD basé sur les mock objects : comment le fait d&#8217;écrire nos classes en partant des couches supérieures (en mockant les couches en dessous) fait émerger un TDD qu&#8217;il a qualifié de &laquo;&nbsp;London style&nbsp;&raquo; , dû au fait que ces techniques ont été documentées en premier par Steve Freeman auteur du livre <a href="http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627">Growing Object Oriented Dotware, guided by tests</a></li>
</ul>
<p>You may now be interested in :</p>
<ul>
<li><a href="http://joind.in/event/view/773">getting the slides from joindin (with some comments from the audience)</a></li>
<li><a href="http://confoo.ca/en">having a look at the schedule</a></li>
</ul>
<p>I really enjoyed speaking and attending sessions at Confoo (thanks to my <a href="http://www.compuware.com/">employer</a> who let me get there !) : the organization was really professional and friendly: some sponsor booths would organize some games and give gifts, sessions were on time and cancelled sessions were twitted in real time, <del>8</del> 10 tracks in parallel, a very interesting keynote, some very good local and international speakers, talks in French and in English (mostly in English since most of the audience was from outside the province of Québec : 600 people from the US/Europe mainly); as a speaker I also could enjoy a very nice dinner with all the other speakers ( I could meet and re connect with developers and trainers I knew from Paris ! and connect with some local software developers) ; and finally this event took place in downtown Montreal, I am so proud I can attend such quality events from here !</p>
<p>I can&#8217;t wait for Confoo 2013 !</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/03/08/confoo-2012-notes-about-the-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : JRuby</title>
		<link>http://blog.dahanne.net/2012/03/08/confoo-2012-jruby/</link>
		<comments>http://blog.dahanne.net/2012/03/08/confoo-2012-jruby/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 05:33:32 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=630</guid>
		<description><![CDATA[<p>Talk by Charles Nutter, on Friday 2nd March</p> <p>How to install JRuby :</p> rvm  install jruby and unzip or download tar/zip file from jruby.org or you can use a windows installer from jruby.org <p>What is bad compared to pure Ruby ?</p> memory footprint, mostly due to the (better) GC; objects are larger, but fewer; BUT [...]]]></description>
			<content:encoded><![CDATA[<p><em>Talk by <a href="https://twitter.com/#!/headius">Charles Nutter</a>, on Friday 2nd March</em></p>
<p>How to install JRuby :</p>
<ul>
<li><a href="https://rvm.beginrescueend.com/">rvm</a>  install jruby and unzip or</li>
<li>download tar/zip file from <a href="http://jruby.org">jruby.org</a> or</li>
<li>you can use a windows installer from <a href="jruby.org">jruby.org</a></li>
</ul>
<p>What is bad compared to pure Ruby ?</p>
<ul>
<li>memory footprint, mostly due to the (better) GC; objects are larger, but fewer; BUT : lower memory when using concurrency (for example using rails, each http request will spawn a new Ruby process consuming the same amount of RAM, compared to JRuby  spawning some new threads and keeping its amount of RAM consumed stable and keeping barriers between those threads)</li>
<li>c extensions, still experimental</li>
</ul>
<p>Good</p>
<ul>
<li>Ruby itself (both 1.8.7 and 1.9.2. modes in the same jruby : start it with jruby &#8211;1.9)</li>
<li>sandboxed jruby (for non thread safe programs, runs in isolated mode)</li>
</ul>
<p>JVM</p>
<ul>
<li>best GC, support dynamic language</li>
<li>ruby code used with Jruby ends up in native code, optimized by the JVM</li>
<li>stable threading : jvm threads are OS threads;</li>
<li>libraries : tens of thousands of JVM library(Swing demo : Charles built a Swing panel with a button adding statements to jirb )</li>
<li>lots of tools : visualvm (demo stressed gc with old and young objects)</li>
<li>invoke dynamic : ruby is about calling methods, the jvm from 1.7 optimizes those calls</li>
</ul>
<p>Android</p>
<ul>
<li><a href="http://ruboto.org/">Ruboto</a> : gem install ruboto ; ruboto app; rake : you&#8217;re done creating an Android app with JRuby</li>
<li>Ruboto irb</li>
<li>Jruby 1.7 : invoke dynamic, dalvik enhancement, ruby 1.9 by default</li>
</ul>
<p>Bonus</p>
<ul>
<li>Charles used the <a href="https://github.com/redcar/redcar">redcar</a> editor, written in jruby + swt</li>
<li><a href="http://thinkincode.net/trinidad/">trinidad</a> : tomcat like launcher with ruby wrapper</li>
<li><a href="http://torquebox.org/">torquebox</a> : jboss like launcher (messaging, schedulers, etc&#8230;)</li>
<li>During his Android demo, Charles used <a href="http://code.google.com/p/androidscreencast/">android screencast</a></li>
<li><a href="http://kenai.com/projects/warbler/pages/Home">warbler</a> for war/jar : to wrap your ruby app in a war</li>
<li>you can deploy your apps to <a href="http://www.engineyard.com/products/cloud">engine yard cloud</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/03/08/confoo-2012-jruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : Regular Expressions</title>
		<link>http://blog.dahanne.net/2012/03/07/confoo-2012-regular-expressions/</link>
		<comments>http://blog.dahanne.net/2012/03/07/confoo-2012-regular-expressions/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 04:57:45 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[outils]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=632</guid>
		<description><![CDATA[<p>Talk by Jakon Westhoff (Qafoo) given on Friday 2nd March</p> <p>Different languages utilize different different regular expression engines : PHP (PCRE), Java, Python, Ruby, etc&#8230;</p> <p>Delimiter  with / for example : /foobar/i  : i is case insensitive</p> <p>MetaCharacters :</p> * : any number of occurrences + : at least once ? : once or not [...]]]></description>
			<content:encoded><![CDATA[<p><em>Talk by <a href="http://westhoffswelt.de/aboutme.html">Jakon Westhoff</a> (Qafoo) given on Friday 2nd March</em></p>
<p>Different languages utilize different different regular expression engines : PHP (PCRE), Java, Python, Ruby, etc&#8230;</p>
<p>Delimiter  with / for example : /foobar/i  : i is case insensitive</p>
<p>MetaCharacters :</p>
<ul>
<li><em>*</em> : any number of occurrences</li>
<li><em>+</em> : at least once</li>
<li><em>?</em> : once or not at all</li>
<li><em>{x,y}</em> : occurrences between x and y</li>
</ul>
<p>Character classes</p>
<ul>
<li>matches any character EXCEPT new line; but using the<em> s</em> , for example :<em> (The.Point)s</em>   it can also match new lines</li>
<li>character classes : <em>[abcdef]+</em> any character in the bracket would be matched on or several times; ranges :  <em>[a--cd-f]+</em> most of the metacharacters loose their meaning inside brackets; except <em>-</em> for the range</li>
<li><em>[^abcef]+</em> : negates a the new line is part of it; to except the new line : <em>[^\n]+</em></li>
<li>predefined character classes : <em>\d</em> (digit) <em>\s</em> : every whitespace whitespace; the  capital letters negate : <em>\D</em> everything but a digit</li>
<li><em>(something)D</em> : no new line tolerated at the end</li>
</ul>
<p>Alternatives</p>
<ul>
<li>Logical OR : <em>Open|Source</em> : matches the first found : Open or Source</li>
</ul>
<p>Escaping</p>
<ul>
<li><em>\</em> in front of the character (it is supposed to be a literal one, not a special one)</li>
<li>be careful that according to your programming language, <em>\</em> has also a meaning; so <em>\\n</em> become current&#8230;</li>
</ul>
<p>Anchors</p>
<ul>
<li><em>^</em> beginning of the subject</li>
<li><em>$</em> end of the character</li>
<li><em>(^abcdef$)m</em> enables multiline mode</li>
</ul>
<p>Sub pattern</p>
<ul>
<li><em>((abc)(def))</em> : to extract part of the string : 1 -&gt; abc and 2 -&gt; def</li>
<li>named sub-pattern : <em>P</em> option</li>
</ul>
<p>Readability</p>
<ul>
<li><em>x</em> : Extend your pattern&#8217;s legibility by permitting whitespace and comments.</li>
</ul>
<ul>
<li><em>#</em> is ignored, so you can use it to comment</li>
</ul>
<ul>
<li>whitespaces are ignored if they are not escaped</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/03/07/confoo-2012-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : TDD and getting paid</title>
		<link>http://blog.dahanne.net/2012/02/29/confoo2012-tdd-and-getting-paid/</link>
		<comments>http://blog.dahanne.net/2012/02/29/confoo2012-tdd-and-getting-paid/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 22:37:31 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=627</guid>
		<description><![CDATA[<p>Talk by Rowan Merewood, given on Tuesday the 29th of February</p> What is TDD ? <p>Rowan reminded us with what TDD is about :</p> decide what you want to do, write the test, run it and watch it fail, write minimum piece of code, re run the test to watch it pass, refactor, repeat Why [...]]]></description>
			<content:encoded><![CDATA[<p><em>Talk by <a href="https://twitter.com/#!/rowan_m">Rowan Merewood</a>, given on Tuesday the 29th of February</em></p>
<h3>What is TDD ?</h3>
<p>Rowan reminded us with what TDD is about :</p>
<ul>
<li>decide what you want to do,</li>
<li>write the test,</li>
<li>run it and watch it fail,</li>
<li>write minimum piece of code,</li>
<li>re run the test to watch it pass,</li>
<li>refactor,</li>
<li>repeat</li>
</ul>
<h3>Why is it hard ?</h3>
<p>do you even know what you / your customer want(s) ?<br />
Rowan took the analogy of a computer scientist with a ninja, repeating kata to master the perfect move:  <a href="http://codekata.pragprog.com">http://codekata.pragprog.com</a> , <a href="http://osherove.com/tdd-kata-1">TDD Kata</a><br />
Rowan went on with a demo of the design using TDD of a php class (with phpunit checking in the background for modifications to re run the test)</p>
<ul>
<li>First test : check the instantiation returns the good type ; it fails because the class is not existing, Rowan created the class (no methods no variables) re run, the test passed</li>
<li>Second test : expects that a method called calc returns 0 :  it fails since the method add does not exist in the class under test, then Rowan wrote an add method that returns 0, and the test passed</li>
<li>Third test same thing with add 1 : to make it pass, he just returned the param given to the method</li>
<li>Fourth test : add (1,2) should return 3 : he parses the params into an array and array_sums it</li>
</ul>
<h3>So now, we&#8217;re ready to apply this at work</h3>
<p>you should not try to implement all the tests at once : they won&#8217;t be maintanable / understandable and you will miss the deadline<br />
You can try to &laquo;&nbsp;force tests&nbsp;&raquo; to your client : add a fixed percentage to your estimates, and do not compromise your principles<br />
You can also try to &laquo;&nbsp;sell the tests&nbsp;&raquo; to your client : use tests to define done, involve the client in creating tests (automated hopefully) you can use <a href="http://fitnesse.org">fitnesse </a> <a href="http://seleniumhq.org">selenium</a> , <a href="http://behat.org">behat</a>  (can be seen as using cucumber to describe fitnesse tests), and make the tests a deliverable (use CI )<br />
Do not over promise.</p>
<p>The steps to get you started with TDD :</p>
<ul>
<li>Unit testing and acceptance testing</li>
<li>puppet/chef to enable continuous deployment re creating a fresh environment</li>
<li>continuous integration to make progress visible</li>
<li>issue tracking (it allows reporting on TDD)</li>
</ul>
<p>Reporting :</p>
<p>&nbsp;</p>
<ul>
<li>Code/branch coverage</li>
<li>Bug origin (tested or untested code )</li>
<li>For a begineer in TDD, a good idea can be to measure the amount of time spent testing vs amount of time spent coding</li>
</ul>
<p>On a human side : owners vs heroes (a owner can spread the knowledge, a hero just fixes the problems during ight and keeps the knowledge to himself) and ff the team does not care : try games to imply them or&#8230; quit (!)<br />
You have to accept not testing the legacy code; but you can wrap the calls to this legacy code and run tests against this wrapping api.</p>
<p>Running late ? drop features or test the happy path / test only the core(reduce the scope)<br />
Broken build ? fix the test or disable/delete the test (some -legacy-tests can be wrong and their impact may be even worse than not having tests at all)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/02/29/confoo2012-tdd-and-getting-paid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : Implanter l&#8217;AOP&#8230; comment partir du bon pied?</title>
		<link>http://blog.dahanne.net/2012/02/29/confoo-2012-implanter-laop-comment-partir-du-bon-pied/</link>
		<comments>http://blog.dahanne.net/2012/02/29/confoo-2012-implanter-laop-comment-partir-du-bon-pied/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 22:04:49 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=622</guid>
		<description><![CDATA[<p>Par Félix-Antoine Bourbonnais, Mardi 29 Février</p> <p>La programmation orientée aspect permet d&#8217;injecter des appels de méthodes (Logger.log() par exemple), avant/après/autour, par exemple des appels aux méthodes commençant par start.</p> <p>AspectJ peut fonctionner en 2 modes : compile time (il faut utiliser son tisseur/weaver pour compiler) ou au runtime en utilisant un agent (ce qui peut [...]]]></description>
			<content:encoded><![CDATA[<p><em>Par <a href="http://developpementagile.com/">Félix-Antoine Bourbonnais</a>, Mardi 29 Février</em></p>
<p>La programmation orientée aspect permet d&#8217;injecter des appels de méthodes (Logger.log() par exemple), avant/après/autour, par exemple des appels aux méthodes commençant par start.</p>
<p>AspectJ peut fonctionner en 2 modes : compile time (il faut utiliser son tisseur/weaver pour compiler) ou au runtime en utilisant un agent (ce qui peut permettre d&#8217;appliquer ses aspects sur du code tierce)</p>
<p>Spring AOP par contre est un cadre applicatif AOP pur java.</p>
<p>Parce l&#8217;AOP n&#8217;a pas décollé ?</p>
<ul>
<li>Mauvaises raisons et utilisations</li>
<li>Complexité puisqu&#8217;on sait difficilement si le comportement de notre code va être modifié par des aspects</li>
<li>Manque de support et d&#8217;intégration / manque de connaissance</li>
<li>Trop de promesses</li>
</ul>
<p>Outillage AspectJ :</p>
<ul>
<li>on peut construire avec Maven (attention à ne pas ré instrumenter le code avec du code coverage&#8230;)</li>
<li>et on a une intégration dans Eclipse avec AJDT.</li>
</ul>
<p>Il ne faut pas utiliser l&#8217;AOP pour cacher des problèmes de design ou pire, créer des problèmes de design.</p>
<p>Bonnes pratiques :</p>
<ul>
<li>garder les bonnes pratiques orientées objet</li>
<li>ne pas oublier qu&#8217;un aspect va coupler du code (attention aux dépendances circulaires et la séparation des responsabilités du code)</li>
<li>les classes sur lesquelles l&#8217;aspect va opérer, doivent elles en être &laquo;&nbsp;conscientes&nbsp;&raquo; (lisibilité, en utilisant des annotations)</li>
</ul>
<p>Tester des aspects : un aspect n&#8217;est pas du code java pur : il est nécessaire de coder 1 &laquo;&nbsp;pot de miel&nbsp;&raquo; et vérifier que les appels des aspects ont bien été exécutés ET CECI aux bons endroits (pointcut)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/02/29/confoo-2012-implanter-laop-comment-partir-du-bon-pied/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : JVM Internal for Dummies</title>
		<link>http://blog.dahanne.net/2012/02/29/confoo-2012-jvm-internal-for-dummies/</link>
		<comments>http://blog.dahanne.net/2012/02/29/confoo-2012-jvm-internal-for-dummies/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 18:04:01 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=614</guid>
		<description><![CDATA[<p>This talk was given by Charles Nutter, full time JRuby developer</p> <p>The slides are are on slideshare .</p> How the JVM&#8217;s JIT work Monitring theJIT Finding problems Dumping assembly (don&#8217;t be scared) <p>So intense (slides with x86 assembly code !) I could not take any notes :-p but really insightful !</p> [...]]]></description>
			<content:encoded><![CDATA[<p><em>This talk was given by <a href="http://blog.headius.com">Charles Nutter</a>, full time <a href="http://jruby.org/">JRuby</a> developer</em></p>
<p>The slides are are on <a href="http://www.slideshare.net/CharlesNutter/redev-2011-jvm-jit-for-dummies-what-the-jvm-does-with-your-bytecode-when-youre-not-looking">slideshare</a> .</p>
<ul>
<li>How the JVM&#8217;s JIT work</li>
</ul>
<ul>
<li>Monitring theJIT</li>
</ul>
<ul>
<li>Finding problems</li>
</ul>
<ul>
<li>Dumping assembly (don&#8217;t be scared)</li>
</ul>
<p>So intense (slides with x86 assembly code !) I could not take any notes :-p but really insightful !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/02/29/confoo-2012-jvm-internal-for-dummies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confoo 2012 : Continuous Delivery at speed</title>
		<link>http://blog.dahanne.net/2012/02/29/confoo-2012-continuous-delivery-at-speed/</link>
		<comments>http://blog.dahanne.net/2012/02/29/confoo-2012-continuous-delivery-at-speed/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 15:41:53 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[confoo2012]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=609</guid>
		<description><![CDATA[<p>Presentation given by Joseph Wilk  (co developer of Cucumber, work on Songkick.com) on Tuesday, 29th February</p> <p>His presentation was about about :</p> for sure, continuous integration : build small pieces of work, continuously continuous deployment, putting your process in flow. Continuous delivery is the addition of those 2 concepts. <p>As a joke Joseph reminded us [...]]]></description>
			<content:encoded><![CDATA[<p><em>Presentation given by <a href="https://twitter.com/#!/josephwilk">Joseph Wilk</a>  (co developer of <a href="http://cukes.info/">Cucumber</a>, work on<a href="http://www.songkick.com/"> Songkick.com</a>) on Tuesday, 29th February</em></p>
<p>His presentation was about about :</p>
<ul>
<li>for sure, continuous integration : build small pieces of work, continuously</li>
<li>continuous deployment, putting your process in flow.</li>
<li>Continuous delivery is the addition of those 2 concepts.</li>
</ul>
<p>As a joke Joseph reminded us how we could do some primal sort of continuous delivery : ssh to the server and edit the files with Vim <img src='http://blog.dahanne.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   change is immediate !</p>
<p>To bring back the fun to software engineering practice, Joseph suggests that the delivery process should be faster (today there are too many barriers with CI, QA, etc..)</p>
<p>Tooling ?</p>
<ul>
<li>Heroku is a tool that deploys your code from your SCM, pushes it to prod, restart the server; it is fun but&#8230; dangerous .</li>
</ul>
<ul>
<li>Joseph showed us then a tool that, once you save, runs the tests and deploys the code to the live server (why hacking directly with VIM could not work after all ?)</li>
</ul>
<ul>
<li>To add safety, he can also deploy to a different web server, on the same live production machine, but running on a different port : the ability to change and experiment, having a live feedback.</li>
</ul>
<p>What if some code breaks the site ? does it matter if it is the about page that gets 1% of the traffic, in a month is broken ? you can balance the risks with metrics on your website visits for example.</p>
<p>Thinking bigger : when failure is not an option anymore : if you don&#8217;t trust your tests, what can you do to be confident on them so that you are also confident about the quality of the code when your tests is green ? smoke tests, acceptance tests, etc..</p>
<p>Some users want a stable experience visiting your website; others volunteer to beta software : those last ones can accept some broken pages.</p>
<p>Joseph is using at his work a Jenkins CI server to run series of tests : unit tests, acceptance tests (using selenium) recording the run of tests on a flash video file that you can replay. (using a python tool)</p>
<p>With <a href="http://www.heroku.com/">Heroku</a>, you can use a &laquo;&nbsp;one button deploy&nbsp;&raquo;, same thing with Jenkins (anyone in the company can deploy ) it triggers a build that will run the tests before deploying</p>
<p>Joseph also uses <a href="http://www.zabbix.com/">Zabbix</a> : to monitor CPU, memory, requests : data that gives you immediate feedback.</p>
<p>Zero downtime releases : no sense to deploy if it takes your website down for 10 minutes</p>
<ul>
<li>canary deploy : use your load balancer to redirect 1% of your traffic to the new code</li>
<li>bug : if you can deploy quicky, then that also means you can fix bugs fast</li>
</ul>
<p>Joseph asked himself this question from the Poppendieck : how long does it take for a single line of code to be deployed : Joseph was sad to discover that it could be as long as 2 days (he did find 2 days a long time ! !!); a reason for this can be because of all your dependencies : you can try to use libraries (such as rails, will be upgraded every 6 months or so), artifacts (such as ruby gems or debian packages : every machine can get the latest packages from an artifact server) to focus on your business code.</p>
<p>Fast is scary ; but using all this discipline (automated tests running on every commit): fast is fun</p>
<p>&nbsp;</p>
<h3>Q&amp;A :</h3>
<ul>
<li>can you balance the fun of deploying quickly vs the money you can loose on failure : it depends on your environment, you have to make compromises; tests give you confidence : unit tests, acceptance test, smoke tests; about the infrastructure cost : usually it is not that high; about resources : if you want good developers , you have to help them make their work fun, so continuous deployment can help you hire the best developers</li>
<li>How long did it take for you to put this infrastructure up : about a year, progressively</li>
<li>Do you use code coverage : use it as a guidance : you can prefer more fine grained metrics such as logs, <a href="http://docs.seattlerb.org/heckle/">parameters permutation with heckle</a>, etc&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/02/29/confoo-2012-continuous-delivery-at-speed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating and applying a patch for an Eclipse project with Git, part 2 : using github</title>
		<link>http://blog.dahanne.net/2012/01/19/creating-and-applying-a-patch-for-an-eclipse-project-with-git-part-2-using-github/</link>
		<comments>http://blog.dahanne.net/2012/01/19/creating-and-applying-a-patch-for-an-eclipse-project-with-git-part-2-using-github/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 00:18:11 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[tycho]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=580</guid>
		<description><![CDATA[<p>In a recent post, I described how to contribute a patch to an eclipse project using git as its version control system.</p> <p>Patches are OK, but you lack all the social aspect that is enabled with git and its tooling (be it pure git + gerrit or github with the comments on commits and pull [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent post, <a href="http://blog.dahanne.net/2011/10/05/creating-and-applying-a-patch-for-an-eclipse-project-with-git/" title="Creating and applying a patch for an Eclipse project with Git">I described how to contribute a patch to an eclipse project using git as its version control system</a>.</p>
<p>Patches are OK, but you lack all the social aspect that is enabled with git and its tooling (be it pure git + <a href="https://code.google.com/p/gerrit/" title="Gerrit">gerrit </a>or github with the comments on commits and <a href="http://help.github.com/send-pull-requests/" title="Github pull requests">pull requests</a>)</p>
<p>As of today, pull requests are not accepted by Eclipse committers since they lack IP (Intellectual Property) information, and <a href="https://git.eclipse.org/c/" title="Eclipse git repositories">the official git repositories at eclipse are hosted by the foundation</a> not on github (github repositories of Eclipse projects exist for mirroring only).</p>
<p>Recently talking with a committer on the <a href="http://www.eclipse.org/tycho/" title="Eclipse Tycho">Eclipse Tycho project</a> (Tobias Oberlies not to name him), he suggested to me to share my contributions via github, instead of attaching patches,  <a href="http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions" title="Handling Git contributions at Eclipse">as long as the git contribution scenario is followed</a></p>
<p>To comply with this suggestion, </p>
<h4>1. I would clone the official repository at git.eclipse.org</h4>
<pre class="bash">git clone http://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git</pre>
<h4>2. work on my changes, test them, add them, and commit them for each functional change</h4>
<pre class="bash">git add myfile1 myfile2</pre>
<pre class="bash">git commit -m "BZ xxxxxx : comment"</pre>
<h4>3. <a href="http://help.github.com/create-a-repo/" title="Create a  new repository on Github">create a new repository on my github account</a></h4>
<p><a href="http://blog.dahanne.net/wp-content/uploads/Create-a-New-Repository-GitHub-Mozilla-Firefox_2012-01-19_13-10-05.png"><img src="http://blog.dahanne.net/wp-content/uploads/Create-a-New-Repository-GitHub-Mozilla-Firefox_2012-01-19_13-10-05-300x211.png" alt="" title="Create a New Repository - GitHub" width="300" height="211" class="alignnone size-medium wp-image-584" /></a></p>
<h4>4. synchronize my new github repo with the official tycho repository</h4>
<pre class="bash">git remote add origin.github git@github.com:anthonydahanne/org.eclipse.tycho.git</pre>
<p>&laquo;&nbsp;behind proxy&nbsp;&raquo; users can use https access instead, </p>
<pre class="bash">git remote add origin.github  https://anthonydahanne@github.com/anthonydahanne/org.eclipse.tycho.git</pre>
<h4>5. push my committed changes to my github repository</h4>
<pre class="bash">git push -u origin.github master</pre>
<h4>6. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=351487#c30" title="Add a comment to a bugzilla entry to share the github commit ids">add a comment to the bugzilla entry describing the fix or new feature I worked on, giving the github commit id</a></h4>
<h4>7. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=357503#c9" title="Accept IP terms of the eclipse foundation">accept the IP conditions of the Eclipse foundation</a></h4>
<p>That&#8217;s it ! you just contributed some code to a cool Eclipse project !<br />
OK, it seems more complicated than just submitting a patch or a pull request, but once your local repo is set up,<br />
you should have something like :</p>
<pre class="bash">git remote -v
origin  http://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git (fetch)
origin  http://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git (push)
origin.github   https://anthonydahanne@github.com/anthonydahanne/org.eclipse.tycho.git (fetch)
origin.github   https://anthonydahanne@github.com/anthonydahanne/org.eclipse.tycho.git (push)</pre>
<p> and it is just a matter of juggling between the original repo, synchronizing the latest changes</p>
<pre class="bash">git pull origin master</pre>
<p> and the github repo (pushing the latest changes)</p>
<pre class="bash">git push origin.github master</pre>
<p>and copying/pasting the commit ids to the bugzilla entry.</p>
<p>I&#8217;m still relatively new to Git, so if you think there are better ways to sync the repositories, then please add a comment to this post !</p>
<h3>To go deeper on that topic :</h3>
<ul>
<li><a href="http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users">http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users</a></li>
<li>
<a href="http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions">http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions</a></li>
<li>
<a href="http://wiki.eclipse.org/Tycho/Contributor_Guide#Contributing_the_Patch">http://wiki.eclipse.org/Tycho/Contributor_Guide#Contributing_the_Patch</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2012/01/19/creating-and-applying-a-patch-for-an-eclipse-project-with-git-part-2-using-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sécuriser son serveur dédié : quelques conseils</title>
		<link>http://blog.dahanne.net/2011/11/19/securiser-son-serveur-dedie-quelques-conseils/</link>
		<comments>http://blog.dahanne.net/2011/11/19/securiser-son-serveur-dedie-quelques-conseils/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 16:03:35 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[outils]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=571</guid>
		<description><![CDATA[<p>Assomption avant de commencer : Bien entendu, vous êtes à jour des derniers correctifs de sécurité de l&#8217;ensemble de vos services&#8230;</p> <p>En lisant un article faisant référence à un serveur mal sécurisé ; j&#8217;ai été pris de quelques doutes : et si mon serveur dédié était lui aussi mal sécurisé ? Étant développeur et adepte [...]]]></description>
			<content:encoded><![CDATA[<p><em>Assomption avant de commencer</em> : Bien entendu, <strong>vous êtes à jour des derniers correctifs de sécurité de l&#8217;ensemble de vos services&#8230;</strong></p>
<p>En lisant un article <a href="http://reflets.info/doxump-ca-sent-mauvais/">faisant référence à un serveur mal sécurisé</a> ; j&#8217;ai été pris de quelques doutes : et si mon serveur dédié était lui aussi mal sécurisé ?<br />
Étant développeur et adepte de l&#8217;auto hébergement (oui je ne suis pas un grand fan des services hébergés chez les géants du net avec leurs clauses de confidentialité obscures&#8230;) je fais évoluer mon serveur dédié (services qui tournent dessus) au rythme de mes besoins&#8230; ce qui fait que la sécurité passe souvent au second plan&#8230;<br />
Et rien de tel que de jeter un coup d’œil à la sécurisation de ces services de temps en temps&#8230;</p>
<h3>Audit rapide et efficace</h3>
<p>On commence avec nmap, avec les options qui vont bien :</p>
<pre class="bash">sudo nmap -A mon.serveurdedie.fr</pre>
<p>On peut alors commencer à l&#8217;analyse du résultat, et à remédier aux problèmes.</p>
<h3>DNS et Bind</h3>
<p>Dans le rapport obtenu par nmap, si vous voyez :</p>
<pre>| dns-zone-transfer:</pre>
<p>et ensuite la liste de vos sous domaines; méfiance, cela veut dire que quiconque peut lister vos sous domaines; pas forcément une bonne idée si certains d&#8217;entre eux sont là pour des tests ou pour des services non publics&#8230;</p>
<h4>Les solutions</h4>
<pre>Rendez vous dans votre fichier de configuration de bind, /etc/bind/named.conf.options, et ajouter les options suivantes :
 allow-transfer { x.x.x.x; }; --&gt; uniquement donner accès aux informations détaillées des zones à cette IP (votre dns secondaire)
 version "Ma version"; --&gt; pourrait derouter certaines attaques en offuscant la version de Bind; mais comme disent certains, l'obfuscation est rarement une bonne méthode de sécurisation...
 fetch-glue no; --&gt; défendre votre serveur dns aux attaques de type déni de service
 recursion no; --&gt; défendre votre serveur dns aux attaques de type déni de service</pre>
<p>Ces informations sont issues d&#8217;un <a href="http://www.techrepublic.com/article/secure-bind-with-these-tips/5716787">article de TechRepublic</a> , et n&#8217;hésitez pas à vérifier votre configuration avec <a href="http://www.zonecheck.fr/">zonecheck</a></p>
<h3>HTTP et Apache</h3>
<p>Dans le rapport obtenu par nmap, si vous voyez :</p>
<pre>80/tcp  open     http         Apache httpd 2.2.9 ((Debian) DAV/2 SVN/1.5.1 PHP/5.2.6-1+lenny13 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2)</pre>
<p>Et bien cela signifie que votre serveur est très bavard&#8230;</p>
<h4>La solution</h4>
<p>Sur Ubuntu, dirigez vous vers /etc/apache2/conf.d/security et éditez :</p>
<pre>ServerTokens Prod</pre>
<pre>ServerSignature Off</pre>
<pre>TraceEnable Off</pre>
<p>Si vous utilisez PHP, faites aussi un tour du côté de  /etc/php5/apache2/php.ini</p>
<pre>expose_php = Off</pre>
<p>Encore une fois, l’offuscation n&#8217;est pas une méthode de sécurisation en soit, mais moins les potentiels attaquants en savent, mieux c&#8217;est&#8230;<br />
Ces informations sont issues de <a href="http://www.debianadmin.com/apache-tipshide-apache-information-php-software-version.html">DebianAdmin</a></p>
<h3>SSH et OpenSSH</h3>
<p>Pour l&#8217;instant je ne peux que conseiller de lire cet article : <a href="http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html">http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html </a></p>
<p>à suivre&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/11/19/securiser-son-serveur-dedie-quelques-conseils/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating and applying a patch for an Eclipse project with Git</title>
		<link>http://blog.dahanne.net/2011/10/05/creating-and-applying-a-patch-for-an-eclipse-project-with-git/</link>
		<comments>http://blog.dahanne.net/2011/10/05/creating-and-applying-a-patch-for-an-eclipse-project-with-git/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 03:23:35 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=546</guid>
		<description><![CDATA[<p>Since its move to git, contributing to the Eclipse foundation projects is a bit different.</p> <p>Nothing terrible actually, let&#8217;s take the example of a contribution to the p2 project (part of the equinox umbrella at the Eclipse foundation)</p> Checkout the project git clone http://git.eclipse.org/gitroot/equinox/rt.equinox.p2.git do the changes and then commit them to your local repo [...]]]></description>
			<content:encoded><![CDATA[<p>Since its move to git, contributing to the Eclipse foundation projects is a bit different.</p>
<p>Nothing terrible actually, let&#8217;s take the example of a contribution to the p2 project (part of the equinox umbrella at the Eclipse foundation)</p>
<ul>
<li>Checkout the project</li>
</ul>
<pre class="bash">git clone http://git.eclipse.org/gitroot/equinox/rt.equinox.p2.git</pre>
<ul>
<li>do the changes and then commit them to your local repo (you can perform this step several times)</li>
</ul>
<pre class="bash">git commit</pre>
<ul>
<li>create the patch against the master branch</li>
</ul>
<pre class="bash">git format-patch origin</pre>
<p>You  will get a file for each commit you submitted, so one commit =  one patch file.</p>
<p>You can attach your patch(es) to a bugzilla entry, for example , <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304594">make p2 buildable with tycho (click on one of the patches)</a></p>
<ul>
<li>what an eclipse committer will do then , is apply your patch to its local repo to test everything is ok</li>
</ul>
<pre class="bash">git apply 0001-my-patch.patch</pre>
<p>That&#8217;s pretty much it ! A bit more tedious than a Github pull request, but it does the job !</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/10/05/creating-and-applying-a-patch-for-an-eclipse-project-with-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run UI tests on a headless Jenkins / Hudson Continuous Integration server running Ubuntu</title>
		<link>http://blog.dahanne.net/2011/07/18/run-ui-tests-on-a-headless-jenkins-hudson-continuous-integration-server-running-ubuntu/</link>
		<comments>http://blog.dahanne.net/2011/07/18/run-ui-tests-on-a-headless-jenkins-hudson-continuous-integration-server-running-ubuntu/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 03:43:59 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tycho]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=535</guid>
		<description><![CDATA[<p>If you want to set up a ci build, running ui tests, on a box without any windowing system, you need to pay attention to a few details, here are some of  them :</p> Set up your ubuntu box and Jenkins/Hudson <p>On your ubuntu box :</p> <p># apt-get install vnc4server fluxbox</p> <p>Vnc4server is a free [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to set up a ci build, running ui tests, on a box without any windowing system, you need to pay attention to a few details, here are some of  them :</p>
<h3>Set up your ubuntu box and Jenkins/Hudson</h3>
<p>On your ubuntu box :</p>
<p><code># apt-get install vnc4server fluxbox</code></p>
<p>Vnc4server is a free vnc server, that will act as your X environment, and fluxbox is a tiny window manager; more than enough for UI testing.</p>
<p>In Jenkins / Hudson, Manage Jenkins -&gt; Plugins -&gt; Install new plugins, choose the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin">xvnc plugin </a></p>
<p><a href="http://blog.dahanne.net/wp-content/uploads/S%C3%A9lection_001.png"><img class="alignnone size-medium wp-image-542" title="xvnc plugin" src="http://blog.dahanne.net/wp-content/uploads/S%C3%A9lection_001-300x38.png" alt="" width="300" height="38" /></a></p>
<div>In your job that launches UI tests (in my case it was Eclipse Equinox UI tests launched by a tycho build), tick the box &laquo;&nbsp;Run xvnc during build&nbsp;&raquo;</div>
<div>Now launch your job, you will run into this problem :</div>
<pre class="bash">Starting xvnc [workspace] $ vncserver :10 You will require a password to access your desktops. getpassword error: Invalid argument Password:Starting xvnc [workspace]</pre>
<div>etc&#8230; until vncserver :13</div>
<div>It is because you need to launch vncserver interactively, at least once, to setup a password; connect to your ubuntu box and:</div>
<pre class="bash"># su jenkins
$ vncserver :10You will require a password to access your desktops.

Password:
Verify:
Password too long - only the first 8 characters will be used
xauth:  creating new authority file /var/lib/jenkins/.Xauthority

New 'host:10 (jenkins)' desktop is host:10

Creating default startup script /var/lib/jenkins/.vnc/xstartup
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/host:10.log</pre>
<div>
<div>Once this is done, re launch your job :</div>
<pre class="bash">[workspace] $ vncserver :14

New 'host:14 (jenkins)' desktop is host:14 Starting applications specified in /var/lib/jenkins/.vnc/xstartup Log file is /var/lib/jenkins/.vnc/host:14.log</pre>
<div>and your build goes on, able to create a UI during the tests !</div>
</div>
<h3>Have a look at the tested UI while the tests are running</h3>
<p>This can be very useful whenever your UI gets stuck (waiting on a dialog to be closed &#8230;, in my case I run into the issue of launching an eclipse runtime, and a plugin, Google ADT, was asking to confirm whether or not I wanted to upload usage data&#8211; hopefully only the first time) during the tests.</p>
<div>To do so, you first have to know what is the port xvnc is listening to :</div>
<pre class="bash"># ps aux |grep "vnc"
jenkins  29591  0.0  0.7  33192 14104 ?        S    21:10   0:00 Xvnc4 :14 -desktop host:14 (jenkins) -auth /var/lib/jenkins/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /var/lib/jenkins/.vnc/passwd -rfbport 5914 -pn -fp /usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,/usr/share/fonts/X11/100dpi/ -co /etc/X11/rgb</pre>
<p>OK, looks like xvnc is listening on port 5914 in this case.<br />
You can then use a vnc viewer (on ubuntu, vinagre is a good choice) of your choice to connect to your ubuntu box on port 5914.<br />
If the ubuntu box has firewall rules impeding you to connect to 5914, then set up a ssh tunnel :</p>
<p><code>$ ssh -L 5914:localhost:5914 anthony@ubuntubox</code><br />
then connect your vnc viewer to localhost:5914 , and the magic begins !</p>
<p><a href="http://blog.dahanne.net/wp-content/uploads/S%C3%A9lection_002.png"><img class="alignnone size-medium wp-image-543" title="Seeing the UI tested in Hudson /  Jenkins through vnc" src="http://blog.dahanne.net/wp-content/uploads/S%C3%A9lection_002-215x300.png" alt="" width="215" height="300" /></a></p>
<p>&nbsp;</p>
<h3>A concrete example :  m2eclipse-android-integration in Jenkins</h3>
<p>I actually set up this configuration for the m2eclipse-android-integration project; this project is an eclipse plugin, that extends the capability of m2eclipse to android projects, here is the link to the<a href="http://ci.dahanne.net/"> Jenkins hosting this job</a></p>
<p>The author, <a href="http://rgladwell.wordpress.com/">Ricardo Gladwell</a>, designed exclusively integration tests on the UI, since most of the functionality of this eclipse plugin is UI contribution.</p>
<p>Here are the specific problems I met while setting up this job in Jenkins :</p>
<ul>
<li>as I previously mentioned, the first time I launched the job against this project, once all the tests passed, the tycho surefire plugin step would not stop&#8230; actually the Google ADT plugin in Eclipse, was asking to confirm whether or not I wanted to upload usage data, so I connected to the UI and clicked &laquo;&nbsp;ok&nbsp;&raquo;;  vnc saved the day&#8230;</li>
<li>the tests were relying on android projects, requiring to have among the latest Android libraries; to be up to date (so that the tests would not fail), I had to run the command :</li>
</ul>
<p><code>$ android update sdk --no-ui --obsolete --force</code></p>
<p>Overall, that was a good exercise to practice CI on a UI project.</p>
<p>Links :</p>
<div>
<ul>
<li><a href="https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin">The Hudson / Jenkins xVNC plugin</a>\</li>
<li><a href="http://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/">m2eclipse-android-integration on google code</a> and now <a href="http://rgladwell.github.com/m2e-android/">m2e-android on github</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/07/18/run-ui-tests-on-a-headless-jenkins-hudson-continuous-integration-server-running-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NAS Synology : pour les sauvegardes et pour diffuser les médias</title>
		<link>http://blog.dahanne.net/2011/07/11/nas-synology-pour-les-sauvegardes-et-pour-diffuser-les-medias/</link>
		<comments>http://blog.dahanne.net/2011/07/11/nas-synology-pour-les-sauvegardes-et-pour-diffuser-les-medias/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 23:58:27 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[outils]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=526</guid>
		<description><![CDATA[<p>Séduit par l&#8217;idée d&#8217;un boîtier pour effectuer mes sauvegardes à faible coût, faible consommation énergétique, faible encombrement, en ligne 24h/24, j&#8217;ai récemment fait l&#8217;acquisition d&#8217;un NAS (Network Attached Storage); et c&#8217;est assez naturellement que je me suis tourné vers Synology, un des (sinon le) incontournables du marché (l&#8217;utilisation de Linux BusyBox et d&#8217;une multitude de [...]]]></description>
			<content:encoded><![CDATA[<p>Séduit par l&#8217;idée d&#8217;un boîtier pour effectuer mes sauvegardes à faible coût, faible consommation énergétique, faible encombrement, en ligne 24h/24, j&#8217;ai récemment fait l&#8217;acquisition d&#8217;un <a href="http://fr.wikipedia.org/wiki/Stockage_en_r%C3%A9seau_NAS">NAS (Network Attached Storage)</a>; et c&#8217;est assez naturellement que je me suis tourné vers <a href="http://www.synology.com/index.php?lang=fre">Synology</a>, un des (sinon le) incontournables du marché (l&#8217;utilisation de Linux BusyBox et d&#8217;une multitude de logiciels libres n&#8217;y est sans doute pas pour rien !); j&#8217;ai opté pour le DS211J, qui dispose de 2 baies à disque SATA; pour l&#8217;instant je n&#8217;y aie inséré qu&#8217;un disque de 1.5 To.</p>
<p>Mon objectif premier est de réaliser des sauvegardes robustes, la cerise sur le gâteau (ou sundae) est le fait de pouvoir consulter mes fichiers multimédias sur mon téléviseur (via une vieille XBOX avec <a href="http://xbmc.org/">XBMC</a> et/ou une PS3)</p>
<h3>Architecture de sauvegarde robuste</h3>
<p>On réalise des sauvegardes, car on ne veut pas perdre des années de photo, de travail sur documents multimédia (montages vidéos) ses documents personnels (impôts, etc..).</p>
<p>La majorité des utilisateurs sauvegarde leurs fichiers vers un disque dur externe, quand ils y pensent&#8230;</p>
<p>Cette approche là est résolument insatisfaisante : il faut automatiser (fréquence) le processus de sauvegarde (donc avoir du matériel toujours disponible pour effectuer la sauvegarde) et aussi diversifier ses lieux de sauvegarde (tout sauvegarder sur des supports qui se trouvent au même endroit que les originaux ouvre la porte à une perte de donnés en cas d&#8217;inondation, incendie, cambriolage, etc&#8230;)</p>
<p>Je vais décrire ici comment utiliser un NAS Synology pour :</p>
<ul>
<li>y sauvegarder ses documents (les machines du réseau local, dans notre cas sous Ubuntu, vont sauvegarder vers le NAS)</li>
<li>synchroniser ces sauvegardes vers une machine distante (le NAS va synchroniser les sauvegardes vers une machine dans un data center)</li>
<li>y sauvegarder des sites internet et boîtes courriels hébergés sur un serveur distant (une machine dans un data center va sauvegarder ses données vers le NAS)</li>
</ul>
<p>Enfin, je décrirai quelques astuces pour profiter de son NAS en serveur multimédia.</p>
<h3>Sauvegarde entre les ordinateurs locaux et le NAS</h3>
<p>Il existe un excellent article qui introduit ce propos <a href="http://forum.synology.com/wiki/index.php/Backup_Linux_desktop_data_using_rsync">sur le wiki de Synology</a>; ceci dit la technique est la même que celle que <a href="http://blog.dahanne.net/2008/02/16/solution-de-sauvegarde-locale-et-distante-avec-rsync/">j&#8217;avais décrit pour des sauvegardes distantes</a>.</p>
<p>Mon objectif est ici de sauvegarder mon home directory (/home/anthony en excluant tous les .*) et rien d&#8217;autre<br />
Voici mes remarques et ajouts :</p>
<ul>
<li>Depuis l&#8217;interface graphique de votre NAS, rendez vous dans Panneau de configuration&gt;Utilisateur, sélectionnez votre utilisateur et appuyez et cocher &laquo;&nbsp;Accueil Utilisateur&nbsp;&raquo; (une traduction sympathique de Home directory :-p) , vous disposez maintenant d&#8217;un répertoire personnel dans /volume1/homes/votre_utilisateur</li>
<li>la première étape est la création d&#8217;une clef (DSA, c&#8217;est important, RSA n&#8217;a pas marché chez moi&#8230;) sans mot de passe; utilisez la série de commande standard suivantes, dans mon cas :</li>
</ul>
<p><code>ssh-keygen -t dsa -b 1024 -f ~/.ssh/diskstation</code></p>
<p>(pas de mot de passe, il serait difficile de gérer des sauvegardes non interactives avec un mot de passe, vérifiez quand même que votre clef .ssh/diskstation est en 600)</p>
<ul>
<li>Maintenant envoyer la clef publique à votre NAS :</li>
</ul>
<p><code>ssh-copy-id -i .ssh/diskstation.pub anthony@diskstation</code></p>
<ul>
<li>Tester la connexion à votre NAS en utilisant la clef : (attention, il est fort possible que votre utilisateur n&#8217;aie pas de shell utilisable par défaut; connectez vous alors via SSH en tant que root (même mot de passe que admin) à votre NAS et éditez /etc/passwd, sur la ligne correspondant à votre utilisateur, remplacez /sbin/login par /bin/ash ; l’interpréteur de commandes par défaut)</li>
</ul>
<p><code>ssh -i .ssh/diskstation diskstation</code></p>
<p>vous devriez arriver, sans mot de passe, dans le répertoire /volume1/homes/votre_utilisateur de votre NAS.</p>
<ul>
<li>rsync pour sauvegarder, la commande est assez simple :</li>
</ul>
<p><code>rsync -avz --delete /home/anthony/ --exclude=.* diskstation:/volume1/homes/anthony/sauvegarde</code></p>
<ul>
<li>sauf que le vrai défi avec les sauvegardes, c&#8217;est qu&#8217;il faut qu&#8217;elles soient automatiques, et lancées périodiquement ! ce bon vieux cron est encore une fois notre ami :</li>
</ul>
<p><code>vim sauvegarde.ssh</code></p>
<p>on y écrit :</p>
<pre class="bash">#!/bin/sh
rsync -avz --delete --exclude=.*  -e "ssh -i /home/anthony/.ssh/diskstation"   /home/anthony/  diskstation:/volume1/homes/anthony/x60s</pre>
<p><code>chmod +x</code></p>
<p>on peut tester :</p>
<p><code> ./sauvegarde.sh</code></p>
<p>et enfin le rajouter à la crontab :</p>
<p><code>sudo vim /etc/crontab</code></p>
<p>et rajouter la ligne (pour lancer la sauvegarde tous les Dimanche à 2h00) :</p>
<pre class="bash"># m h dom mon dow user  command
0 2    * * 7   anthony      /home/anthony/sauvegarde.sh</pre>
<ul>
<li>Répétez cette opération pour tous les postes du réseau local.</li>
</ul>
<p>Tout devrait bien se passer quotidiennement, à surveiller que tout est bien en place quand le disque dur de l&#8217;hôte commence à faire des bruits étranges ou avant de partir en congés&#8230;</p>
<h3>Sauvegarde entre le NAS et un serveur distant</h3>
<p>Le logiciel d&#8217;administration web des NAS Synology, Disk Station Manager (DSM 3.1 au moment où j&#8217;écris) dispose d&#8217;une efficace interface d’administration, qui comporte un volet &laquo;&nbsp;Restaurer et sauvegarder&nbsp;&raquo;; nous pourrions très bien faire comme précédemment pour sauvegarder le NAS vers un serveur distant, mais autant profiter de l&#8217;interface graphique et des notifications de DSM !</p>
<p>Pour commencer, vous devez préparer votre serveur distant à recevoir les sauvegardes, dans mon cas, nous avons un utilisateur backup, avec son répertoire personnel /home/backup</p>
<p>Dans ce même répertoire personnel, nous allons y créer un fichier rsyncd.conf avec le contenu suivant :</p>
<pre class="bash">[diskstation]
comment = diskstation
path = /home/backup/diskstation
use chroot = no
read only = no
list = yes
uid = sauvegarde
gid = sauvegarde
strict modes = yes
ignore errors = no
ignore nonreadable = yes
transfer logging = no
timeout = 600
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz</pre>
<p>Grâce à ce fichier, lorsque votre NAS fera ses sauvegardes, il trouvera la configuration rsync.</p>
<p>Côté client, donc le NAS, dirigez vous vers l&#8217;interface graphique &laquo;&nbsp;Restaurer et sauvegarder&nbsp;&raquo; et créez une nouvelle sauvegarde</p>
<ul>
<li>choisissez sauvegarde réseau (compatible rsync)</li>
<li>sélectionnez toutes les options SAUF l&#8217;avant dernière (réserver les fichiers; si vous la cochez, lorsque vous supprimerez un fichier/répertoire de la source il sera gardé sur le serveur)</li>
<li>choisissez le nom de module rsync que vous avez configuré sur votre serveur distant (dans notre cas diskstation) et saisissez l&#8217;utilisateur (dans notre cas backup) ainsi que son mot de passe</li>
<li>Testez la connexion, paramétrez la fréquence</li>
</ul>
<p>Et c&#8217;est fini !</p>
<h3>Sauvegarde entre un serveur distant et le NAS</h3>
<p>Dans ce cas ci, vous devez au préalable avoir un moyen d&#8217;identifier sur internet votre nas, par exemple, DSM vient avec un client DynDNS.</p>
<p>Dans la suite du paragraphe j&#8217;assume que vous avez un nom d&#8217;hôte fixe (ou une IP fixe) pour votre NAS, et que vous pouvez y accéder par internet (pour ceci vous devrez configurer aussi les bons port forwarding [seul ssh nous intéresse dans le cas présent] depuis votre routeur ou &laquo;&nbsp;box&nbsp;&raquo;)</p>
<p>Pour le reste, c&#8217;est la même chose que ce que j&#8217;ai décrit au chapitre &laquo;&nbsp;Sauvegarde entre les ordinateurs locaux et le NAS&nbsp;&raquo; &#8230;</p>
<p>La particularité que vous pourrez rencontrer, au cas où vous sauvegarder des répertoires qui appartiennent à plusieurs utilisateurs sur le serveur distant à sauvegarder vers le NAS, est de travailler avec l&#8217;utilisateur root : c&#8217;est le seul utilisateur à pouvoir accéder à tous le système de fichiers.</p>
<p>Donc</p>
<ul>
<li>côté NAS, créez un utilisateur backup, donnez lui un répertoire personnel et l&#8217;accès via SSH;</li>
<li>côté serveur distant à sauvegarder, créez un couple de clefs pour se connecter sans mot de passe au NAS, en tant que utilisateur backup, créez un script sauvegarde.sh, qui vous rentrerez dans la crontab, à lancer par root (il pourra donc travailler sur tout le système de fichiers)</li>
</ul>
<p>procéder de cette manière vous permet de pouvoir sauvegarder tout le système de fichiers, sans jamais compromettre l&#8217;utilisateur root (pas de connexion en tant que root, ni par SSH ni par sudo, etc&#8230;)</p>
<p>&nbsp;</p>
<h3>Astuces pour la performance de votre NAS Synology</h3>
<p>Si vous avez beaucoup de photos dans le partage &laquo;&nbsp;photo&nbsp;&raquo;, vous risquez de voir un process appelé &laquo;&nbsp;convert&nbsp;&raquo; (en fait c&#8217;est imagemagick) prendre tout la mémoire vive et une bonne partie du CPU de votre Synology.</p>
<p>Ce process est lancé par le démon suivant :</p>
<p><code>/usr/syno/etc/rc.d/S77synomkthumbd.sh</code></p>
<p>donc il vous suffit, une fois connecté par ssh en root (même mot de passe que admin une fois que l&#8217;accès ssh est configuré) de lancer :</p>
<p><code>/usr/syno/etc/rc.d/S77synomkthumbd.sh stop</code></p>
<p>Si vous voulez définitivement arrêter ce service, éditez le avec vim et rajouter exit à la 2ème ligne (<a href="http://forum.synology.com/wiki/index.php/How_to_disable_the_Synology_Multimedia_Indexing_Engine">cette astuce est publiée dans le wiki de synology</a>; attention à ne pas comme eux désactiver postgresql, toutes les applications multimédia : photo, son, video, téléchargements nécessitent cette base de donnée); attention quand vous remettrez votre NAS à jour, il faudra ré effectuer l&#8217;opération (sigh!)</p>
<p>&nbsp;</p>
<h3>Diffuser des fichiers vidéos hébergés par le NAS Synology</h3>
<p>Le plus simple, si vous disposez d&#8217;un lecteur branché à la TV qui peut naviguer sur des partages Samba/CIFS (comme la vieille XBOX avec XBMC), c&#8217;est alors de configurer un dossier partagé (par défaut, un dossier partagé est un partage SMB/CIFS) contenant vos vidéos.</p>
<p>Si vous utilisez une PS3, l&#8217;approche est différente, il faut utiliser le partage médias par DLNA (car la PS3 ne peut pas monter un partage SMB/CIFS)</p>
<p>Si vous configurez votre NAS comme étant un serveur DLNA, il vous suffit d&#8217;avoir vos videos dans le partage video pour que la PS3 puisse les lire&#8230;enfin çà va bien pour les formats (container, codes audio et video) que la PS3 reconnaît nativement&#8230;</p>
<p>Pour les autres formats de video, comme par exemple container MKV encapsulant du h264, votre PS3 vous dira &laquo;&nbsp;format de fichier non compatible&nbsp;&raquo;.</p>
<p>Deux options se présentent à vous :</p>
<ul>
<li>votre PS3 utilise un firmware &laquo;&nbsp;non officiel&nbsp;&raquo;comme le CFW 3.55 kmeaw, dans ce cas vous pouvez installer le logiciel de lecture<a href="https://www.lonelycoder.com/hts/showtime_overview.html"> Showtime sur votre PS3</a>, qui non seulement lit les partages DLNA, mais est capable aussi d&#8217;ouvrir à peu près tous les containeurs vidéo et recense un bon nombre de codecs..(il repose sur libav)</li>
<li>Une autre approche, est de convertir à la volée vos fichiers vidéos dans un format que la PS3 peut ouvrir, le logiciel <a href="http://forum.synology.com/enu/viewtopic.php?f=37&amp;t=13014">PS3 Media Player semble pouvoir être installable sur un NAS Synology</a>, ceci dit je n&#8217;ai pas essayé&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/07/11/nas-synology-pour-les-sauvegardes-et-pour-diffuser-les-medias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EclipseCon 2011 blog posts : talks I attended</title>
		<link>http://blog.dahanne.net/2011/04/13/eclipsecon-2011-blog-posts-talks-i-attended/</link>
		<comments>http://blog.dahanne.net/2011/04/13/eclipsecon-2011-blog-posts-talks-i-attended/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:09:52 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=521</guid>
		<description><![CDATA[<p>From the 21st to the 24th of March, 2011, I was a lucky attendee of EclipseCon 2011.</p> <p>Lucky because it was my first time at EclipseCon, my first major conference in North America (it was located in Santa Clara, in the Californian Silicon Valley) and also because my employer, Compuware, agreed to let me go [...]]]></description>
			<content:encoded><![CDATA[<p>From the 21st to the 24th of March, 2011, I was a lucky attendee of <a href="http://www.eclipsecon.org/2011/">EclipseCon 2011</a>.</p>
<p>Lucky because it was my first time at EclipseCon, my first major conference in North America (it was located in Santa Clara, in the Californian Silicon Valley) and also because my employer,<a href="http://www.compuware.com/"> Compuware</a>, agreed to let me go there, along with 2 of my colleagues.</p>
<p>EclipseCon 2011 was great, because</p>
<ul>
<li>the main actors of the Eclipse community were there : people I may follow on twitter or ask questions to on several mailing lists; the committers of the projects I use everyday at work; being able to chat with them and ask them questions (even harass them ! no I&#8217;m kidding, I did not harass Jeff during 2 days! )</li>
<li>the talks were diversified and most of them were really interesting, you have below links to some of the talks I attended while there.</li>
</ul>
<p>Attending this conference made me also realize, maybe once more, that meeting with other developers working on the same technologies, is really inspiring, motivating, and it makes you grow technically.</p>
<p>Ok, you got the picture, I enjoyed the conf !</p>
<p>Here are some of the talks I attended:</p>
<ul>
<li>Under the provisioning (p2) and release engineering themes,</li>
</ul>
<ol>
<li><a title="Permanent Link to p2, your savior or your achilles heel? Everything an Eclipse team needs to know about p2 at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/22/p2-your-savior-or-your-achilles-heel-everything-an-eclipse-team-needs-to-know-about-p2-at-eclipsecon-2011/">p2, your savior or your Achilles heel? Everything an Eclipse team needs to know about p2 at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Discovering the P2 APIs at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/22/discovering-the-p2-apis-at-eclipsecon-2011/">Discovering the P2 APIs at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Tycho presentation and tutorial at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/21/tycho-presentation-and-tutorial-at-eclipsecon-2011/">Tycho presentation and tutorial at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Next Generation Development Infrastructure: Maven, m2eclipse, Nexus &amp; Hudson at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/22/next-generation-development-infrastructure-maven-m2eclipse-nexus-hudson-at-eclipsecon-2011/">Next Generation Development Infrastructure: Maven, m2eclipse, Nexus &amp; Hudson at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Growing an open source project one bugday at a time at EclipseCon 2011" rel="bookmark" href="../2011/03/22/growing-an-open-source-project-one-bugday-at-a-time-at-eclipsecon-2011/">Growing an open source project one bugday at a time at EclipseCon 2011</a></li>
</ol>
<ul>
<li>Under the architecture ,  performance and OSGI themes,</li>
</ul>
<ol>
<li><a title="Permanent Link to Stop the Architecture Erosion of Eclipse And Open Source Projects at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/24/stop-the-architecture-erosion-of-eclipse-and-open-source-projects-at-eclipsecon-2011/">Stop the Architecture Erosion of Eclipse And Open Source Projects at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Using and Extending Memory Analyzer into Uncharted Waters at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/23/using-and-extending-memory-analyzer-into-uncharted-waters-at-eclipsecon-2011/">Using and Extending Memory Analyzer into Uncharted Waters at EclipseCon 2011</a></li>
<li><a title="Permanent Link to OSGi introduction and OSGi 4.3 at EclipseCon2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/21/osgi-introduction-and-osgi4-3-at-eclipsecon2011/">OSGi introduction and OSGi 4.3 at EclipseCon2011</a></li>
<li><a title="Permanent Link to 10 signs you’re doing OSGi wrong at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/22/10-signs-youre-doing-osgi-wrong-at-eclipsecon-2011/">10 signs you&#8217;re doing OSGi wrong at EclipseCon 2011</a></li>
</ol>
<ul>
<li>Under the Eclipse tooling theme,</li>
</ul>
<ol>
<li><a title="Permanent Link to Android Development with Eclipse at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/22/android-development-with-eclipse-at-eclipsecon-2011/">Android Development with Eclipse at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Getting Eclipse Preferences Under Control in Teams at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/24/eclipse-preferences-under-control-in-teams-at-eclipsecon-2011/">Getting Eclipse Preferences Under Control in Teams at EclipseCon 2011</a></li>
</ol>
<ul>
<li>Other really cool talks</li>
</ul>
<ol>
<li><a title="Permanent Link to Keynote on Apache Hadoop at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/24/keynote-on-apache-hadoop-at-eclipsecon-2011/">Keynote on Apache Hadoop at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Virgo and RT playing together at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/23/virgo-and-rt-playing-together-at-eclipsecon-2011/">Virgo and RT playing together at EclipseCon 2011</a></li>
<li><a title="Permanent Link to Effective Git tutorial at EclipseCon 2011" rel="bookmark" href="http://blog.dahanne.net/2011/03/21/effective-git-tutorial-at-eclipsecon-2011/">Effective Git Tutorial</a></li>
</ol>
<p>If you want my opinion, well, I&#8217;d say that Tycho, p2, Virgo, git along with gerrit, and Eclipse Memory Analyzer were predominant topics; you could definitely not ignore them.. and not like them neither !</p>
<p>If you did not, you&#8217;ll hear from these great technologies in the next few months !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/04/13/eclipsecon-2011-blog-posts-talks-i-attended/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keynote on Apache Hadoop at EclipseCon 2011</title>
		<link>http://blog.dahanne.net/2011/03/24/keynote-on-apache-hadoop-at-eclipsecon-2011/</link>
		<comments>http://blog.dahanne.net/2011/03/24/keynote-on-apache-hadoop-at-eclipsecon-2011/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 00:33:14 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=486</guid>
		<description><![CDATA[<p>Todd introduces the audience to the world of huge datasets, what you can do with it, profiling users and customers for example.</p> <p>False assumptions learned in the last 10 years (that Hadoop has been building with this in mind)</p> Machines are reliable, Hadoop separates fault tolerance logic from code logic Machines deserve identities, I put [...]]]></description>
			<content:encoded><![CDATA[<p>Todd introduces the audience to the world of huge datasets, what you can do with it, profiling users and customers for example.</p>
<p>False assumptions learned in the last 10 years (that Hadoop has been building with this in mind)</p>
<ol>
<li>Machines are reliable, Hadoop separates fault tolerance logic from code logic</li>
<li>Machines deserve identities, I put data in a cluster, I don&#8217;t care which particular machine hosts the data; Hadoop can swap in and swap out machines across the cluster</li>
<li>Your analysis fits on one machine, Hadoop scales linearly with data size or analysis complexity</li>
</ol>
<p>A typical Hadoop installation : 5 to 4000 commodity servers (8 cores, 24 GB RAM, 4 to 12 TB hard drive; 2 levels network architecture, 20 to 40 nodes per rack)</p>
<p>The cluster nodes are composed of m</p>
<ul>
<li>master nodes : 1 NameNode  (metadata) and 1 jobtracker</li>
<li>slaves nodes  (1 to 4000 each) data nodes and tasktrackers</li>
</ul>
<p>To access the file system, you would not mount it (even if you could, with fuse), you can use an API, HDFS API (in Java)</p>
<p>Hadoop will write on chunks of 64 MB, which will get replicated across the nodes.</p>
<p>Using HDFS, you will use 2 functions : map() and reduce(); they are run on the node containing the data, so no network overhead to get the info, but HDFS can interpret bytes as key; then reduce is used to aggregate the value.</p>
<p>Hadoop is not only map/reduce, with Hive, you can also use SQL; but there are other tools on top of Hadoop, Pig (DataFlow) or Sqoop (RDBMS compatibilty)</p>
<p>Who uses Hadoop : Yahoo (&gt;82 PB, &gt;40 k machines); FaceBook, 15 TB data/day, 1200 machines; Twitter, etc&#8230;</p>
<p>Mozilla uses Hadoop to analyze crash data (FF crashes, you send a report, and they get and analyze the data)</p>
<p>Hadoop Java brings some good tooling (along with integration tools such as Apache, Ivy, etc..) but some bad things such as JVM bugs, JNI libraries to add for non standard features (specific to the OS)</p>
<p><a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2370">http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2370</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/03/24/keynote-on-apache-hadoop-at-eclipsecon-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Eclipse Preferences Under Control in Teams at EclipseCon 2011</title>
		<link>http://blog.dahanne.net/2011/03/24/eclipse-preferences-under-control-in-teams-at-eclipsecon-2011/</link>
		<comments>http://blog.dahanne.net/2011/03/24/eclipse-preferences-under-control-in-teams-at-eclipsecon-2011/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 00:07:42 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=477</guid>
		<description><![CDATA[<p>Michael began his talk remainding us that Eclipse configuration lies everywhere :</p> eclipse.ini configuration/eclipse.ini /home/.eclipse .metadata/ $project/.settings/ runtime option -vmargs &#8230; <p>Michael recommends the audience to try to configure as much as possible preferences on project level.</p> <p>You can manage team preferences documenting them in a wiki , but it is boring for the user, [...]]]></description>
			<content:encoded><![CDATA[<p>Michael began his talk remainding us that Eclipse configuration lies everywhere :</p>
<ul>
<li>eclipse.ini</li>
<li>configuration/eclipse.ini</li>
<li>/home/.eclipse</li>
<li>.metadata/</li>
<li>$project/.settings/</li>
<li>runtime option -vmargs &#8230;</li>
</ul>
<p>Michael recommends the audience to try to configure as much as possible preferences on project level.</p>
<p>You can manage team preferences documenting them in a wiki , but it is boring for the user, and also very hard to maintain.</p>
<p>Or you can use Eclipse EPF files (Eclipse Preference File), that you can import manually using the import wizard, but same drawback as wiki documentation, people forget about it.</p>
<p>Better than that, you can manage EPF files with one of those 3 tools :</p>
<ul>
<li>Eclipse Team etceteras, is a plugin that can do automatic and manual EPF import over HTTP ,set preference between workspace, and tells the user if he has not imported the EPF, suggesting him to download it</li>
</ul>
<ul>
<li>Another tool, workspace mechanic, it is a task oriented configuration engine(using Groovy, Java, or other); thing it is file system based, no possibility to transfer preferences through HTTP</li>
</ul>
<ul>
<li>Bug 334016 (Common preferences), it is an automatic EPF import over HTTP, without asking the user if he wants it</li>
</ul>
<p>Which one to choose ?</p>
<ul>
<li>just importing through HTTP, use ETE,</li>
<li>if EPF are not enough for you, use Workspace Mechanic</li>
<li>need enforcement ? use Common preferences</li>
</ul>
<p>Then we had a demo of ETE, starting eclipse in a new workspace, a dialog appeared to suggest the user to import the preferences; then changing workspace, there was a dialog to copy settings and preferences.</p>
<p><a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2057">http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2057</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/03/24/eclipse-preferences-under-control-in-teams-at-eclipsecon-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stop the Architecture Erosion of Eclipse And Open Source Projects at EclipseCon 2011</title>
		<link>http://blog.dahanne.net/2011/03/24/stop-the-architecture-erosion-of-eclipse-and-open-source-projects-at-eclipsecon-2011/</link>
		<comments>http://blog.dahanne.net/2011/03/24/stop-the-architecture-erosion-of-eclipse-and-open-source-projects-at-eclipsecon-2011/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 23:49:26 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=460</guid>
		<description><![CDATA[<p>Bernhard and Frederic began their talk defining software architecture and architectural erosion, which means that your system becomes deprecated and overloaded</p> <p>Then, Bernhard evoked Findbugs, saying that</p> back in March 2004, only 4 packages for version 0.7.2, very simple new features added for annotations for example, few months later, still looking good in May 2005, [...]]]></description>
			<content:encoded><![CDATA[<p>Bernhard and Frederic began their talk defining software architecture and architectural erosion, which means that your system becomes deprecated and overloaded</p>
<p>Then, Bernhard evoked Findbugs, saying that</p>
<ul>
<li>back in March 2004, only 4 packages for version 0.7.2, very simple</li>
<li>new features added for annotations for example, few months later, still looking good</li>
<li>in May 2005, a first cyclic dependency appeared, in the svn log, &laquo;&nbsp;temporary hack&nbsp;&raquo;appears</li>
<li>June 2006, version 1.0.0 many packages,   new cyclic dependency,</li>
<li>2009 : many, many tangles</li>
</ul>
<p>Can you still maintain easily this project ?</p>
<p>He followed his explanation with a tool called Sotoarc to show the dependency between classes and packages; he also mentioned <a href="http://www.eclipse.org/pde/incubator/dependency-visualization/">PDE dependency visualization</a></p>
<p>To check your dependency, you can perform architectural inspection with some architectural tools.</p>
<p>Then Frederic explained to the audience the critical aspect of the architectural quality of an open source project: it is used by many many consumers.</p>
<p>He then enumerated the risks of Erosion in FOSS :</p>
<ul>
<li>contributors from several organizations (different processes)</li>
<li>lower pressure from management</li>
<li>hazardous funding</li>
</ul>
<p>What about Eclipse project then ? Bernhard analyzed the architecture of JDT, and found out that the org.eclipse.ant.ui plugin uses JDT, and this dependency could have be avoided.</p>
<p>Also, duplication of code can cause problems of maintenance; he demonstrated this problem with a DialogField class in Eclipse, duplicated since 2.0</p>
<p>Frederic introduced to us the recommendations of the <a href="http://wiki.eclipse.org/Architecture_Council">Architecture Council</a>.</p>
<p>Also, some new eclipse projects, such as Orion, the web based ide, introduce new architectures.</p>
<p>To migrate your plugins from Eclipse 3.x to e4 , you have to go through an architectural modernization process which consists in auditing, testing, etc&#8230;</p>
<p>To do that, he suggests to use models to represent and manipulate artifacts of existing projects, using <a href="http://www.eclipse.org/MoDisco/">MoDisco</a>; so that you can get in EMF the model of  a plugin (sources folder, plugin.xml, etc..</p>
<p>Once you have the model represented, you can proceed to the migration of this model to the model of e4 for example.</p>
<p>You need to analyze and proceed to modernization of your tools.</p>
<p><a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2001">http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2001</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/03/24/stop-the-architecture-erosion-of-eclipse-and-open-source-projects-at-eclipsecon-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using and Extending Memory Analyzer into Uncharted Waters at EclipseCon 2011</title>
		<link>http://blog.dahanne.net/2011/03/23/using-and-extending-memory-analyzer-into-uncharted-waters-at-eclipsecon-2011/</link>
		<comments>http://blog.dahanne.net/2011/03/23/using-and-extending-memory-analyzer-into-uncharted-waters-at-eclipsecon-2011/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 22:39:11 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=482</guid>
		<description><![CDATA[<p>Vladimir first introduced to the audience problems such as:</p> Tracking memory leaks : hard to debug and leading to OutOfMemory errors Thread issues : deadlocks, exhausted threads, waiting for external resources, such as DB connection <p>To solve those problems, you can use Eclipse Memory Analyzer, which is :</p> a Java Heap Analyzer it helps find [...]]]></description>
			<content:encoded><![CDATA[<p>Vladimir first introduced to the audience problems such as:</p>
<ul>
<li>Tracking memory leaks : hard to debug and leading to OutOfMemory errors</li>
<li>Thread issues : deadlocks, exhausted threads, waiting for external resources, such as DB connection</li>
</ul>
<p>To solve those problems, you can use Eclipse Memory Analyzer, which is :</p>
<ul>
<li>a Java Heap Analyzer</li>
<li>it helps find memory leaks and reduce memory consumption</li>
<li>UI and programmatic access to data in the heap dumps</li>
<li>faster then competitors, such as JHat</li>
<li>not that intrusive (in terms of memory overhead)</li>
<li>supporting a lot of JVM (Sun, SAP, 1.4.2 and above)</li>
<li>providing an automatic problem recognition</li>
</ul>
<p>Then, on to the demo ! Dimitar,</p>
<ul>
<li>loaded a thread dump (very fast to startup)</li>
<li>showed to us some problems found by the application, such as leak suspects</li>
<li>and some views such as memory consumed by objects, the states of the threads, etc&#8230;</li>
</ul>
<p>Back to the presentation, Vladimir explained how you can extend the tool (you can extend it to save time doing the same thing repeatedly, to share view configurations, etc&#8230;)</p>
<p>There are several ways to access a snapshot</p>
<ul>
<li>through the API : ISnapshot, Iclass, IObject, IArray</li>
<li>extensions points : NameResolver (descriptions of objects) ; Query, for exploring dumps or detailed analysis, in a form of table, tree, histogram ; RequestResolver, to provide the details of what a thread is doing; Vladimir also told us about the presence of 6 other extension points</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2184">http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2184</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/03/23/using-and-extending-memory-analyzer-into-uncharted-waters-at-eclipsecon-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virgo and RT playing together at EclipseCon 2011</title>
		<link>http://blog.dahanne.net/2011/03/23/virgo-and-rt-playing-together-at-eclipsecon-2011/</link>
		<comments>http://blog.dahanne.net/2011/03/23/virgo-and-rt-playing-together-at-eclipsecon-2011/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 19:04:00 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[eclipsecon2011]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=471</guid>
		<description><![CDATA[<p>During this talk, Christopher presented the audience Virgo, part of the RT umbrella of the Eclipse Foundation</p> The virgo packages Equinox, then Virgo Kernel, then Virgo Tomcat Server or Virgo Jetty Server The Gemini project blueprint : DI Web : support for WABs and WARs JPA : persistence in OSGi DBAccess : modular JDBC drivers [...]]]></description>
			<content:encoded><![CDATA[<p>During this talk, Christopher presented the audience Virgo, part of the RT umbrella of the Eclipse Foundation</p>
<h2>The virgo packages</h2>
<ul>
<li>Equinox,</li>
<li>then Virgo Kernel,</li>
<li>then Virgo Tomcat Server or Virgo Jetty Server</li>
</ul>
<h2>The Gemini project</h2>
<ul>
<li>blueprint : DI</li>
<li>Web : support for WABs and WARs</li>
<li>JPA : persistence in OSGi</li>
<li>DBAccess : modular JDBC drivers</li>
<li>Management : JMX management (start /stop)</li>
<li>JNDI : JNDI naming in OSGi</li>
</ul>
<h2>Demo :</h2>
<p>How to extend virgo to get your own custom server</p>
<ol>
<li>Download virgo kernel and unzip it (and configure your osgi console port)</li>
<li>starts it, it looks for new applications to install; you can open an osgi console through telnet</li>
<li>add equinox.http to the ext repo, and the same for equinox servlet API bundle (2.5)</li>
<li>Configure http port , in properties, define : org.osgi.service.http.port=5555 for example</li>
<li>add the HttpService to the initial artifacts (a configuration similar to a config.ini osgi.bundles list)</li>
<li>start it, check everything is ok in the osgi console</li>
<li>You can then deploy a jar (osgi bundle) containing a servlet, configured using Spring (osgi:reference on osgi.http service); just copying it to the virgo kernel : it just works</li>
</ol>
<p>In the works :</p>
<ol>
<li>P2 integration</li>
<li>integration with Gemini projects</li>
<li>better tooling from libra project</li>
</ol>
<p>Talking to Christopher and Glynn, I also learned that : (I&#8217;m totally a virgo n00b)</p>
<ul>
<li>Virgo is like having Equinox + Spring OSGi + Jetty; BUT it also provides a unified mechanism system, using logback (and so slf4j logging APIs)</li>
<li>Virgo also solved problems such as Emphatic loading mechanism : take hibernate for example, a bundle using it would normally not be able to see the other bundles providing Hibernate based classes; that&#8217;s why they came up with this idea of dynamic bundle creation at runtime, that solves this visibility problem (c<a href="http://underlap.blogspot.com/2011/02/thread-context-class-loading-in-virgo.html">heck Glynn blog entry to know more about this problem</a>)</li>
<li>Not P2 enabled : Virgo just recently joined the Eclipse world, and since uses its own dependency and update mechanism; P2 support is high on the priority list</li>
</ul>
<p>&nbsp;</p>
<p><a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2086">http://www.eclipsecon.org/2011/sessions/?page=sessions&amp;id=2086</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2011/03/23/virgo-and-rt-playing-together-at-eclipsecon-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic

Served from: blog.dahanne.net @ 2012-05-20 21:16:03 -->
