<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>adrian&#039;s blog</title>
	<atom:link href="http://beradrian.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://beradrian.wordpress.com</link>
	<description>Web and Software</description>
	<lastBuildDate>Fri, 20 Jan 2012 09:14:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='beradrian.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c6b5bbdf851425cab4f6824002f93f30?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>adrian&#039;s blog</title>
		<link>http://beradrian.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://beradrian.wordpress.com/osd.xml" title="adrian&#039;s blog" />
	<atom:link rel='hub' href='http://beradrian.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Font detection</title>
		<link>http://beradrian.wordpress.com/2011/11/23/font-detection/</link>
		<comments>http://beradrian.wordpress.com/2011/11/23/font-detection/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 22:05:55 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=731</guid>
		<description><![CDATA[Yesterday I participated to NetCamp 2011. In the end, there was a special contest, where 5 web projects out of 20, made it to the final. The prize was 1000 euro. The winner was WhatFontIs.com, which, I must admit, was also my personal favorite. A nice web application, easy to use and clearly explained by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=731&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I participated to <a href="http://www.netcamp.ro/2011/">NetCamp 2011</a>. In the end, there was a special contest, where 5 web projects out of 20, made it to the final. The prize was 1000 euro.</p>
<p>The winner was <a href="http://www.whatfontis.com/">WhatFontIs.com</a>, which, I must admit, was also my personal favorite. A nice web application, easy to use and clearly explained by its author. The author was also very enough and donated the prize money to an humanitarian cause.<br />
The idea is very simple. You see an image with some text on it and you want to know what font is using. You upload the image or specify the URL and the application analyze the image, splits into letters and then gives you a list of closest matching fonts. Further on you can download (if it&#8217;s free) or buy the font. It aggregates different font sources and searches through almost 250000 fonts. Extensions are available for Firefox and Chrome.<br />
This is especially useful for designers, but not exclusively. I don&#8217;t see myself using this on a daily basis, but only because of my job nature. And I can see the value and usefulness in it.</p>
<p>There are a few things that I would like to see in such an application. First it would be nice that the application will also recognize the letters and to offer at least some suggestions. And to also have an option to contact a font author that will create the font for you if you haven&#8217;t found it.</p>
<p>Altogether, this web application is easy to use and valuable. And 100% Romanian. Nice!</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/web/'>Web</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/731/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=731&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/11/23/font-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.438553 26.090635</georss:point>
		<geo:lat>44.438553</geo:lat>
		<geo:long>26.090635</geo:long>
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Generic project management &#8211; really?</title>
		<link>http://beradrian.wordpress.com/2011/09/25/generic-project-management/</link>
		<comments>http://beradrian.wordpress.com/2011/09/25/generic-project-management/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 17:10:30 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=721</guid>
		<description><![CDATA[I heard a lot of people saying that a PM is a PM. And if you manage one type of projects, you can manage any type of project. But I don&#8217;t think that&#8217;s true. And I will argue this opinion in the current article. First of all let me tell you that I understand where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=721&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I heard a lot of people saying that a PM is a PM. And if you manage one type of projects, you can manage any type of project.<br />
But I don&#8217;t think that&#8217;s true. And I will argue this opinion in the current article.</p>
<p>First of all let me tell you that I understand where this idea is coming from. The reason behind is that a PM should have only knowledge about managing a project and he can easily apply the methods and processes to any kind of project. Far from true. The real value of a PM comes from taking the theoretical tools and processes and tailor them to fit the specifics of the project and company. Without it, a PM is no more than a glorified secretary. Or can be easily replaced by an automated software tool.</p>
<p>Another thing that is easily looked over is the field expertise. The argument is that a PM should not be an SME (Subject Matter Expert). True, but he should be able to understand one, to have a common language. Let me give you one example. In a software project (I will mostly use examples from this field as this is to what I&#8217;m acquainted with) a PM can easily have access to SME knowledge through a senior developer, team leader, architect etc. But a PM should also play the role of a mediator/negotiator between the resources/teams involved in a project. What will happen when two SMEs from two different teams (like QA and dev) don&#8217;t reach an agreement because what it lacks is a common ground, a common language. Then the PM should step into the scene and lay out this common ground. But if he lacks the minimal expertise in the field to understand both languages and bridge the teams &#8230;<br />
In business, there is a saying: a worst decision is better than a late decision. Same in project management. And sometime, the PM will end up in the position of taking hard decisions for the well being of the project. Sometime these decisions are at the borderline of two SMEs. </p>
<p>Just for the fun let&#8217;s see a discussion between a PM with a background in construction and a developer.<br />
John (developer): &#8211; Mike, the database broke just two hours ago.<br />
Mike (PM): &#8211; But this should not be a problem. We will order one, you&#8217;ll unscrew the old one and mount the new one.<br />
John (developer): [Thinking: Ohh geez, what a %&amp;#$]<br />
And we can laugh about the other side of the coin too. But my expertise in the construction field does not allow me to make a good one <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Of course, the example is exaggerated and this exact situation can be easily handled by an SME, but I think you got the point. </p>
<p>And not to forget the human factor &#8211; the professionals in the team can feel frustrated and not understood if the PM does not employ a common language and a minimal expertise in their field. </p>
<p>So you can easily see, why a PM is a little bit of everything plus a PM. Of course, real life examples can easily contradict me (and any of us knows at least a few), but the actual added value of the PM in those cases is worth pennies.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/software/'>Software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=721&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/09/25/generic-project-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.438553 26.090635</georss:point>
		<geo:lat>44.438553</geo:lat>
		<geo:long>26.090635</geo:long>
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>XPath2 functions in Java</title>
		<link>http://beradrian.wordpress.com/2011/08/10/xpath2-functions-in-java/</link>
		<comments>http://beradrian.wordpress.com/2011/08/10/xpath2-functions-in-java/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 01:24:00 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=714</guid>
		<description><![CDATA[Some time ago I wrote an article about how to implement custom functions in XSLT/XPath in order to bring XPath 2 functions to XSLT 1 engine in .Net. Now it&#8217;s Java turn. And this is actually much easier. First of all, how do you define Java custom functions in XSLT. Opposed to .Net, no workaround [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=714&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago I wrote an <a href="http://beradrian.wordpress.com/2009/09/17/xpath2-in-dotnet/" title="XPath2 in .Net">article</a> about how to implement custom functions in XSLT/XPath in order to bring XPath 2 functions to XSLT 1 engine in .Net. Now it&#8217;s Java turn. And this is actually much easier.</p>
<p>First of all, how do you define Java custom functions in XSLT. Opposed to .Net, no workaround is needed, you simply define a namespace for all the public static methods in a class. And then you can easily access all these methods.<br />
<pre class="brush: xml;">
&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:xpath2=&quot;java:com.wordpress.beradrian.XPath2Utilities&quot;&gt;
...
&lt;!-- select the XHTML elements of which CSS class is 'one' or 'two' --&gt;
&lt;xsl:for-each select=&quot;descendant::*[xpath2:matches(string(@class), '(\b(one|two))*')]&quot;&gt;
...
&lt;/xsl:stylesheet&gt;
</pre></p>
<p>Now all you have to do is write the <code>com.wordpress.beradrian.XPath2Utilities</code> class and its static method &#8211; one of them is <code>matches</code>.</p>
<p><pre class="brush: java;">
package com.wordpress.beradrian;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Emulates XPath2 functions extending XSLT 1.0. capabilities.
 */
public class XPath2Utilities {
	public static String replace(String input, String pattern, String replacement) {
		return input.replaceAll(pattern, replacement);
	}
	
	/**
	 * Matches an input string against a regular expression
	 * @param input
	 * @param pattern the regular expression pattern
	 * @return true if the input matches the given regular expression, false otherwise
	 */
	public static boolean matches(String input, String pattern) {
		try {
			Pattern p = Pattern.compile(pattern);
			Matcher m = p.matcher(input);
			return m.find();
		} catch (Exception e) {
			return false;	
		}
	}
	
	/**
	 * Compares two strings.
	 * @param first first string to compare
	 * @param second second string to compare
	 * @return a negative value if first string is lexicographically smaller than the second one, 
	 * 0 if they're equal and positive if first one is bigger than second one
	 */
	public static int compare(String first, String second) {
		return first.compareTo(second);
	}

	/**
	 * @param first the full string
	 * @param second the string to check if it is a suffix of the first one.
	 * @return true if the second string is a suffix for the first one 
	 */
	public boolean endsWith(String first, String second) {
		return first.endsWith(second);
	}	
}
</pre></p>
<p>And now let&#8217;s see how you can put the pieces together and test the result. I&#8217;m using Eclipse and starting with version 3.4 (I think, I&#8217;m using Indigo anyway) it has an XSLT debugger integrated. In Project Explorer view, right click on an XSLT file and select Run As &#8230; / XSL Transformation. Then choose the XML file and the XML result will be generated. As this is as any run/debug item you can easily configure it. Go to Run / Run configurations, select the Classpath tab and then add your project, the one containing the class com.wordpress.beradrian.XPath2Utilities. You can also check the log in Console view. </p>
<p>For reference you can check XPath functions <a href="http://www.w3.org/TR/xpath/" title="XPath 1">1</a> and <a href="http://www.w3.org/TR/xpath-functions/" title="XPath 2">2</a>.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/software/'>Software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/714/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/714/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/714/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=714&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/08/10/xpath2-functions-in-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Sad little piece of software&#8221;</title>
		<link>http://beradrian.wordpress.com/2011/06/05/getelementbyid-in-ie/</link>
		<comments>http://beradrian.wordpress.com/2011/06/05/getelementbyid-in-ie/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 23:29:36 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=709</guid>
		<description><![CDATA[What do you think this code will do? You would think that it will print that element with id one is a div. Yep, and Firefox, Chrome and Safari will agree with you. But not IE . For IE getElementById is synonym with getElementByName. No matter the version &#8211; 7, 8 or the mighty IE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=709&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What do you think this code will do?<br />
<pre class="brush: xml;">
&lt;html&gt;
&lt;body&gt;
&lt;a name=&quot;one&quot;&gt;an anchor&lt;/a&gt; &lt;hr /&gt;
&lt;div id=&quot;one&quot;&gt;a div&lt;/div&gt; &lt;hr /&gt;
&lt;/body&gt;

&lt;script&gt;
document.writeln(&quot;Element with id 'one' is '&quot; + document.getElementById(&quot;one&quot;).innerHTML + &quot;'&quot;);
&lt;/script&gt;

&lt;/html&gt;
</pre></p>
<p>You would think that it will print that element with id one is a div. Yep, and Firefox, Chrome and Safari will agree with you. But not IE <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . For IE getElementById is synonym with getElementByName. No matter the version &#8211; 7, 8 or the mighty IE 9. I don&#8217;t know if you would guess, but if you put the div first, it has the expected behavior.<br />
So, getElementById, in IE, returns the first element that has the id or name attribute, equal to the given value. Good to know. But sad.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/web/'>Web</a> Tagged: <a href='http://beradrian.wordpress.com/tag/javascript/'>javascript</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/709/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=709&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/06/05/getelementbyid-in-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Tip: CSS gradients</title>
		<link>http://beradrian.wordpress.com/2011/05/17/css-gradients/</link>
		<comments>http://beradrian.wordpress.com/2011/05/17/css-gradients/#comments</comments>
		<pubDate>Mon, 16 May 2011 21:19:56 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=704</guid>
		<description><![CDATA[Gradients in CSS are actually a special image. Because multiple background images are possible, you can specify both an image and a gradient. Below is the entire CSS code for having gradients in all major browsers. For your convenience, I encapsulated it into a Less function. Here I used top down gradient, but you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=704&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Gradients in CSS are actually a special image. Because multiple background images are possible, you can specify both an image and a gradient. Below is the entire CSS code for having gradients in all major browsers. For your convenience, I encapsulated it into a Less function.<br />
<pre class="brush: css;">
.gradient(@fromColor, @toColor, @additionalImage) {
	background-color: @fromColor;
	background-image: @additionalImage;
	background-image: @additionalImage, -moz-linear-gradient(90deg, @fromColor, @toColor);
	background-image: @additionalImage, -webkit-gradient(linear, 0% 0%, 0% 100%, from(@fromColor), to(@toColor));
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@fromColor', endColorstr='@toColor');
	-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@fromColor', endColorstr='@toColor');
}
</pre><br />
Here I used top down gradient, but you can easily modify it. If the browser  does not support CSS gradients, it will gracefully fallback to a plain color.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/web/'>Web</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/704/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=704&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/05/17/css-gradients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Mobile web guidelines</title>
		<link>http://beradrian.wordpress.com/2011/05/16/mobile-web-guidelines/</link>
		<comments>http://beradrian.wordpress.com/2011/05/16/mobile-web-guidelines/#comments</comments>
		<pubDate>Mon, 16 May 2011 14:26:40 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=701</guid>
		<description><![CDATA[Mobile web principles Some time ago I wrote an article about mobile web and what choices you have to create a mobile web presence for your company. Few days ago I gave a presentation to the students in Polytechnics about the same subject. The presentation was focused more on healthy mobile web development principles, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=701&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Mobile web principles</p>
<p>Some time ago I wrote an <a href="http://beradrian.wordpress.com/2009/01/10/mobile-web/" title="Mobile web">article</a> about mobile web and what choices you have to create a mobile web presence for your company. Few days ago I gave a presentation to the students in Polytechnics about the same subject. The presentation was focused more on healthy mobile web development principles, which will also be the subject of the present article.<br />
But first of all, why you must care about mobile web?3.7 billion unique mobile phone users, 1.2 billion mobile Internet users vs 1.4 billion classic (desktop, laptop, netbook) users in 2010, and most probably surpassing in 2011, 600 million phones sold yearly worldwide. This industry all together surpasses worldwide in revenues any other IT or entertainment industry.<br />
Not convinced yet? Then maybe you should skip the rest of the article.<br />
Ok, so you want to dip your fingers in mobile web. Good. Let&#8217;s start first understand it.</p>
<h2>Definitions</h2>
<p>What is a mobile phone? If we use Wikipedia as reference a mobile phone is a device that enables you to <em>make mobile telephone calls (… move around freely rather than stay fixed in one location …) across a wide geographic area.</em>. Nothing more. No web, no applications. Just voice calls.<br />
Then there are featured phones, mobile phones augmented by the manufacturer with different applications like a web browser, games and even productivity suites.<br />
And in the late years, the smartphone. But what is a smartphone? To tell you frankly it is pretty hard to define it. More computing power or more memory? About CPU frequency or RAM size would you consider a phone to be &#8220;smart&#8221;? Complex operating system? How would you define an OS to be complex? But there is a more widely accepted definition and I will adhere to it as being the most appropriate one: a smartphone is a mobile phone on which you can (download and) install applications. And if you think a little bit, it makes sense. Nobody is born smart. But you learn and you become smart. Same way a phone, offers a new feature, by installing an application. It &#8220;learns&#8221; a new software, it becomes &#8220;smart&#8221;.<br />
And now you have a website. Do you need to build another one for mobile? Yes and no. </p>
<h2>Differences</h2>
<p>Why yes? Simply because mobiles have different characteristics. We have different hardware capabilities: <strong>smaller screen sizes</strong>, <strong>resolution</strong>s, various input devices (<strong>touchscreen</strong>, <strong>trackball</strong>, <strong>smaller or no keyboard</strong>), lower capacity <strong>battery</strong>. If some of these are somehow downsides, we also have advantages: <strong>camera</strong>, <strong>GPS</strong>, newer upcoming technologies like <strong>NFC</strong>(Near Field Communication).<br />
We also have software differences: different OSes, browsers and in many more flavors than on desktop, different tools to leverage hardware capabilities: QR codes reader, mapping applications.<br />
When it comes to connectivity, a mobile has a smaller bandwidth and most probably higher costs per bit. But on the other hand, the user is 24/7 online (yes, it is the only device that connects us even in our sleep). Moreover, on the mobile you have a wide range of communication channels: SMS, email, web, social networks, voice, LBS, SEM. You can even expect that the classic channels (print ads, radio, TV) are closer to the user.<br />
We don&#8217;t have to miss one important aspect: the mobile is the only device that has an integrated payment method. Either it is by SMS, integrated credit card (mostly on Asia) or NFC.<br />
These are the technical terms, but the mobile is the most personal device and we need to take a look at its social impact. A phone is not simply a device, in many cases is the door to the user social network or it is a mobile entertainment center. In some cases, it is a fashion statement. The most expensive phone is an 8 million USD iPhone 4 and there is a 100 USD iPhone application that does nothing. Compare this with the most expensive laptop.<br />
Another important aspect to consider when developing a mobile website or application is the user behavior. You will watch to a presentation on mobile, but most probably you will create it on desktop. You will use a software application on mobile, but you will develop it on desktop. As a rule of thumb you can compare a 30 minutes task on desktop with a 30 seconds task on mobile. That&#8217;s why you will hear about &#8220;task oriented websites&#8221;. The concept means that you will include in your site only relevant tasks to its interest and environment(physical or virtual). It would not make any sense to create a mobile website to download drivers. A mobile website for a versioning control system will offer little value, but if you reduce it to a tracking/statistics section can make its way to the user pocket.<br />
Something that is easily ignored is the <strong>technological awareness</strong>. A phone is upgraded every 18 months, opposed to a laptop/desktop that is upgraded every 42 months. As a consequence, the technological advancement curve is much more steep and you have to keep in mind that not all the users are keeping the pace. So it could be that they are not fully aware of their phone potential.</p>
<h2>Developing mobile web</h2>
<p>Taking into account all these differences should I care about mobile? Definitely. Should I develop another site? No.<br />
Following just a few principles, you will have a clean website, that can easily adapt for desktop and mobile. Without the hassle of maintaining several websites.</p>
<dl>
<dt>Content-layout separation</dt>
<dd>This principle has made its way into many software development design patterns and architectures: MVC, three tier architecture, etc. Extended to web development, this will allow faster development, cost effective maintenance, easy re-branding, improved collaboration between web developers, designers and content editors.</dd>
<dt>One web</dt>
<dd>Content layout separation allows us to have only one website and to optimize the presentation of the same content for desktop, netbooks, featured phones, smartphones, printing etc. W3C is militating for this as one of the primary objectives in web development.</dd>
<dt>Semantic CSS</dt>
<dd>Considering that you used the content layout separation, usually the link between is done with CSS classes. Semantic CSS is about how to name these classes. You should choose names relevant for the content and not the layout. So a name like <code>bigfont</code> will most probably become irrelevant when you will decide to change the layout or optimize for different devices; but <code>sectionTitle</code> will not lose its meaning over time. I will come back with a detailed article on this matter.</dd>
<dt>Progressive enhancements</dt>
<dd>This term sounds very complicated and futuristic, but it is not rocket science. It is not a framework or a new technology to learn and use. It is only a change of mindset. Mainly this applies to JavaScript and you have to keep in mind that some features that you&#8217;re going to use in your scripts could not be implemented on some devices/browsers.</p>
<p>	To better understand the concept let&#8217;s take an example. Let&#8217;s say that you&#8217;re going to use geolocation on your website.<br />
	<pre class="brush: jscript;">
		navigator.geolocation.getCurrentPosition(locationHandler);
	</pre><br />
	The above could be one option. But what happens if the user browser does not support geolocation. Your website will break and offer a poor user experience.<br />
	By simply adding an <code>if</code> you&#8217;re out of the trouble.<br />
	<pre class="brush: jscript;">
		if (navigator.geolocation)
			navigator.geolocation.getCurrentPosition(locationHandler);
	</pre><br />
	You can even have some fail-over mechanism implemented on <code>else</code> branch. As I said nothing complicated, only a mindset change. <strong>Develop for the highest end browsers/devices, but think of all.</strong></p>
<p>	The same can be applied to CSS. If you want to implement CSS gradients you will have to do something like<br />
	<pre class="brush: css;">
		background-color: #00ff00;
		background-image: url(bg.jpg);
		background-image: url(bg.jpg), -moz-linear-gradient(90deg, #00ff00, #0000ff);
		background-image: url(bg.jpg), -webkit-gradient(linear, 0% 0%, 0% 100%, from(#00ff00), to(#0000ff));
	</pre><br />
	This way you will be able to have a green to blue CSS gradient on both Mozilla and WebKit and just a plain green background on older browsers. Also if you have an image that one will be there as well. The browsers without CSS gradient support will just ignore the last two lines.
	</dd>
<dt>Liquid layout</dt>
<dd>With so many screen sizes and resolution, two possible orientations, it is nearly impossible to optimize your website for a given size. That&#8217;s why you will have to use liquid layout and your website will honor every resolution and expand through the entire viewing area. This way you will also take advantage of the full display, which is also critical on mobile.</dd>
<dt>Detection and adaptation</dt>
<dd>So far you developed your website, thinking to all the mobile users. But a user who paid over $500 on his phone wants to take advantage of it. So you will have to detect high end devices and offer extended features for them. This can be done on the client side through progressive enhancements or server side. About the latter subject I wrote another <a href="http://beradrian.wordpress.com/2008/10/10/mobile-device-recognition/" title="Mobile device recognition">article</a> in the past. And remember that the 80/20 rule applies here as well. 20% of the users generates 80% of the traffic. You don&#8217;t want to lose the big amount of traffic, but you also don&#8217;t want to lose a big amount of users.</dd>
<dt>Performance</dt>
<dd>This is a very sensitive topic on both desktop and mobile. On mobiles you can refer to page performance in terms of response time, cost, number of dependent resource.</dd>
<dt>Mobile guidelines</dt>
<dd>There are also very specific mobile guidelines, like no flash, order of preferred format images is JPEG, GIF, PNG, but I will not enter into details. You can find them at <a href="http://www.w3.org/TR/mobile-bp/">W3C Mobile Best Practices</a>. You can even use automatic validators for your code like W3C mobileOK or mobiReady</dd>
</dl>
<p>This article will be a starting point for the mobile web developer and it will help you setting the right approach, when it comes to this new highly expanding field, mobile web.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/web/'>Web</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/701/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=701&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/05/16/mobile-web-guidelines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Overriding Spring Beans</title>
		<link>http://beradrian.wordpress.com/2011/05/08/overriding-spring-beans/</link>
		<comments>http://beradrian.wordpress.com/2011/05/08/overriding-spring-beans/#comments</comments>
		<pubDate>Sun, 08 May 2011 19:06:38 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=695</guid>
		<description><![CDATA[Spring IoC container is a very powerful configuration tool. So powerful that became a de-facto industry standard. I would choose it without second doubts in almost any project, especially bigger ones. Still there is a feature in Spring that I would consider it confusing. With Spring IoC Container you can override beans. Very simple actually. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=695&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Spring IoC container is a very powerful configuration tool. So powerful that became a de-facto industry standard. I would choose it without second doubts in almost any project, especially bigger ones.<br />
Still there is a feature in Spring that I would consider it confusing. With Spring IoC Container you can override beans. Very simple actually. Just define another bean with the same id. Spring will consider the last definition and ignore all the others before. You can have the following scenarios</p>
<dl>
<dt>a.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;beans&gt;
			&lt;bean class=&quot;java.lang.String&quot; id=&quot;x&quot;&gt;
				&lt;constructor-arg&gt;Bean from A&lt;/constructor-arg&gt;
			&lt;/bean&gt;
		&lt;/beans&gt;
</pre>
	</dd>
<dt>b.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;beans&gt;
			&lt;import resource=&quot;a.xml&quot;/&gt;
			&lt;bean class=&quot;java.lang.String&quot; id=&quot;x&quot;&gt;
				&lt;constructor-arg&gt;Bean from B&lt;/constructor-arg&gt;
			&lt;/bean&gt;
		&lt;/beans&gt;
</pre>
	</dd>
<dt>web.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;context-param&gt;
			&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
			&lt;param-value&gt;classpath:b.xml&lt;/param-value&gt;
		&lt;/context-param&gt;
</pre>
	</dd>
</dl>
<dl>
<dt>a.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;beans&gt;
			&lt;bean class=&quot;java.lang.String&quot; id=&quot;x&quot;&gt;
				&lt;constructor-arg&gt;Bean from A&lt;/constructor-arg&gt;
			&lt;/bean&gt;
		&lt;/beans&gt;
</pre>
	</dd>
<dt>b.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;beans&gt;
			&lt;bean class=&quot;java.lang.String&quot; id=&quot;x&quot;&gt;
				&lt;constructor-arg&gt;Bean from B&lt;/constructor-arg&gt;
			&lt;/bean&gt;
		&lt;/beans&gt;
</pre>
	</dd>
<dt>web.xml</dt>
<dd>
<pre class="brush: xml;">
		&lt;context-param&gt;
			&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
			&lt;param-value&gt;classpath:a.xml,classpath:b.xml&lt;/param-value&gt;
		&lt;/context-param&gt;
</pre>
	</dd>
</dl>
<p>In both cases the <code>Bean from A</code> is overridden by the <code>Bean from B</code>. In the first case a.xml is imported in b.xml and only a.xml is referenced from web.xml and in the second case both a.xml and b.xml are referenced from web.xml, but b.xml is the last one.</p>
<p>If you have many configuration files and many modules this can be somewhat confusing. Personally I would add an attribute named, let&#8217;s say, override, that must be set to true if you want that the current bean override another bean definition. If not, then an exception will be thrown during configuration load. (default value will be false).<br />
I also encountered another issue with Spring configuration: having the same configuration file name in different classpath locations (aka jars). This lead to undeterministic behavior (unlike the first case) resulting in loading one of the two files. But this one is clearly bad practice from the programmer side. I usually keep my Spring configuration files along with the sources. So in the package com.my.package I have a file package-ctx.xml. This can be referenced in Spring as classpath:/com/my/package/package-ctx.xml. I would not recommend names like spring-ctx.xml or general.xml. They are too general and counterintuitive.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/software/'>Software</a> Tagged: <a href='http://beradrian.wordpress.com/tag/spring/'>spring</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=695&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/05/08/overriding-spring-beans/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>10.000 euro pentru tineri care dezvoltă soluţii multimedia</title>
		<link>http://beradrian.wordpress.com/2011/04/05/idei-tari-multimedia/</link>
		<comments>http://beradrian.wordpress.com/2011/04/05/idei-tari-multimedia/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 19:11:35 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[advertorial]]></category>
		<category><![CDATA[ideitari]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=688</guid>
		<description><![CDATA[Aş dori să mă înscriu şi la a doua ediţie a concursului Idei tari pentru că, prima participare a însemnat mult pentru mine prin faptul că am cunoscut foarte mulţi oameni din Romtelecom şi de la diferite universităţi şi am discutat cu oameni care vorbeau aceeaşi limbă cu mine&#8230; cea a pasionaţilor de tehnologie. Am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=688&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>Aş dori să mă înscriu şi la a doua ediţie a concursului Idei tari pentru că, prima participare a însemnat mult pentru mine prin faptul că am cunoscut foarte mulţi oameni din Romtelecom şi de la diferite universităţi şi am discutat cu oameni care vorbeau aceeaşi limbă cu mine&#8230; cea a pasionaţilor de tehnologie. Am putut să îmi prezint ideile şi să îmi fac o imagine mai clară despre locul în care se află momentan technologia în România. Am văzut că sunt mulţi oameni talentaţi şi m-am bucurat enorm că există instituţii şi fundaţii cum este şi cea a Romtelecom, care sunt interesate de tinerii ca mine şi le oferă sprijin să arate ce pot.</p></blockquote>
<p> Este declaraţia lui Hunor Bocz, câştigătorul premiului special din cadrul primei ediţii a competiţiei naţionale <strong>Idei tari</strong>, organizate de Fundaţia Romtelecom pentru români, pe care l-a obţinut pentru un proiect de casă inteligentă.</p>
<p>Hunor este un puşti de numai 13 ani care în loc să iasă cu prietenii şi să vorbească numai despre muzică, preferă să mănânce pe pâine proiecte robotică şi tehnologie, în general. Iar el nu este singurul, poate doar cel mai tânăr şi entuziast aplicant la cea de-a doua ediţie a competiţiei, care îi vizează de această dată pe cei care se pricep în special la dezvoltarea de soluţii multimedia.  </p>
<p>Orice tânăr până în 35 de ani care poate să creeze, de exemplu, un personaj interactiv online sau o aplicaţie speech-to-text (restul temelor sunt disponibile pe site-ul competiţiei) are şansa să câştige între 2000 şi 5000 de euro, dacă se numără printre cei trei mari câştigători.</p>
<blockquote><p>Temele acestei ediţii au un caracter inovativ, iar nivelul lor de dificultate depinde de ce îţi alegi să dezvolţi. Dacă cei care se înscriu au cunoştinţe de programare, electronică nu pot spune despre teme nici că sunt floare la ureche, dar nici că sunt imposibil de abordat.</p></blockquote>
<p>adaugă Hunor, rugându-i pe toţi cei care îl cunosc să îi ţină pumnii. Urarea este de fapt pentru toţi cei care vor să demonstreze în cadrul competiţiei că pot implementa proiecte complexe, iar pasiunea pentru multimedia le aduce şi premii consistente în valoare totală de 10.000 euro.</p>
<p>Tinerii pot răspunde provocării până pe 30 aprilie 2011, iar pe <a href="http://www.ideitari.ro">www.ideitari.ro</a> găsesc toate detaliile pentru înscriere.  </p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/ideas/'>Ideas</a> Tagged: <a href='http://beradrian.wordpress.com/tag/advertorial/'>advertorial</a>, <a href='http://beradrian.wordpress.com/tag/ideitari/'>ideitari</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=688&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/04/05/idei-tari-multimedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Cross browser event handling</title>
		<link>http://beradrian.wordpress.com/2011/03/16/cross-browser-event-handling/</link>
		<comments>http://beradrian.wordpress.com/2011/03/16/cross-browser-event-handling/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 13:29:47 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=671</guid>
		<description><![CDATA[We all know very well what a mess is Internet Explorer. Especially when it comes to following standards. But if I have to choose one thing and one thing only to change in IE, I will choose event handling without second thoughts. Why is that? Because you will face this in your every day life [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=671&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We all know very well what a mess is Internet Explorer. Especially when it comes to following standards. But if I have to choose one thing and one thing only to change in IE, I will choose event handling without second thoughts.<br />
Why is that? Because you will face this in your every day life as JavaScript developer and writing code that handles both world can lead to hardly readable code. I said both, because all the other browsers follows W3C event model. Except IE, but this no surprise by now. Of course you have the option of using different frameworks that will hide the messy part in their internals. But why to do so, when you have already such a good framework define by W3C?<br />
And the good news is that you can make a little trick to make IE compliant. Yes, you heard well and then your code can be clean, W3C compliant and work on all the browsers.<br />
I explained this technique before, which is based on IE behaviors. With behaviors you can add in an uniform and transparent way methods, properties and register events. What we are looking here is to define <code>addEventListener</code>, <code>removeEventListener</code> and <code>dispatchEvent</code>. Fortunately all these have IE counterparts <code>attachEvent</code>, <code>detachEvent</code> and <code>fireEvent</code>, so only a bridge will be required.<br />
Before actually writting the code, there is one more thing to add: IE has even different names for some events (I know, I know &#8230;), so a mapping will be required here.<br />
<pre class="brush: jscript;">
&lt;PUBLIC:COMPONENT lightWeight=&quot;true&quot;&gt;
&lt;PUBLIC:DEFAULTS viewLinkContent=&quot;true&quot;/&gt;  
&lt;PUBLIC:METHOD name=&quot;addEventListener&quot; /&gt;
&lt;PUBLIC:METHOD name=&quot;removeEventListener&quot; /&gt;
&lt;PUBLIC:METHOD name=&quot;dispatchEvent&quot; /&gt;

&lt;SCRIPT&gt;
var TRANSLATED_IE_EVENT_TYPES = {
    DOMContentLoaded: &quot;readystatechange&quot;, 
    DOMAttrModified: &quot;propertychange&quot;,
    DOMMouseScroll: &quot;mousewheel&quot;,
    invalid: &quot;error&quot; // for HTML 5
};

/**
 * Translates W3C DOM event types into IE ones
 * @param type the event type
 * @return the translation or the initial type if there is no translation
 */ 
function translateIEEventType(type) {
    var xtype = TRANSLATED_IE_EVENT_TYPES[type];
    return (xtype != null ? xtype : type);
}

function addEventListener(type, listener, useCapture) {
    return this.attachEvent(&quot;on&quot; + translateIEEventType(type), wrapListener(listener)); 
}

function removeEventListener(type, listener, useCapture) {
    return this.detachEvent(&quot;on&quot; + translateIEEventType(type), wrapListener(listener));
};

function dispatchEvent(event) {
    try {
        return this.fireEvent(&quot;on&quot; + translateIEEventType(type));
    } catch(exc) {
		// if we can log ...
    	if (window != null &amp;&amp; window.console != null &amp;&amp; window.console.log != null)
    		window.console.log(exc + &quot;;&quot; + exc.message);
    }
}
&lt;/SCRIPT&gt;
&lt;/PUBLIC:COMPONENT&gt;
</pre><br />
Pretty straightforward. You probably notice the <code>wrapListener</code> method. The idea is to wrap the W3C listener into an IE one, so that it can be handled by IE, and consequently, to wrap the IE event into a W3C one, so that it can be used by the original handler. For the last part we also have to define the Event type and all its methods as per W3C specifications.<br />
<pre class="brush: jscript;">
function wrapListener(handler) {
    var h = handler;
    if (h._wrapper == null) {
        h._wrapper = function() {
            var event = wrapIEEvent();
            retval = h(event);
            return retval == null ? (!event.defaultPrevented) : retval;
        };
        h._wrapper.toString = function() {
            return h.toString();
        };
    }
    return h._wrapper;
}


/**
 * Wrap the IE Event into a W3C one. 
 */ 
function wrapIEEvent() {
    // keep the W3C event as a standardEvent property of the window
    if (window.standardEvent == null || window.standardEvent.ieEvent != window.event) {
        window.standardEvent = new Event(window.event);
    }
    return window.standardEvent;
}

/** 
 * Creates a new event.
 * @param ieEvent the IE event. 
 */
function Event(ieEvent) {
	// wrap the IE event into a W3C one
}

Event.prototype.preventDefault = function() {

};

Event.prototype.stopPropagation = function() {

};
</pre><br />
The only thing left for you is to fill in the gaps: wrap the IE event into a W3C one and define the W3C methods for the event &#8211; preventDefault, stopPropagation and all the rest. This is your homework. Or you can download it from <a href="http://my-ui.svn.sourceforge.net/viewvc/my-ui/trunk/src/cb.event.htc">here</a>.<br />
The final stage of the trick &#8211; using it. Like any other behavior and in this case you have to register it for all the elements.<br />
<pre class="brush: css;">
* { 
	behavior: url(cb.event.htc);
}
</pre><br />
Or another resolution of this problem (I would like it better) will be to stop using IE, tell your friends to do the same and them to their friends and so on until we will get rid of this &#8220;web poison&#8221;.</p>
<p><em>P.S.</em> This was tested with IE 7 &amp; 8. It seems that IE 9 is implementing W3C events, but still I would like to see it gone.</p>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/web/'>Web</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/671/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=671&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/03/16/cross-browser-event-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
		<item>
		<title>Code analysis and review</title>
		<link>http://beradrian.wordpress.com/2011/01/19/code-analysis-and-review/</link>
		<comments>http://beradrian.wordpress.com/2011/01/19/code-analysis-and-review/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 22:45:46 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://beradrian.wordpress.com/?p=648</guid>
		<description><![CDATA[In a big team, with many developers involved, code review is essential. But do you have the tools to do it? Certainly. As I was lately using Eclipse (and I want to do as much as possible in one place) I will further describe some plugins that will help you accomplish that. Code analysis I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=648&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a big team, with many developers involved, code review is essential. But do you have the tools to do it?<br />
Certainly. As I was lately using Eclipse (and I want to do as much as possible in one place) I will further describe some plugins that will help you accomplish that.</p>
<h3 id="code-analysis">Code analysis</h3>
<p>I will start with some automated code analysis tool.<br />
I&#8217;m using <a href="http://findbugs.sourceforge.net/">FindBugs</a> and <a href="http://pmd.sourceforge.net/">PMD</a>. My goal is to have 100% clear report from FindBugs. On PMD, things are a little bit different, and this plugin is reporting even the slightest problems, even though they aren&#8217;t of real concern. But this tool has a useful feature, <code>Find Suspect Cut and Paste</code> to find duplicate code. It does not always do the best job, but increasing the tile size can help.</p>
<p>If you need report metrics about your project a good choice can be <a href="http://metrics.sourceforge.net/">Metrics</a>. It calculates a lot of metrics, it can do a dependecy analysis, export the reports into XML. </p>
<p>All these tools can be easily installed in Eclipse from the update sites. Then they will provide contextual menu items to run the analysis on file, folders or the entire project, displaying the results in specific views. They can be integrated in your build process, running as Ant tasks and generating reports in various formats, usually XML.</p>
<h3 id="code-review">Code review</h3>
<p>I love automation, but human intervention is the ultimate factor. In this case &#8211; code review. And the tool here is <a href="http://code.google.com/p/jupiter-eclipse-plugin/">Jupiter</a>. I must say that I love this tool &#8211; easy to use and right on target. Unlike other similar tools, it does not require an additional web application or any additional software. It stores everything on files, which can be maintained in your source versioning system, to coordinate and communicate the review between team members.<br />
I will enter here in a few more details.<br />
After installing Jupiter like any other Eclipse plugins and restarting the environment, you will have to setup a review, to keep everything under the same roof. So, click on the project that you want to review, then Properties &gt; Review &gt; New &#8230; A wizard will start to configure your review (you can edit these settings at a later time). Here you can setup </p>
<ul>
<li>the review name and description;</li>
<li>the files to be reviewed &#8211; you can leave blank for all;</li>
<li>the reviewers &#8211; I would suggest to use the developer&#8217;s email addresses;</li>
<li>review folder (where Jupiter stores all the review data) &#8211; I would suggest to use /review or /.review and to store this into your versioning system, along with the file /.jupiter (where Jupiter stores the metadata about all the reviews). Be careful, if you keep the latter on the versioning system, that one contains who is the author of the review, which should be different on each machine;</li>
<li>issue types and severities &#8211; the default ones seem pretty good and they&#8217;re explained <a href="http://code.google.com/p/jupiter-eclipse-plugin/wiki/ItemReference">here</a>;</li>
<li>the author of this review;</li>
<li>the default values for fields like type or severity;</li>
<li>filters for the issues for different phases of review: individual &#8211; when issues are submitted, team &#8211; when issues are discussed and assigned and rework &#8211; when issues are addressed</li>
</ul>
<p>Now you are all set up and good to &#8230; REVIEW. Just go to a line in a file in editor, right click and select Add Review Issue &#8230; The Review Editor view will open and there you can enter all the details. You can browse the existing issues using the Review Table view and navigate directly to an issue in the file, notice the purple icon on the left side of the editor or the small purple line on the right side. Another useful feature is the ability to customize different filters, even different for each review phase.</p>
<p>If you will store your review files on SVN (or other versioning system), after update/checkout, don&#8217;t forget to modify in the configuration that you are the reviewer (and not the one that committed the last version). Just go to Project Properties &gt; Review &gt; Select a review &gt; Edit &gt; Author and select your name from the list. Also after update don&#8217;t forget to refresh the project and the review.</p>
<p>I like Jupiter, because it does not require another server or software installation, it keeps everything in some XML files so you can use your favorite versioning system and it is easy to use and straightforward. It is like a local code issue tracker, but you can also synchronize across a team using, let&#8217;s say, Subversion. And, it is integrated in Eclipse and you can do everything in one place.</p>
<h3>Summary</h3>
<table>
<thead>
<tr>
<th>Tool</th>
<th>Eclipse update site</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://findbugs.sourceforge.net/">FindBugs</a></td>
<td>http://findbugs.cs.umd.edu/eclipse/</td>
</tr>
<tr>
<td><a href="http://pmd.sourceforge.net/">PMD</a></td>
<td>http://pmd.sf.net/eclipse</td>
</tr>
<tr>
<td><a href="http://metrics.sourceforge.net/">Metrics</a></td>
<td>http://metrics.sourceforge.net/update</td>
</tr>
<tr>
<td><a href="http://code.google.com/p/jupiter-eclipse-plugin/">Jupiter</a></td>
<td>http://jupiter-eclipse-plugin.googlecode.com/svn/trunk/site/</td>
</tr>
</tbody>
</table>
<br />Filed under: <a href='http://beradrian.wordpress.com/category/software/'>Software</a> Tagged: <a href='http://beradrian.wordpress.com/tag/java/'>java</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beradrian.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beradrian.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beradrian.wordpress.com/648/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beradrian.wordpress.com&amp;blog=2129041&amp;post=648&amp;subd=beradrian&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beradrian.wordpress.com/2011/01/19/code-analysis-and-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4c43752049a61b677819432a8444a20d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beradrian</media:title>
		</media:content>
	</item>
	</channel>
</rss>
