<?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"
	>

<channel>
	<title>The Weblog</title>
	<atom:link href="http://www.haltingproblem.net/weblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haltingproblem.net/weblog</link>
	<description>Personal weblog of Roland Sadowski</description>
	<pubDate>Thu, 04 Dec 2008 13:04:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Clojure goodies</title>
		<link>http://www.haltingproblem.net/weblog/2008/11/25/clojure-goodies/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/11/25/clojure-goodies/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 10:54:06 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Clojure]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=45</guid>
		<description><![CDATA[Processing + Clojure

Processing is a java library for doing visualizations and various
media related stuff. A while ago I did a Clojure wrapper for it. You
can get it from github: clj-processing. 

Cloak

A couple of months ago I saw examples of config files of ruby&#8217;s
rake. Rake is a build tool, like ant or msbuild, but unlike
those, it [...]]]></description>
			<content:encoded><![CDATA[<h4>Processing + Clojure</h4>

<p><a href="http://processing.org/">Processing</a> is a java library for doing visualizations and various
media related stuff. A while ago I did a Clojure wrapper for it. You
can get it from github: <a href="http://github.com/rosado/clj-processing/tree/master">clj-processing</a>. </p>

<h4>Cloak</h4>

<p>A couple of months ago I saw examples of config files of ruby&#8217;s
<a href="http://rake.rubyforge.org/">rake</a>. Rake is a build tool, like <code>ant</code> or <code>msbuild</code>, but unlike
those, it doesn&#8217;t involve editing XML files. And thanks to ruby&#8217;s
quite flexible syntax, the resulting configuration files don&#8217;t hurt
your eyes.</p>

<p>I don&#8217;t know ruby and didn&#8217;t really feel like learning it just for one
tool. Googling for something similar to rake in the python universe didn&#8217;t
yield any results.</p>

<p>Since I&#8217;m investing much time in Clojure lately, I decided that I
might as well write something useful in it. Hence <a href="http://github.com/rosado/cloak/tree">Cloak</a>, a
simplistic automation tool written in Clojure. It&#8217;s heavily inspired by
rake; I had rake&#8217;s docs opened most of the time when writing the app.</p>

<p>Here&#8217;s how to use it. You put a file named <code>CLOAK</code> in your project&#8217;s
directory, and in it you define tasks, like this:</p>

<pre>
(task :task-name [:other-task :another]
    (when (exists? "some.file")
        (rm  "some.file"))
    (sh "command arg1 arg2 arg3" :dofail))
</pre>

<p>Task name should be a keyword. To run it from the command line, type
<code>cloak task-name</code>, without the semicolon (assuming <code>cloak</code> is the name
of the shell script that launches cloak). Second argument to task is an
optional list of dependencies, which can be other tasks or files. For
example <code>[:compile "classes/my.lib"]</code>. To refer to a file, use it&#8217;s
file name. Apart from regular tasks, you can specify file tasks:</p>

<pre><code> (file "index.html" ["template.xml" "content/main.txt"]
       (sh "genhtml template.xml content/main.txt index.html"))
</code></pre>

<p><code>file</code> tasks differ from regular <code>tasks</code> in one detail: they compare
modification time of the target and all its dependencies. Task is
executed only if mtime of target &lt; mtime of source.</p>

<p>Cloak is not a replacement for <code>maven</code> or <code>ant</code>. It would take me ages
to reach the level of functionality of those tools. I just wanted
something simple, to automate the generation of my website (among
other things). So far, it&#8217;s still a work in progress but it&#8217;s usable enough for me to use it with my own projects.</p>

<h4>Utility Libs</h4>

<p>I&#8217;ve also put my <a href="https://github.com/rosado/libs4clj/tree">utility libs</a> on github. Cloak requires them (but has
them in in a jar, so no need to download them separately). There&#8217;s
some IO and math related stuff in there. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/11/25/clojure-goodies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Autumn Update</title>
		<link>http://www.haltingproblem.net/weblog/2008/11/20/autumn-update/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/11/20/autumn-update/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:23:13 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=39</guid>
		<description><![CDATA[Since the end of the year is near, and because at the beginning of January
I&#8217;ll be pretty busy with other things (see below), I decided I&#8217;ll post
something while I still have spare time on my hands.

On a personal note, that was a good year (I finished school, among
other things). On the professional level, well, I [...]]]></description>
			<content:encoded><![CDATA[<p>Since the end of the year is near, and because at the beginning of January
I&#8217;ll be pretty busy with other things (see below), I decided I&#8217;ll post
something while I still have spare time on my hands.</p>

<p>On a personal note, that was a good year (I finished school, among
other things). On the professional level, well, I didn&#8217;t work
anywhere, was too busy with my thesis. But in September I started
sending out my CV and found something really nice. In Denmark.</p>

<p>I&#8217;m starting in January, that&#8217;s why I won&#8217;t have much time at the
beginning of next year for fancy retrospectives. I&#8217;ll spend 1+ year in
Denmark. I always wanted to live there, at least for a while. I mean,
they invented Lego, best toy <em>ever</em>.</p>

<p>But till then, I have lots of free time and so far I&#8217;m spending it
mostly on reading and programming. I&#8217;m gradually replacing Python with
<a href="http://www.clojure.org/">Clojure</a> as my weapon of choice and I&#8217;ll post something on that
topic shortly. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/11/20/autumn-update/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MathTalker Went Live</title>
		<link>http://www.haltingproblem.net/weblog/2008/08/31/mathtalker-went-live/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/08/31/mathtalker-went-live/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 00:18:01 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[appengine]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[mathtalker]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=35</guid>
		<description><![CDATA[On friday I uploaded the 1.0 version of MathTalker to
   Google&#8217;s servers. It&#8217;s a simple chat application which allows you to write
   mathematical formulas (using syntax similar to TeX). It was written in
   Python and runs on App Engine. 


MathTalker has pretty steep requirements for a web app: Firefox
 [...]]]></description>
			<content:encoded><![CDATA[<p>On friday I uploaded the 1.0 version of <a href="http://mathtalker.appspot.com">MathTalker</a> to
   Google&#8217;s servers. It&#8217;s a simple chat application which allows you to write
   mathematical formulas (using syntax similar to TeX). It was written in
   Python and runs on <a href="http://appengine.google.com">App Engine</a>. 
</p>

<p><em>MathTalker</em> has pretty steep requirements for a web app: Firefox
   browser and special math fonts (download links on <em>MathTalker</em>
   page). Displaying math formulas is possible thanks to <a href="http://asciimathml.sourceforge.net/">ASCIIMathML</a>
   library, which converts ASCII to MathML. I know about the plug-in that
   lets you render MathML in IE, but I decided to drop support for that
   browser after spending a couple of hours trying to make the UI work.
</p>

<h4>App Engine</h4>

<p>App Engine SDK comes with a little web framework and that&#8217;s what I
   used. You can also use <a href="http://www.djangoproject.com/">Django</a>, but I wanted to keep things
   simple. The built-in framework is nothing special, but it doesn&#8217;t get
   in your way. What requires more attention is Google&#8217;s Datastore -
   their distributed database. Honestly, I used only relational databases
   so far (oh, and flat files&#8230;), so I had to watch one or two talks
   from Google IO conference to get the idea.
</p>

<p>What pissed me off the most was lack of support for nested
   transactions and some bugs in existing transaction code. To run some
   piece of code, you have to pass a function to
   <code>db.run_in_transaction()</code>, but whenever I tried to make the code more
   generic (as in: not to write two almost identical functions) stuff
   exploded. It&#8217;s pretty bad, because creating an entity and updating a
   counter should be a single atomic action. But they aren&#8217;t, so you end
   up hoping for the best.
</p>

<h4>JavaScript</h4>

<p>Little bit of history: At first I hated it, then I really liked
   it. Now I&#8217;m just using it and ignoring its deficiencies. And regarding
   the period that I liked JS: it was the time that JS libraries were
   becoming really, really good, and I was just impressed (shocked, even)
   that it&#8217;s possible to build anything with it without cursing like mad.
</p>

<p>But even JS 1.7, which has generators and list comprehensions, is
   pretty verbose, and you can only take it so far as
   <a href="http://jquery.org">jQuery</a> - the best attempt for creating domain
   specific language in JavaScript. Great for traversing/manipulating
   DOM.
</p>

<p>Another thing: I used Emacs with <a href="http://code.google.com/p/js2-mode/">js2-mode</a>. The style of formating
   code encouraged (somewhat) by jQuery drives Emacs insane and beaks the
   indentation. At the beginning it bothered me, but then I stopped
   nesting function definitions and <code>js2-mode</code> let me do my work, and my
   code looked more readable. I don&#8217;t know if that was how <code>js2-mode</code>
   supposed to work or if it was just a bug, but it&#8217;s done more good than
   harm.
</p>

<h4>Blueprint</h4>

<p>I&#8217;ve also tried out <a href="http://blueprintcss.org/">Blueprint</a> CSS framework. I&#8217;ve used
   Yahoo&#8217;s CSS reset library before (and I don&#8217;t want to work without CSS
   reset <em>ever</em> again), but never Blueprint. It&#8217;s pretty good, but
   somehow feels not <em>clean</em> enough. I guess it provides to much defaults
   for my taste. But I&#8217;ll probably use it again someday.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/08/31/mathtalker-went-live/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Functional</title>
		<link>http://www.haltingproblem.net/weblog/2008/07/20/functional/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/07/20/functional/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 17:39:57 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Clojure]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=34</guid>
		<description><![CDATA[Recently I tried to rewrite a particular algorithm for generating 
   permutations in a functional manner. The original was written in C#, therefore 
   lots of mutable data structures etc. My first attempt at rewriting the code 
   in Clojure went something like this:




As you can see, I got [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I tried to rewrite a <a href="http://msdn.microsoft.com/en-us/library/aa302371.aspx">particular</a> algorithm for generating 
   permutations in a functional manner. The original was written in C#, therefore 
   lots of mutable data structures etc. My first attempt at rewriting the code 
   in <a href="http://www.clojure.org">Clojure</a> went something like this:
</p>

<p><a href="http://picasaweb.google.co.uk/szabla/ForMyBlog/photo#5225143462541658722"><img src="http://lh3.ggpht.com/szabla/SINwS5FACmI/AAAAAAAAAIU/dj1YvCFoJPI/s400/clj_fail.png" /></a></p>

<p>As you can see, I got lost halfway through. But this is what you get when you 
   try to write procedural/OO code in a functional language, using immutable 
   data structures. Usually the right way to get out of a mess like the one above 
   is to use <code>map</code> or its syntactic brother: list comprehension (Clojure&#8217;s <code>for</code> macro). 
</p>

<p>I ended up with a lazy list of permutations, where the laziness required 
   zero effort from me - got that for free from the language. 
</p>

<p>I&#8217;m still stumbling while writing programming in Clojure, but not in the 
   frustrating way like when I tried to write something of use in F#. 
   Probably getting to know Scheme beforehand helped a bit.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/07/20/functional/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;m no longer a student.</title>
		<link>http://www.haltingproblem.net/weblog/2008/07/06/im-no-longer-a-student/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/07/06/im-no-longer-a-student/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 09:24:31 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Message]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=33</guid>
		<description><![CDATA[A little more than a week ago I defended my thesis and now have a Master&#8217;s degree in mathematics. The title of my thesis is &#34;Particular classes of functions holomorphic in the unit circle,&#34; topic related to the Bieberbach conjecture, for those more oriented in math. For the next month and then some, I&#8217;ll be [...]]]></description>
			<content:encoded><![CDATA[<p>A little more than a week ago I defended my thesis and now have a Master&#8217;s degree in mathematics. The title of my thesis is &quot;Particular classes of functions holomorphic in the unit circle,&quot; topic related to the Bieberbach conjecture, for those more oriented in math. For the next month and then some, I&#8217;ll be writing code and learning. I&#8217;d also like to finish <a href="http://en.wikipedia.org/wiki/Okami">Okami</a>. After that I&#8217;ll start looking for a job. 
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/07/06/im-no-longer-a-student/feed/</wfw:commentRss>
		</item>
		<item>
		<title>At least I&#8217;ve written some code</title>
		<link>http://www.haltingproblem.net/weblog/2008/04/28/at-least-ive-written-some-code/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/04/28/at-least-ive-written-some-code/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 22:07:10 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Journal]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/?p=31</guid>
		<description><![CDATA[A Little Update

I&#8217;ve entered the thesis-writing mode and that means I only allow myself to work on my projects on Saturdays. By projects I mean tasks that usually take a good couple of hours. More often a whole day. 

Yesterday I finally did some work on my game. With a couple of thousands LOC it [...]]]></description>
			<content:encoded><![CDATA[<p class="bl">A Little Update</p>

<p>I&#8217;ve entered the thesis-writing mode and that means I only allow myself to work on my projects on Saturdays. By projects I mean tasks that usually take a good couple of hours. More often a whole day. </p>

<p>Yesterday I finally did some work on my game. With a couple of thousands LOC it became apparent I have to write some tests, and that&#8217;s mostly what I&#8217;ve done this Saturday. I&#8217;m using <a href="http://testng.org/">TestNG</a>. </p>

<p>I also have to force myself to write some PHP code for a class in the coming weeks. I was avoiding PHP for so long, but it finally got me. At school, of all places.</p>

<h4>Linux</h4>

<p>Lately, I&#8217;m spending much of my time on Linux. Here&#8217;s why: my laptop is three years old, but only a couple of days ago suspend and resume started working. Sort of - 1 in 5 times the machine just doesn&#8217;t want to wake up, and I have to reboot it. Other annoyances: this <a href="https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/218532">PulseAudio bug</a> (<code>pulseaudio -k</code> and using &#8220;plain&#8221; ALSA drivers fixes it), Tracker, a desktop search app, doesn&#8217;t work (but Beagle does, I use it). Oh, and watching video on Linux sucks - I always see huge pixels and sometimes that just ruins the whole experience. </p>

<p>One small observation: I don&#8217;t install many apps on Windows these days (I&#8217;m not counting various dev tools). I do almost everything in the browser, which really bothers me, because the UI usually is slow etc. But on Linux, I find myself more willing to try out new apps. And some of them are really good or very promising (Gnome-do, Tasque, Glipper). </p>

<p>The overal feel of a modern Linux desktop environment is positive. Not quite there yet, but also not far from where it should be. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/04/28/at-least-ive-written-some-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>26: Good Age To Start Using Lisp</title>
		<link>http://www.haltingproblem.net/weblog/2008/03/26/26-good-age-to-start-using-lisp/</link>
		<comments>http://www.haltingproblem.net/weblog/2008/03/26/26-good-age-to-start-using-lisp/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 22:37:04 +0000</pubDate>
		<dc:creator>roland</dc:creator>
		
		<category><![CDATA[Clojure]]></category>

		<category><![CDATA[Journal]]></category>

		<category><![CDATA[Lisp]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.haltingproblem.net/weblog/2008/03/26/26-good-age-to-start-using-lisp/</guid>
		<description><![CDATA[I&#8217;m 26 now. Spent my birthday writing my thesis. Nobody forced me, I just want to be done with it.


Haven&#8217;t worked much on my game. But since I started working on it, I pay more attention to what is happening in the java world. That&#8217;s how I found out about Clojure - a lisp dialect [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m 26 now. Spent my birthday writing my thesis. Nobody forced me, I just want to be done with it.
</p>

<p>Haven&#8217;t worked much on my game. But since I started working on it, I pay more attention to what is happening in the java world. That&#8217;s how I found out about <a href="http://www.clojure.org">Clojure</a> - a lisp dialect for the JVM. It was created to address many of the concurrency annoyances that occur when you write code in java (or any other language which doesn&#8217;t really promote immutability). I always wanted to learn lisp, but my understanding of the situation is that there&#8217;s lot of lisp implementations and all of them work well within their own world; interop with other languages is clunky. Clojure has all java libraries at its command, so I decided to take a look.
</p>

<p>The only sensible programming environment for Clojure at the moment is Emacs. I&#8217;m getting more and more proficient with Vim, so learning yet another editor didn&#8217;t seam like a good idea. But I did it anyway and I&#8217;m glad that I did. The combination of Emacs + REPL completely blew my mind. I&#8217;ve used Python REPL (and the excellent ipython), but somehow Emacs + Lisp REPL is different. Hard to explain it. 
</p>

<p>I also decided to take a brief look at <a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)">Scheme</a> to familiarize myself with the syntax and basic idioms of the language. Another thing: reading <a href="http://mitpress.mit.edu/sicp/ ">SICP</a> is on my todo list for this summer and authors use scheme there. Going through a couple of exercises in <a href="http://www.htdp.org/">How To Design Programs</a> resulted in one or two &quot;Aha!&quot; moments. 
</p>

<p>I uploaded an <a href="/files/astar/">implementation of A*</a> path finding algorithm in JavaScript, that I wrote a year ago or so. It took me so much time to put it here, because I couldn&#8217;t get it to work on IE properly. It still doesn&#8217;t work on IE but I don&#8217;t care - it&#8217;s just not worth my time. Anyway, since writing the code I learned that the way I render the board is really inefficient on current browsers (especially IE) - all those <code>div</code>s shouldn&#8217;t be created dynamically. 
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haltingproblem.net/weblog/2008/03/26/26-good-age-to-start-using-lisp/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
