<?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>A rather coolish blog</title>
	<atom:link href="http://emou.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://emou.wordpress.com</link>
	<description>Everything is relative. Also, I don&#039;t like olives.</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:34:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='emou.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A rather coolish blog</title>
		<link>http://emou.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://emou.wordpress.com/osd.xml" title="A rather coolish blog" />
	<atom:link rel='hub' href='http://emou.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SCons explicit Depends on Python object</title>
		<link>http://emou.wordpress.com/2011/01/26/scons-explicit-depends-on-python-object/</link>
		<comments>http://emou.wordpress.com/2011/01/26/scons-explicit-depends-on-python-object/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 18:34:02 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[scons python object]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=725</guid>
		<description><![CDATA[I was googling for this and couldn&#8217;t find it. I hope this will be find-able through google. If you want a node to depend on a certain python value in the SConscript, for example if you generate a file which depends on some options passed on the command line, then you can add this explicit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=725&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was googling for this and couldn&#8217;t find it. I hope this will be find-able through google.</p>
<p>If you want a node to depend on a certain python value in the SConscript, for example if you generate a file which depends on some options passed on the command line, then you can add this explicit dependency, assuming generated_file is a node that should depend on the python object:</p>
<p><pre class="brush: python;">
from SCons.Node import Python
options = {'foo': 'bar'}
SCons.Depends(generated_file, Python.Value(options))
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/725/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/725/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/725/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=725&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2011/01/26/scons-explicit-depends-on-python-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>[Rant] I love git</title>
		<link>http://emou.wordpress.com/2010/11/12/rant-i-love-git/</link>
		<comments>http://emou.wordpress.com/2010/11/12/rant-i-love-git/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 19:29:10 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=722</guid>
		<description><![CDATA[Git was the first version control system I&#8217;ve used. I started off just using three basic commands: git add . git commit -a git push origin master And that was it! It was simple, I was happy. But I knew there was more to it. And, there certainly is. I maybe know just a small [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=722&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Git was the first version control system I&#8217;ve used. I started off just using three basic commands:</p>
<pre>git add .
git commit -a
git push origin master
</pre>
<p>And that was it! It was simple, I was happy. But I knew there was more to it. And, there certainly is. I maybe know just a small subset, but I&#8217;m learning every day and I love it!</p>
<p>Branches, stashes, commits, everything. It&#8217;s plain cool.</p>
<p>Git saved me more than a few times recently.</p>
<p>Example: I&#8217;m doing some experimenting. I&#8217;m making a change, then another one, then another one&#8230; And I get carried away. I&#8217;ve got a bunch of changes and I want to test parts of them only. If I could only split this one big diff&#8230; But I can! There are git add &#8211;interactive or git stash save &#8211;patch &#8211;no-keep-tree. Simple as that. So what I did was I fired off git stash &#8211;save &#8211;no-keep-tree. It asked me for every hunk (part of the diff). I picked out the ones I wanted and stashed them away. And I didn&#8217;t even commit (I could&#8217;ve used git add &#8211;interactive for that)! Then I stashed away everything else. And my diff is split in two parts.<br />
There&#8217;s so much beauty in git, that I would say this is one of my favourite pieces of software. That&#8217;s why I couldn&#8217;t stand using p4 at work and got the git-p4 wrapper (which sucks but mostly works). And I was born again. p4 sucks balls. The only reason I see to use Perforce is performance with big files and big repositories.</p>
<p>But p4 is a huge pain to use every day. There&#8217;s no way to stash your changes, for crying out loud!</p>
<p>What happens if you need to make change A, test it, then *without throwing away A*, make change B, test it *in isolation*; then test A and B together? Good luck with that.</p>
<p>Git (there&#8217;s more than one way to do it):<br />
First way:<br />
$ git checkout -b changeA master<br />
$ # make change A and test it<br />
$ git commit -a # git add . &amp;&amp; git commit # One or more commits<br />
$ git checkout -b changeB master<br />
$ # make change B and test it<br />
$ git commit -a # git add . &amp;&amp; git commit # One or more commits<br />
$ git checkout -b changesAandB master<br />
$ git merge changeA<br />
$ git merge changeB<br />
$ # Now choose what to merge to master!<br />
$ git checkout master &amp;&amp; git merge changesAandB # Both</p>
<p>Second way (faster, less flexible):<br />
$ git checkout -b changesAandB<br />
$ # make change A and test it<br />
$ git stash # One time<br />
$ # make change B and test it<br />
$ git commit -a # changeB feels like a &#8220;master&#8221; change, it&#8217;s commited, but changeA is stashed<br />
$ git stash pop # Get changeA<br />
$ # test together<br />
$ # If you choose changeA<br />
$ git revert &lt;commit-sha of changeB&gt;<br />
$ # If you choose changeB<br />
$ git stash # Keeping changeA stashed, though. You might want to use git checkout . to throw it away<br />
$ # If you choose both<br />
$ git commit -a # Commiting changeA</p>
<p>P4: ???</p>
<p>What happens if while working on Feature 1, you get interrupted and need to start working on Feature 2, because it has a higher priority?</p>
<p>Git:<br />
$ git checkout -b Feature1 master<br />
$ # work, commit; get interrupted<br />
$ # Either use git stash or git commit; you can later create a new commit with git revert that reverts this temporary one or you can use git reset &#8211;hard to delete the commit.<br />
$ # If you chose git commit, git checkout -b Feature2 master<br />
$ # Work on Feature2.. When finished, merge to master branch. If you want to work on Feature1, just commit to the Feature2 branch, and checkout Feature1, then stash pop the change from the second step if you want to and if you did a stash at all.</p>
<p>Another way in git, if you&#8217;re working on master branch (which you shouldn&#8217;t be doing, but let&#8217;s say you did.)<br />
$ git commit / git stash # Temporary commit or a stash; btw, you can squash commits into one, so even if you do a bunch of them you can still push only one!<br />
$ git log # see which is the last commit that&#8217;s not from work on Feature1<br />
$ git checkout &lt;sha-1 of that commit&gt; -b Feature2<br />
$ # work on feature 2</p>
<p>Most people would have multiple clients so that they can work on those&#8230; Which is downright stupid. Especially if the tree is 10GB for example (and after all, this will probably be the case because p4 is used for such big trees, because of its performance).</p>
<p>How about differences between changes ?</p>
<p>Git: git diff &lt;commit1&gt; &lt;commit2&gt;</p>
<p>P4: ???</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/722/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=722&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/11/12/rant-i-love-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript Gotchas</title>
		<link>http://emou.wordpress.com/2010/06/23/javascript-gotchas/</link>
		<comments>http://emou.wordpress.com/2010/06/23/javascript-gotchas/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 17:08:56 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Програмиране]]></category>
		<category><![CDATA[gotchas]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=703</guid>
		<description><![CDATA[Some pretty stupid things in Javascript to follow. Associative arrays are objects Look at this interactive session (checkout Rhino or SpiderMonkey for a js shell) js&#62; var x = {} js&#62; x == {} false js&#62; x == true false js&#62; x == false false So, a condition if({}) is always satisfied. There&#8217;s no native [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=703&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some pretty stupid things in Javascript to follow.</p>
<h3>Associative arrays are objects</h3>
<p>Look at this interactive session (checkout Rhino or SpiderMonkey for a js shell)</p>
<pre>
js&gt; var x = {}
js&gt; x == {}
false
js&gt; x == true
false
js&gt; x == false
false
</pre>
<p>So, a condition
<pre>if({})</pre>
<p> is always satisfied. There&#8217;s no native way to check if an associative array is empty! Because an associative array IS in fact an object and no two objects are equal except<br />
if they are the same instance.<br />
Here&#8217;s my workaround:</p>
<pre>
function empty(ar) {
    for(var k in ar) {
        return false;
    }
    return true;
}
</pre>
<h3>Wrapper classes</h3>
<p>The reason for this &#8216;gotcha&#8217; is actually the same as the first.</p>
<pre>
js&gt; var s = new String("abc")
js&gt; var t = new String("abc")
js&gt; s == t
false
</pre>
<p>My workaround for this is to always use:</p>
<pre>
var str = new String(some_val).toString();
</pre>
<p>instead of</p>
<pre>
var str = new String(some_val)
</pre>
<p>This translates to all wrapper classes.</p>
<p>For Boolean:</p>
<pre>
var bool = some_val==true
</pre>
<p>instead of</p>
<pre>
var bool = new Boolean(some_val)
</pre>
<p>For Number:</p>
<pre>
var num = new Number(some_val).valueOf()
</pre>
<p>instead of</p>
<pre>
var num = new Number(some_val)
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/703/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/703/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/703/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=703&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/06/23/javascript-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>ADO Resync() and autoincrement with PostgreSQL</title>
		<link>http://emou.wordpress.com/2010/06/16/ado-resync-with-postgresql/</link>
		<comments>http://emou.wordpress.com/2010/06/16/ado-resync-with-postgresql/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:04:55 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Програмиране]]></category>
		<category><![CDATA[ADO]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=689</guid>
		<description><![CDATA[I was forced to do a project in classic ASP. Of course, I chose Javascript. And PostgreSQL. I use the unicode ODBC driver for PostgreSQL. I connect with a DSN (you need to create a data source in the windows control panel (yuck) ). And I actually made a small Object Relational Mapper that kinda [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=689&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was forced to do a project in classic ASP. Of course, I chose Javascript. And PostgreSQL. I use the unicode ODBC driver for PostgreSQL. I connect with a DSN (you need to create a data source in the windows control panel (yuck) ).</p>
<p>And I actually made a small Object Relational Mapper that kinda works very well for now. It&#8217;s about 400 lines of code for now. However, that&#8217;s another topic.</p>
<p>When I was implementing the save() method for my models I needed to insert some records<br />
and after that to access their fields.</p>
<p>The solution is to use the AddNew() method of a recordset. So:</p>
<p><pre class="brush: jscript;">
                var rs = Server.CreateObject(&quot;ADODB.Recordset&quot;);
                rs.CursorLocation = 3; // adUseClient, without this, resync() does not work!

                rs.Open(quoted_table_name, db._conn, 3, 3, 512);

                rs.AddNew(cols, vals);
                rs.Resync();
                /* Do stuff with the rs fields, like get a default value that the database put for us */

                rs.Close();

</pre></p>
<p>I know it sucks seing integers instead of constant names, but I haven&#8217;t gotten around to reference the DLL that defines these constants (or whatever, I read something in an ASP book).</p>
<p>The important line is the second one. 3 is adUseClient, which means &#8220;Uses a client-side cursor supplied by a local cursor library&#8221; whatever that actually means. That was the key after about an hour spent trying to solve this shit! If you do not set the CursorLocation, you&#8217;ll get an error when you call Resync() saying that the current provider does not support refreshing underlying variables.</p>
<p> Unfortunately, this does not work with primary key values like autoincrement IDs, which was my first intent.</p>
<p>However, after many more minutes surfing the internet I have finally <a href="http://support.microsoft.com/kb/221931">found the solution</a>!</p>
<p>Well, this works only when the primary key is an autoincrement value. So we use resync() when the<br />
field is not AI, and the absolutePosition method, otherwise.</p>
<p>My code looks like this now:</p>
<p><pre class="brush: jscript;">
// Part of the save() method
                var rs = Server.CreateObject(&quot;ADODB.Recordset&quot;);
                rs.CursorLocation = 3; // adUseClient. This is required
                rs.Open(quoted_table_name, db._conn, 3, 3, 512);

                rs.AddNew(cols, vals);
                rs.Update();
                this._refresh(rs);

                rs.Close();
</pre></p>
<p><pre class="brush: jscript;">
        /* Refresh values in the object from a recordset
         * Changes argument rs
         * For internal use only
         *
         * - If the model has a serial (autoincrement, AI) field,
         *   that was specified in the creation of the model,
         *   to refresh the row, we use absolutePosition and Requery().
         *   - If there is column named 'id', we assume it to be AI
         *     and to the same as above.
         *
         * - If klass.serial is null, we do not make the assumption about
         *   the 'ID' column
         * 
         */
        _refresh: function(rs) { 

            if(klass.serial || (this.id === null &amp;&amp; klass.serial === undefined)) {
                var pos = rs.absolutePosition;
                rs.Requery();
                rs.absolutePosition = pos;
            }
            else {
                rs.Resync();
            }

            var cols = klass.columns;
            for(var i in cols) {
                 this[cols[i].name] = rs.Fields(cols[i].name).value;
            }

        },
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/689/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=689&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/06/16/ado-resync-with-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Configure a second screen (for presentations, external monitor)</title>
		<link>http://emou.wordpress.com/2010/06/16/configure-a-second-screen-for-presentations-external-monitor/</link>
		<comments>http://emou.wordpress.com/2010/06/16/configure-a-second-screen-for-presentations-external-monitor/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 12:48:39 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[external monitor]]></category>
		<category><![CDATA[modeline]]></category>
		<category><![CDATA[refresh rate]]></category>
		<category><![CDATA[resolution]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=684</guid>
		<description><![CDATA[I made this small script to help me rapidly connect to external monitors, when I am in a hurry. For example, if I have to do a presentation at the university, I just connect the VGA output and type $ vga_conf VGA1 1024 768 60 and that gives me 1024&#215;768@60Hz on the beamer. The script [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=684&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I made this small script to help me rapidly connect to external monitors, when I am in a hurry.</p>
<p>For example, if I have to do a presentation at the university, I just connect the VGA output and type</p>
<p><code><br />
$ vga_conf VGA1 1024 768 60<br />
</code></p>
<p>and that gives me 1024&#215;768@60Hz on the beamer.</p>
<p>The script is extra-simple and doesn&#8217;t handle all situations. It&#8217;s just a quick way to try to set your resolution and refresh rate when in a hurry.</p>
<p><pre class="brush: bash;">
#!/bin/bash

if [ $# != 4 ]; then
    echo &quot;** Usage: &quot;
    echo &quot;** $0 output height width refresh_rate&quot;
    echo &quot;** Example usage:&quot;
    echo &quot;** $0 VGA1 1280 1024 60&quot;
    echo &quot;** Note: output name can be retrieved from the xrandr command&quot;
    exit
fi


echo &quot;Generating modeline...&quot;
modeline=`gtf $2 $3 $4 | grep Modeline | cut -f3 -d' ' --complement`
mode=`echo $modeline | cut -f1 -d' '`
echo &quot;Creating modeline: $modeline&quot;
xrandr --newmode $modeline
echo &quot;Adding mode $mode to output $1&quot;
xrandr --addmode $1 $mode
echo &quot;Setting mode of $1 to $mode&quot;;
xrandr --output $1 --mode $mode
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/684/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=684&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/06/16/configure-a-second-screen-for-presentations-external-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Classic ASP on Linux with VirtualBox running Windows XP</title>
		<link>http://emou.wordpress.com/2010/04/16/classic-asp-on-linux-with-virtualbox/</link>
		<comments>http://emou.wordpress.com/2010/04/16/classic-asp-on-linux-with-virtualbox/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 18:46:36 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fuck this shit]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=663</guid>
		<description><![CDATA[I found myself forced to use classic ASP. Of course, I would never use Windows willingly so I started looking for ways to run ASP on Linux. It turned out there aren&#8217;t any. Mono runs only .NET applications. And as ASP is so damn old, even the two commercial alternatives that have obviously existed: chili!ASP [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=663&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found myself <strong>forced</strong> to use <strong>classic</strong> ASP. Of course, I would never use Windows willingly so I started looking for ways to run ASP on Linux. It turned out there aren&#8217;t any.<br />
Mono runs only .NET applications. And as ASP is so damn old, even the two commercial alternatives that have obviously existed: chili!ASP and Instant ASP, that could eventually run on Linux are just not available anymore anywhere.<br />
So, the obvious alternative was to use a virtual machine running Windows. I already had setup a Windows XP virtual machine with VirtualBox.</p>
<p>I&#8217;ll try to present what I actually did to use ASP.</p>
<h2>Prerequisites</h2>
<ul>
<li>A linux host machine (I tested with Arch)</li>
<li>Packets called <strong>bridge-utils</strong> and <strong>uml_utilities</strong> in ArchLinux</li>
<li>A VirtualBox (tested with ver. 3.1.4 r57640) machine that has Windows (I tested with XP SP3) installed and running; and IIS installed and working on the &#8220;localhost&#8221; of the virtual machine!</li>
<li>A packet called virtualbox-additions in ArchLinux.</li>
<li>Load these modules:
<pre>modprobe vboxnetflt vboxdrv</pre>
</li>
</ul>
<h2>Results</h2>
<ul>
<li>I am accessing the virtual machine from the host machine just like they were in a local network.</li>
<li>I have IIS running on port 8077 so I open a browser and go to http://{local-guest-ip}:8077/test.asp and am able to run the test.asp script which I put in the Home directory of IIS.</li>
<li>I have a samba share of the IIS Home directory mounted in a localdir, let&#8217;s say /home/foo/asp-root/ and I can edit files with vim right in there, then refresh the page and see the results. I just keep the virtual machine on a different desktop, so I don&#8217;t even have to look at the damn thing.</li>
</ul>
<h2>Failed attempts</h2>
<p>I tried to do this with forwarding a port on the host machine, for example 8088, to the guest machine port 8077 where IIS listens, and then sharing a directory <strong>from the host</strong> to the guest through VirtualBox shared folders. Then I tried to make this shared directory the Home dir for IIS by selecting &#8220;A shared directory located on another computer&#8221; in </p>
<blockquote><p>Control Panel -&gt; Administrative Tools -&gt; IIS -&gt; &#8230; -&gt; Default Web Site (right click)-&gt; Properties.</p></blockquote>
<p> That didn&#8217;t work. The Windows XP guest sees the share just fine, has read and write access and stuff, but&#8230; IIS won&#8217;t work. It dumped some permission errors. I tried making the same user/pass pair on both the host and guest and using that in the IIS &#8220;connect to:&#8221; setting for the shared directory, or in the Directory Security tab. Whatever I did either other errors appeared or the mighty error message:</p>
<blockquote><p>
Incorrect function.
</p></blockquote>
<p>appeared in the browser (Opera); Internet Explorer, though, just showed Internal Server Error.</p>
<h2>Success story</h2>
<p>So it obviously needs to be done the other way around &#8212; share from the guest and access from the host.<br />
Here&#8217;s how I did it (I hope I don&#8217;t miss something).</p>
<h3>Bridging a host network interface with the guest</h3>
<p>I used these <a href="http://wiki.archlinux.org/index.php/VirtualBox#Using_host_interface_networking_.28the_Arch_way.29">instructions in ArchWiki</a>. They are pretty straight-forward, but if you can&#8217;t apply them, you need to know what to look for and that is,</p>
<blockquote><p>You need to make a bridge (for example, br0) <strong>from</strong> an interface of your choice (for example, eth0) <strong>to</strong> vbox0, which I guess is a VirtualBox interface.</p></blockquote>
<p>Then you need to attach a &#8220;Bridged Adapter&#8221; in the network settings of the virtual machine and choose &#8220;br0&#8243;.<br />
After finishing the instructions you should have something similar to:</p>
<blockquote><p>
$ ifconfig br0<br />
br0       Link encap:Ethernet  HWaddr 00:23:3C:CD:31:44<br />
         <strong>inet addr:192.168.0.2</strong>  Bcast:192.168.0.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::221:9bff:fecf:86e0/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:3151 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:0<br />
          RX bytes:0 (0.0 b)  TX bytes:1150259 (1.0 Mb)
</p></blockquote>
<p>You should watch out if you have other network interfaces not to clash with them! Every interface should be on a different subnet &#8211; that is the first 3 numbers of the IP address should not be the same for any two interfaces on the same machine.</p>
<p>Then, in the guest Windows machine you should set up a static IP in the same subnetwork like your br0 (for example 192.168.0.3). You should <strong>get a response</strong> from</p>
<blockquote><p>
$ ping 192.168.0.3
</p></blockquote>
<p>on the host machine and</p>
<blockquote><p>
ping 192.168.0.2
</p></blockquote>
<p>on the guest machine (Start-&gt;Run..-&gt;cmd).<br />
Also, openning <strong>http://192.168.0.3:8077/test.asp</strong> (or whatever other test file you&#8217;ve got) on the host machine should work. If not, you should</p>
<blockquote><p>
open TCP port 8077<br />
on the Windows XP firewall.
</p></blockquote>
<p>Google it if you don&#8217;t know how &#8211; it&#8217;s easy.</p>
<h2>Setting new Home dir on IIS and sharing it</h2>
<p>In the guest machine, go to</p>
<blockquote><p>Control Panel -&gt; Administrative Tools -&gt; IIS -&gt; &#8230; -&gt; Default Web Site (right click)-&gt; Properties -&gt; Home Directory.</p></blockquote>
<p>There, choose a directory which will be the root of the default site.<br />
After that, I won&#8217;t explain in detail &#8212; use google if you don&#8217;t know how to do it, you should</p>
<blockquote><p>
Create <em>a user</em> in Windows, or use an exisitng one; disable simple file sharing; share the folder you chose for a home directory; Give full access to <em>the user</em> and restrict <strong>Everyone</strong>.
</p></blockquote>
<p>Now, on the Linux host machine, open <strong>/etc/fstab</strong> as root and add something like this:</p>
<blockquote><p>
//192.168.0.3/{share-name}    /where/i/want/my/asp/files/ cifs umask=000,rw,exec,noauto,noatime,username={win-user},password={win-pass},gid=users,uid=foobar 0 0
</p></blockquote>
<p>where:</p>
<ul>
<li>{share-name} is the name of the share you did on the guest machine (by default, same as the dir name).</li>
<li>{win-user} is the name of the user you gave Full access for the share and {win-pass} hiss password.</li>
<li>You should edit the mountpoint (/where&#8230;), gid (your linux user&#8217;s group &#8212; users will probably do) and uid (your username)!</li>
</ul>
<p>Now type</p>
<blockquote><p>
mount //192.168.0.3/{share-name}</p>
<p>and go to /where/i/want/my/asp/files. You should be able to edit them.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=663&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/04/16/classic-asp-on-linux-with-virtualbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Vim for notetaking</title>
		<link>http://emou.wordpress.com/2010/04/12/vim-for-notetaking/</link>
		<comments>http://emou.wordpress.com/2010/04/12/vim-for-notetaking/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:28:57 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=658</guid>
		<description><![CDATA[I am currently trying to use vim for notetaking. This is the main idea: I have a directory ~/.notes/ where I will keep my notes. One file for each day. I have this simple shell script at /usr/local/bin/n Edit: this requires GNU Date which is not standart on all UNIX systems (doh). Now I type: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=658&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am currently trying to use vim for notetaking. This is the main idea:</p>
<p>I have a directory
<pre>~/.notes/</pre>
<p> where I will keep my notes. One file for each day.</p>
<p>I have this simple shell script at
<pre>/usr/local/bin/n</pre>
<p><pre class="brush: bash;">
#!/bin/bash
if [ $# -eq 1 ]; then
  dayopt=&quot;-d \&quot;$1 days\&quot;&quot;
fi
cmd=&quot;date $dayopt +%d-%m-%Y&quot;
vim ~/.notes/$(eval $cmd).txt
</pre></p>
<p>Edit: this requires GNU Date which is not standart on all UNIX systems (doh).</p>
<p>Now I type:</p>
<pre>
n
</pre>
<p>to see my notes for the current day.</p>
<p>For tommorow:</p>
<pre>
n +1
</pre>
<p>Three days ago:</p>
<pre>
n -3
</pre>
<p>Thanks, GNU date.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/658/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=658&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/04/12/vim-for-notetaking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Reorder font characters (Dirty work)</title>
		<link>http://emou.wordpress.com/2010/02/03/reorder-font-characters-dirty-work/</link>
		<comments>http://emou.wordpress.com/2010/02/03/reorder-font-characters-dirty-work/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 19:48:19 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=635</guid>
		<description><![CDATA[I got some TTF files which have broken character placement &#8211; the cyrillic letters were at the Latin-1 Supplement block of the Unicode table. However I tried (different keyboard layouts, locales, etc.) I couldn&#8217;t input those characters anywhere, hence I was not able to use the TTF fonts. I hacked up a python script that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=635&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got some TTF files which have broken character placement &#8211; the cyrillic letters were at the<br />
<a href="http://en.wikipedia.org/wiki/Latin-1_Supplement_Unicode_block">Latin-1 Supplement</a><br />
block of the Unicode table. However I tried (different keyboard layouts, locales, etc.) I couldn&#8217;t input those characters anywhere, hence I was not able to use the TTF fonts.</p>
<p>I hacked up a python script that tries to copy the characters from where they are located in the broken files to their right position in the Unicode table (starting from 0&#215;410).<br />
The script uses the fontTools library and is really <strong>a dirty piece of work</strong> (it even swears, sometimes) as it just skips files where an exception is thrown from the fontTools library.<br />
Honestly, I have little idea why some of the files corrupt the TTFile object character maps (tables), but I&#8217;m glad I got most files fixed.<br />
Also, I&#8217;m not really sure what are the different cmap &#8220;formats&#8221; that are located in every TTFile object. But I guess it&#8217;s ok as long as I got something working.</p>
<p><pre class="brush: python;">
#!/usr/bin/env python
from fontTools import ttLib
import getopt
import sys
def fixFont(filename):
    try:
      ttf = ttLib.TTFont(filename)
    except IOError:
      print filename + ' does not exist. Skipping to next file.'
      return
    # There are a few cmap tables inside a ttf object (in different 'formats'), but they apparantely are all synced with each other
    for ti in range(0,3):
      try:
        cmap = ttf['cmap'].tables[ti].cmap
      except Exception:
        print 'Fucked up stuff.. Skipping.'
        return
      # letter count -- small + capital letters
      lc = 62
      # in the broken ttfs, cyrillic chars start from a broken index
      broken = 0xc0
      # where cyrillic chars should start from in the fixed ttf
      fixed = 0x410
      #just copy all the cyrillic chars to where they belong
      for b,f in zip(range(broken,broken+lc+1),range(fixed,fixed+lc+1)):
        try:
          cmap[f] = cmap[b]
        except KeyError:
          import fontTools.unicode
          print 'The font does not contain the character ' + fontTools.unicode.Unicode[b] + '. Skipping to next character.'
      newfname = filename[:-4]+'_fixed.'+'ttf'
      try:
        ttf.save(newfname)
        return
      except Exception:
        print 'Trying another table...'

if __name__ == &quot;__main__&quot;:
  for filename in sys.argv[1:]:
    if filename.lower()[-3:] != 'ttf':
      print filename + ': not a TTF file. Skipping to next file.'
    else:
      fixFont(filename)
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/635/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=635&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/02/03/reorder-font-characters-dirty-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>zip stuff</title>
		<link>http://emou.wordpress.com/2010/01/26/zip-stuff/</link>
		<comments>http://emou.wordpress.com/2010/01/26/zip-stuff/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 09:40:00 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=630</guid>
		<description><![CDATA[List files in an archive: unzip -l pdf-archive.zip Create new archive (-u is optional, but I prefer to put it for clarity): zip -u pdf-archive pdf/*.pdf The resulting zip file is called pdf-archive.zip and contains pdf/doc1.pdf pdf/doc2.pdf If you don&#8217;t want to create directories for the entries use the -j option zip -u -j pdf-archive [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=630&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>List files in an archive:</p>
<pre>
unzip -l pdf-archive.zip
</pre>
<p>Create new archive (-u is optional, but I prefer to put it for clarity):</p>
<pre>
zip -u pdf-archive pdf/*.pdf
</pre>
<p>The resulting zip file is called pdf-archive.zip and contains</p>
<pre>
pdf/doc1.pdf
pdf/doc2.pdf
</pre>
<p>If you don&#8217;t want to create directories for the entries use the -j option</p>
<pre>
zip -u -j pdf-archive pdf/*.pdf
</pre>
<p>To delete some files from the archive</p>
<pre>
zip -d pdf-archive pdf/*.pdf
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/630/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/630/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/630/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=630&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2010/01/26/zip-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
		<item>
		<title>Bye, bye Amarok! Hello, mpd!</title>
		<link>http://emou.wordpress.com/2009/12/22/bye-bye-amarok-hello-mpd/</link>
		<comments>http://emou.wordpress.com/2009/12/22/bye-bye-amarok-hello-mpd/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 12:41:28 +0000</pubDate>
		<dc:creator>emou</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[mpd]]></category>
		<category><![CDATA[music player]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://emou.wordpress.com/?p=623</guid>
		<description><![CDATA[I have been using Amarok for a long time now as my only music player. It has all those great features like last.fm scrobbling decent tag editing music library extras like: additional scripts; wikipedia info; lyrics display, etc. But I have always been annoyed that also among the reasons I use Amarok was that there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=623&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been using Amarok for a long time now as my only music player. It has all those great features like</p>
<ul>
<li>last.fm scrobbling</li>
<li>decent tag editing</li>
<li>music library</li>
<li>extras like: additional scripts; wikipedia info; lyrics display, etc.</li>
</ul>
<p>But I have always been annoyed that also among the reasons I use Amarok was that there weren&#8217;t really any good alternatives &#8211; I&#8217;ve tried a few but fell in love with none of them.</p>
<p>Also, some problems with Amarok were really annoyning (in order of importance):</p>
<ol>
<li>The database constantly f***s up. I mean, at one time you&#8217;ve got all your songs and albums. And after updating (not sure if this happens even without updating) you suddenly find out that albums and songs are all messed up &#8211; songs appear to belong to artist A according to Amarok but we all know that artist B released them. Some albums just become empty &#8211; others have only some songs, and so on. So I start rescanning the collection which helps sometimes and sometimes doesn&#8217;t. Then I probably delete the database or something like that.</li>
<li>It&#8217;s slow. It loads slow and feels kind of slow. Not very slow. But not fast in my book</li>
</ol>
<p>I am not complaining &#8211; I know I should post bug reports &#8211; and I am not being arrogant &#8211; I know nobody owns me nothing. Don&#8217;t get me wrong &#8211; I love Amarok, and I&#8217;ll probably go back to it when (if?) I get disappointed with mpd and various clients.</p>
<p>However, for now I&#8217;m really going on the mpd side. mpd is a daemon that resides in the background and maintains your musical collection; playlists and it does the playing too. It looks highly configurable, although I have not played with much it yet. But pretty fast I was able to configure it (with the help of <a title="ArchWiki MPD page" href="http://wiki.archlinux.org/index.php/MPD">ArchWiki</a>, of course &#8211; thanks, guys) to play through my sound card and put a httpd stream (also simultaneously), which I was able to play through a remote computer.</p>
<p>MPD has <strong>a lot of <a title="Clients for MPD" href="http://mpd.wikia.com/wiki/Clients">clients</a> </strong>written for it. That is, you can use a bunch of different players to play your music! There are GTK, Qt, Java and even console client (there&#8217;s one that looks like vim!). Also, closing your client (or crashing it) does not stop music playback. You can close one client, continue hearing music, start another and see the same playlist and collection with a totally different interface! Or you can listen to music without having to hold a client open at all.</p>
<p>Also, I don&#8217;t know if it&#8217;s the subjective little guy in my left year talking but I hear better sound from mpd than Amarok.</p>
<p>So, I fell in love with mpd!</p>
<p>There&#8217;s mpdscribble &#8211; a last.fm scrobbling daemon, that also works fine!</p>
<p>Actually, I got this idea to write a client for mpd, that will be just what I want in a music player! It seems easy because I&#8217;ll be like implementing only the GUI (or CLI, don&#8217;t know yet), because the libmpdclient library has a really high level of abstraction &#8211; you don&#8217;t need to worry about ALSA (that always looked pretty scary to me as a library).</p>
<p>We&#8217;ll see. For now, I&#8217;ll be just rocking and switching different clients <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/emou.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/emou.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/emou.wordpress.com/623/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=emou.wordpress.com&amp;blog=3109272&amp;post=623&amp;subd=emou&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://emou.wordpress.com/2009/12/22/bye-bye-amarok-hello-mpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24d716d6ec5be8bc5e9f709fae0c7ff9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emou</media:title>
		</media:content>
	</item>
	</channel>
</rss>
