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

<channel>
	<title>nanoANT</title>
	<atom:link href="http://www.nanoant.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nanoant.com</link>
	<description>Yet another self-employee site &#38; blog</description>
	<lastBuildDate>Sat, 20 Feb 2010 13:50:52 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling kernel IEGD 10.x module for any Linux distribution</title>
		<link>http://www.nanoant.com/linux/compiling-kernel-iegd-10x-module-for-any-linux-distribution</link>
		<comments>http://www.nanoant.com/linux/compiling-kernel-iegd-10x-module-for-any-linux-distribution#comments</comments>
		<pubDate>Fri, 19 Feb 2010 13:23:55 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[IEGD]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=354</guid>
		<description><![CDATA[Intel has put great effort to put complete open-source drivers into recent kernels for its devices. Only device that is clearly missing there is GMA500 (aka Poulsbo, aka US15 chipset, aka Atom Z5xx family). This is understood as it does relay on Imagination Technologies PowerVR core licensed out by Intel to produce GMA500, so most [...]]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://www.nanoant.com/wp/wp-content/uploads/2010/02/atom1.gif"><img class="alignright size-full wp-image-377" title="Intel Atom" src="http://www.nanoant.com/wp/wp-content/uploads/2010/02/atom1.gif" alt="" width="81" height="100" /></a>Intel</em> has put great effort to put complete open-source drivers into recent kernels for its devices. Only device that is clearly missing there is <em>GMA500</em> (aka <em>Poulsbo,</em> aka <em>US15</em> chipset, aka <em>Atom Z5xx</em> family). This is understood as it does relay on I<em>magination Technologies PowerVR</em> core licensed out by <em>Intel</em> to produce <em>GMA500</em>, so most of the driver parts cannot go open-source as it would imply of violation of some agreement between <em>ImgTec</em> and <em>Intel</em>.<br />
<span id="more-354"></span></p>
<p>Fortunately Intel provides binary driver set called <a href="http://edc.intel.com/Software/Downloads/IEGD/">Intel® Embedded Graphics Driver</a> (<em>IEGD</em>) supporting all embedded video chipsets, containing binary form of video driver libraries for latest <em>Xorg</em>, <em>OpenGL</em> and <em>VA</em>.</p>
<p>While most of the work you need to do is to have <tt>IEGD_10_3_Linux.tgz</tt> file (in case of <em>IEGD 10.3</em>) extracted onto the target box and to copy various <tt>.so</tt> files in proper places (follow <em>IEGD</em> documentation). Yet there is one more complicated thing extra &#8211; <em>IEGD Kernel Module</em> (<em>IKM</em>) <tt>iegd_mod.ko</tt> that has to be compiled out of the source shipped with <em>IEGD</em>.</p>
<h2>Linux Kernel module</h2>
<p><em>IEGD</em> documentation clearly states that only few distributions are supported by this driver, and those are i.e. <em>Fedora 8</em> &amp; <em>10</em>, some older <em>Ubuntu 8.x</em> and finally <em>Moblin</em>. But what about others, such as <em>Debian</em>, newer <em>Ubuntu</em>. You think you are unlucky running other distro? You shall understand word &#8220;supported&#8221; here as &#8220;tested&#8221;.</p>
<p>Reading the documentation, in all cases your are supposed to enter <tt>IKM</tt> folder of extracted drivers and launch <tt>install.sh</tt> script. This script shall compile and install without any hassle IKM on &#8220;supported&#8221; distributions. Surprisingly trying that on your distribution even it is not supported may work too! With one important exception it produces bogus driver that will crash your kernel.</p>
<h2>Finding the proper way for your distribution</h2>
<p>This recipe will save some few hours upto few days of struggling with fancy errors trying to compile and run the IKM module on your system <img src='http://www.nanoant.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Investigating the driver and <tt>install.sh</tt> first thing to notice is that it checks you <em>Kernel</em> version, it also takes (false) assumption that your are running one of the &#8220;supported&#8221; distros, so i.e <tt>2.6.27</tt> may mean Fedora version of the <tt>2.6.27</tt> <em>Kernel</em> not any <tt>2.6.27</tt> kernel.</p>
<p><em>Linux</em> distributions have this fancy characteristic that they usually come with heavily patched kernel, so when you take <tt>2.6.xx</tt> driver module from one distro and try to run it on the same version kernel on the other distro it will likely crash your kernel. Why? Incompatible ABI.</p>
<p>What <em>Intel</em> (<em>Tungsten?</em>) did in <em>IKM</em> is prepared <tt>IKM/val</tt> subfolder with headers <strong>extracted</strong> from several kernel sources of &#8220;supported&#8221; distributions. And what <tt>install.sh</tt> does, it tries to guess which one of <tt>DRM</tt> and <tt>AGP</tt> kernel module headers placed in that subfolder are OK for your <em>Kernel</em>.</p>
<p>In case you are running on the &#8220;unsupported&#8221; distribution the answer in 95% cases is <strong>NONE</strong>! Even you will be able to compile the <tt>iegd_mod.ko</tt> using <tt>Makefile</tt> produced by <tt>install.sh</tt> the module will crash you kernel as soon you will try to use it. Since your kernel has incompatible ABI (different structures) with the ABI provided inside <tt>IKM/val</tt> subfolder.</p>
<h2>Preparing for compilation of <em>IKM</em> for your own kernel</h2>
<p>If you are running &#8220;unsupported&#8221; distribution you should avoid then using headers in <tt>IKM/val</tt> subfolder. The right way is to take <tt>AGP</tt> and <tt>DRM</tt> headers out of your running kernel sources (you don&#8217;t have to compile the whole kernel of course).</p>
<p>So go to <tt>IEGD_10_3_Linux</tt> folder and launch:</p>
<pre>sudo apt-get install linux-headers-x.y.zz
apt-get source linux-image-x.y.zz</pre>
<p>Where <tt>x.y.zz</tt> is your running kernel version. (Use your own distro command to grab kernel source if you don&#8217;t run on <em>Debian</em> or <em>Ubuntu</em>)</p>
<p>This will install kernel headers and scripts to build kernel modules and also produce <tt>linux-x.y.zz</tt> folder containing source code of your running <em>Kernel</em>. The whole trick if to place (replace) <tt>Makefile</tt> in <tt>IKM</tt> folder as below:</p>
<pre class="textmate-source"><span class="source source_makefile"><span class="variable variable_other variable_other_makefile">KERNELVER ?= $(shell uname -r)</span>
<span class="variable variable_other variable_other_makefile">KERNELDIR ?= /lib/modules/$(KERNELVER)/build</span>
<span class="variable variable_other variable_other_makefile">INSTALLDIR ?= /lib/modules/$(KERNELVER)/kernel/drivers/char/agp</span>
<span class="variable variable_other variable_other_makefile">PWD ?= $(realpath .)</span>

EXTRA_CFLAGS += -I$(PWD)/include
EXTRA_CFLAGS += -I$(PWD)/../linux-$(KERNELVER)/drivers/char/agp
EXTRA_CFLAGS += -I/lib/modules/$(KERNELVER)/build/include/drm

<span class="meta meta_function meta_function_makefile"><span class="entity entity_name entity_name_function entity_name_function_makefile">all:</span> clean modules</span>

<span class="meta meta_function meta_function_makefile"><span class="entity entity_name entity_name_function entity_name_function_makefile">modules:</span>
</span>	@echo $(PWD)
	@$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

<span class="meta meta_function meta_function_makefile"><span class="entity entity_name entity_name_function entity_name_function_makefile">install:</span>
</span>	install -o root -g root -m 755 -d $(INSTALLDIR)
	install -o root -g root -m 744 iegd_mod.ko $(INSTALLDIR)
	/sbin/depmod -a

<span class="meta meta_function meta_function_makefile"><span class="entity entity_name entity_name_function entity_name_function_makefile">uninstall:</span>
</span>	rm -rf $(INSTALLDIR)/iegd_mod.ko
	/sbin/depmod -a

<span class="meta meta_function meta_function_makefile"><span class="entity entity_name entity_name_function entity_name_function_makefile">clean:</span>
</span>	@rm -f *.o iegd*.ko iegd*.mod.c iegd*.o agp/*.o drm/*.o Module.symvers
	@rm -fr .intel* .tmp* .*.cmd agp/.*.cmd drm/.*.cmd

obj-m := iegd_mod.o
iegd_mod-objs := agp/pci.o agp/global.o agp/drv_alm.o agp/drv_nap.o agp/drv_plb.o agp/drv_cmn.o agp/drv_gn4.o drm/iegd_drv.o drm/iegd_interface.o drm/iegd_interface_265.o drm/iegd_interface_2611.o drm/iegd_interface_2615.o drm/iegd_interface_2624.o drm/psb_irq.o</span></pre>
<p>You don&#8217;t need to launch <tt>install.sh</tt> at all. Just paste the file as above.</p>
<p>As you see now, this <tt>Makefile</tt> references to <tt>../linux-$(KERNELVER)</tt> for your running <em>Kernel</em> source <tt>AGP</tt> &amp; <tt>DRM</tt> headers. Yet however you may still need to do few tweaks in your <tt>Makefile</tt>, see notes below:</p>
<p><strong>Note (1)</strong> In case you are running older kernel, <tt>/lib/modules/$(KERNELVER)/build/include/drm </tt>may not exist, then <tt>$(PWD)/../linux-$(KERNELVER)/drivers/char/drm </tt>should be right path to put in the <tt>Makefile</tt> instead.</p>
<p><strong>Note (2)</strong> The <em>Kernel</em> source code folder you downloaded (i.e. via <tt>apt-get source</tt>) may not actually match exactly <tt>linux-$(KERNELVER)</tt>, so you may change that <tt>EXTRA_CFLAGS</tt> setting manually:</p>
<ul>
<li>In case of <em>Ubuntu</em> `<tt>uname -r</tt>` is <tt>2.6.31-19-generic</tt> while the extracted source folder name has no <tt>-generic</tt> suffix and it is just <tt>linux-2.6.31-19</tt>.</li>
<li>In case of <em>Debian</em> `<tt>uname -r</tt>` is <tt>2.6.26-21</tt> while the extracted source folder name is <tt>linux-2.6-2.6.26-21</tt>. Weird huh?</li>
</ul>
<h3>Final fixes before compilation</h3>
<p>There is a file still missing if you try now to `<tt>make</tt>`. It is file that exists in <tt>IKM/val/agp</tt> but does not exist in your <tt>$(PWD)/../linux-$(KERNELVER)/drivers/char/agp</tt>. It is called <tt>interface_abs.h</tt>.</p>
<p>Wonder why the heck it is NOT in <tt>IKM/include</tt>!? This is a little lack of consequence from <em>Intel</em> here.</p>
<p>Anyway just copy <tt>interface_abs.h</tt> into <tt>IKM/include</tt> out of <tt>IKM/val/agp/agpm0vmob2</tt> if you are running on &gt;= 2.6.30 <em>Kernel</em> or from <tt>IKM/val/agp/agpm0v103</tt> otherwise. The only difference between <tt>interface_abs.h</tt> from <tt>agpm0vmob2</tt> and <tt>agpm0v103</tt> is one macro definition.</p>
<p>Finally we need two little extra fixes.</p>
<p><strong>(1)</strong> Trying to compile on <em>Debian Lenny</em> we will get many nasty errors from kernel headers for <tt>IKM/drm/iegd_interface.c</tt>. Moving <tt>igd_abs.h</tt> inclusion in this source file little down fixes the issue. Edit <tt>IKM/drm/iegd_interface.c</tt> as below:</p>
<pre> #include "iegd.h"
<strong>-#include "igd_abs.h"</strong>
 #include "drmP.h"
 #include "drm.h"

<strong>+#include "igd_abs.h"</strong>
 #include "iegd_drm.h"
 #include "iegd_drv.h"
 #include "psb_intregs.h"</pre>
<p><strong>(2)</strong> <tt>IKM/drm/iegd_drv.c</tt> tries to include <tt>linux/config.h</tt> at the very begining of the file. This is not actually necessary, and anyway does not exist, so you may comment that out:</p>
<pre><strong>-#include &lt;linux/config.h&gt;
+/* #include &lt;linux/config.h&gt; */</strong></pre>
<h3>Compiling at last</h3>
<p>Now you are ready to so `<tt>make</tt>` and `<tt>sudo make install</tt>`. This time  <tt>iegd_mod.ko</tt> should be ABI compatible with your kernel.</p>
<p>I have tested this method on <em>Debian 5.0 Lenny</em> and <em>Ubuntu 9.10 Karmic Koala</em>.</p>
<p>To ensure everything works fine after driver installation try:</p>
<pre>sudo modprobe iegd_mod</pre>
<p>And try to go into <tt>IKM/agp</tt> and compile and run <tt>agp_test.c</tt>:</p>
<pre>gcc -o agp_test agp_test.c
sudo ./agp_test</pre>
<p>Next try the same with <tt>IKM/drm</tt> compiling and running <tt>drm_test.c</tt>.</p>
<p>If those two test won&#8217;t fail and won&#8217;t blow your kernel it means you have fully working <em>IEGD</em> module on your own <em>Linux</em> distro.</p>
<h3>Notes for users of old psb-modules or psb-kernel-source Ubuntu package</h3>
<p>Older <em>psb-modules</em> and <em>psb-kernel-source</em> <em>Ubuntu</em> packages install their own incompatible <tt>drm.ko</tt> module at <tt>/lib/modules/`uname -r`/updates/char/drm</tt>.</p>
<p>Check <tt>find /lib/modules/`uname -r` -type f -name 'drm*'</tt> you should have only one: <tt>/lib/modules/`uname -r`/kernel/drivers/gpu/drm/drm.ko</tt></p>
<p>In case if you find other <tt>drm.ko</tt>, probably in <tt>updates/char/drm</tt> delete it. That one came from <em>psb-kernel-source</em> and is causing you a trouble. You may ensure you got only valid <tt>drm.ko</tt> reinstalling your kernel image with:</p>
<p><tt>apt-get install --reinstall linux-image-`uname -r`</tt></p>
<h2>Notes for curious</h2>
<p>The difference of <tt>Makefile</tt> of mine and <tt>Makefile</tt> produced of <tt>install.sh</tt> is the beginning:</p>
<pre class="textmate-source"><span class="source source_makefile"><span class="variable variable_other variable_other_makefile">KERNELVER ?= $(shell uname -r)</span>
<span class="variable variable_other variable_other_makefile">KERNELDIR ?= /lib/modules/$(KERNELVER)/build</span>
<span class="variable variable_other variable_other_makefile">INSTALLDIR ?= /lib/modules/$(KERNELVER)/kernel/drivers/char/agp</span>
<span class="variable variable_other variable_other_makefile">PWD ?= $(realpath .)</span>

EXTRA_CFLAGS += -I$(PWD)/include
EXTRA_CFLAGS += -I$(PWD)/../linux-$(KERNELVER)/drivers/char/agp
EXTRA_CFLAGS += -I/lib/modules/$(KERNELVER)/build/include/drm</span></pre>
<p>If you try to run <tt>install.sh</tt> <tt>EXTRA_CFLAGS</tt> will include two of <tt>IKM/val</tt> folders which contain some <em>Kernel</em> source extracted header definitions that are likely not compatible with your <em>Kernel</em>.</p>
<p>I use also <tt>PWD ?= $(realpath .</tt>) here instead of <tt>PWD ?= $(shell pwd)</tt> because with some <em>Linux</em> headers versions $(shell pwd) resolves to /lib/modules path not the path where IKM sources are.</p>
<h2>Notes for <em>Intel</em></h2>
<p>It would be nice for next <em>IEGD</em> release if <em>IKM</em> source tree would be made for readable and clear:</p>
<ol>
<li><tt>IKM/val</tt> should be renamed to <tt>IKM/kernel-headers</tt> (what the heck &#8220;val&#8221; means here ?!) and this should be noted somewhere in docs that files here are NOT made by <em>Intel</em> but extracted of &#8220;supported&#8221; <em>Linux</em> distributions <em>Kernel</em> sources</li>
<li><tt>interface_abs.h</tt> should moved away from <tt>IKM/val</tt> (<tt>IKM/kernel-headers</tt>) to avoid confusion (with point 1) and placed into <tt>IKM/includes</tt> (and there should be <tt>#ifdef</tt> for this one macro that makes it different for across 2.6.30)</li>
<li><tt>IKM/drm/iegd_interface.c</tt> should be fixed as described above (moving <tt>iegd_abs.h</tt> inclusion little bit down).</li>
<li><tt>IKM/drm/iegd_drv.c</tt> inclusion of <tt>&lt;include/config.h&gt;</tt> is not necessary, may be removed.</li>
<li>Finally <tt>install.sh</tt> should contain case when running on &#8220;unsupported&#8221; distribution.<br />
So it shall make SURE if running on &#8220;supported&#8221; distributions and then and only then use files from <tt>IKM/kernel-headers</tt>, OTHERWISE ask for a path for your own <em>Linux</em> distribution <em>Kernel</em> source&#8217;s to find a path for your own <tt>kernel/drivers/char/agp</tt> and <tt>kernel/drivers/char/drm</tt> (<tt>include/drm</tt>) i.e. by showing:</p>
<pre>Your Linux distribution and Kernel version was untested, however you may try to compile and run driver on your own risk.
Please provide your running kernel sources extracted i.e. on Debian or Ubuntu using apt-get source linux-image-2.6-686:
[path to your kernel]:</pre>
</li>
</ol>
<h3>Fell free to post your comments and problems with method presented here below using comment form!</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/linux/compiling-kernel-iegd-10x-module-for-any-linux-distribution/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Is closed-source project like CMSity doomed to the death nowadays?</title>
		<link>http://www.nanoant.com/projects/is-closed-source-project-like-cmsity-doomed-to-the-death-nowadays</link>
		<comments>http://www.nanoant.com/projects/is-closed-source-project-like-cmsity-doomed-to-the-death-nowadays#comments</comments>
		<pubDate>Tue, 28 Apr 2009 14:31:46 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[cmsity]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[open-source]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=317</guid>
		<description><![CDATA[
Seems it is very hard to spread the news about CMSity around the world, and acquire some user base of this project. Till now I did few commercial deployments of CMSity, however the cmsity.com page hits look really miserable.
I wrote mails to many CMS magazines asking to drop a note about my project. However only [...]]]></description>
			<content:encoded><![CDATA[<p class="alignright"><a href="http://www.cmsity.com/"><img class="size-full wp-image-181" title="CMSity Logo" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/cmsity_ss.png" alt="" width="278" height="89" /></a></p>
<p>Seems it is very hard to spread the news about <a href="http://www.cmsity.com/">CMSity</a> around the world, and acquire some user base of this project. Till now I did few commercial deployments of <em>CMSity</em>, however the <a href="http://www.cmsity.com/users">cmsity.com</a> page hits look really miserable.</p>
<p>I wrote mails to many <em>CMS</em> magazines asking to drop a note about my project. However only two of them replied and posted something on their sites about <em>CMSity</em>. So I still miss some more reviews that can put a breathe into the project. But it seems my mails are ignored by majority of big <em>CMS</em> related sites making very hard to promote new project like <em>CMSity</em> nowadays.</p>
<p>Since I believe this software presents great value and <a href="http://www.cmsity.com/blog/cmsity-vs-wordpress">outperforms other popular solutions</a> I consider releasing it as <strong>open-source</strong>, however probably not <strong>GPL</strong> but some license that will force the code to stay by the author (me), deny all the forks, making all community changes happen to be included in the source code base.</p>
<p>Open-source is a great idea, but I have seen too many projects that were just bloated, forked and spoiled by masses of developers that were just about put something of themselves in the project regardless of quality of the included changes, missing overall sense and directions of the project itself. That is why I decided to keep the code closed initially, while giving the licenses for free, but it seems non-open source project are just kicked out of the focus today, and releasing the source code is a &#8220;must&#8221; to gain the momentum.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/projects/is-closed-source-project-like-cmsity-doomed-to-the-death-nowadays/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Haml + Gettext = automagic translation</title>
		<link>http://www.nanoant.com/programming/haml-gettext-automagic-translation</link>
		<comments>http://www.nanoant.com/programming/haml-gettext-automagic-translation#comments</comments>
		<pubDate>Mon, 13 Apr 2009 21:39:41 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[haml templates ruby performance i18n l10n multilanguage]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=290</guid>
		<description><![CDATA[I was rather sceptic to Haml once I have first time read about it. But after recently playing a while with it I can frankly express that it is simply outstanding template engine for Ruby. What I miss about Haml is some seamless integration with some i18n framework (gem).
So I decided to create Haml &#8220;mod&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://www.nanoant.com/wp/wp-content/uploads/2009/04/haml.gif" alt="Haml logo" />I was rather sceptic to <a href="http://haml.hamptoncatlin.com/">Haml</a> once I have first time read about it. But after recently playing a while with it I can frankly express that it is simply outstanding template engine for <a href="http://www.ruby-lang.org/">Ruby</a>. What I miss about <em>Haml</em> is some seamless integration with some i18n framework (gem).</p>
<p>So I decided to create <em>Haml</em> &#8220;mod&#8221; that uses <a href="http://www.yotabanana.com/hiki/ruby-gettext.html">GetText</a> (<a href="http://github.com/grosser/fast_gettext/tree/master">FastGettext</a> alternatively) to automagically translate static texts from <em>Haml</em> templates during precompilation stage. So something that you don&#8217;t see and you don&#8217;t need to worry about.<span id="more-290"></span></p>
<p>Normally you would use <tt>_(text)</tt> calls to translate string in your templates as below:</p>
<pre class="textmate-source"><span class="text text_haml"><span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">h1</span></span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> _<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>Items<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></span>
<span class="meta meta_line meta_line_ruby meta_line_ruby_haml">-<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> items<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>each </span><span class="source source_ruby source_ruby_embedded source_ruby_embedded_html"><span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do</span> |item|</span></span>
  <span class="entity entity_name entity_name_tag entity_name_tag_class entity_name_tag_class_haml">.item</span>
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">h1</span></span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> item<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>title</span></span>
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">a</span></span><span class="meta meta_section meta_section_attributes meta_section_attributes_haml">{<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span>href<span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/edit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> }</span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> _<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>Edit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></span>
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">a</span></span><span class="meta meta_section meta_section_attributes meta_section_attributes_haml">{<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span>href<span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/delete<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> }</span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> _<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>Delete<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></span></span></pre>
<p>You can see this is pretty ugly and unreadable. If you gonna have multi-language site you want to translate all of the static texts there anyway, without doing anything extra. So you would prefer to type:</p>
<pre class="textmate-source"><span class="text text_haml"><span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">h1</span></span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> <span class="variable variable_other variable_other_constant variable_other_constant_ruby">Items</span></span></span>
<span class="meta meta_line meta_line_ruby meta_line_ruby_haml">-<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> items<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>each </span><span class="source source_ruby source_ruby_embedded source_ruby_embedded_html"><span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do</span> |item|</span></span>
  <span class="entity entity_name entity_name_tag entity_name_tag_class entity_name_tag_class_haml">.item</span>
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">h1</span></span><span class="meta meta_line meta_line_ruby meta_line_ruby_haml">=<span class="source source_ruby source_ruby_embedded source_ruby_embedded_haml"> item<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>title</span></span>
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">a</span></span><span class="meta meta_section meta_section_attributes meta_section_attributes_haml">{<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span>href<span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/edit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> }</span> Edit
    <span class="meta meta_tag meta_tag_haml"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_haml">%</span><span class="entity entity_name entity_name_tag entity_name_tag_haml">a</span></span><span class="meta meta_section meta_section_attributes meta_section_attributes_haml">{<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span>href<span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/delete<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> }</span> Delete</span></pre>
<p>And have <em>&#8220;Items&#8221;</em>, <em>&#8220;Edit&#8221;</em>, <em>&#8220;Delete&#8221;</em> just translated, right? This is what my mod does. It translates all of those at precompilation stage which also is much better for your application performance, since <em>GetText</em> routines are called only once at precompilation stage. Here it goes.</p>
<h3>haml_gettext.rb</h3>
<pre class="textmate-source"><span class="source source_ruby"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Haml gettext module providing gettext translation for all Haml plain text calls
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> http://pastie.org/445295
</span>
<span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">Haml::Engine</span></span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Inject _ gettext into plain text and tag plain text calls
</span>  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">push_plain</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">text</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby">super</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>_<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>text<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">))</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">parse_tag</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">line</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    tag_name<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes_hash<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> object_ref<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> nuke_outer_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
      nuke_inner_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> action<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> value <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby">super</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>line<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    value <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> _<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="keyword keyword_control keyword_control_ruby">unless</span> action <span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby">||</span> value<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>empty?
    <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span>tag_name<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes_hash<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> object_ref<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> nuke_outer_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
        nuke_inner_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> action<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> value<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>All you need is to choose <em>GetText</em> or <em>FastGettext</em> and load my mod later on.</p>
<pre class="textmate-source"><span class="source source_ruby"><span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>haml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
<span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>fast_gettext<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
<span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">include</span> <span class="support support_class support_class_ruby">FastGettext</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">Translation</span>
<span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>haml_gettext<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span></span></pre>
<p>You probably want to know the way to your gettext pot/po files out of the tempaltes. I have prepared here Rake tasks for you as well (based on work I found somewhere over Ruby blogs) to parse Haml templates extended to include static texts in the translation.</p>
<h3>Rakefile</h3>
<pre class="textmate-source"><span class="source source_ruby">desc <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Update pot/po files.<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>updatepo</span> <span class="keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby">do
</span>  <span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>gettext/tools<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
  <span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>haml_parser<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
  <span class="support support_class support_class_ruby">GetText</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>update_pofiles<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>rbigg<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="support support_class support_class_ruby">Dir</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>glob<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>{lib,views}/**/*.{rb,haml}<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">&lt;&lt;</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>rbigg.rb<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>rbigg 1.0.0<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>po_root</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>locale<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<h3>haml_parser.rb</h3>
<pre class="textmate-source"><span class="source source_ruby"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Haml gettext parser module
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> http://pastie.org/445297
</span><span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>gettext/tools/rgettext<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
<span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>gettext/parser/ruby<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>
<span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>haml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>

<span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">Haml::Engine</span></span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Overriden function that parses Haml tags
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Injects gettext call for plain text action.
</span>  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">parse_tag</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">line</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    tag_name<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes_hash<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> object_ref<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> nuke_outer_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
      nuke_inner_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> action<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> value <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby">super</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>line<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>precompiled</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">&lt;&lt;</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>_(<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\"</span><span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>value<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\"</span>)<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\n</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="keyword keyword_control keyword_control_ruby">unless</span> action <span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby">||</span> value<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>empty?
    <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span>tag_name<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> attributes_hash<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> object_ref<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> nuke_outer_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
        nuke_inner_whitespace<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> action<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> value<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Overriden function that producted Haml plain text
</span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Injects gettext call for plain text action.
</span>  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">push_plain</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">text</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>precompiled</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">&lt;&lt;</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>_(<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\"</span><span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>text<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="constant constant_character constant_character_escape constant_character_escape_ruby">\"</span>)<span class="constant constant_character constant_character_escape constant_character_escape_ruby">\n</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Haml gettext parser
</span><span class="meta meta_module meta_module_ruby"><span class="keyword keyword_control keyword_control_module keyword_control_module_ruby">module</span> <span class="entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby">HamlParser</span></span>
  <span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">module_function</span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">target?</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">file</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    <span class="support support_class support_class_ruby">File</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>extname<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>file<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>.haml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">parse</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">file<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> ary <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[]</span></span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    haml <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="support support_class support_class_ruby">Haml</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">Engine</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="support support_class support_class_ruby">IO</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>readlines<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>file<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>join<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    code <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> haml<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>precompiled<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>split<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span>$<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="support support_class support_class_ruby">GetText</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">RubyParser</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>parse_lines<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>file<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> code<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> ary<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="support support_class support_class_ruby">GetText</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">RGetText</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>add_parser<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">HamlParser</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></pre>
<p>So this is it. Have fun with nice and clean templates that are translated on the fly</p>
<h2>See &amp; get more&#8230;</h2>
<p>You can find more recent and complete code at my <a href="http://github.com/nanoant/sinatra-hat">Sinatra Hat</a> GitHub hosted Ruby gem project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/programming/haml-gettext-automagic-translation/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Opening specified path in Terminal&#8217;s new tab</title>
		<link>http://www.nanoant.com/programming/opening-specified-path-in-terminals-new-tab</link>
		<comments>http://www.nanoant.com/programming/opening-specified-path-in-terminals-new-tab#comments</comments>
		<pubDate>Tue, 24 Mar 2009 11:13:36 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=284</guid>
		<description><![CDATA[Updates

It uses now click menu instead of keystroke &#8220;System Events&#8221; command, because in some cases when you had this script assigned to shortcut that used Ctrl or Shift modifiers, those modifiers were sent together with Cmd to &#8220;Terminal&#8221; producing invalid behavior.
It waits 0.5 second when window is busy just in case Terminal.app was not running and it is just [...]]]></description>
			<content:encoded><![CDATA[<h2>Updates</h2>
<ol>
<li>It uses now <tt>click menu</tt> instead of <tt>keystroke</tt> <em>&#8220;System Events&#8221;</em> command, because in some cases when you had this script assigned to shortcut that used <em>Ctrl</em> or <em>Shift</em> modifiers, those modifiers were sent together with <em>Cmd</em> to <em>&#8220;Terminal&#8221;</em> producing invalid behavior.</li>
<li>It waits 0.5 second when window is busy just in case <em>Terminal.app</em> was not running and it is just loading the shell which makes it <tt>busy</tt> for short while too. Fixes incorrect behavior of opening extra tab when <em>Terminal.app</em> was not running.</li>
</ol>
<p>If you ever wondered how to open specified path in new tab of <em>Terminal.app</em> or reuse current one if it is not busy (running a command), here&#8217;s a script you may use:</p>
<pre class="textmate-source"><span class="source source_applescript"><span class="meta meta_tell-block meta_tell-block_application meta_tell-block_application_generic meta_tell-block_application_generic_applescript"><span class="keyword keyword_control keyword_control_applescript">tell</span> <span class="support support_class support_class_built-in support_class_built-in_applescript">application</span> <span class="string string_quoted string_quoted_double string_quoted_double_application-name string_quoted_double_application-name_applescript"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span>Terminal<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span></span>

    <span class="support support_function support_function_standard-suite support_function_standard-suite_applescript">activate</span>

    <span class="keyword keyword_control keyword_control_applescript">set</span> <span class="variable variable_other variable_other_applescript">windowCount</span> <span class="keyword keyword_control keyword_control_applescript">to</span> <span class="punctuation punctuation_section punctuation_section_group punctuation_section_group_applescript">(</span><span class="support support_function support_function_standard-suite support_function_standard-suite_applescript">count</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> the <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">windows</span><span class="punctuation punctuation_section punctuation_section_group punctuation_section_group_applescript">)</span>

    <span class="comment comment_line comment_line_double-dash comment_line_double-dash_applescript"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_applescript">--</span> Terminal may be just launched loading the shell, wait a bit
</span>    <span class="keyword keyword_control keyword_control_applescript">if</span> windowCount <span class="keyword keyword_operator keyword_operator_applescript">is greater than</span> <span class="constant constant_numeric constant_numeric_applescript">0</span> <span class="keyword keyword_operator keyword_operator_applescript">and</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">window</span> <span class="keyword keyword_operator keyword_operator_applescript">is</span> busy <span class="keyword keyword_control keyword_control_applescript">then</span>
        <span class="support support_function support_function_standardadditions support_function_standardadditions_user-interaction support_function_standardadditions_user-interaction_applescript">delay</span> <span class="constant constant_numeric constant_numeric_applescript">0.5</span>
    <span class="keyword keyword_control keyword_control_applescript">end</span>

    <span class="comment comment_line comment_line_double-dash comment_line_double-dash_applescript"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_applescript">--</span> Still busy / no windows? open new tab
</span>    <span class="keyword keyword_control keyword_control_applescript">if</span> windowCount <span class="keyword keyword_operator keyword_operator_applescript">is greater than</span> <span class="constant constant_numeric constant_numeric_applescript">0</span> <span class="keyword keyword_operator keyword_operator_applescript">and</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">window</span> <span class="keyword keyword_operator keyword_operator_applescript">is</span> busy <span class="keyword keyword_operator keyword_operator_applescript">or</span> windowCount <span class="keyword keyword_operator keyword_operator_applescript">is</span> <span class="constant constant_numeric constant_numeric_applescript">0</span> <span class="keyword keyword_control keyword_control_applescript">then</span>
<span class="meta meta_tell-block meta_tell-block_application meta_tell-block_application_generic meta_tell-block_application_generic_applescript">        <span class="keyword keyword_control keyword_control_applescript">tell</span> <span class="support support_class support_class_built-in support_class_built-in_applescript">application</span> <span class="string string_quoted string_quoted_double string_quoted_double_application-name string_quoted_double_application-name_applescript"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span>System Events<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span></span> <span class="keyword keyword_control keyword_control_applescript">to</span> <span class="keyword keyword_control keyword_control_applescript">tell</span> process <span class="string string_quoted string_quoted_double string_quoted_double_applescript"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span>Terminal<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span></span>
            click <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> menu <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">item</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> menu <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">second</span> menu <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">item</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> menu <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">third</span> menu bar <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">item</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">of</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> menu bar
        <span class="keyword keyword_control keyword_control_applescript">end tell</span></span>
    <span class="keyword keyword_control keyword_control_applescript">end if</span>

    do <span class="support support_class support_class_built-in support_class_built-in_applescript">script</span> <span class="string string_quoted string_quoted_double string_quoted_double_applescript"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span>cd #{e_as(e_sh(dir))}<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_applescript">"</span></span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">in</span> <span class="keyword keyword_control keyword_control_reference keyword_control_reference_applescript">first</span> <span class="support support_class support_class_standard-suite support_class_standard-suite_applescript">window</span>

<span class="keyword keyword_control keyword_control_applescript">end tell</span></span></span></pre>
<p>Where <tt>#{e_as(e_sh(dir))}</tt> is your desired folder. This is modified chunk of <em>TextMate</em>&#8217;s command script found at <a href="http://markelikalderon.com/blog/2008/05/18/open-terminal-in-new-tab/">Mark Eli Kalderon&#8217;s Blog</a>. Thanks Mark!</p>
<p><em>Note:</em> Mark&#8217;s <em>TextMate</em> command script does not open anything when <em>Terminal.app</em> has no windows or it is not running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/programming/opening-specified-path-in-terminals-new-tab/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back from ITSBA OpenCoffee</title>
		<link>http://www.nanoant.com/business/back-from-itsba-opencoffee</link>
		<comments>http://www.nanoant.com/business/back-from-itsba-opencoffee#comments</comments>
		<pubDate>Thu, 19 Mar 2009 14:46:05 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=236</guid>
		<description><![CDATA[Today I have paid a visit at OpenCoffee organized by IT Small Business Alliance at Filmowa Cafe (just inside Kino Kijów). That wasn&#8217;t big effort for me since I am just living about 15mins by walk from there. I was surprised to meet many great folks involved in Kraków&#8217;s local IT business and some representatives of broader companies/organizations [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-241" title="itsba-logo" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/itsba-logo-300x113.png" alt="" width="300" height="113" />Today I have paid a visit at <em>OpenCoffee</em> organized by <a href="http://itsba.pl/">IT Small Business Alliance</a> at <em>Filmowa Cafe</em> (just inside<em> Kino Kijów</em>). That wasn&#8217;t big effort for me since I am just living about 15mins by walk from there. I was surprised to meet many great folks involved in Kraków&#8217;s local IT business and some representatives of broader companies/organizations like <em>Cisco</em> and <a href="http://uk.techcrunch.com/about/">TechCrunch</a>.</p>
<p>I am running my own business for 3 years now, however last 2.5 years I was working actually for just 3 clients that were keeping me alive, most of them were foreign companies. So I wasn&#8217;t particularly interested what is going on in Kraków where I am living for past 10 years. Since lately one of my major clients is going to shut down his business I decided to try myself at the local market &#8211; as so called &#8220;freelancer&#8221; seeking for the projects.</p>
<p>I must confess it does happen a lot in Kraków nowadays. Wow&#8230; I am pretty happy I have chosen to stay in such a great city. Keeping my finger crossed for Mike Butcher having <a href="http://uk.techcrunch.com/about/">TechCrunch</a> conference done here in Kraków.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/business/back-from-itsba-opencoffee/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I use this!</title>
		<link>http://www.nanoant.com/apple/i-use-this</link>
		<comments>http://www.nanoant.com/apple/i-use-this#comments</comments>
		<pubDate>Thu, 19 Mar 2009 14:38:04 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=229</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://osx.iusethis.com/user/ono"><img class="size-full wp-image-231  aligncenter" title="iusethis" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/iusethis.gif" alt="" width="500" height="220" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/apple/i-use-this/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MinGW on Mac, hell yeah!</title>
		<link>http://www.nanoant.com/programming/mingw-on-mac-hell-yeah</link>
		<comments>http://www.nanoant.com/programming/mingw-on-mac-hell-yeah#comments</comments>
		<pubDate>Thu, 19 Mar 2009 14:18:18 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=223</guid>
		<description><![CDATA[Want to build some small/or not, neat Windows/or Linux application on your Mac? Just use MinGW/Linux GCC cross compiler package from Pierre Molinaro. Those were recently updated to GCC 4.2 and do cross-compile really fast, especially when using make -j2.
It is hard to be Switcher and totally forget/abandon Windows projects, since most of my clients&#8230; well almost [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-227" title="GCC" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/gccegg-65.gif" alt="GCC Logo" width="109" height="130" />Want to build some small/or not, neat <em>Windows</em>/or <em>Linux</em> application on your <em>Mac</em>? Just use <em>MinGW</em>/<em>Linux GCC</em> cross compiler package from <a href="http://crossgcc.rts-software.org/">Pierre Molinaro</a>. Those were recently updated to <em>GCC 4.2</em> and do cross-compile really fast, especially when using <tt>make -j2.</tt></p>
<p>It is hard to be Switcher and totally forget/abandon <em>Windows</em> projects, since most of my clients&#8230; well almost all of them are on *indows. So since I switched, I am constant user of <a href="http://www.vmware.com/products/fusion/">VMWare Fusion</a> + XP (Win7, Win98) as a guest OS having <em>Visual Studio</em> installed inside. But sometimes if you want to create small cute application for *indows I prefer do it 100% on <em>Mac</em> with <em>TextMate</em>, then just test it on <em>Windows</em>. This is what <em>MinGW</em> cross compiler is perfect for. Not to mention I did <em>Miranda&#8217;s</em> <em>MinGW</em> <a href="https://miranda.svn.sourceforge.net/svnroot/miranda/trunk/miranda/Makefile">Makefile</a> that successfully builds miranda on Linux/Mac using cross-compiler, so it can be queued for nightly builds on SF.net servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/programming/mingw-on-mac-hell-yeah/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No more free lunch, maybe a pie for free?</title>
		<link>http://www.nanoant.com/publications/no-more-free-lunch-maybe-a-pie-for-free</link>
		<comments>http://www.nanoant.com/publications/no-more-free-lunch-maybe-a-pie-for-free#comments</comments>
		<pubDate>Wed, 11 Mar 2009 23:40:11 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Publications]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[parallel]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=205</guid>
		<description><![CDATA[How to survive computing paradigm shift
We cannot count on free &#8220;performance lunch&#8221; anymore, but how about at least a pie for free? Do we need to throw all our old source-code into the trash bin and start over again? 
Certainly, not. We may think of our old software as a zombie of the new multi-core era. Still there [...]]]></description>
			<content:encoded><![CDATA[<h4>How to survive computing paradigm shift</h4>
<p>We cannot count on free &#8220;performance lunch&#8221; anymore, but how about at least a pie for free?<span> Do we need to throw all our old source-code into the trash bin and start over again?<span> </span></span></p>
<p><img class="alignright size-full wp-image-214" title="Double Core flow" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/doublecore-flow.png" alt="" width="273" height="142" />Certainly, not. We may think of our old software as a zombie of the new multi-core era. Still<span> there is a way to make the zombie walk, even walk faster. Of course we will need to rewrite<span> our code sometime, but we may postpone this nasty need for a while.<span> </span></span></span></p>
<p>The computing paradigm shift is now a fact we need to learn how to live with. It is unques<span>tionable that processor manufacturers hit the barrier of 3 GHz. There pretty many news about<span> spinning the CPU up to 5 GHz or so, but do not try to do so at home unless you got liquid<span> nitrogen cylinder around. Over 3 GHz heat emission grows unreasonably making the CPU<span> economically worthwhile.<span> </span></span></span></span></span></p>
<p>So the only sensible way is now horizontal performance improvement, doubling the number<span> of processing units. This means we can expect soon 128 core CPUs. Oh, wait they are here<span> already; nVidia GeForce 9 series are perfect example of 128 core streaming processor.<span> </span></span></span></p>
<p>Now how to keep up with things that happen so fast. First we need focus more on performance<span> of our code. Something that was not important before, now cannot be ignored.</span><br />
<span id="more-205"></span><br />
<em>Want more, read my article draft below:</em></p>
<ul class="projects">
<li class="pdf"><a href="/uj/A Pie for free.pdf">A Pie for free.pdf</a> 256KB, 2008-06-16</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/publications/no-more-free-lunch-maybe-a-pie-for-free/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMSity &#8211; small, generic content management system</title>
		<link>http://www.nanoant.com/projects/cmsity-small-generic-content-management-system</link>
		<comments>http://www.nanoant.com/projects/cmsity-small-generic-content-management-system#comments</comments>
		<pubDate>Thu, 05 Mar 2009 12:57:00 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[small]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=179</guid>
		<description><![CDATA[
After spending few years using WordPress, MODx, PHPnuke I found out those systems getting more and more complicated, well yes sophisticated too, but first of all complicated. Anyway, feeling that this is not right direction I have decided to rewrite something by my own; simple, but powerful enough to provide functionality that you expect from [...]]]></description>
			<content:encoded><![CDATA[<p class="alignright"><a href="http://www.cmsity.com/"><img class="size-full wp-image-181" title="CMSity Logo" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/cmsity_ss.png" alt="" width="278" height="89" /></a></p>
<p>After spending few years using <em>WordPress</em>, <em>MODx</em>, <em>PHPnuke</em> I found out those systems getting more and more complicated, well yes sophisticated too, but first of all complicated. Anyway, feeling that this is not right direction I have decided to rewrite something by my own; simple, but powerful enough to provide functionality that you expect from most of the modern sites &#8211; blog, forums, RSS feeds.</p>
<p><span id="more-179"></span></p>
<p>Such functionality was requested by few of my clients, asking me: &#8220;<em>Adam, we need something like WordPress, but we would like to have forums too, also site should be multi-lingual and finally we would like to limit the access to some parts of the site.&#8221;</em> Just to mention those clients were running websites at PHP virtual hosting. I said, <em>&#8220;Roger that&#8221;</em> and started looking for some (any) CMS that could satisfy their needs.</p>
<p>I use to browse for new CMSes time to time. I did it again last October. Nothing new. Okay, maybe I could somehow tailor <em>MODx</em>, or <em>WordPress</em>. Nah. Then I found <em>BBpress</em>, well I was excited. A forum system made by <em>WordPress</em> creators, that integrates with WP. Great! Maybe this will fit.</p>
<p>Unfortunately I was hitting so many problems syncing WP and <em>BBpress</em> user database and logins, cookies (Why the hell it is so complicated?), so I gave it up.</p>
<p>I decided to write my own system, having in mind that forum, blog, they just differ at presentation level! There is always some parent page and subpages, post and replies, forum and topics. All having some hierarchy relations, and different presentation model. So why we have to install <em>BBpress</em> over WP if it is just a matter of presentation. Forum should look more like a table&#8230; while blog more like list of post excerpts. Why we cannot just turn WP sub-blog into the forum?</p>
<h3>The difference is the presentation</h3>
<p>So thing that makes forum or blog special is the way it is presented to the user. But from structure point of view both are the same. So this is the idea of the <em>CMSity</em>. For <em>CMSity</em> all pages (document tree nodes) are the same, they just carry the <strong>type</strong> which is used to determine what template to use to render them &#8211; what is their presentation.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-180" title="CMSity template resolution" src="http://www.nanoant.com/wp/wp-content/uploads/2009/03/template_s.png" alt="" width="403" height="303" /></p>
<p>Why PHP? Even I know more optimized/fast languages such as Ruby (1.9 is really fast), Java, C++.. started learning Erlang, still PHP is kind of standard that is present on most of the web servers and you can expect your clients will have PHP on their web servers. So I have chosen PHP; not really my favorite language, but the one I know pretty well and have spent quite a while with.</p>
<p>So this is genesis of <em><a href="http://www.cmsity.com/">CMSity</a></em>&#8230; hope it will find many users and will be useful for you all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/projects/cmsity-small-generic-content-management-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jabberd2 win32 hits SVN rev 752 and Visual Studio 2008 (SP1)</title>
		<link>http://www.nanoant.com/projects/jabberd2-win32-hits-svn-rev-752-and-visual-studio-2008-sp1</link>
		<comments>http://www.nanoant.com/projects/jabberd2-win32-hits-svn-rev-752-and-visual-studio-2008-sp1#comments</comments>
		<pubDate>Thu, 05 Mar 2009 12:06:42 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Jabber]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[jabberd2]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://www.nanoant.com/?p=176</guid>
		<description><![CDATA[After a while I had put the jabberd2 win32 project aside, finally I have revived it. Here are some news about it:

Project files and binaries were upgraded to Visual Studio 2008 (SP1).
Installer now checks the runtime properly on Windows Vista &#38; Windows 7 Beta, was tested also on Windows XP &#38; 2003. Moreover since Visual Studio 2008 runtime [...]]]></description>
			<content:encoded><![CDATA[<p>After a while I had put the <a href="http://www.nanoant.com/projects/jabberd2-win32">jabberd2 win32</a> project aside, finally I have revived it. Here are some news about it:</p>
<ul>
<li>Project files and binaries were upgraded to <em>Visual Studio 2008 (SP1).</em></li>
<li>Installer now checks the runtime properly on <em>Windows </em><em>Vista</em> &amp; <em>Windows 7 Beta</em>, was tested also on <em>Windows XP &amp; 2003.</em> Moreover since <em>Visual Studio 2008</em> runtime seems to be present by default on many machines, most of you will not need to install it manually at all.</li>
<li>Installer now contains <em>OpenSSL 0.9.8j</em>, so no more problems with <em>OpenSSL</em> external installation.</li>
<li>&#8230; finally we got all the fixes and features introduced in <em>jabberd2</em> till the revision #752.</li>
</ul>
<p>Once you upgrade, you may uninstall <em>Visual Studio 2005 Runtime</em> and <em>OpenSSL</em> using <em>Add/Remove Programs</em> if you have them installed just for older <a href="http://www.nanoant.com/projects/jabberd2-win32">jabberd2 win32</a> build.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanoant.com/projects/jabberd2-win32-hits-svn-rev-752-and-visual-studio-2008-sp1/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
