<?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>41 technologies</title>
	<atom:link href="http://techblog.41concepts.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.41concepts.com</link>
	<description>A software development blog from 41concepts</description>
	<lastBuildDate>Fri, 25 Nov 2011 14:44:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techblog.41concepts.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>41 technologies</title>
		<link>http://techblog.41concepts.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techblog.41concepts.com/osd.xml" title="41 technologies" />
	<atom:link rel='hub' href='http://techblog.41concepts.com/?pushpress=hub'/>
		<item>
		<title>Howto: Java 7(ea) &amp; Eclipse 3.7.1 on Mac OS X</title>
		<link>http://techblog.41concepts.com/2011/10/05/howto-java-7ea-eclipse-3-7-1-on-mac-os-x/</link>
		<comments>http://techblog.41concepts.com/2011/10/05/howto-java-7ea-eclipse-3-7-1-on-mac-os-x/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 19:51:54 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=110</guid>
		<description><![CDATA[I recall that when Java 6 first came out, Mac OS X did not support it at first and it was only when Java 6 got full support by Apple that I decided to switch to a Mac. Now, years later Java 7 is out on Windows/Linux/etc and I have been feeling a bit cheated by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=110&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recall that when Java 6 first came out, Mac OS X did not support it at first and it was only when Java 6 got full support by Apple that I decided to switch to a Mac. Now, years later <strong>Java 7</strong> is out on Windows/Linux/etc and I have been feeling a bit cheated by Apple since they won&#8217;t provide Java 7 and have in fact decided to drop Java support in OS X in the future.</p>
<p>Happily, the <a title="OpenJDK project - Mac" href="http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port">OpenJdk</a> project does have Java 7 for Mac OSX under development with an official build from Oracle available <a title="Oracle jdk7 ea" href="http://jdk7.java.net/macportpreview/">here</a>.</p>
<p>In related news, <a href="http://www.eclipse.org/">Eclipse</a> Indigo SR1 (v3.7.1) has just been released with full JDK1.7 support for Mac OS X. It is available <a title="Eclipse download" href="http://www.eclipse.org/downloads/">here</a>.</p>
<p>To get Eclipse 3.7.1 to work with Java 1.7 (EA) on Mac OS X do the following.</p>
<p>1) Install Java 7 but leave the more complete+stable Java 6 as the default Java on Mac OS X.</p>
<p>2) Install Eclipse and let it run under Java 6.</p>
<p>3) Start Eclipse, select Preferences,  Installed JREs, Execution Environments and click on &#8220;add&#8221;.</p>
<p>4) Select standard VM.</p>
<p>5) In the field JRE home, do <strong>not</strong> attempt to browse for the Java 7 directory as this will not work. Instead just paste the installation dir of the installed Java 7 package +/Content/Home (fx. &#8220;/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home&#8221;) into the JRE home text field and press return.</p>
<p>6) Fix the JRE name in the field below to something suitable like &#8220;JDK1.7&#8243; and click finish.</p>
<p>Now you should be able to create your Java 7 project in eclipse on your Mac OS X and you should be able to run/debug without problems&#8230;. Yes!</p>
<br />Filed under: <a href='http://techblog.41concepts.com/category/eclipse/'>Eclipse</a>, <a href='http://techblog.41concepts.com/category/java/'>Java</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=110&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2011/10/05/howto-java-7ea-eclipse-3-7-1-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>3 small steps for non-OSGI developers that want to stay OSGi compatible</title>
		<link>http://techblog.41concepts.com/2010/05/21/3-small-steps-for-non-osgi-developers-that-want-to-stay-osgi-compatible/</link>
		<comments>http://techblog.41concepts.com/2010/05/21/3-small-steps-for-non-osgi-developers-that-want-to-stay-osgi-compatible/#comments</comments>
		<pubDate>Fri, 21 May 2010 19:08:44 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OSGI]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=101</guid>
		<description><![CDATA[Here is some advice if you do not know OSGI, but you would like your Java code to at least not be hostile towards OSGI environments (so that other OSGI developers can use your code and you might easier &#8220;upgrade&#8221; your code to OSGI later): 1) Do not use (or set/unset/inspect) the context class loader [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=101&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is some advice if you do not know <a title="OSGI" href="http://en.wikipedia.org/wiki/OSGi">OSGI</a>, but you would like your Java code to at least not be hostile towards OSGI environments (so that other OSGI developers can use your code and you might easier &#8220;upgrade&#8221; your code to OSGI later):</p>
<p>1) Do <strong>not</strong> use (or set/unset/inspect) the context class loader returned by Thread.<a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#getContextClassLoader%28%29">getContextClassLoader</a>(). The context class loader is only applicable to JEE applications. For OSGI in particular, any code that relies to the context class loader will generally fail (or more correctly might by accident work in a few OSGI implementation but will fail in most cases)&#8230;. Even if the context loader is non-null do not try to use the context class loader to load any classes as this might interferer with how OSGI resolves classes/versions. To put bluntly, the context class loader should be completely ignored for anything but JEE-only applications, where the context class loader is well defined.</p>
<p>2) Do <strong>not</strong> use <a href="http://java.sun.com/javase/6/docs/api/java/lang/Class.html#forName%28java.lang.String%29">Class.forname</a>(&#8220;name&#8221;) which will not use the class loader setup by OSGI and cause of kinds of failures incl. ClassNotFound exceptions. You can use the classloader returned by any of the existing classes of your module to dynamically load your classes. F.x. you may use Myclass.<a href="http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getClassLoader%28%29">class.getClassLoader</a>().loadClass(&#8220;name&#8221;) instead.</p>
<p>3) Do <strong>not</strong> split your packages across multiple jars (i.e. where multiple jars have the same exact package and java has to combine the files from each jar to get the whole package content). While it works in OSGI, it is complicated and highly undesired.</p>
<p>P.S. Also, do not use the default package (no package) for your code as this will break OSGI. But seriously, who would do that anyway ?</p>
<p>That&#8217;s it, while your code might still not be full OSGI&#8217;fied it will at least be OSGI friendly.</p>
<br />Filed under: <a href='http://techblog.41concepts.com/category/java/'>Java</a>, <a href='http://techblog.41concepts.com/category/java/osgi/'>OSGI</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=101&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/05/21/3-small-steps-for-non-osgi-developers-that-want-to-stay-osgi-compatible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Portable Eclipse projects &amp; goodbye to unbound classpath container (JRE) errors</title>
		<link>http://techblog.41concepts.com/2010/04/25/portable-eclipse-projects-goodbye-to-unbound-classpath-container-jre-errors/</link>
		<comments>http://techblog.41concepts.com/2010/04/25/portable-eclipse-projects-goodbye-to-unbound-classpath-container-jre-errors/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 09:44:30 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=95</guid>
		<description><![CDATA[It is nice to have Eclipse projects under source control but unless you setup your project correctly you will have a high risk of getting JRE errors like &#8220;unbound classpath container&#8221; when you share your project with other developers. For new projects make sure to select &#8220;Execution Environment JRE&#8221; when you create your projects &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=95&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is nice to have <a href="http://www.eclipse.org/">Eclipse</a> projects under source control but unless you setup your project correctly you will have a high risk of getting JRE errors like &#8220;unbound classpath container&#8221; when you share your project with other developers.</p>
<ul>
<li>For new projects make sure to select &#8220;<a href="http://wiki.eclipse.org/index.php/Execution_Environments">Execution Environment JRE</a>&#8221; when you create your projects &#8211; do <strong>not</strong> select project specific JRE or default JRE!</li>
<li> For existing projects select package view, right click on JRE system library, select &#8220;<a href="http://wiki.eclipse.org/index.php/Execution_Environments">Execution Environment</a>&#8221; and the appropriate environment.  F.x. JavaSE-1.6</li>
</ul>
<br />Filed under: <a href='http://techblog.41concepts.com/category/eclipse/'>Eclipse</a>, <a href='http://techblog.41concepts.com/category/java/'>Java</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=95&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/04/25/portable-eclipse-projects-goodbye-to-unbound-classpath-container-jre-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Do’s and Dont’s for exception handling (moved posting)</title>
		<link>http://techblog.41concepts.com/2010/04/19/do%e2%80%99s-and-dont%e2%80%99s-for-exception-handling-moved-posting/</link>
		<comments>http://techblog.41concepts.com/2010/04/19/do%e2%80%99s-and-dont%e2%80%99s-for-exception-handling-moved-posting/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 18:32:09 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Design & Architecture]]></category>
		<category><![CDATA[CopyFromOldBlog]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=68</guid>
		<description><![CDATA[… Or what every developer should know about the implementation of exception handling (in your compiler/os): Modern Exception Handling (EH) in C++, JAVA, Ruby, Modular-3, C# and other modern programming languages is a great tool for handling errors but unfortunately it is sometimes abused by software developers that do not quite get what exceptions are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=68&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>… Or what every developer should know about the  implementation of exception handling (in your compiler/os):</strong></p>
<p>Modern Exception Handling (EH) in C++, JAVA, Ruby, Modular-3, C# and  other modern programming languages is a great tool for handling errors  but unfortunately it is sometimes abused by software developers that do  not quite get what exceptions are really for or are just ignorant of  possible implementations.</p>
<p>The handling of exceptions must be done at runtime by your compiler/os/virtual machine, since it is  generally not possible to predict in advance which handler to transfer  control to, identify which exception has been raised, where to perform  object cleanup during the propagation of an exception and how much  memory to pre-allocate for exception storage. Sometimes the EH runtime  mechanism is compiler-specific and a part of compiler&#8217;s runtime library. In other cases, support for EH is provided through the operating  system or virtual machine.</p>
<p>Common abuses of EH that affect performance include using exceptions as an alternative flow  control mechanism (think sophisticated “goto’s” and  you got the basic idea of this antipattern”)……. Don’t do that. It will  only make the code harder to read. It will also make your code slower to  execute since throwing exceptions are generally very expensive  operations.</p>
<p>Another less apparent misuse of EH is usage of try-catch(-finally),  or similar constructions your language may offer, inside the control  flow of hotspots (such as inside time critical  loops). Don’t do that, as a the try-catch-finally construction may have  overhead even when you won’t expect it.</p>
<p>So why are throwing exceptions expensive and why may the  try-catch-finally constructions (or similar) have overhead ? Well, it  all depends on the language, the implementation of your VM or compiler  (and sometimes on whether you use native code or not if your language  allows it). Depending on your environment, just raising one exception  can be from 10-100.000 times as slow as alternatively returning a simple  return code from the method (in particular depending on if a dynamic registration approach or  a static table approach is used to support control flow transfer). And even if you don’t raise any exception,  just having a try-catch-finally in your control flow can also be  moderately expensive (but usually only enough to be a  real problem inside hotspots).</p>
<p>Specifically, the case of overhead of try-catch-finally constructions  when no exceptions occur is difficult to get rid of by compiler &amp;  virtual-machine implementers. Few implementations on selected virtual machine and chip  architecture got it right and have 100% overhead-free implementations  but many impose a overhead just for placing try/catch/finally  constructions in your control flow. Basically this is because something  like a “linked list” may have to be maintained internally by the compiler or VM  each time the control flow enters or exits a try-catch-finally (unless you are luck to run om a fully static table driven implementation of EH).</p>
<p><em>For much more details about various possible implementations of  exception handling and the impact on performance refer to this old  thesis of mine <a href="http://www.mortench.net/archive/eh.pdf">here</a> (not up-to-date for virtual machines though).<br />
</em></p>
<p><strong>In conclusion, the morale of the story is:</strong><br />
* Do use exception handling for error handling only (not for control  flow).<br />
* Don’t use try-catch-finally constructs inside hot-spots (i.e. loops  and such) if it can be avoided. Do the try-catch at a higher level that  is called less often.<br />
* If your particular java, c++, ruby, clr …  implementation of exception handling on one chip architecture yields  excellent performance even when you break the above rules you are just  plain lucky. Change the version, vendor or chip architecture and you  luck may desert you. Therefore don’t do it <img src="http://www.mortench.net/blog/wp-includes/images/smilies/icon_smile.gif" alt=":-)" /></p>
<p><em>P.S. This post is not about good use EH in general&#8230;. But of cause, don&#8217;t forget to use exception handling when it is necessary and in particular do NOT ignore exceptions. I have also seen quite a few mistakes in code where exceptions are  catched and then ignored. I have even seen senior developers do this  in difficult places like event-handlers where one have to go the extra  mile to actually handle the error (one way to do this is to create have  the main thread manage errors and transfer exceptions to that thread in  the event handlers ; but that is long story so I will reserve that for  another blog posting)</em></p>
<p><strong>Notice:</strong></p>
<p>This post is slightly updated version of a posting originally from my old blog at “<a href="http://www.mortench.net/blog/2006/08/08/dos-and-donts-for-exception-handling-or-what-every-developer-should-know-about-the-implementation-of-exception-handling/" target="_blank">http://www.mortench.net/blog</a>” which I will shortly  retire for good.</p>
<br />Filed under: <a href='http://techblog.41concepts.com/category/design-architecture/'>Design &amp; Architecture</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=68&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/04/19/do%e2%80%99s-and-dont%e2%80%99s-for-exception-handling-moved-posting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>

		<media:content url="http://www.mortench.net/blog/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">:-)</media:title>
		</media:content>
	</item>
		<item>
		<title>Scala meet up in Århus (DK), 5th of May</title>
		<link>http://techblog.41concepts.com/2010/04/08/scala-meet-up-in-arhus-dk-5th-of-may/</link>
		<comments>http://techblog.41concepts.com/2010/04/08/scala-meet-up-in-arhus-dk-5th-of-may/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 10:44:09 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=83</guid>
		<description><![CDATA[If you are interested in the Scala programming language + you are around Århus (Denmark) on the 5th of May, then you are invited to participate in the first Scala software developers meetup in Århus. This free meet up is sponsered by Miracle and 41concepts. We meet at GeekHouse from 5. May. 2010  kl. 15-17 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=83&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are interested in the <a title="Scala" href="http://www.scala-lang.org/">Scala</a> programming language + you are around Århus (Denmark) on the 5th of May, then you are invited to participate in the first Scala software developers meetup in Århus.</p>
<p>This free meet up is sponsered by <a title="Miracle" href="http://www.miracleas.dk">Miracle</a> and <a title="forty one concepts" href="http://www.41concepts.com">41concepts</a>. We meet at <a href="http://www.miracleas.dk/index.php?option=com_content&amp;view=article&amp;id=292%3Ageekhouse&amp;catid=1%3Amiracle-as-ydelser-&amp;Itemid=247&amp;lang=da">GeekHouse </a>from 5. May. 2010  kl. 15-17 , Rosensgade 22, 2. sal, 8000 Århus C.</p>
<p>Agenda is still open, but we will try to ensure that subjects like <a href="http://www.scala-lang.org/">Scala</a> 1.7/1.8, <a href="http://liftweb.net/">Lift</a>, development tools and <a href="http://java.sun.com/">Java</a> integration will be covered. If you are experienced in Scala and want to contribute with a talk or demo, you are very welcome !</p>
<p>P.S. It is the plan to arrange a  similar meet up in Copenhagen at a later time, so don&#8217;t worry if you can&#8217;t travel on the 5th.</p>
<br />Filed under: <a href='http://techblog.41concepts.com/category/scala/'>Scala</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=83&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/04/08/scala-meet-up-in-arhus-dk-5th-of-may/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Breaking encapsulation with C# 2.0 partial classes (moved posting)</title>
		<link>http://techblog.41concepts.com/2010/03/23/breaking-encapsulation-with-c-2-0-partial-classes-moved-posting/</link>
		<comments>http://techblog.41concepts.com/2010/03/23/breaking-encapsulation-with-c-2-0-partial-classes-moved-posting/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 17:03:30 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[CopyFromOldBlog]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=61</guid>
		<description><![CDATA[For good or bad partial classes in C# 2.0 allows breaking of encapsulation as this example will show. In a consulting job I recently ran into an interesting case involving a webservice with several different service methods f1, f2, fn (sample names, not actual names) all taking the same string argument and all returning a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=61&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For good  or bad <a href="http://en.wikipedia.org/wiki/Partial_type">partial  classes</a> in C# 2.0 allows breaking of encapsulation as this example  will show.</p>
<p>In a  consulting job I recently ran into an interesting case involving a  webservice with several different service methods f1, f2, fn <em>(sample  names, not actual names)</em> all taking the same string argument and  all returning a string. The user would select an operation name after  which my code had to call the named operation on a web service using a  standard parameter. Trivial really, if one would do accept bad code like  this below, but I don’t:</p>
<p><code> </code></p>
<pre><em> String operationName = …
 String arg = …
 Webserviceproxy webserviceproxy = …
 // Warning: Badly coupled code begins here (need to update each time we  add/rename/delete operations).
 switch (operationName) {
 case “f1″: return webserviceproxy.f1(arg); break;
 case “f2″: return webserviceproxy.f2(arg); break;
 }</em>
</pre>
<p>What is  really needed is a method to invoke a webservice method by name, while  still using the generated .NET proxy to do the hard soap/http stuff (no  time to reinvent a better wheel here). Reflection is one way to do this, but let&#8217;s try another type-safe method for this posting, because the technique shown here is quite powerful for all sorts of related problems:</p>
<p>Let’s look at an extract  of the generated proxy:</p>
<p><code> </code></p>
<pre><em>public partial class Webserviceproxy :  System.Web.Services.Protocols.SoapHttpClientProtocol
 {
  …
  public string f1(string arg) {
   object[] results = this.Invoke(”f1″, new object[] {arg});
   return ((string)(results[0]));
  }
  …
 }</em></pre>
<p>and at  the inherited SoapHttpClientProtocol:</p>
<p><code> </code></p>
<pre> <em>public  class SoapHttpClientProtocol : HttpWebClientProtocol {</em>
 <em> …</em>
 <em> protected object[]  Invoke(string methodName, object[] parameters) {</em>
 <em> …</em>
 <em> }</em>
 <em> …</em></pre>
<pre> <em> }</em></pre>
<p>It  seems the method “invoke” would fulfil our needs if it was only public  (which it isn’t). So what do we do? Certainly we do not want to modify  the generated file (and lose our changes each time it is regenerated).</p>
<p>The  good news is that Generatedwebserviceproxy is a partial class so we can  extend it with the following code. We will place the code in a file  safely outside the generated proxy class file:</p>
<p><code> </code></p>
<pre><em>public partial class Webserviceproxy :  System.Web.Services.Protocols.SoapHttpClientProtocol
 {
  ///
  /// Dynamic operation that allows us to call an operation by name.
  ///
  public string InvokeAny(String operationName, string arg)
  {
   object[] results = this.Invoke(operationName, new object[] {arg});
   return ((string)(results[0]));
  }
 }</em></pre>
<p>The  compiler will merge the two class definitions effectively adding a new  public InvokeAny method to the generated class. And now we can call our  web service calls dynamicly from using InvokeAny:</p>
<p><code> </code></p>
<pre><em> String operationName = …
 String arg = …
 Webserviceproxy webserviceproxy = …
 return webserviceproxy.InvokeAny(operationName, arg);</em></pre>
<p>Clearly,  easy to do and with better overall code than a “switch” &#8211; even though  it is not without drawbacks as it breaks encapsulation of the generated  proxy.</p>
<p><strong>Post scriptum:</strong><br />
Used the same partial  classes trick today to add a common custom interface to two differently  generated proxies. I now officially miss this feature in Java (yes, <a href="http://www.eclipse.org/aspectj/">AspectJ </a>can do the thing but  it is not a official part of the language).</p>
<p><strong>Recent update and notice:</strong></p>
<p>This post an almost identical copy from my old blog at &#8220;<a href="http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/" target="_blank">http://www.mortench.net/blog</a>&#8221; which I will shortly retire for good.</p>
<br />Filed under: <a href='http://techblog.41concepts.com/category/microsoft/net/'>.Net</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=61&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/03/23/breaking-encapsulation-with-c-2-0-partial-classes-moved-posting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Keeping track of Rails Boot progress</title>
		<link>http://techblog.41concepts.com/2010/03/02/keeping-track-of-rails-boot-progress/</link>
		<comments>http://techblog.41concepts.com/2010/03/02/keeping-track-of-rails-boot-progress/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 21:59:10 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=55</guid>
		<description><![CDATA[Ruby on Rails can take a long time to boot so in some cases it can be useful to provide some kind of progress reporting (f.x. if you are considering using Rails in an embedded application). RoR does not provide any direct means to monitoring the progress of the boot-process, so a little work is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=55&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Rails" href="http://rubyonrails.org/">Ruby on Rails</a> can take a <strong>long</strong> time to boot so in some cases it can be useful to provide some kind of progress reporting (f.x. if you are considering using Rails in an embedded application).</p>
<p>RoR does not provide any direct means to monitoring the progress of the boot-process, so a little work is necessary. Changing the ruby source files involved in the boot process is not ideal from a maintenance standpoint and even if one does so, the progress report turns out to be very uneven. The best approach I could come up with was a Kernel hook which keeps track of when files are <em>require</em>&#8216;d. Both easy to do and works surprisingly well for fine-tuned progress reporting.</p>
<pre># Hook into require so that we can track startup progress
module Kernel
 alias org_untracked_require_myAppName require
 def require(file, *extras)
 v=org_untracked_require_myAppName(file, *extras)
 $progress_coordinator.addWorkDelta(1,'Rails required '+file.to_s)
  unless progress_coordinator.nil? || file.nil? || !v
 v
 end
end</pre>
<br />Filed under: <a href='http://techblog.41concepts.com/category/ruby/rails/'>Rails</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=55&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2010/03/02/keeping-track-of-rails-boot-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Translating models in ruby on rails</title>
		<link>http://techblog.41concepts.com/2009/07/03/translating-models-in-ruby-on-rails/</link>
		<comments>http://techblog.41concepts.com/2009/07/03/translating-models-in-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 14:02:48 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[copenhagenrb]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=49</guid>
		<description><![CDATA[I had to translate a model in Ruby on Rails. The example (in: http://guides.rails.info/i18n.html#translations-for-active-record-models) was: activerecord: models: user: Dude attributes: user: login: "Handle" Well that didn&#8217;t work for me. My only difference was that my model name consisted of two words, so in my yml file I had the following: activerecord: models: email_template: Email template attributes: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=49&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had to translate a model in Ruby on Rails. The example (in: <a href="http://guides.rails.info/i18n.html#translations-for-active-record-models">http://guides.rails.info/i18n.html#translations-for-active-record-models</a>) was:</p>
<pre>activerecord:
  models:
    user: Dude
  attributes:
    user:
      login: "Handle"</pre>
<p>Well that didn&#8217;t work for me. My only difference was that my model name consisted of two words, so in my yml file I had the following:</p>
<pre>activerecord:
  models:
    email_template: Email template
  attributes:
    email_template:
      name: Name
      subject: Subject
      body: Body</pre>
<p>But this did not work in the &#8220;error_messages_for&#8221;. Well the attribute names did, but not the model name that remained untranslated.</p>
<p>After an hour of Googling I didn&#8217;t have any answers until I tried to ad a space instead of the &#8220;underscore&#8221; in the model name. THAT WORKED. So now my yaml file looks like the following. Notice the inconsistencies in the model name!</p>
<pre>activerecord:
  models:
    email template: Email template
  attributes:
    email_template:
    name: Name
    subject: Subject
    body: Body</pre>
<p>Looking at the source code for the helper method &#8220;error_messages_for&#8221; we find the thing bothering me here:</p>
<pre>          I18n.with_options :locale =&gt; options[:locale], :scope =&gt; [:activerecord, :errors, :template] do |locale|
            header_message = if options.include?(:header_message)
              options[:header_message]
            else
              object_name = options[:object_name].to_s.gsub('_', ' ')
              object_name = I18n.t(options[:object_name].to_s, :default =&gt; object_name, :scope =&gt; [:activerecord, :models], :count =&gt; 1)
              locale.t :header, :count =&gt; count, :model =&gt; object_name
            end</pre>
<p>(line 199 of active_record_helper.rb)</p>
<pre>object_name = options[:object_name].to_s.gsub('_', ' ')</pre>
<p>?!?! They are replacing the underscores instead of doing something like:</p>
<pre>eval(resource_name.classify).human_name</pre>
<p>Has someone else noticed this?! And what are your fixes?<br />
Currently I have to write the model name twice in my yaml files. This is not DRY. My file ended up looking like:</p>
<pre>  activerecord:
    models:
      # used by EmailTemplate.human_name
      email_template: "Email template"
      # used by error_messages_for (go figure?!?)
      email template: "Email template"
    attributes:
      email_template:
        name: Name
        subject: Subject
        body: Body</pre>
<br />Posted in Rails  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=49&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2009/07/03/translating-models-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting weeknumbers in Google Calendar</title>
		<link>http://techblog.41concepts.com/2009/07/01/getting-weeknumbers-in-google-calendar/</link>
		<comments>http://techblog.41concepts.com/2009/07/01/getting-weeknumbers-in-google-calendar/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 06:54:26 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=47</guid>
		<description><![CDATA[Ok I know this is a minor thing, but I would really like to have week numbers in my Google Calendar. Apparently this is not something that Google Calendar supports out of the box. We here at 41concepts use the Google App version where we use our own domain, but the following fix works for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=47&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok I know this is a minor thing, but I would really like to have week numbers in my Google Calendar. Apparently this is not something that Google Calendar supports out of the box. We here at <a href="http://www.41concepts.com">41concepts</a> use the Google App version where we use our own domain, but the following fix works for both the &#8220;normal&#8221; Google Calendar as well as the App version:</p>
<p><a href="https://sites.google.com/site/gcalweeknumbers/googlecalendarweeknumbers">https://sites.google.com/site/gcalweeknumbers/googlecalendarweeknumbers</a></p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=47&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2009/07/01/getting-weeknumbers-in-google-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
		<item>
		<title>Generating ANT build numbers using subversion</title>
		<link>http://techblog.41concepts.com/2009/05/08/generating-ant-build-numbers-using-subversion/</link>
		<comments>http://techblog.41concepts.com/2009/05/08/generating-ant-build-numbers-using-subversion/#comments</comments>
		<pubDate>Thu, 07 May 2009 23:31:18 +0000</pubDate>
		<dc:creator>mmc</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://techblog.41concepts.com/?p=38</guid>
		<description><![CDATA[I have been working on a Java project recently where we are using ANT as a build tool and Subversion for version control. Managing software build-versions manually is bothersome and the ANT&#8217;s build-in buildnumber task has many problems/pitfalls. Using subversion and it&#8217;s reversion history is really the way to go for easily generating consistent, ’build’ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=38&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been working on a Java project recently where we are using <a href="http://ant.apache.org/">ANT</a> as a build tool and <a href="http://subversion.tigris.org/">Subversion</a> for version control. Managing software build-versions manually is bothersome and the ANT&#8217;s build-in<a href="http://ant.apache.org/manual/CoreTasks/buildnumber.html"> buildnumber</a> task has many problems/pitfalls.</p>
<p>Using subversion and it&#8217;s reversion history  is really the way to go for easily generating consistent, ’build’ numbers across team member machines. Furthermore, if your application has multiple modules (in multiple directories) subversion can easily provide individual version numbers for each module.</p>
<p>Unfortunately, subversion is poorly supported by ANT. There are many optional add-on tasks that can be downloaded, but all the ones that I looked at either did not work, was not portable or the license was unacceptable.</p>
<p>The best solution I could find was to invoke the subversion command line command &#8220;svnversion&#8221; directly from ANT and with a little help from <a href="http://ant.apache.org/manual/CoreTasks/macrodef.html">here</a> and <a href="http://www.innovationontherun.com/creating-a-build-number-with-ant-and-subversion/">here</a>, I wrote a nice little macro that can be used from ANT 1.6+.</p>
<pre>&lt;macrodef name="svnversion" description="Get last subversion commit version."&gt;
 &lt;attribute name="dir"/&gt;
 &lt;attribute name="outputproperty"/&gt;
 &lt;attribute name="unversionedDefault"/&gt;
 &lt;sequential&gt;
  &lt;echo message="svnversion -n -c '@{dir}' =&gt; '@{outputproperty}'"/&gt;
  &lt;exec outputproperty="@{outputproperty}" executable="svnversion" failonerror="true"&gt;
  &lt;arg line="-n -c @{dir}" /&gt;
  &lt;redirector&gt;
   &lt;outputfilterchain&gt;
   &lt;tokenfilter&gt;
    &lt;replaceregex pattern="^[0-9]*:" replace="" flags="g"/&gt;
    &lt;replaceregex pattern="exported" replace="@{unversionedDefault}" flags="g"/&gt;
   &lt;/tokenfilter&gt;
   &lt;/outputfilterchain&gt;
  &lt;/redirector&gt;
  &lt;/exec&gt;
  &lt;echo message="svnversion returned '${@{outputproperty}}'"/&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;</pre>
<p>Usage example</p>
<pre>&lt;!--
Sets the ant propery 'src_revision' the the subversion revision of the 'src' directory.
--&gt;
&lt;svnversion unversionedDefault="" dir="src" outputproperty="src_revision"/&gt;</pre>
<p>P.S. The last echo statement in the ANT macro also demonstrates a useful ANT trick: How to get the indirect value of a property using another property&#8217;s value as the name of the property that we are retriving the value from? This is something that is only possible in ANT 1.6 using macros.</p>
<br />Posted in Java  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/41tech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/41tech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/41tech.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techblog.41concepts.com&amp;blog=1325376&amp;post=38&amp;subd=41tech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techblog.41concepts.com/2009/05/08/generating-ant-build-numbers-using-subversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d5bb3e48385cef486d4d915f9713e49b?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mmc</media:title>
		</media:content>
	</item>
	</channel>
</rss>
