<?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>DevOnLinux &#187; programming</title>
	<atom:link href="http://blog.devonlinux.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.devonlinux.net</link>
	<description>ICT solutions that work</description>
	<lastBuildDate>Tue, 02 Feb 2010 23:54:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Linux Foundation free webinars</title>
		<link>http://blog.devonlinux.net/2010/01/26/linux-foundation-free-webinars/</link>
		<comments>http://blog.devonlinux.net/2010/01/26/linux-foundation-free-webinars/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:32:02 +0000</pubDate>
		<dc:creator>neuromancer</dc:creator>
				<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[linux foundation]]></category>
		<category><![CDATA[webinars]]></category>

		<guid isPermaLink="false">http://blog.devonlinux.net/?p=206</guid>
		<description><![CDATA[Another great initiative from the Linux Foundation: free training webinars. Just signup here and wait until first start date. The first webinar will be dedicated to community collaboration: &#8220;How to Work with the Linux community&#8220;. How suggested by this news it will be available on 1st of March, 2010.]]></description>
			<content:encoded><![CDATA[<p>Another great initiative from the Linux Foundation: <strong>free training webinars</strong>.<br />
Just signup <a href="http://training.linuxfoundation.org/lp/sign-up-for-the-free-linux-training-webinar-series">here</a> and wait until first start date.<br />
The first webinar will be dedicated to community collaboration: &#8220;<strong>How to Work with the Linux community</strong>&#8220;.<br />
How suggested by <a href="http://www.h-online.com/open/news/item/Linux-Foundation-announces-free-training-webinar-series-913352.html">this news</a> it will be available on 1st of March, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devonlinux.net/2010/01/26/linux-foundation-free-webinars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remember jCarousel position</title>
		<link>http://blog.devonlinux.net/2009/10/10/remember-jcarousel-position/</link>
		<comments>http://blog.devonlinux.net/2009/10/10/remember-jcarousel-position/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 09:00:31 +0000</pubDate>
		<dc:creator>ed0t</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jCarousel]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.devonlinux.net/?p=104</guid>
		<description><![CDATA[In these months i have worked on an ecommerce project with a lot of products&#8217; list. Since the customer had asked a carousel solution to show her products, we have chosen for jCarousel, an amazing plugin for jQuery. jCarousel is great and highly configurable but it has a small lack: it does not remember the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-105 alignright" title="jQuery Logo" src="http://blog.devonlinux.net/wp-content/uploads/2009/09/jquery_logo.jpg" alt="jQuery logo: write less, do more" width="246" height="96" align="right" /></p>
<p>In these months i have worked on an ecommerce project with a lot of products&#8217; list. Since the customer had asked a carousel solution to show her products, we have chosen for <a title="Take a look at this amazing jQuery plugin" href="http://sorgalla.com/jcarousel/">jCarousel</a>, an amazing plugin for jQuery.</p>
<p>jCarousel is great and highly configurable but it has a small lack: it does not remember the position of the carousel when a user came back to product list page after a quick view of a product detail.</p>
<p>I came out with a simple but practical solution that solves this problem using the support of cookies.</p>
<p>To do this we need few lines of Javascript.<span id="more-104"></span></p>
<p>First of all we have to manage our cookies. We can use pure javascript or jQuery thanks to <a title="Go to jQuery Cookie plugin page" href="http://plugins.jquery.com/project/cookie">jQuery Cookie</a>. I&#8217;ll use the latter in the example above.</p>
<pre style="overflow:auto;">var inNum;
var outNum;
var COOKIE_NAME = "my_carousel_position";

// MANAGE COOKIES
function setCookie(cName, cValue, cDaysNum)
{
  var date = new Date();
  date.setTime(date.getTime() + (cDaysNum * 24 * 60 * 60 * 1000));
  $.cookie(cName, cValue, {  expires: date });
  return false;
}

function getCookie(cName)
{
  return $.cookie(cName);
}

function delCookie(cName)
{
  date = "Thu, 01-Jan-70 00:00:01 GMT";
  $.cookie(cName, null, {  expires: date });
  return false;
}
// END MANAGE COOKIES

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
  outNum = i;
  setPosition();
};

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
  inNum = i;
};

// calculate first visible item
function getFirstVisibleItemId(inNum, outNum)
{
  minVal = Math.min(inNum, outNum);
  if(inNum == minVal){
    minVal--;
  }
  return minVal;
}

//set new carousel position in cookie
function setPosition()
{
  position = getFirstVisibleItemId(inNum, outNum)
  if(position &gt;= 0 ){
    value = position+1;
    setCookie(COOKIE_NAME, value, 1);
  }
}

//retrieves carousel position from cookie
function getPosition()
{
  startVal = 1;
  var cookieVal = getCookie(COOKIE_NAME);
  if(cookieVal != ""){
    startVal = parseInt(cookieVal);
  }else{
    delCookie(COOKIE_NAME);
  }
  return startVal;
}

jQuery(document).ready(function() {
  startPosition = getPosition();
  jQuery('#mycarousel').jcarousel({
    scroll: 1,
    animation: 500,
    start: startPosition,
    itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
    itemVisibleInCallback: {onAfterAnimation: mycarousel_itemVisibleInCallback}
  });

});</pre>
<p>First of all i declare three vars. The last of the three ( <strong>COOKIE_NAME</strong> ) is the name to assign to your cookie. Next there are three functions to manage cookies using jQuery Cookie plugin: <strong>getCookie</strong>, <strong>setCookie</strong> and <strong>delCookie</strong>.</p>
<p>Next there are <strong>mycarousel_itemVisibleInCallback </strong>and <strong>mycarousel_itemVisibleOutCallback</strong>. These functions simply retrieve the position of the carousel&#8217;s edges and store them in two global vars <strong>inNum</strong> and <strong>outNum</strong> previously declared.</p>
<p>mycarousel_itemVisibleOutCallback function also calls <strong>setPosition</strong> function that stores the correct carousel start value inside the specified cookie.</p>
<p>At the end there is <strong>getPosition</strong> function, that retrieves the starting position value from the cookie. This value is assigned to <strong>start</strong> parameter inside jcarousel initialization.</p>
<p>You can see an <a title="Look at my example" href="http://blog.devonlinux.net/wp-content/uploads/examples/jcarousel/">example here</a> (i have edited an example of jCarousel website) or <a href="http://blog.devonlinux.net/wp-content/uploads/2009/10/jcarousel_with_cookie.zip">download it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devonlinux.net/2009/10/10/remember-jcarousel-position/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Eclipse Galileo problem in Karmic Koala</title>
		<link>http://blog.devonlinux.net/2009/10/09/eclipse-galileo-problem-in-karmic-koala/</link>
		<comments>http://blog.devonlinux.net/2009/10/09/eclipse-galileo-problem-in-karmic-koala/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:18:06 +0000</pubDate>
		<dc:creator>neuromancer</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[eclipse galileo]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[karmic koala]]></category>

		<guid isPermaLink="false">http://blog.devonlinux.net/?p=136</guid>
		<description><![CDATA[A few day ago I began to use Ubuntu Karmic Koala 9.10 beta on my laptop. It&#8217;s look very fine and also work great but yesterday I&#8217;ve found a big problem for me and all developer that use Eclipse as preferred IDE. The problem is that Eclipse Galileo doesn&#8217;t work right with the new version [...]]]></description>
			<content:encoded><![CDATA[<p>A few day ago I began to use <a href="http://cdimage.ubuntu.com/releases/9.10/beta/">Ubuntu Karmic Koala 9.10 beta</a> on my laptop.<br />
It&#8217;s look very fine and also work great but yesterday I&#8217;ve found a big problem for me and all developer that use Eclipse as preferred <acronym title="Integrated development environment">IDE</acronym>.</p>
<p>The problem is that <strong>Eclipse Galileo</strong> doesn&#8217;t work right with the new version of gtk (gtk+ 2.18), and therefore all the Eclipse <acronym title="Graphical user interface">GUI</acronym> is unusable.<br />
In particular I&#8217;ve noted that click of mouse are not intercepted correctly and also some interface redraw (for example if I change perspective or move some bar) doesn&#8217;t work.</p>
<p>Now, this morning I&#8217;ve found <a title="Eclipse Galileo gtk problem in Ubuntu Karmic Koala" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=291257">the bug and also a workaround</a> for the moment.<br />
Just open a terminal,  then give this command <code>export GDK_NATIVE_WINDOWS=true</code> and finally launch eclipse from the same terminal.</p>
<p>Open Source community it&#8217;s amazing!</p>
<p><em>Update</em><br />
Now eclipse packaged in Ubuntu official repository work without above trick. Simply install eclipse 3.5.1-0ubuntu7 (or later) from the Ubuntu archive.<br />
Eclipse version in the official eclipse site doesn&#8217;t work right yet. (See <a href="https://bugs.launchpad.net/gtk/+bug/442078/comments/28">#28 in this bug for a complete explanation of this Eclipse bug</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devonlinux.net/2009/10/09/eclipse-galileo-problem-in-karmic-koala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Eclipse with Mylyn and Trac via TracXMLRPC</title>
		<link>http://blog.devonlinux.net/2009/04/14/use-eclipse-with-mylyn-and-trac-via-tracxmlrpc/</link>
		<comments>http://blog.devonlinux.net/2009/04/14/use-eclipse-with-mylyn-and-trac-via-tracxmlrpc/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:09:04 +0000</pubDate>
		<dc:creator>ed0t</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bug tracking]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[mylyn]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://blog.devonlinux.net/?p=47</guid>
		<description><![CDATA[Today i&#8217;ve decided to add to my Eclipse IDE the Mylyn plugin, an add-on that lets manage bugs and planning of a project inside the IDE itself. Mylyn can be used with a lot of bug tracking tools and since i use Trac i&#8217;ve decided to link them together inside Eclipse. I assume you have [...]]]></description>
			<content:encoded><![CDATA[<p>Today i&#8217;ve decided to add to my Eclipse IDE the <a title="Go to Mylyn plugin offical site" href="http://www.eclipse.org/mylyn/">Mylyn plugin</a>, an add-on that lets manage bugs and planning of a project inside the IDE itself. Mylyn can be used with a lot of bug tracking tools and since i use Trac i&#8217;ve decided to link them together inside Eclipse.</p>
<p>I assume you have <a title="Read how to install Trac on Dreamhost" href="http://blog.devonlinux.net/2008/04/21/install-trac-on-dreamhost/">installed Trac on your local server, or on your Dreamhost account</a>. To enable communication between Trac and Mylyn we have to install and enable the XmlRpcPlugin that you can download from <a title="Go to Trac-hacks plugin" href="http://trac-hacks.org/wiki/XmlRpcPlugin">trac-hacks</a>.</p>
<p>After the download, copy your plugin on the system where Trac is installed. Uncompress the archive and go to the <em>0.10</em> folder if you have Trac 0.10 or <em>trunk</em> folder otherwise.</p>
<p>Now digit these commands:</p>
<pre>chmod 755 -R *
python setup.py bdist_egg</pre>
<p>Wait until the Python egg is created and then copy it into the <em>plugins</em> directory of your Trac environment. The egg file is in the <em>dist</em> directory created during the egg building.</p>
<p>Now go into your Admin account of your Trac web interface and go to Plugins page. You&#8217;ll see a TracXMLRPC 0.1 field. Clicking on it you&#8217;ll see some component. You have to enable these components as shown in the next figure.</p>
<p><img class="aligncenter size-full wp-image-64" title="Trac XMLRPC plugin components" src="http://blog.devonlinux.net/wp-content/uploads/2009/04/trac.jpg" alt="Trac XMLRPC plugin components" width="500" height="429" align="center" /></p>
<p>Well we&#8217;ve almost done. Now we have to install Mylyn and Mylyn extras into Eclipse.</p>
<p>Start Eclipse and click on <em>Help</em> -&gt; <em>Software Updates</em>. Click on the <em>Availabe Software</em> tab. Click on <em>Add Site</em> button and paste these two &#8220;repository&#8221;:</p>
<pre>http://download.eclipse.org/tools/mylyn/update/e3.4

http://download.eclipse.org/tools/mylyn/update/extras</pre>
<p>Now select to install these features:</p>
<p><img class="aligncenter size-full wp-image-73" title="Mylyn Plugin" src="http://blog.devonlinux.net/wp-content/uploads/2009/04/mylyn.jpg" alt="Mylyn Plugin" width="411" height="414" align="center" /></p>
<p>Wait until Eclipse asks you to restart to update changes and then you&#8217;ll be able to use Mylyn with your Trac environment.</p>
<p><a class="external free" title="http://download.eclipse.org/tools/mylyn/update/extras" rel="nofollow" href="http://download.eclipse.org/tools/mylyn/update/extras"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devonlinux.net/2009/04/14/use-eclipse-with-mylyn-and-trac-via-tracxmlrpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A polymorphic approach against if/switch statement</title>
		<link>http://blog.devonlinux.net/2009/01/13/a-polymorphic-approach-against-ifswitch-statement/</link>
		<comments>http://blog.devonlinux.net/2009/01/13/a-polymorphic-approach-against-ifswitch-statement/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 22:15:48 +0000</pubDate>
		<dc:creator>ed0t</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[good programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[spaghetti programming]]></category>

		<guid isPermaLink="false">http://blog.devonlinux.net/2009/01/13/a-polymorphism-approach-against-ifswitch-statement/</guid>
		<description><![CDATA[Recently i&#8217;ve watched an intresting speech by Miško Hevery. He explains how to use the correct polymorphic approach instead of a succession of if/switch statements. Polymorphism is better because it lets everybody to understand, to extend and to test the code. Watch the video at: http://googletesting.blogspot.com/2008/12/by-miko-hevery-google-tech-talks.html]]></description>
			<content:encoded><![CDATA[<p>Recently i&#8217;ve watched an intresting speech by <font color="#000000">Miško Hevery.</font></p>
<p>He explains how to use the correct polymorphic approach instead of a succession of if/switch statements. Polymorphism is better because it lets everybody to understand, to extend and to test the code.</p>
<p>Watch the video at: <a href="http://googletesting.blogspot.com/2008/12/by-miko-hevery-google-tech-talks.html" title="Watch the video: Clean Code Talks - Inheritance, Polymorphism, &amp; Testing" target="_blank">http://googletesting.blogspot.com/2008/12/by-miko-hevery-google-tech-talks.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devonlinux.net/2009/01/13/a-polymorphic-approach-against-ifswitch-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.339 seconds -->
