<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Igor&#039;s Blog</title>
	<atom:link href="http://weirdfellow.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://weirdfellow.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 23:26:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='weirdfellow.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Igor&#039;s Blog</title>
		<link>http://weirdfellow.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://weirdfellow.wordpress.com/osd.xml" title="Igor&#039;s Blog" />
	<atom:link rel='hub' href='http://weirdfellow.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Cannot open Name index using db3</title>
		<link>http://weirdfellow.wordpress.com/2011/09/28/cannot-open-name-index-using-db3/</link>
		<comments>http://weirdfellow.wordpress.com/2011/09/28/cannot-open-name-index-using-db3/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 09:17:52 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Rpm Linux]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=179</guid>
		<description><![CDATA[I am using Ubuntu 10.04, but often have to work with RPMs &#8211; see what&#8217;s inside or get the content. And errors drive me crazy &#8211; &#8220;Cannot open Name index using db3 &#8211; No such file or directory (2)&#8221; especially. Eventually I figured it out. If you are getting it, that means the file /var/lib/rpm/Name [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=179&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am using Ubuntu 10.04, but often have to work with RPMs &#8211; see what&#8217;s inside or get the content. And errors drive me crazy &#8211; &#8220;Cannot open Name index using db3 &#8211; No such file or directory (2)&#8221; especially.</p>
<p>Eventually I figured it out. If you are getting it, that means the file <code>/var/lib/rpm/Name</code> is missing. </p>
<p>Because I am on Ubuntu and don&#8217;t really depend on RPMs databases, I purged the whole <code>/var/lib/rpm</code> directory, and then ran <code>rpm --rebuilddb</code> to recreate them. This created empty <code>/var/lib/rpm/Packages</code> file. Now just copy it as <code>/var/lib/rpm/Name</code>.</p>
<p>Error free environment <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=179&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2011/09/28/cannot-open-name-index-using-db3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title>Compressing RAM with zRam</title>
		<link>http://weirdfellow.wordpress.com/2011/05/04/compressed-ram-with-zram/</link>
		<comments>http://weirdfellow.wordpress.com/2011/05/04/compressed-ram-with-zram/#comments</comments>
		<pubDate>Wed, 04 May 2011 17:30:00 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[compcache]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upstart]]></category>
		<category><![CDATA[zram]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=172</guid>
		<description><![CDATA[How to integrate zram based swap files into the Ubuntu. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=172&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A successor to compcache, zram, has been already integrated in the Linux kernel for a while now. This means that no additional compilation nor tweaking is required to benefit from compressing memory on the fly and massively reduced swapping.</p>
<p>As with compache, I wanted to nicely integrate the solution into the Ubuntu Upstart deamon &#8211; hence this short article. After a couple of minutes of playing the configuration was ready. </p>
<p>Create file <code>zramswap.conf</code> in <code>/etc/init</code> and put the following content in it.</p>
<p><pre class="brush: cpp;">
description &quot;Initializes zram swaping&quot;
 
start on runlevel [2345]
stop on runlevel [!2345]
 
pre-start script
 
# load dependency modules
modprobe zram num_devices=2
 
# initialize the devices
echo 1073741824 &gt; /sys/block/zram0/disksize
echo 1073741824 &gt; /sys/block/zram1/disksize
 
# Creating swap filesystems
mkswap /dev/zram0
mkswap /dev/zram1
 
# Switch the swaps on
swapon -p 5 /dev/zram0
swapon -p 5 /dev/zram1
end script
 
post-stop script
 
# Switching off swap
swapoff /dev/zram0
swapoff /dev/zram1
 
rmmod zram
end script
</pre></p>
<p>Now you can start the service with <code>sudo start zramswap</code> (it will be automatically started on after the reboot as well).<br />
You will benefit from 2x1GB swap files, which will be compressed and stored in the RAM. Tested on Ubuntu 11.04.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=172&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2011/05/04/compressed-ram-with-zram/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title>I don&#8217;t believe in Groovy</title>
		<link>http://weirdfellow.wordpress.com/2010/10/31/why-i-dont-believe-in-groovy/</link>
		<comments>http://weirdfellow.wordpress.com/2010/10/31/why-i-dont-believe-in-groovy/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 12:03:59 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=157</guid>
		<description><![CDATA[I always try to stay on the open minded part of the population. I have been trying with Groovy too&#8230; Half year later I can state &#8211; it is a fancy toy that looks great in the sample, but not a generic purpose language. Groovy advocates usually have following reasoning: Static typing doesn&#8217;t give any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=157&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always try to stay on the open minded part of the population. I have been trying with Groovy too&#8230; Half year later I can state &#8211; it is a fancy toy that looks great in the sample, but not a generic purpose language.</p>
<p>Groovy advocates usually have following reasoning:</p>
<p><strong>Static typing doesn&#8217;t give any benefits &#8211; you have to unit test anyway</strong><br />
I am almost certain that nobody will ever hear from me that testing is unnecessary &#8211; quite the opposite.<br />
But type checking allows to instantly identify a whole bunch of common coding mistakes, without need to wait for the tests to execute (and those can take some time)&#8230; </p>
<p><strong>Java is too verbose, Groovy is much more compact. </strong><br />
Let&#8217;s make the identifiers optional wherever there is only one token in scope that fits! Compiler can figure things out and the code will be 17 bytes shorter!!! All this time I would have spent so much time on pressing the space&#8230; </p>
<p>Java is verbose &#8211; but what is wrong in being verbose? The more compact code, the more comments are required and it the end it sums up to the same number of bytes. I could start writing a more verbose, self explanatory Groovy code too. In other words &#8211; to make a code that is easier to read I would have to discard the compactness of Groovy. In such case &#8211; why bother with Groovy at all?</p>
<p>I don&#8217;t deny Groovy the right to exist &#8211; I definitely can see its the benefits. There are even things in Groovy I really like. Closures. Compact syntax for creating instances of ArrayList and HashMap. XML parsing. Groovy definitely can be useful. </p>
<p>However I am certain that those are only the situations when once you got working code, you never touch it again&#8230; Projects when the functionality has to be there now, and will be thrown away week later. Or tiny, very specialized classes you can throw away when they need to change and write them again. Refactoring a Groovy code will be a nightmare &#8211; because of its dynamic nature.</p>
<p>So &#8211; if doing anything with longer time frame, anything that might get refactored &#8211; keep away from Groovy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=157&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/10/31/why-i-dont-believe-in-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title>Patching Cairo</title>
		<link>http://weirdfellow.wordpress.com/2010/08/01/patching-cairo/</link>
		<comments>http://weirdfellow.wordpress.com/2010/08/01/patching-cairo/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 00:26:33 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=144</guid>
		<description><![CDATA[Short description of fighting with Cairo and the results of it. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=144&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had it enough&#8230; GTK applications are respecting some of the Fontconfig setting (you can switch antialias or hinting on/off), but others were just ignored (it wasn&#8217;t possible to specify hintstyle or switch between grayscale and subpixel antialiasing)&#8230; <a href="https://bugs.freedesktop.org/show_bug.cgi?id=11838">Not</a> <a href="https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/209256">only I</a> have had issue with that &#8211; in my case the &#8220;quasi-bitmap&#8221; fonts used for programming look much better with grayscale AA. There were some ad-hoc patches, for instance <a href="http://hg.core.ws/devnull/file/ccce0ea4eeae/x11-libs/cairo/files/cairo-respect-fontconfig.patch">cairo-respect-fontconfig</a>, but they don&#8217;t really fix the problem &#8211; just sweep the problem under the carpet.</p>
<p>First of all I had to decode what is used to <a href="http://weirdfellow.wordpress.com/2010/07/25/insanity/">render fonts</a> in Gnome. After identifying that the bugs are in Cairo, I decided to compile it myself. After a bit of the struggle with missing libraries &#8211; thank you Ubuntu for Synaptic Package Manager &#8211; I managed to compile Cairo 1.8.10. I have applied patches shipped with Ubuntu and started to look into the problems. </p>
<p>The functions dealing with properties returned by Fontconfig have been rewritten and profusely commented &#8211; patch file and binary package available to download below. </p>
<p><strong>Be aware: </strong>After the installation, you might notice that the Appearance panel seems not to work. This behavior is intentional and absolutely OK.<br />
Gnome does not save it&#8217;s settings in Fontconfig registry, and by default Fontconfig comes with some settings &#8211; they are stored in files in <code>/etc/fonts/conf.d</code>. By default they cover switching on antialiasing (<code>10-antialias.conf</code>) and switching on slight hinting (<code>10-hinting-slight.conf</code>). In the result Fontconfig will always override those two settings.</p>
<p>As a workaround, remove those two mentioned symbolic links, and the panel will start to behave correctly again. Files <code>10-hinting.conf</code> and <code>11-lcd-filter-lcddefault.conf</code> are ok and should stay  in <code>/etc/fonts/conf.d</code>. The long term solution would be for Gnome to save the font settings in the Fontconfig registry too &#8211; I am working on the plug-in for gnome-settings-daemon, that would do this.</p>
<p><strong>Downloading</strong></p>
<p>The <a href="http://cairographics.org/releases/">source</a> of Cairo is available from the project <a href="http://cairographics.org/">homepage</a>, but I downloaded the source package from <a href="https://launchpad.net/ubuntu/+source/cairo/1.8.10-2ubuntu1">Ubuntu launchpad</a> &#8211; this version does not require autoconf, you can just call ./configure.</p>
<p><strong>Patching</strong></p>
<p>Ubuntu patches are to be downloaded from <a href="https://launchpad.net/ubuntu/+archive/primary/+files/cairo_1.8.10-2ubuntu1.debian.tar.gz">here</a>. Each patch is to be executed from cairo-1.8.10 directory in following manner:<br />
<code>$ patch -p 1 &lt;<em>path-to-the-patch-file</em></code>. After applying Ubuntu patches, you can apply my patch.</p>
<p><strong>Compilation</strong></p>
<p>My version of library would compile, but it was much bigger than the one shipped within distro. Setting environment variables to skip debug information and add some optimizations prior executing <code>configure</code> (<code>export CFLAGS='-Wall -g0 -O0 -O2'</code>) helped a lot. After successful execution of <code>configure</code> and <code>make</code>, the result can be found in <code>src/.libs</code> directory. Copy it into the <code>/usr/lib</code> folder and restart X.</p>
<p><strong>Results and downloads</strong></p>
<p>Finally I have fonts that work as I want. </p>
<p>Patch file from <a href="http://rapidshare.com/files/410279166/respect-fontconfig-ultimate.patch">Rapidshare</a><br />
Binary package from <em>in progress</em>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=144&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/08/01/patching-cairo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://weirdfellow.wordpress.com/2010/07/31/does-git-stand-for-great-innovative-technology/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/31/does-git-stand-for-great-innovative-technology/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 12:15:51 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Shorts]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=133</guid>
		<description><![CDATA[Does Git stand for Great Innovative Technology?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=133&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Does Git stand for Great Innovative Technology?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=133&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/31/does-git-stand-for-great-innovative-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title>Insanity</title>
		<link>http://weirdfellow.wordpress.com/2010/07/25/insanity/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/25/insanity/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 12:20:43 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[fontconfig]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[fonts.conf]]></category>
		<category><![CDATA[FreeType]]></category>
		<category><![CDATA[hinting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subpixel]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xft]]></category>
		<category><![CDATA[xrdb]]></category>
		<category><![CDATA[XSETTINGS]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=118</guid>
		<description><![CDATA[This is just insane&#8230; The number of blog articles, forum posts and standard proposals definitely proves it&#8230;. After struggling with it for a while I have finally managed to (at least I hope so) get an overview of the font rendering stack in Gnome&#8230; That&#8217;s how it looks at the moment (Ubuntu 10.04): Gnome fonts [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=118&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just insane&#8230; </p>
<p>The <a href="http://www.kilobitspersecond.com/2009/04/17/ubuntu-font-hinting-you-a-cautionary-tale/">number</a> <a href="http://martin.ankerl.com/2009/01/22/beautiful-font-hinting-in-ubuntu-810/">of</a> <a href="http://jehurst.wordpress.com/2010/05/22/ubuntu-karmic-and-your-fonts-conf/">blog</a> <a href="http://johan.kiviniemi.name/blag/ubuntu-fonts/">articles</a>, <a href="http://ubuntuforums.org/showthread.php?t=546251">forum</a> posts and <a href="http://freedesktop.org/wiki/ScreenFontSettings">standard proposals</a> definitely proves it&#8230;.</p>
<p>After struggling with it for a while I have finally managed to (at least I hope so) get an overview of the font rendering stack in Gnome&#8230; That&#8217;s how it looks at the moment (Ubuntu 10.04):<br />
<a href="http://weirdfellow.files.wordpress.com/2010/07/gnomefontstack.png"><img src="http://weirdfellow.files.wordpress.com/2010/07/gnomefontstack.png?w=650" alt="" title="GnomeFontStack"   class="aligncenter size-full wp-image-119" /></a></p>
<p>Gnome fonts settings are stored in <em>gconf</em> registry (<code>~/.gconf</code>). They are read by <em>gnome-settings-daemon</em> and automatically published in two places: <a href="http://en.wikipedia.org/wiki/Xrdb"><em>xrdb</em></a> &#8211; and <a href="http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html"><em>XSETTINGS</em></a>. In addition to the Gnome settings, there is the <a href="http://freedesktop.org/wiki/Software/fontconfig">Fontconfig</a> with the handful of configuration files (<code>/etc/fonts/fonts.conf</code>, <code>/etc/fonts/conf.d/*</code>, <code>/etc/fonts/local.conf</code> and <code>~/.fonts.conf</code>). All settings are combined by <a href="http://cairographics.org/">Cairo</a> lib (which behaves weirdly when dealing with Fontconfig data &#8211; there are a <a href="https://bugs.freedesktop.org/show_bug.cgi?id=11838">few</a> <a href="https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/209256">bugs</a> in there) and <a href="http://freedesktop.org/wiki/Software/Xft">Xft</a> is invoked to render the fonts. </p>
<p><em>xrdb</em> registry can be listed by calling <code>xrdb -query</code>. Getting to see the published XSETTINGS properties is a bit more tricky &#8211; but possible with tools provided by <a href="http://code.google.com/p/xsettingsd/">xsettingsd</a> project. Install it (there are <a href="http://code.google.com/p/xsettingsd/downloads/detail?name=xsettingsd_0.0.20090828-1_i386.deb&amp;can=2&amp;q=">binaries</a> for Ubuntu) and execute <code>dump_xsettings</code>. It is even possible to <a href="http://code.google.com/p/xsettingsd/wiki/Installation">get rid</a> of <em>gnome-settings-daemon</em> &#8211; useful especially for the KDE guys running GTK apps. </p>
<p>Why the hell doesn&#8217;t it look like that? Fontconfig sole purpose is to store font configuration information, why are additional registries introduced? </p>
<p><a href="http://weirdfellow.files.wordpress.com/2010/07/gnome-simplefontstack.png"><img src="http://weirdfellow.files.wordpress.com/2010/07/gnome-simplefontstack.png?w=650" alt="" title="Gnome-SimpleFontStack"   class="aligncenter size-full wp-image-120" /></a></p>
<p><em>Appearance</em> panel would need just to create/remove symlinks in <code>~/.fonts.conf.d/</code> to files in <code>/etc/fonts/conf.avail</code> or create one own there. There would be 5 of those for default values of: one for hinting and hintstyle, autohint (now still not available through GUI), antialias and lcdfilter. <em>gnome-settings-daemon</em> wouldn&#8217;t need to publish fonts settings anywhere&#8230; If the <em>gconf</em> must stay, there might be a plugin for <em>gnome-settings-daemon</em> that would publish the gnome font settings in a Fontconfig file, instead of xrdb and XSETTINGS.</p>
<p>It doesn&#8217;t sound like rocket science and definitely would make the font settings more consistent. Life would be so much simpler&#8230; </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=118&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/25/insanity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>

		<media:content url="http://weirdfellow.files.wordpress.com/2010/07/gnomefontstack.png" medium="image">
			<media:title type="html">GnomeFontStack</media:title>
		</media:content>

		<media:content url="http://weirdfellow.files.wordpress.com/2010/07/gnome-simplefontstack.png" medium="image">
			<media:title type="html">Gnome-SimpleFontStack</media:title>
		</media:content>
	</item>
		<item>
		<title>Valid autohinting / hinting style options</title>
		<link>http://weirdfellow.wordpress.com/2010/07/25/valid-autohinting-hinting-style-options/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/25/valid-autohinting-hinting-style-options/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 23:40:31 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[autohint]]></category>
		<category><![CDATA[fontconfig]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[fonts.conf]]></category>
		<category><![CDATA[FreeType]]></category>
		<category><![CDATA[hinting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=98</guid>
		<description><![CDATA[Everyone that ever tried to edit any of the FontConfig configuration files came across the dilemma which hinting to select for your fonts. There are dozens of sample files in the Internet, but noone tells what are the possible valid options and what actually they do. Today I have been doing some experiments and have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=98&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Everyone that ever tried to edit any of the <a href="http://www.fontconfig.org/wiki/">FontConfig</a> configuration files came across the dilemma which hinting to select for your fonts. There are dozens of sample files in the Internet, but noone tells what are the possible valid options and what actually they do. </p>
<p>Today I have been doing some experiments and have found a way to render the same font face with different hinting settings side by side in one window. The conclusion from that is: there are only five different results to be expected out of eight possible combinations of <code>hintstyle</code> and <code>autohint</code> properties. </p>
<ul>
<li>hintstyle = hintnone &#8211; switches off the hinting</li>
<li>hinstyle = hintslight &#8211; switches on the slight hinting (usually results with only vertical hinting but unfortunately not always). Autohint property is ignored and autohinter is always used with this hinting style.</li>
<li>hintstyle = hintmedium, autohint = true. </li>
<li>hintstyle = hintfull, autohint = true. </li>
<li>hintstyle = hintmedium | hintfull, autohint = false &#8211; uses the BCI (patented) hinter. In majority it does not matter if hintstyle is set to medium or full &#8211; the results are the same. </li>
</ul>
<p>As an example, the DejaVu Sans with different hinting options. </p>
<p><img src="http://weirdfellow.files.wordpress.com/2010/07/test-dejavu.png?w=600" alt="" title="Test-DejaVu" class="aligncenter wp-image-101" /></a></p>
<p>The difference might not be huge with this font, but with different fonts product more versatile results (Liberation Serif 14pt):<br />
<a href="http://weirdfellow.files.wordpress.com/2010/07/test-liberationserif14pt.png"><img src="http://weirdfellow.files.wordpress.com/2010/07/test-liberationserif14pt.png?w=600" alt="" title="Test-LiberationSerif14pt" class="aligncenter wp-image-107" /></a></p>
<p>I used a trick with introducing an additional property to the fontconfig &#8211; <code>family-old</code>.<br />
In the <code>&lt;match type="pattern"&gt;</code> elements I replace the all the weird font families with something a bit more sensible. But I also store the original <code>family</code> in the <code>family-old</code> property, so later the additional test in <code>&lt;match type="font"&gt;</code> can be performed and properties <code>hintstyle</code> and <code>autohint</code> modified according to the original font family.</p>
<p>This is the <code>.font.config</code> file I have used:</p>
<p><pre class="brush: xml;">
&lt;?xml version='1.0'?&gt;
&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
&lt;fontconfig&gt;
&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-none&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-ah-none&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-slight&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-ah-slight&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-medium&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-ah-medium&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-full&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-ah-full&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-none&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-nah-none&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-slight&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-nah-slight&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-medium&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-nah-medium&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-full&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/edit&gt;
  &lt;edit name=&quot;family-old&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;TestFont-nah-full&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-none&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintnone&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-slight&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintslight&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-medium&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintmedium&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-ah-full&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintfull&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 

&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-none&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintnone&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-slight&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintslight&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-medium&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintmedium&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 
&lt;match target=&quot;font&quot;&gt;
  &lt;test name=&quot;family-old&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont-nah-full&lt;/string&gt;&lt;/test&gt;

  &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt; 
  &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot;&gt;&lt;const&gt;hintfull&lt;/const&gt;&lt;/edit&gt; 
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test name=&quot;family&quot; compare=&quot;eq&quot; qual=&quot;any&quot;&gt;&lt;string&gt;TestFont&lt;/string&gt;&lt;/test&gt;
  &lt;edit name=&quot;family&quot; binding=&quot;same&quot; mode=&quot;assign&quot;&gt;&lt;string&gt;Liberation Serif&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;/fontconfig&gt;
</pre></p>
<p>Line 112 contains the name of the fontface to be actually used while rendering. The test images were generated in Firefox &#8211; following HTML/JavaScript document was used to display the content. </p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;script src=&quot;http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;
function putText( fontFamily, weight, size ) {
	if (!size) size = 14;

	var $span = $(&quot;&lt;div&gt;&lt;span style='width: 180px; float: left; clear: left;'&gt;&quot; + fontFamily + &quot; &quot; + size + &quot;pt.&lt;/span&gt;aąbcćdeęfghijklłoónńsśzźż AĄBCĆDEĘFGHIJKLŁOÓNŃSŚZŻŹ&lt;/div&gt;&quot;);
	$span.css(&quot;font-family&quot;, fontFamily).css(&quot;font-size&quot;, size).css(&quot;font-weight&quot;, weight);

	$(&quot;BODY&quot;).append($span);
}

function putSpace() {
	$(&quot;BODY&quot;).append($(&quot;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&quot;));
}

function generateHifferentHintingOptions( familyName, fontWeight ) {
	putText ( familyName + &quot;-ah-none&quot;, fontWeight );
	putText ( familyName + &quot;-nah-none&quot;, fontWeight );
	putSpace();

	putText ( familyName + &quot;-ah-slight&quot;, fontWeight );
	putText ( familyName + &quot;-nah-slight&quot;, fontWeight );
	putSpace();

	putText ( familyName + &quot;-nah-medium&quot;, fontWeight );
	putText ( familyName + &quot;-nah-full&quot;, fontWeight );
	putSpace();

	putText ( familyName + &quot;-ah-medium&quot;, fontWeight );
	putSpace();

	putText ( familyName + &quot;-ah-full&quot;, fontWeight);
	putSpace();
}

$(document).ready(function(){
	generateHifferentHintingOptions( &quot;TestFont&quot;, &quot;normal&quot; );
});
		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>I mentioned <a href="http://weirdfellow.wordpress.com/2010/06/27/creature-of-habbit/">ealier</a> that usually I prefer the <code>autohint</code> + <code>hintslight</code> combination. There are some rare exceptions I identified with this method. What are your preferences?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=98&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/25/valid-autohinting-hinting-style-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>

		<media:content url="http://weirdfellow.files.wordpress.com/2010/07/test-dejavu.png?w=600" medium="image">
			<media:title type="html">Test-DejaVu</media:title>
		</media:content>

		<media:content url="http://weirdfellow.files.wordpress.com/2010/07/test-liberationserif14pt.png?w=600" medium="image">
			<media:title type="html">Test-LiberationSerif14pt</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux font substitutions</title>
		<link>http://weirdfellow.wordpress.com/2010/07/20/linux-font-substitutions/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/20/linux-font-substitutions/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 22:59:23 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[fonts.conf]]></category>
		<category><![CDATA[FreeType]]></category>
		<category><![CDATA[Liberation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=81</guid>
		<description><![CDATA[Most of the sites out there expect you to have Windows fonts. The layout is usually designed with those fonts and would break if you don&#8217;t have them. Usually the designer is nice enough to include the sans-serif font at the end of the font definition in CSS, but two sans-serif fonts can be pretty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=81&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most of the sites out there expect you to have <a href="http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html">Windows fonts</a>. The layout is usually designed with those fonts and would break if you don&#8217;t have them. </p>
<p>Usually the designer is nice enough to include the sans-serif font at the end of the font definition in CSS, but two sans-serif fonts can be pretty different &#8211; <a href="http://en.wikipedia.org/wiki/Tahoma_%28typeface%29">Tahoma</a> and <a href="http://en.wikipedia.org/wiki/Arial_black">Arial Black</a> for instance. </p>
<p>It is also possible to install the <a href="http://corefonts.sourceforge.net/">msttcorefonts</a> package and use the <a href="https://wiki.ubuntu.com/Fonts#Font%20settings">.fonts.conf</a> from Ubuntu wiki, but I don&#8217;t really like this approach &#8211; Linux comes with a handful of nice fonts, why not to use them?</p>
<p>The most obvious choice for substitutions is the <a href="https://www.redhat.com/promo/fonts/">Liberation family</a> &#8211; Liberation Serif for Times New Roman, Liberation Sans for Arial and Liberation Sans Mono for Courier New. But what to do with other fonts? Courier does look different too&#8230; </p>
<p>I have been playing with the script below (save it as <code>.fonts.conf</code> in <code>/home/<em>username</em></code> directory) for a while now. Here is the result:</p>
<p><pre class="brush: xml;">
&lt;?xml version='1.0'?&gt;
&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
&lt;fontconfig&gt;
&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Verdana&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;DejaVu Sans&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Arial Black&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;DejaVu Sans&lt;/string&gt;&lt;/edit&gt;
  &lt;edit mode=&quot;assign&quot; name=&quot;weight&quot;&gt;&lt;double&gt;200&lt;/double&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;font&quot;&gt; &lt;!-- Switch off hinging for DejaVu Sans --&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;DejaVu Sans&lt;/string&gt;&lt;/test&gt;
  &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot;&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Tahoma&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Droid Sans&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Arial&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Liberation Sans&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Times New Roman&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Liberation Serif&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Georgia&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Droid Serif&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Impact&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Droid Serif&lt;/string&gt;&lt;/edit&gt;
  &lt;edit mode=&quot;assign&quot; name=&quot;weight&quot;&gt;&lt;double&gt;200&lt;/double&gt;&lt;/edit&gt;
&lt;/match&gt;

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Courier New&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Nimbus Mono L&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Trebuchet MS&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Linux Biolinum O&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Lucida Console&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;DejaVu Sans Mono&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Lucida Sans Unicode&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;DejaVu Sans&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Palatinio Linotype&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;URW Palladio L&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt; 

&lt;match target=&quot;pattern&quot;&gt;
  &lt;test compare=&quot;eq&quot; name=&quot;family&quot; qual=&quot;any&quot;&gt;&lt;string&gt;Consolas&lt;/string&gt;&lt;/test&gt;
  &lt;edit binding=&quot;same&quot; mode=&quot;prepend&quot; name=&quot;family&quot;&gt;&lt;string&gt;Inconsolata&lt;/string&gt;&lt;/edit&gt;
&lt;/match&gt;
&lt;/fontconfig&gt;
</pre></p>
<p>Liberation fonts are usually installed, but don&#8217;t forget to install <a href="http://en.wikipedia.org/wiki/Droid_%28font%29">Droid font family</a>, <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> and <a href="http://linuxlibertine.sourceforge.net/Libertine-EN.html">Libertine and Biolinum</a> families. </p>
<p>I have also switched off the hinting for DejaVu Sans. It does not get correctly hinted with Polish letters &#8211; I guess not everyone will have this problem &#8211; the lines 15-18 could be removed in such case.</p>
<p>In the result I get something like that:</p>
<p><a href="http://weirdfellow.files.wordpress.com/2010/07/linuxfonts.jpg"><img src="http://weirdfellow.files.wordpress.com/2010/07/linuxfonts.jpg?w=650" alt="" title="LinuxFonts"   class="aligncenter size-full wp-image-90" /></a></p>
<p>I am really happy with the result. How about you?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=81&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/20/linux-font-substitutions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>

		<media:content url="http://weirdfellow.files.wordpress.com/2010/07/linuxfonts.jpg" medium="image">
			<media:title type="html">LinuxFonts</media:title>
		</media:content>
	</item>
		<item>
		<title>2 matchers expected, 1 recorded.</title>
		<link>http://weirdfellow.wordpress.com/2010/07/15/2-matchers-expected-1-recorded/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/15/2-matchers-expected-1-recorded/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 18:30:32 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[easymock]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=53</guid>
		<description><![CDATA[EasyMock is really a nice framework for mocking interfaces, so you can reliably test your classes. As always &#8211; everything is fine, unless you need to do something more complex. As long as you know all parameters passed to the mocks, there are no problems. But sometimes it is not possible to predict all arguments [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=53&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://easymock.org/">EasyMock</a> is really a nice framework for mocking interfaces, so you can reliably test your classes.</p>
<p>As always &#8211; everything is fine, unless you need to do something more complex. As long as you know all parameters passed to the mocks, there are no problems. But sometimes it is not possible to predict all arguments the mock will receive. A bit of research and here it is:</p>
<p><pre class="brush: java;">
  MyData myData = EasyMock.createNiceMock( MyData.class );
  MyService serviceMock = EasyMock.createMock( MyService.class );

  expect( serviceMock.doSth( EasyMock.&lt;File&gt;anyObject(), myData ).andReturn( true );
</pre></p>
<p>Seems OK &#8211; doesn&#8217;t it? The code tells <code>serviceMock</code> to expects a call to <code>doSth</code> method. The second argument should be <code>myData</code> object, while we don&#8217;t care about the first one.</p>
<p>Unfortunately, you will get something like that:</p>
<pre>java.lang.IllegalStateException: 2 matchers expected, 1 recorded.
	at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:56)
	at org.easymock.internal.ExpectedInvocation.(ExpectedInvocation.java:48)
	at org.easymock.internal.ExpectedInvocation.(ExpectedInvocation.java:40)
	at org.easymock.internal.RecordState.invoke(RecordState.java:76)
	at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:38)
	at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:72)
	at org.easymock.classextension.internal.ClassProxyFactory$MockMethodInterceptor.intercept(ClassProxyFactory.java:93)</pre>
<p>Unfortunately, it is not possible to mix values and <em>matchers</em> &#8211; a <code>anyObject</code> method is a matcher. To make the test execute correctly, all parameters should use matchers instead of just values. Solution is pretty straight forward &#8211; use <code>eq</code> matcher:</p>
<p><pre class="brush: java;">
  expect( serviceMock.doSth( EasyMock.&lt;File&gt;anyObject(), EasyMock.eq( myData ) ).andReturn( true );
</pre></p>
<p>In addition to <code>eq</code> matcher, EasyMock does publish a handful of other matchers. Worth noting are <code>aryEq</code> for comparing the array contents and <code>isA</code> for checking the class of given object. The <a href="http://easymock.org/EasyMock2_5_Documentation.html">EasyMock site</a> gives a full list of those. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=53&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/15/2-matchers-expected-1-recorded/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Lucid and Compcache</title>
		<link>http://weirdfellow.wordpress.com/2010/07/15/ubuntu-lucid-and-compcache/</link>
		<comments>http://weirdfellow.wordpress.com/2010/07/15/ubuntu-lucid-and-compcache/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 18:08:53 +0000</pubDate>
		<dc:creator>weirdfellow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compcache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upstart]]></category>

		<guid isPermaLink="false">http://weirdfellow.wordpress.com/?p=51</guid>
		<description><![CDATA[I have been very excited about memory compression for years. The performance boost achieved with Quarterdeck MagnaRAM on Windows 98 still brings smile on my face. Without memory compression my 64MB system sounded like it was chopping parsley &#8211; definitely there was some swapping. Switching MagnaRAM on kept it quiet (to be precise &#8211; it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=51&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been very excited about memory compression for years. The performance boost achieved with Quarterdeck MagnaRAM on Windows 98 still brings smile on my face. Without memory compression my 64MB system sounded like it was chopping parsley &#8211; definitely there was some swapping. Switching MagnaRAM on kept it quiet (to be precise &#8211; it was loading the next level of Colin McRae Rally 2). Not to mention the difference in required time. Unfortunately, I couldn&#8217;t find similar tool for any Windows NT system. </p>
<p>Recently I started to build a development machine on <a href="http://www.ubuntu.com/">Ubuntu</a> Lucid Lynx and decided to give the <a href="http://code.google.com/p/compcache/">Compcache</a> a chance. Compilation caused me absolutely no problems &#8211; just <a href="http://code.google.com/p/compcache/downloads/list">download</a> the package, unpack it and execute <code>make</code>. Although there are some patches for the kernel, so it can use the memory even more efficient, they are not required and Compcache will work with stock kernel. Compilation generates two things: a kernel module <code>ramzswap.ko</code> and a user-space utility <code>rzscontrol</code>. </p>
<p>It is pretty simple to initialize compressed swap disk by hand, but I wanted a slick and elegant integration with the services management subsystem. A couple of experiments and voila: my <a href="http://upstart.ubuntu.com/">Upstart</a> script for Compcache looks like that:</p>
<p><pre class="brush: csharp;">
description &quot;Initializes Compcache&quot;

start on runlevel [2345]
stop on runlevel [!2345]

pre-start script
DIR=/usr/local/src/compcache-0.6.2
CONTROL=$DIR/sub-projects/rzscontrol/rzscontrol

# load dependency modules
modprobe lzo_compress
modprobe lzo_decompress

# load ramzswap module
insmod $DIR/ramzswap.ko num_devices=2
sleep 1s

# Initialize devices with 512MB upper limit.
# These devices does not have a backing swap.
$CONTROL /dev/ramzswap0 --disksize_kb=524288 --init
$CONTROL /dev/ramzswap1 --disksize_kb=524288 --init

# Switch the swaps on
swapon -p 5 /dev/ramzswap0
swapon -p 5 /dev/ramzswap1
end script

post-stop script
DIR=/usr/local/src/compcache-0.6.2
CONTROL=$DIR/sub-projects/rzscontrol/rzscontrol

swapoff /dev/ramzswap0
swapoff /dev/ramzswap1

$CONTROL /dev/ramzswap0 --reset
$CONTROL /dev/ramzswap1 --reset

rmmod ramzswap
end script</pre></p>
<p>Update the paths, save the file as <code>/etc/init/compcache.conf</code> and restart your system. Your system should have two additional swap drives &#8211; 512MB each &#8211; already configured and switched on. Such configuration also enables switching Compcache off by using <a href="http://upstart.ubuntu.com/">Upstart</a> commands too. </p>
<p>In my environment Compcache achieved ~65% compression &#8211; 1GB of swapped pages would take approximately 350MB of memory. In result system can allocate 1.7GB and use only 1GB of physical memory without any sign of HDD swapping!</p>
<p>My setup uses two separate swapping devices in order to keep both of the CPU cores busy. If running on Quad Core CPU, it is beneficial to create four devices. Kernel utilizes them equally. </p>
<p>Some useful commands to track your swapping:<br />
<pre class="brush: csharp;">
sudo swapon -s #displays active swap devices and their usage
sudo stop compcache #switches Compcache off.
sudo start compcache #switches Compcache on
sudo rzscontrol /dev/ramzswap0 --stats #displays the stats of the first swapping device.
</pre></p>
<p>I am running this environment for couple of days and I see only advantages. Give it a try!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weirdfellow.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weirdfellow.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weirdfellow.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weirdfellow.wordpress.com&amp;blog=14407398&amp;post=51&amp;subd=weirdfellow&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weirdfellow.wordpress.com/2010/07/15/ubuntu-lucid-and-compcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2bf80c1f9b1ab0e46025cae190913d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weirdfellow</media:title>
		</media:content>
	</item>
	</channel>
</rss>
