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

<channel>
	<title>Deftly.net</title>
	<atom:link href="http://www.deftly.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deftly.net</link>
	<description>I think this stuff is cool!</description>
	<lastBuildDate>Sat, 12 Jun 2010 23:47:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using a picoLCD 256&#215;64 on OpenBSD 4.7</title>
		<link>http://www.deftly.net/2010/06/12/using-a-picolcd-256x64-on-openbsd-4-7/</link>
		<comments>http://www.deftly.net/2010/06/12/using-a-picolcd-256x64-on-openbsd-4-7/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 23:46:26 +0000</pubDate>
		<dc:creator>Qbit</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[OpenBSD]]></category>

		<guid isPermaLink="false">http://www.deftly.net/?p=22</guid>
		<description><![CDATA[The first thing you will notice if you connect your fancy picoLCD 256&#215;64 to your OpenBSD box, is that it shows up as a Human Interface Device. Unfortunately libusb doesn&#8217;t know what to do with devices on bsd systems that are NOT using the ugen driver: 464 if (strncmp(di.udi_devnames[0], "ugen", 4) != 0) 465 /* best [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing you will notice if you connect your fancy picoLCD 256&#215;64 to your OpenBSD box, is that it shows up as a Human Interface Device.</p>
<p>Unfortunately libusb doesn&#8217;t know what to do with devices on bsd systems that are NOT using the <strong>ugen</strong> driver:</p>
<pre>  464     if (strncmp(di.udi_devnames[0], "ugen", 4) != 0)
<a id="l_465"></a>  465       /* best not to play with things we don't understand */
<a id="l_466"></a>  466       continue;</pre>
<p>Fine libusb!  We will have to come up with another way to use this screen!  OR!  We could tell OpenBSD to use ugen when ever it sees the lcd! <img src='http://www.deftly.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>To do that &#8211; you need the the OpenBSD source, knowledge of how to build Open&#8217;s kernel, and my patch!  Getting the source is beyond the scope of this little post.. so you will have to rtfm that action.</p>
<ol>
<li>cd to the usb source directory: <em>cd /usr/src/sys/dev/usb</em></li>
<li>Download the patch ( md5: 85e7498826635c612ede672f5e295e7a ): <a href="http://qbit.devio.us/picoLCD256x64.patch">picoLCD256x64.patch</a></li>
<li>Apply said patch: <em>patch -p1 &lt; picoLCD256x64.patch</em></li>
<li>pkg_add libusb</li>
<li>Compile your kernel, install and reboot!</li>
</ol>
<p>Once you are running your freshly compiled kernel, download the lcd4linux-256&#215;64 source from <a href="http://picolcd.com/drivers/">http://picolcd.com/drivers/</a> .  Apply this patch ( md5: 3852103e3e5a13a3cd6b0c49389688f6 ): <a href="http://qbit.devio.us/lcd4linux-256x64.patch">lcd4linux-256&#215;64.patch</a>, compile ( You will have to play around with the plugins as some of them use linux&#8217;s proc fs and are not compatible with OpenBSD ).</p>
<p>Now check out the sample config files and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deftly.net/2010/06/12/using-a-picolcd-256x64-on-openbsd-4-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concurrent Hello with Erlang</title>
		<link>http://www.deftly.net/2010/03/12/concurrent-hello-with-erlang/</link>
		<comments>http://www.deftly.net/2010/03/12/concurrent-hello-with-erlang/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 23:18:40 +0000</pubDate>
		<dc:creator>Qbit</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://www.deftly.net/?p=14</guid>
		<description><![CDATA[I recently picked up a copy of Joe Armstrong&#8217;s superb Programming Erlang book ( from the folks @ pragprog.com ). While reading the chapter on concurrent programming I was completely stumped by one of the examples. It basically creates a &#8220;server&#8221; and &#8220;client&#8221; and allows for message passing between the two. I found it very [...]]]></description>
			<content:encoded><![CDATA[<p>I recently picked up a copy of Joe Armstrong&#8217;s superb Programming Erlang book ( from the folks @ pragprog.com ).  While reading the chapter on concurrent programming I was completely stumped by one of the examples.  It basically creates a &#8220;server&#8221; and &#8220;client&#8221; and allows for message passing between the two.  I found it very difficult to follow the passing of messages from a to b, and back.</p>
<p>Enter chello.erl!  I created a slightly modified version of Joe&#8217;s example that uses some io:format to tell you what&#8217;s going on.  Hope someone finds this useful.</p>
<hr />
<pre>-module (chello).
-export ([loop/0, rpc/2]).

rpc(Pid, Request) -&gt;
    io:format("rpc[~p]  sending ~p to ~p~n", [self(), Request, Pid]),
    Pid ! {self(), Request},
    receive
            Response -&gt;
                io:format("rpc[~p]  responding with : ~p~n", [self(), Response]),
                {Pid,Response}
    end.

loop() -&gt;
    receive
        {From, {hello}} -&gt;
            io:format("loop[~p] received info from: ~p~n", [self(), From]),
            From ! {self(), "Hello"},
            loop();
        {From, {goodbye}} -&gt;
            io:format("loop[~p] received info from: ~p~n", [self(), From]),
            From ! {self(),"Goodbye"},
            loop();
        {From, Other} -&gt;
            io:format("loop[~p] received info from: ~p~n", [self, From]),
            From ! {self(),{error, Other}},
            loop()
    end.</pre>
<hr />Run with:</p>
<p>1&gt; Pid = spawn(fun chello:loop/0).</p>
<p>&lt;0.38.0&gt;</p>
<p>2&gt; chello:rpc(Pid, {hello}).<br />
rpc[&lt;0.31.0&gt;]  sending {hello} to &lt;0.38.0&gt;</p>
<p>loop[&lt;0.38.0&gt;] received info from: &lt;0.31.0&gt;</p>
<p>rpc[&lt;0.31.0&gt;]  responding with : {&lt;0.38.0&gt;,&#8221;Hello&#8221;}</p>
<p>{&lt;0.38.0&gt;,{&lt;0.38.0&gt;,&#8221;Hello&#8221;}}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deftly.net/2010/03/12/concurrent-hello-with-erlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using VIM to make erlang pretty</title>
		<link>http://www.deftly.net/2010/03/12/using-vim-to-make-erlang-pretty/</link>
		<comments>http://www.deftly.net/2010/03/12/using-vim-to-make-erlang-pretty/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 16:18:52 +0000</pubDate>
		<dc:creator>Qbit</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.deftly.net/?p=6</guid>
		<description><![CDATA[I recently read an article ( Which no longer exists ) talking about purtifying erlang. This inspired me to create a quick function in vim to do this for me! Here it is: function! ErlPretty() silent !erl -noshell -eval 'erl_tidy:file("%",[verbose]).' -s erlang halt endfunction nmap ep :execute ErlPretty() Hopefully someone finds it handy!]]></description>
			<content:encoded><![CDATA[<p>I recently read an <a href="http://blog.tornkvist.org/blog.yaws/?id=1233867602690448" target="_blank">article</a> ( Which no longer exists <img src='http://www.deftly.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  ) talking about purtifying erlang. This inspired me to create a quick function in vim to do this for me!<br />
Here it is:</p>
<pre>function! ErlPretty()
    silent !erl -noshell -eval 'erl_tidy:file("%",[verbose]).' -s erlang halt
endfunction
nmap ep :execute ErlPretty()</pre>
<p>Hopefully someone finds it handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deftly.net/2010/03/12/using-vim-to-make-erlang-pretty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
