<?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>=&#62; "New/Old stuff"</title>
	<atom:link href="http://newoldstuff.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://newoldstuff.wordpress.com</link>
	<description>&#62;&#62; ["New","Old"].inject{&#124;m,n&#124; "#{m}/#{n} stuff"}</description>
	<lastBuildDate>Fri, 12 Feb 2010 07:49:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='newoldstuff.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>=&#62; "New/Old stuff"</title>
		<link>http://newoldstuff.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://newoldstuff.wordpress.com/osd.xml" title="=&#62; &#34;New/Old stuff&#34;" />
	<atom:link rel='hub' href='http://newoldstuff.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Erlang string to term</title>
		<link>http://newoldstuff.wordpress.com/2009/06/09/erlang-string-to-term/</link>
		<comments>http://newoldstuff.wordpress.com/2009/06/09/erlang-string-to-term/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 13:02:54 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=160</guid>
		<description><![CDATA[Evaluation of string to erlang&#8217;s term:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=160&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Evaluation of string to erlang&#8217;s term:</p>
<p><pre class="brush: ruby;">
-module(evaluator_utils).
-export([eval_string/1]).

eval_string([]) -&gt; []; 
eval_string(String) -&gt;
    {ok, Tokens, _} = erl_scan:string(lists:concat([String, &quot;.&quot;])),
    {Status, Term} = erl_parse:parse_term(Tokens),
    case Status of
        ok -&gt; {ok, Term};
        error -&gt;
            {_, _, ErrorMessage} = Term,
            {error, ErrorMessage}
    end.
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=160&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/06/09/erlang-string-to-term/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Clojure tips: patterns matching</title>
		<link>http://newoldstuff.wordpress.com/2009/05/28/clojure-tips-patterns-matching/</link>
		<comments>http://newoldstuff.wordpress.com/2009/05/28/clojure-tips-patterns-matching/#comments</comments>
		<pubDate>Thu, 28 May 2009 12:05:59 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Clojure]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=153</guid>
		<description><![CDATA[This is how it can be done in clojure: Factorial pattern matching:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=153&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is how it can be done in clojure:</p>
<p><pre class="brush: ruby;">
user=&gt; (defmulti fib (fn [x] x) :default :default)
#'user/fib
user=&gt; (defmethod fib 0 [x] 0)
#&lt;MultiFn clojure.lang.MultiFn@de1b8a&gt;
user=&gt; (defmethod fib 1 [x] 1)
#&lt;MultiFn clojure.lang.MultiFn@de1b8a&gt;
user=&gt; (defmethod fib :default [n] (+ (fib (- n 2)) (fib (- n 1))))
#&lt;MultiFn clojure.lang.MultiFn@de1b8a&gt;
user=&gt; (fib 32)
2178309
user=&gt; (time (fib 32))
&quot;Elapsed time: 3406.246008 msecs&quot;
2178309
user=&gt;
</pre></p>
<p>Factorial pattern matching:</p>
<p><pre class="brush: ruby;">
(defmulti fac (fn [x] x) :default :default)
(defmethod fac 1 [x] 1)
(defmethod fac :default [n] (* n (fac (- n 1))))
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=153&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/05/28/clojure-tips-patterns-matching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang tips: remote module loading</title>
		<link>http://newoldstuff.wordpress.com/2009/05/26/erlang-tips-remote-module-loading/</link>
		<comments>http://newoldstuff.wordpress.com/2009/05/26/erlang-tips-remote-module-loading/#comments</comments>
		<pubDate>Tue, 26 May 2009 12:05:46 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=143</guid>
		<description><![CDATA[Context: when remote module pushing is needed. Initial setup: 1. 2 nodes (physical nodes, each one having one erlang instance started): node1@10.0.0.1 and node2@10.0.0.2 2. both erlang instances must be started with the same cookie, in order to be able to successfully communicate Steps: (On node1, create test module) (On node1, start erlang instance) (On [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=143&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Context: when remote module pushing is needed.</p>
<p>Initial setup:<br />
1. 2 nodes (physical nodes, each one having one erlang instance started): node1@10.0.0.1 and node2@10.0.0.2<br />
2. both erlang instances must be started with the same cookie, in order to be able to successfully communicate</p>
<p>Steps:</p>
<p>(On node1, create test module)<br />
<pre class="brush: ruby;">
-module(test).
-export([test_fun/0]).

test_fun() -&gt;
    io:format(&quot;Hello ~s~n&quot;,[&quot;World&quot;]).
</pre></p>
<p>(On node1, start erlang instance)<br />
<pre class="brush: ruby;">
$ erl -name node1@10.0.0.1 -setcookie testcookie
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.1  (abort with ^G)
(node1@10.0.0.1)1&gt; 
</pre></p>
<p>(On node2, start erlang instance)<br />
<pre class="brush: ruby;">
$ erl -name node2@10.0.0.2 -setcookie testcookie
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.1  (abort with ^G)
(node1@10.0.0.2)1&gt; 
</pre></p>
<p>(On node1, compile/load/remote load test module)<br />
<pre class="brush: ruby;">
(node1@10.0.0.1)1&gt; c(test).
{ok,test}
(node1@10.0.0.1)2&gt; {Mod, Bin, _} = code:get_object_code(test).
{test,&lt;&lt;70,79,82,49,0,0,1,252,66,69,65,77,65,116,111,109,
        0,0,0,63,0,0,0,7,4,116,101,...&gt;&gt;,
      &quot;/home/alin/test.beam&quot;}
(node1@10.0.0.1)3&gt; rpc:call('node2@10.0.0.2',erlang,load_module, [Mod, Bin]).
{module,test}
(node1@10.0.0.1)4&gt; spawn('node2@10.0.0.2', test, test_fun, []).
Hello World
&lt;8592.45.0&gt;
(node1@10.0.0.1)5&gt; 
</pre></p>
<p>(On node1, edit test.erl)</p>
<p>Instead of<br />
<pre class="brush: ruby;">
... io:format(&quot;Hello ~s~n&quot;,[&quot;World&quot;]).
</pre></p>
<p>set<br />
<pre class="brush: ruby;">
... io:format(&quot;Hello ~s~n&quot;,[&quot;World2&quot;]).
</pre></p>
<p>(On node1, go back to opened erlang shell)<br />
<pre class="brush: ruby;">
(node1@10.0.0.1)5&gt; f().
ok
(node1@10.0.0.1)6&gt; c(test).
{ok,test}
(node1@10.0.0.1)7&gt; {Mod, Bin, _} = code:get_object_code(test).
{test,&lt;&lt;70,79,82,49,0,0,1,252,66,69,65,77,65,116,111,109,
        0,0,0,63,0,0,0,7,4,116,101,...&gt;&gt;,
      &quot;/home/alin/test.beam&quot;}
(node1@10.0.0.1)8&gt; rpc:call('node2@10.0.0.2',code,purge, [Mod]).
false
(node1@10.0.0.1)9&gt; rpc:call('node2@10.0.0.2',erlang,load_module, [Mod, Bin]).
{module,test}
(node1@10.0.0.1)10&gt; spawn('node2@10.0.0.2', test, test_fun, []).
&lt;8592.48.0&gt;
Hello World2
(node1@10.0.0.1)11&gt; 
</pre></p>
<p>Note: node2 was not touched for anything else than starting (erl -name node2@10.0.0.2 -setcookie testcookie)</p>
<p>Done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=143&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/05/26/erlang-tips-remote-module-loading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang tips: standalone manual</title>
		<link>http://newoldstuff.wordpress.com/2009/05/24/erlang-tips-standalone-manual/</link>
		<comments>http://newoldstuff.wordpress.com/2009/05/24/erlang-tips-standalone-manual/#comments</comments>
		<pubDate>Sun, 24 May 2009 15:22:40 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=136</guid>
		<description><![CDATA[Just run: for instance: etc.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=136&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just run:</p>
<p><pre class="brush: ruby;">
$ erl -man &lt;module&gt;
</pre></p>
<p>for instance:</p>
<p><pre class="brush: ruby;">
$ erl -man erl
$ erl -man rpc
$ erl -man erlang
</pre></p>
<p>etc.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=136&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/05/24/erlang-tips-standalone-manual/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang tips: starting embeded Yaws server</title>
		<link>http://newoldstuff.wordpress.com/2009/05/20/starting-embeded-yaws-server/</link>
		<comments>http://newoldstuff.wordpress.com/2009/05/20/starting-embeded-yaws-server/#comments</comments>
		<pubDate>Wed, 20 May 2009 08:36:05 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=131</guid>
		<description><![CDATA[OS: Ubuntu 9.04 Create some document folder: Add data to an test.html file, in order to be rendered: erlang module for embedded yaws: Start embedded yaws: To check if everything is ok, go to: http://localhost:5559/ (listing of public_html folder will be done if no other resource is specified). If accessing http://localhost:5559/test.html, &#8220;Hello from Yaws!&#8221; message [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=131&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OS: Ubuntu 9.04<br />
<pre class="brush: ruby;">
sudo apt-get install yaws
</pre></p>
<p>Create some document folder:<br />
<pre class="brush: ruby;">
mkdir /home/alin/public_html
</pre></p>
<p>Add data to an test.html file, in order to be rendered:<br />
<pre class="brush: ruby;">
echo '&lt;html&gt;&lt;body&gt;&lt;div&gt;Hello from Yaws!&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;' &gt; /home/alin/public_html/test.html
</pre></p>
<p>erlang module for embedded yaws:</p>
<p><pre class="brush: ruby;">
-module(test_yaws).
-export([start/1, stop/0]).

-define(YAWS_LIB,&quot;/usr/lib/erlang/lib/yaws-1.80/ebin&quot;). 

start(Port) -&gt;
    code:add_path(?YAWS_LIB),
    SL=[{listen,{0,0,0,0}},
        {port,Port},
        {servername,&quot;localhost&quot;},
        {flags,[{dir_listings,true},{access_log,false}]}],
    GL=[{trace,false},{tmpdir,&quot;/tmp&quot;},{flags,[{auth_log,false},{copy_errlog,false}]}],
    yaws:start_embedded(&quot;/home/alin/public_html&quot;, SL, GL).

stop() -&gt;
    code:add_path(?YAWS_LIB),
    yaws:stop().
</pre></p>
<p>Start embedded yaws:<br />
<pre class="brush: ruby;">
$ erl
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.1  (abort with ^G)
1&gt; c(test_yaws).
2&gt; test_yaws:start(5559).
=INFO REPORT==== 24-May-2009::18:28:35 ===
Yaws: Listening to 0.0.0.0:5559 for servers
 - http://localhost:5559 under /home/alin/public_html
ok
3&gt; 
</pre></p>
<p>To check if everything is ok, go to: http://localhost:5559/ (listing of public_html folder will be done if no other resource is specified).<br />
If accessing http://localhost:5559/test.html, &#8220;Hello from Yaws!&#8221; message will be displayed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=131&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/05/20/starting-embeded-yaws-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Haskell call function from main without using the return value</title>
		<link>http://newoldstuff.wordpress.com/2009/05/19/haskell-call-function-from-main-without-using-the-return-value/</link>
		<comments>http://newoldstuff.wordpress.com/2009/05/19/haskell-call-function-from-main-without-using-the-return-value/#comments</comments>
		<pubDate>Tue, 19 May 2009 10:05:05 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=121</guid>
		<description><![CDATA[Few days ago I was stuck at some issue: I wanted to do some profiling of ordinary fibonacci function written in Haskell but I didn&#8217;t wanted to display the result (using main function, from Main module). Guys from #haskell irc channel (irc.freenode.net) were very helpful and they guided me to evaluate and rnf or, using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=121&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Few days ago I was stuck at some issue:<br />
I wanted to do some profiling of ordinary fibonacci function written in Haskell but I didn&#8217;t wanted to display the result (using main function, from Main module). Guys from #haskell irc channel (irc.freenode.net) were very helpful and they guided me to <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#v:evaluate">evaluate</a> and <a href="http://hackage.haskell.org/packages/archive/parallel/1.1.0.1/doc/html/Control-Parallel-Strategies.html#v:rnf">rnf</a></p>
<p><pre class="brush: ruby;">
module Main where

import Control.Parallel.Strategies
import Control.Exception

fib :: Int -&gt; Int
fib 0 = 0
fib 1 = 1
fib n = fib(n - 1) + fib(n - 2)

main = do
   evaluate(rnf (fib 32))
</pre></p>
<p>or, using function composition:</p>
<p><pre class="brush: ruby;">
module Main where

import Control.Parallel.Strategies
import Control.Exception

fib :: Int -&gt; Int
fib 0 = 0
fib 1 = 1
fib n = fib(n - 1) + fib(n - 2)

eval = evaluate . rnf
main = do
   eval(fib 32)
</pre></p>
<p><pre class="brush: ruby;">
ghc --make Fib.hs
time ./Fib
</pre></p>
<p>and for better performance:</p>
<p><pre class="brush: ruby;">
ghc --make -O2 Fib.hs
time ./Fib
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=121&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/05/19/haskell-call-function-from-main-without-using-the-return-value/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Haskell like infinite sequences for clojure</title>
		<link>http://newoldstuff.wordpress.com/2009/04/10/haskell-like-infinite-sequences-for-clojure/</link>
		<comments>http://newoldstuff.wordpress.com/2009/04/10/haskell-like-infinite-sequences-for-clojure/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 14:06:01 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=115</guid>
		<description><![CDATA[Lazy Infinite list of numbers starting with 1: Haskell: Clojure: Lazy list of numbers from 1 to 109: Haskell: Clojure:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=115&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<li>Lazy Infinite list of numbers starting with 1:</li>
<p>Haskell:<br />
<pre class="brush: ruby;">
[1..]
</pre></p>
<p>Clojure:<br />
<pre class="brush: ruby;">
(iterate inc 1)
</pre></p>
<li>Lazy list of numbers from 1 to 109:</li>
<p>Haskell:<br />
<pre class="brush: ruby;">
[1..109]
</pre></p>
<p>Clojure:<br />
<pre class="brush: ruby;">
(range 1 110)
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=115&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/04/10/haskell-like-infinite-sequences-for-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Clojure &#8220;dumb&#8221; simple lazy example</title>
		<link>http://newoldstuff.wordpress.com/2009/02/22/clojure-dumb-simple-lazy-example/</link>
		<comments>http://newoldstuff.wordpress.com/2009/02/22/clojure-dumb-simple-lazy-example/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 20:05:56 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Clojure]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=107</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=107&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: ruby;">
user=&gt; (def x (lazy-seq (cons (do (println &quot;evaluated&quot;) (+ 1 2)) (list 1 2 3))))
#'user/x
user=&gt; (def y (cons (do (println &quot;evaluated&quot;) (+ 1 2)) (list 1 2 3)))
evaluated
#'user/y
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=107&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/02/22/clojure-dumb-simple-lazy-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Clojure immutable collections for Java env</title>
		<link>http://newoldstuff.wordpress.com/2009/02/22/clojure-immutable-collections-for-java-env/</link>
		<comments>http://newoldstuff.wordpress.com/2009/02/22/clojure-immutable-collections-for-java-env/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 11:08:35 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=96</guid>
		<description><![CDATA[(Include clojure.jar in your lib path) This can be used as an alternative for java.util.Collections.unmodifiableList(&#8230;)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=96&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(Include clojure.jar in your lib path)</p>
<p><pre class="brush: java;">
List list = new PersistentList(&quot;t1&quot;);
try {
	list.add(&quot;t2&quot;);
} catch (UnsupportedOperationException e) {
	System.out.println(&quot;It seems that this operation is not supported.&quot;);
}
System.out.println(&quot;List size: &quot; + list.size());

Map map = new PersistentArrayMap(new Object[]{&quot;key1&quot;, &quot;value1&quot;});
try {
	map.put(&quot;key2&quot;, &quot;value2&quot;);
} catch (UnsupportedOperationException e) {
	System.out.println(&quot;It seems that this operation is not supported.&quot;);
}
System.out.println(&quot;Map size: &quot; + map.size());
</pre></p>
<p>This can be used as an alternative for<br />
java.util.Collections.unmodifiableList(&#8230;)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=96&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/02/22/clojure-immutable-collections-for-java-env/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
		<item>
		<title>Lazy clojure</title>
		<link>http://newoldstuff.wordpress.com/2009/02/21/lazy-clojure/</link>
		<comments>http://newoldstuff.wordpress.com/2009/02/21/lazy-clojure/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 21:08:15 +0000</pubDate>
		<dc:creator>alinpopa</dc:creator>
				<category><![CDATA[Clojure]]></category>

		<guid isPermaLink="false">http://newoldstuff.wordpress.com/?p=83</guid>
		<description><![CDATA[Now, to demonstrate lazy vs. non-lazy behavior in clojure: Of course, in real life situations, easier methods can be used, like<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=83&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now, to demonstrate lazy vs. non-lazy behavior in clojure: </p>
<p><pre class="brush: ruby;">
(defn create-lazy [i] 
    (if (zero? i) 
    ()
    (lazy-seq (cons nil (create-lazy (dec i))))))

(defn create-non-lazy [i] 
    (if (zero? i) 
    () 
    (cons nil (create-non-lazy (dec i)))))

(create-lazy 1000000)
(try (create-non-lazy 1000000)
    (catch java.lang.StackOverflowError e
        (println &quot;StackOverflow error&quot;)))
</pre></p>
<p>Of course, in real life situations, easier methods can be used, like<br />
<pre class="brush: ruby;">
user=&gt; (replicate 7 nil)
(nil nil nil nil nil nil nil)
user=&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/newoldstuff.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/newoldstuff.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/newoldstuff.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=newoldstuff.wordpress.com&amp;blog=2984109&amp;post=83&amp;subd=newoldstuff&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://newoldstuff.wordpress.com/2009/02/21/lazy-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/93697354fea1f7bae30d3ab89917c4c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alinpopa</media:title>
		</media:content>
	</item>
	</channel>
</rss>
