<?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>leoboiko’s computing log</title>
	<atom:link href="http://namakajiri.net/complog/feed/" rel="self" type="application/rss+xml" />
	<link>http://namakajiri.net/complog</link>
	<description>experiences with computers.  updated infrequently.</description>
	<pubDate>Mon, 25 Aug 2008 16:54:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Geotag your photos easily from the shell</title>
		<link>http://namakajiri.net/complog/geotag-your-photos/</link>
		<comments>http://namakajiri.net/complog/geotag-your-photos/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 21:42:17 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/geotag-your-photos-easily-from-the-shell/</guid>
		<description><![CDATA[http://namakajiri.net/code/geotag-exif

This is a simple wrapper over exiftool (debian/ubuntu: in package libimage-exiftool-perl) to make it easy to set EXIF geographic information (GPS tags).  It is able to understand the decimal format for latitude/longitude that you can get from google maps, wikimapia etc.

With exiftool:

  exiftool \
      -GPSLatitudeRef=South \
   [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://namakajiri.net/code/geotag-exif">http://namakajiri.net/code/geotag-exif</a></p>

<p>This is a simple wrapper over exiftool (debian/ubuntu: in package <samp>libimage-exiftool-perl</samp>) to make it easy to set EXIF geographic information (GPS tags).  It is able to understand the decimal format for latitude/longitude that you can get from <a href="http://maps.google.com">google maps</a>, <a href="http://wikimapia.org">wikimapia</a> etc.</p>

<p>With <kbd>exiftool</kbd>:</p>

<pre><kbd>  exiftool \
      -GPSLatitudeRef=South \
      -GPSLatitude=23.88 \
      -GPSLongitudeRef=West \
      -GPSLongitude=49.81 \
      pic.jpeg</kbd></pre>

<p>With <kbd>geotag-exif</kbd>:</p>

<pre><kbd>  geotag-exif pic.jpeg -23.88 -49.81</kbd></pre>

<p>It won’t touch your EXIF tags other than the GPS tags and the <samp>FileLastModified</samp> timestamp.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/geotag-your-photos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My entry for the Rubygame Weekend Contest #2: a roguelike in Scheme</title>
		<link>http://namakajiri.net/complog/rubygame-weekend-contest-2/</link>
		<comments>http://namakajiri.net/complog/rubygame-weekend-contest-2/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 18:31:52 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/my-entry-for-the-rubygame-weekend-contest-2-a-roguelike-in-scheme/</guid>
		<description><![CDATA[Joining the contest was a lot of fun, and I highly recommend these weekend events to anyone who wants to learn how to write games.  With the trick of a short time span to motivate yourself and lots of experienced guys on IRC focused in much the same tasks as you, this was more [...]]]></description>
			<content:encoded><![CDATA[<p>Joining <a href="http://www.rubygameforums.com/viewtopic.php?f=10&amp;t=51&amp;sid=d3252e4c1d993848312b8883536c6d91">the contest</a> was a lot of fun, and I highly recommend these weekend events to anyone who wants to learn how to write games.  With the trick of a short time span to motivate yourself and lots of experienced guys on IRC focused in much the same tasks as you, this was more educative than months of reading tutorials.</p>

<p>The theme was “opposites”, and I’m interested in simulations, so my game idea was of an alien world with two complementary species.  When pranjos die they create plants that are the source of food for bluos, and vice-versa.  But these animals are not very adept at surviving, and their populations are threatened: oranjos are lazy and don’t explore much, so they starve to death without finding food; and bluos are timid and breed too seldom.  As a space biologist, it’s your task to throw oranjos and bluos around to increase their numbers.</p>

<p>At least that was the idea.</p>

<p>[feed readers: continue to postmortem and screenshots…]
<span id="more-35"></span></p>

<h4>Structured procrastination rules</h4>

<p>For some reason, working in this game made me <em>very</em> motivated to act on another idea I had for ages: a <a href="http://en.wikipedia.org/wiki/Console_application">console</a> <a href="http://en.wikipedia.org/wiki/Roguelike">roguelike</a> using Japanese kanji and other Unicode characters.  I made a few attempts at writing games in the past, but all came to naught.  It’s hard to admit, but looking back, I think I simply lacked the experience and knowledge to finish one.  I had no idea of how to write the essential basics, like how to model game objects and the world and where exactly to put their attributes and methods (should an object’s position be stored in the object itself, or in the world object? Who handles collision detection? Sight? Viewport scrolling reactions to object-induced events?).  My math and geometry skills are rusty, and you need them like ALL THE TIME — even in 2D or console games — for such basic tasks as collision detection, proximity, line of sight, and so on.  Trying to write games without paying enough attention to these topics confused me, and I’d interpret that feeling as “laziness” and stop coding.</p>

<p>So getting Maggaworld to do something was amazing, even if the “something” I did is only a bunch of oranjos walking over a single screen, getting older, breeding, and starving to death (which would be much more interesting had I draw more than three frames of animation).  I didn’t make no plants, no bluos, no player, no real world with scrolling and uneven terrain.  I actually only worked in Friday night and through the Saturday afternoon; then I got an irresistible urge to hack Makai・Jukai (the roguelike) — which I did in perfect flow until some ~800 lines of scheme mid-Monday, when I grudgingly teared myself away from home to, you know, work.</p>

<p><img src="/pics/screenshots/maggaworld.png" width="640" height="480" title="a world without food sucks…" alt="screenshot of early maggaworld" style="border: thin dashed black;" /></p>

<h4>Maggaworld postmortem and links</h4>

<p>The most costly decision was to use <a href="http://www.slembcke.net/photos/v/programming/chipmunk">Chipmunk</a>, that amazing 2D physics simulation library which IMHO indie developers don’t pay enough attention to.  The demos are so cool, and I though I’d avoid calculating collision detection and gravity, but boy what a price to pay.  80% of the time I spent with Maggaworld wasn’t on the game itself, it was getting my head around the most basic principles of Chipmunk — it’s way too powerful for what I had in mind.  In fact, I often had to learn concepts only to disable them, like setting the angular momentum of bodies to infinity to prevent rotation.  In my first few attempts, I made the Shape definitions all wrong and the oranjos would just fall through the floor =D I ended up coding a <a href="http://namakajiri.net/code/falling_squares.rb">falling squares demo</a> to teach myself, and only then managed to get Maggaworld working.  I documented the demo and hope it’ll be useful for other Gosu + Chipmunk users.  If you’re also new to game coding and want to use Chipmunk in a weekend contest, I suggest writing some demos yourself <em>before</em> the start!</p>

<p><img src="/pics/screenshots/falling-squares.png" width="640" height="480" title="greenness represent elasticity! bounce, falling squares!" alt="screenshot of falling squares ruby+chipmunk demo" style="border: thin dashed black;" /></p>

<p>If Chipmunk’s complex (by necessity), Gosu is a pleasure.  It’s a very ruby-like, convenient high-level library that <em>makes sense</em>; it’s how I wished SDL was when I first tried it.  A shame neither Gosu nor Chipmunk are packaged in Debian yet (or in rubygems, for that matter).</p>

<p>Writing games is a lot of work! I seriously overestimated how much I could chew; the art alone took several hours (yes, those three 32&#215;32 childlike sprites took all that time!).  I stated that my goal with the contest was not winning but finishing <em>something</em>; at the end of the weekend I failed, but in another sense it was a big personal success — my ideas for how to code Makai・Jukai are coming to reality nicely, and I haven’t given up Maggaworld either (though I’ll probably add the missing elements at a leisure pace).  I even forced myself to come out of the closet this time: there’s a <a href="http://rubyforge.org/projects/maggaworld">rubyforge page for Maggaworld</a> now, and a git repository for Makai・Jukai is available in my site at <code>http://namakajiri.net/code/git/makai</code>.  I welcome input from anyone interested, and thanks all the people who kept up with my questions in freenode =D I’m totally joining the next contest!</p>

<p><img src="/pics/screenshots/makai.png" width="640" height="480" title="I’m coding scheme♪" alt="screenshot of early makaijukai" style="border: thin dashed black;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/rubygame-weekend-contest-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python irclib’s privmsg isn’t actually privmsg</title>
		<link>http://namakajiri.net/complog/python-irclibs-privmsg-isnt-actually-privmsg/</link>
		<comments>http://namakajiri.net/complog/python-irclibs-privmsg-isnt-actually-privmsg/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 18:21:49 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/python-irclib%e2%80%99s-privmsg-isn%e2%80%99t-actually-privmsg/</guid>
		<description><![CDATA[I guess irclib is kinda green, but anyway.  I was writing a bot and was very confused with its AddPrivMsgRoute and AddPubMsgRoute methods.  I’m noob to IRC, so I had to browse the RFC to be sure: in IRC, “privmsg” is the command to send messages to users and channels.  And in [...]]]></description>
			<content:encoded><![CDATA[<p>I guess <a href="http://python-irclib.sourceforge.net/">irclib</a> is kinda green, but anyway.  I was writing a bot and was very confused with its <code>AddPrivMsgRoute</code> and <code>AddPubMsgRoute</code> methods.  I’m noob to IRC, so I had to browse the RFC to be sure: in IRC, “privmsg” is the command to send messages to users <em>and</em> channels.  And in IRC, there’s no “pubmsg”.  In irclib, a “privmsg” is a message destined to you (the bot user), and a “pubmsg” is a message destined to the channel in which you’re on. So, irc.privmsg = { irclib.privmsg, irclib.pubmsg }.  The distinction irclib wants to make is useful, but the choice of terminology confused the hell out of me :D</p>

<p>While I’m at it: to respect the RFC, make sure your bots send messages with <code>client.connection.notice</code> and not <code>client.connection.privmsg</code> like many do.  <code>/notice</code> is the same as <code>/privmsg</code> (aka <code>/msg</code> in most clients), only  automated citizens ignore it.  That prevents infinite loops, like the one I often trap myself with when talking to bitlbee’s root user:</p>

<pre><code>   &lt;leoboiko&gt; root: yes
   &lt;root&gt; Did I ask you something?
   &lt;leoboiko&gt; root: yes
   &lt;root&gt; Did I ask you something?
   &lt;leoboiko&gt; root: yes
   &lt;root&gt; Did I ask you something?
   &lt;leoboiko&gt; root: yes
   &lt;root&gt; Did I ask you something?
   &lt;leoboiko&gt; root: yes
   &lt;root&gt; Did I ask you something?
   […]
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/python-irclibs-privmsg-isnt-actually-privmsg/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open source code in Google</title>
		<link>http://namakajiri.net/complog/open-source-code-in-google/</link>
		<comments>http://namakajiri.net/complog/open-source-code-in-google/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 23:56:11 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/open-source-code-in-google/</guid>
		<description><![CDATA[The notice I received today is just too awesome to not blog.  A couple years ago I worked for a certain multinational company who paid lip service to free software; but when I said I wanted to release my library, they kept telling me to wait longer and longer, only to say “no” at [...]]]></description>
			<content:encoded><![CDATA[<p>The notice I received today is just too awesome to not blog.  A couple years ago I worked for a certain multinational company who paid lip service to free software; but when I said I wanted to release my library, they kept telling me to wait longer and longer, only to say “no” at the end (some ten months later…).  Compared to that, I just couldn’t avoid smiling when I read this:</p>

<blockquote>
  <p>Date: Fri, 4 Jul 2008 12:48:26 -0400<br />
  From: &#8220;Daniel Berlin&#8221; <br />
  Subject: Open sourcing code owned by Google<br /></p>
  
  <p>This is just a friendly reminder that we have a process in place for releasing Google owned code as open source. This process is detailed at http://[blah].</p>
  
  <p>I&#8217;ve seen people (presumably from higher overhead companies) who seem to think they need more permission than our process says they do.  You don&#8217;t.</p>
  
  <p>The process is very simple (i.e. usually involves sending a few emails), and the time between being us being emailed and you being able to release the code averages &lt; 24 hours (worst case is about a week if you are doing something insane).</p>
  
  <p>Attempts to make this process more complex will be met with violent resistance.<br />
  Attempts to make this process easier will be welcomed with milk and cookies.</p>
  
  <p>Thanks for your cooperation,<br />
  Dan</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/open-source-code-in-google/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to learn computing^W^W^W Ten books I like</title>
		<link>http://namakajiri.net/complog/ten-books-i-like/</link>
		<comments>http://namakajiri.net/complog/ten-books-i-like/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:07:15 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/how-to-learn-computingwww-ten-books-i-like/</guid>
		<description><![CDATA[Meme du jour: ten books about computing.  I think the meme’s name is misleading.  To “learn computing” one has to keep in mind that:


It takes ten years.  For real.
Books are necessary but not sufficient.  You have to program, to read good programs, and to read bad programs.
Computing ≠ computers ≠ programming. [...]]]></description>
			<content:encoded><![CDATA[<p>Meme du jour: <a href="http://www.ricbit.com/2008/06/como-aprender-computao.html" hreflang="pt-br">ten books about computing</a>.  I think the meme’s name is misleading.  To “learn computing” one has to keep in mind that:</p>

<ul>
<li><a href="http://norvig.com/21-days.html">It takes ten years</a>.  For real.</li>
<li>Books are necessary but not sufficient.  You have to program, to read good programs, and to read bad programs.</li>
<li>Computing ≠ computers ≠ programming. </li>
</ul>

<p>But, FWIW, my ten books:</p>

<ul>
<li><a href="http://books.google.com/books?id=aFcsnUEewLkC&amp;dq=godel+escher+bach&amp;ei=6m1gSMGPIYHAigHU0fmXDA">GEB</a>, for the same reason ricbit suggested: if you don’t like reading it, you won’t like computing (good one ricbit!)</li>
<li><a href="http://openbookproject.net/thinkCSpy/index.xhtml" hreflang="en">How to think like a computer scientist: Learning with Python</a>.  If needed, google for python tutorials to help.</li>
<li><a href="http://www.brpreiss.com/books/opus7/">Data Structures and Algorithms in Python</a> or any other algorithms book.  Being python, this one has the advantage of succinctness.</li>
<li><a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">Structure and Interpretation of Computer Programs</a> as the first computing book for adults.  Ask help ;)  Related reading: <a href="http://www.ccs.neu.edu/home/matthias/BTLS/">The little schemer</a> &amp; <a href="http://www.ccs.neu.edu/home/matthias/BTSS">The reasoned schemer</a>.</li>
<li><a href="http://www.amazon.com/Concrete-Mathematics-Foundation-Computer-Science/dp/0201558025">Concrete mathematics</a>: now we’re talking seriously.  If I have to choose one math book for computer scientists, this gotta be the one.</li>
<li><a href="http://www.amazon.com/Computer-Architecture-Quantitative-Approach-Kaufmann/dp/1558605967">Computer architecture: a quantitative approach</a>.  It’s good to know a bit about computers.</li>
<li><a href="http://cm.bell-labs.com/cm/cs/cbook/">The C Programming Language</a>, by the authors of C.  This wonderfully-written little book is the antidote to Java and C++ behemots.  Read with the architecture book to learn to deal with memory.</li>
<li><a href="http://aima.cs.berkeley.edu/">Artificial Intelligence: A Modern Approach</a>: Best intro to AI evar.  AI techniques will do wonders to enlarge your horizons as a computing guy, and then you can enlarge them even more with…</li>
<li><a href="http://www.amazon.com/Probability-Computing-Randomized-Algorithms-Probabilistic/dp/0521835402/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1214394135&amp;sr=1-1">Probability and Computing: Randomized Algorithms and Probabilistic Analysis</a>.  Who said the best algorithms are deterministic?</li>
<li>And <a href="http://www.amazon.com/Practice-Programming-Addison-Wesley-Professional-Computing/dp/020161586X/ref=pd_sim_b_2">The practice of programming</a>, to polish your <a href="http://paulgraham.com/taste.html">taste</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/ten-books-i-like/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sometimes I do it too</title>
		<link>http://namakajiri.net/complog/sometimes-i-do-it-too/</link>
		<comments>http://namakajiri.net/complog/sometimes-i-do-it-too/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 19:19:43 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/sometimes-i-do-it-too/</guid>
		<description><![CDATA[
  &#60;jtg&#62; Stupid python doesn&#8217;t have &#8220;resume&#8221; or whatever it&#8217;s called in ruby during a try&#8230;except clause.
  &#60;shc_&#62; sigh
  &#60;leoboiko-onduty&#62; implement it with continuations
  &#60;leoboiko-onduty&#62; OH WAIT IT DOESN&#8217;T HAVE THEM EITHER
  &#60;leoboiko-onduty&#62; &#60;/troll&#62;

]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p>&lt;jtg&gt; Stupid python doesn&#8217;t have &#8220;resume&#8221; or whatever it&#8217;s called in ruby during a try&#8230;except clause.<br />
  &lt;shc_&gt; sigh<br />
  &lt;leoboiko-onduty&gt; implement it with continuations<br />
  &lt;leoboiko-onduty&gt; OH WAIT IT DOESN&#8217;T HAVE THEM EITHER<br />
  &lt;leoboiko-onduty&gt; &lt;/troll&gt;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/sometimes-i-do-it-too/feed/</wfw:commentRss>
		</item>
		<item>
		<title>watch-encomenda.sh: hack feio pra automatizar tracking de encomendas dos correios</title>
		<link>http://namakajiri.net/complog/watch-encomenda-sh/</link>
		<comments>http://namakajiri.net/complog/watch-encomenda-sh/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 21:15:55 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/watch-encomendash-hack-feio-pra-automatizar-tracking-the-encomendas-dos-correios/</guid>
		<description><![CDATA[
Irritado que o tracking dos correios não tem feed?
Amargo porque acha que nunca vão fazer um?
Cansado de apertar Ctrl+R no Firefox e dizer que sim, você quer reenviar os dados POST?
Seus pobremas acabaram!!
watch-encomenda.sh
]]></description>
			<content:encoded><![CDATA[<div lang="pt-br" xml:lang="pt-br">
<p>Irritado que o tracking dos correios não tem feed?</p>
<p>Amargo porque acha que nunca vão fazer um?</p>
<p>Cansado de apertar Ctrl+R no Firefox e dizer que sim, você quer reenviar os dados POST?</p>
<p>Seus pobremas acabaram!!</p>
<p><a href="/code/watch-encomenda.sh">watch-encomenda.sh</a></p>
<p><img src="/pics/nonfree/new.png" width="186" height=115" alt="now slower and with more bugs!" title=""/><strong>New:</strong> suporte experimental a encomendas internacionals! (thx ademar)
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/watch-encomenda-sh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Of interest to UI designers:</title>
		<link>http://namakajiri.net/complog/of-interest-to-ui-designers/</link>
		<comments>http://namakajiri.net/complog/of-interest-to-ui-designers/#comments</comments>
		<pubDate>Tue, 20 May 2008 02:17:45 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/of-interest-to-ui-designers/</guid>
		<description><![CDATA[
  Why do variable resistors come with nonlinear tapers? Well, as it turns out,
  human physiology has a weird way of perceiving changes in signal intensity, such as
  sound and light intensities. For example, you may think that if you doubled the
  intensity of sound or light, you would perceive a [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p>Why do variable resistors come with nonlinear tapers? Well, as it turns out,
  human physiology has a weird way of perceiving changes in signal intensity, such as
  sound and light intensities. For example, you may think that if you doubled the
  intensity of sound or light, you would perceive a doubling in sound and light. Unfortunately—at least in terms of intuition (not in terms of safety control for our brains)—humans do not work this way. In fact, our perceptions of sight and sound work as
  follows: Perceived loudness/brightness is proportional to log<sub>10</sub> (actual intensity measured with a nonhuman instrument). Thus, if you are building an amplifier for a set
  of speakers or building a home light-dimming circuit, it would be wise to use a variable resistor with a nonlinear taper.</p>
</blockquote>

<p>(From: <em>Practical Electronics for Inventors</em>, Paul Schers)</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/of-interest-to-ui-designers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In the Land of vexcorp.com Where the Shadows Lie</title>
		<link>http://namakajiri.net/complog/in-the-land-of-vexcorpcom-where-the-shadows-lie/</link>
		<comments>http://namakajiri.net/complog/in-the-land-of-vexcorpcom-where-the-shadows-lie/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 13:52:27 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

		<guid isPermaLink="false">http://namakajiri.net/complog/in-the-land-of-vexcorpcom-where-the-shadows-lie/</guid>
		<description><![CDATA[ping secure.vexcorp.com
    PING smeagol.vexcorp.com (200.160.255.84) 56(84) bytes of data.


Wait.

&#62; PING smeagol.vexcorp.com (200.160.255.84)
&#62; smeagol.vexcorp.com
&#62; smeagol


Oooh!

for i in aragorn gandalf frodo sam sauron melkor morgoth eru saruman balrog nazgul gollum; do
  host $i.vexcorp.com
  done&#124;grep -v 'not found'
    gandalf.vexcorp.com has address 200.187.151.90
    sauron.vexcorp.com has address 200.160.255.100
  [...]]]></description>
			<content:encoded><![CDATA[<pre><code>ping secure.vexcorp.com
    PING smeagol.vexcorp.com (200.160.255.84) 56(84) bytes of data.
</code></pre>

<p>Wait.</p>

<pre><code>&gt; PING smeagol.vexcorp.com (200.160.255.84)
&gt; smeagol.vexcorp.com
&gt; smeagol
</code></pre>

<p>Oooh!</p>

<pre><code>for i in aragorn gandalf frodo sam sauron melkor morgoth eru saruman balrog nazgul gollum; do
  host $i.vexcorp.com
  done|grep -v 'not found'
    gandalf.vexcorp.com has address 200.187.151.90
    sauron.vexcorp.com has address 200.160.255.100
    morgoth.vexcorp.com has address 200.160.255.101
    balrog.vexcorp.com has address 200.160.255.86
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/in-the-land-of-vexcorpcom-where-the-shadows-lie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What’s the difference between /var/log/messages and /var/log/syslog?</title>
		<link>http://namakajiri.net/complog/the-difference-between-messages-and-syslog/</link>
		<comments>http://namakajiri.net/complog/the-difference-between-messages-and-syslog/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 17:41:32 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

		<guid isPermaLink="false">http://namakajiri.net/complog/the-difference-between-messages-and-syslog/</guid>
		<description><![CDATA[This is very embarrassing, but to this day I’ve never payed attention to the semantics of these two files.  When I wanted to look at something, I’d just grep /var/log/*.

Turns out the log files are just a convention spelled out in /etc/syslog.conf (read syslog(3) and syslog.conf(5) if you don’t know syslog).  These are [...]]]></description>
			<content:encoded><![CDATA[<p>This is very embarrassing, but to this day I’ve never payed attention to the semantics of these two files.  When I wanted to look at something, I’d just grep <code>/var/log/*</code>.</p>

<p>Turns out the log files are just a convention spelled out in <code>/etc/syslog.conf</code> (read <code>syslog(3)</code> and <code>syslog.conf(5)</code> if you don’t know syslog).  These are the relevant lines in Debian defaults:</p>

<pre><code>*.*;auth,authpriv.none      -/var/log/syslog

*.=info;*.=notice;*.=warn;\
    auth,authpriv.none;\
    cron,daemon.none;\
    mail,news.none      -/var/log/messages
</code></pre>

<p>The first line means: send all classes of messages (“facilities”) to <code>/var/log/syslog</code>, <em>except</em> the auth and authpriv facilities — these are sent to <code>/var/log/auth.log</code> instead (“auth” is just the deprecated name of “authpriv”).</p>

<p>The second line means: send all messages exactly at the levels of “info”, “notice”, and “warn” to <code>/var/log/messages</code>, <em>except</em> those from the listed facilities.</p>

<p>So <code>/var/log/messages</code> ⊂ <code>/var/log/syslog</code>; and, further, <code>messages</code> only contains generic non-critical messages.  I have no idea why people use that, but there you go.  If you want a complete log, you should look at <code>/var/log/syslog</code> and <code>/var/log/auth.log</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/the-difference-between-messages-and-syslog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I want a blog</title>
		<link>http://namakajiri.net/complog/i-want-a-blog/</link>
		<comments>http://namakajiri.net/complog/i-want-a-blog/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 22:42:45 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://namakajiri.net/complog/i-want-a-blog/</guid>
		<description><![CDATA[When I first designed this blog’s Wordpress theme, Lispy, I was very happy with how the end result turned out.

Now I hate it.

I want a blog with:


No administrative debris 
No sidebars
No categories
No tags
No “blogrolls”
No Ajax or useless Javascripts
No RSS feeds
No authentication mechanisms other than HTTP’s


I want a blog that is:


Fully RESTful, cacheable, cache-aware
Fully W3C-compliant
Able to [...]]]></description>
			<content:encoded><![CDATA[<p>When I first designed this blog’s Wordpress theme, Lispy, I was very happy with how the end result turned out.</p>

<p>Now I hate it.</p>

<p>I want a blog with:</p>

<ul>
<li>No <a href="http://tomayko.com/writings/administrative-debris">administrative debris</a> </li>
<li>No sidebars</li>
<li>No categories</li>
<li>No tags</li>
<li>No “blogrolls”</li>
<li>No Ajax or useless Javascripts</li>
<li>No RSS feeds</li>
<li>No authentication mechanisms other than HTTP’s</li>
</ul>

<p>I want a blog that is:</p>

<ul>
<li>Fully RESTful, cacheable, cache-aware</li>
<li>Fully W3C-compliant</li>
<li>Able to do content negotiation for language and media-type</li>
<li>Knowledgeable about APP, and of course with Atom feeds for everything</li>
<li>Implemented in a proper language.  That is, no PHP, no Java, no JSP, no ASP.</li>
</ul>

<p>What, there’s none with all those unfeatures? Damn. Why can’t the world just write software like <strong>I</strong> want? Oh well, out to be unsatisfied until Tomayko release his Rack + Sinatra thing.  Or until I build one myself…</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/i-want-a-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IM activity patterns</title>
		<link>http://namakajiri.net/complog/im-activity-patterns/</link>
		<comments>http://namakajiri.net/complog/im-activity-patterns/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 18:18:51 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

		<guid isPermaLink="false">http://namakajiri.net/complog/im-activity-patterns/</guid>
		<description><![CDATA[One thing I noticed in my first international trip is that people who hang in Google Talk, ICQ, MSN, or IRQ have activity patterns based on the time of the day, just like animals.  Some are diurnal, or officecular; some are nocturnal, or even caffeiners (extreme nocturnals); some are crepuscular, that is, before-and-after-officecular; dialupers [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I noticed in my first international trip is that people who hang in Google Talk, ICQ, MSN, or IRQ have activity patterns based on the time of the day, just like animals.  Some are diurnal, or officecular; some are nocturnal, or even caffeiners (extreme nocturnals); some are crepuscular, that is, before-and-after-officecular; dialupers only appear after midnight, and schoolers after lunch, etc.  Thus, if you undergo a timezone shift (real or figurative), your IM contact list landscape will surprise you as much as when you hike at night for the first time.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/im-activity-patterns/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Are you sure you want to spend time with this?</title>
		<link>http://namakajiri.net/complog/are-you-sure-you-want-to-spend-time-with-this/</link>
		<comments>http://namakajiri.net/complog/are-you-sure-you-want-to-spend-time-with-this/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 19:11:07 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

		<category><![CDATA[time management]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/are-you-sure-you-want-to-spend-time-with-this/</guid>
		<description><![CDATA[Timesinkers sorted by how much time they cost me:

WoW >&#160;reddit and the like >&#160;feeds >&#160;books >&#160;IM, IRC discussions >&#160;Guitar Hero

Timesinkers ordered by how satisfied I feel after spending time with them:

books >&#160;IM, IRC discussions >&#160;Guitar Hero >&#160;feeds >&#160;reddit and the like >&#160;WoW

It’s almost inversely proportional!  I don’t think that’s a coincidence.  You have [...]]]></description>
			<content:encoded><![CDATA[<p>Timesinkers sorted by how much time they cost me:</p>

<p>WoW >&nbsp;reddit and the like >&nbsp;feeds >&nbsp;books >&nbsp;IM, IRC discussions >&nbsp;Guitar Hero</p>

<p>Timesinkers ordered by how satisfied I feel after spending time with them:</p>

<p>books >&nbsp;IM, IRC discussions >&nbsp;Guitar Hero >&nbsp;feeds >&nbsp;reddit and the like >&nbsp;WoW</p>

<p>It’s almost inversely proportional!  I don’t think that’s a coincidence.  You have to spend a lot of time with World of Warcraft or news sites <em>because</em> they’re so unsatisfying, and keep you hooked for the next low-probability random reinforcement.  Feeds are more focused to your interests, so you don’t need to waddle that much in a sea of stuff you don’t care about.  Conversations with your friends are always interesting, and of course so are your books.</p>

<p>This gives a good guideline for optimizing your timewasting: if it doesn’t make you feel happy, it’ll probably take too much time, too.  I stopped playing WoW altogether when I noticed that an hour of Guitar Hero was more fun than a whole month of grinding; and then, suddenly, there was life after work again.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/are-you-sure-you-want-to-spend-time-with-this/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why I’m not switching to OSX</title>
		<link>http://namakajiri.net/complog/why-i%e2%80%99m-not-switching-to-osx/</link>
		<comments>http://namakajiri.net/complog/why-i%e2%80%99m-not-switching-to-osx/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 14:33:25 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

		<category><![CDATA[æsthetics]]></category>

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

		<category><![CDATA[free software]]></category>

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

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

		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://namakajiri.net/complog/why-i%e2%80%99m-not-switching-to-osx/</guid>
		<description><![CDATA[(Or: why I didn’t apply to work for Apple instead).

I care about good design and æsthetics more than most people.  I’ve toyed with an OS 8 system before and, though I wasn’t part of its intended audience, I couldn’t help falling in love with the attention the guys put on it — especially after [...]]]></description>
			<content:encoded><![CDATA[<p>(Or: why I didn’t apply to work for Apple instead).</p>

<p>I care about good design and æsthetics more than most people.  I’ve toyed with an OS 8 system before and, though I wasn’t part of its intended audience, I couldn’t help falling in love with the attention the guys put on it — especially after years of exposure to crappy interfaces in the free software world.  Thus, when my company asked me to choose between a Thinkpad and a Macbook, I thought it would be a good time to taste OS X myself.</p>

<p>By the way, no, design and æsthetics aren’t the same thing.  Design is about working well, and æsthetics is about being pleasurable to the senses.  Good design is mostly (but not always) universal, and good æsthetics is generally (but not entirely) subjective.  Still, they’re <a href="http://www.amazon.com/Emotional-Design-Love-Everyday-Things/dp/0465051367/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1204725194&amp;sr=8-1">closely related characteristics</a>.</p>

<p>You have to understand that, given its reputation, I had high expectations for OS X.  Most of my free software friends talk about it like it’s a temptation too strong to resist.  As it turns out, they weren’t saying this for love of design; they were just running away from the trouble of having to fiddle with configuration files.  It’s true that it’s a big bother, and that OS X is much better in that aspect, but this advantage has little to do with product quality; it’s a natural consequence of Apple’s controlled hardware model.  I like being free to work in real work, but I don’t like it so much that I’m willing to abandon a free market approach to hardware, so this argument isn’t enough for me to switch.  Let’s talk about what matters instead.</p>

<p>Hardware– and sofware-wise, <strong>the design is simply perfect</strong>.  Most important in design is being simple and paying attention to detail, and Apple excels in both.  I love the way the sleep led is subdued, so it doesn’t reflect from the wall into your face if you turn your notebook away when you’re in bed; the way the power cable has a (pretty) light indicator in the connector itself, lighting green if the battery’s full and orange if it’s charging; the way the size of the keyboard and trackpad and space for your hands are all carefully thought out and well-laid so that you don’t feel like typing in a sardine can, etc.  As for the GUI, if Windows is KDE done wrong, OS X is Gnome done right (so it’s two orders of magnitude better than Windows).  I’ve nothing to complain.</p>

<p>My first problem with OS X is æsthetic.</p>

<p>It might help to insist that I <em>care</em> about æsthetics.  I asked for a Macbook instead of a Macbook Pro because I don’t like silvery things; this is how much I care. I hate most modern technology, and my reasons are mainly æsthetic (though the rampant bad design also helps).  I’m burning money improving the appearance of my apartment before buying stuff I need like a TV, a car, or furniture.  If I don’t like the æsthetic vision of a system I won’t use it, period.  And <strong>I hate hate hate OS X’s appearance</strong>.  It’s representative of everything I hate in modern visual trends: it’s glossy, shiny, round, plastic, 3d, horribly “lickable”.   I like simple plain 2d colors with square corners.  My monitor is a bidimensional surface AND I LIKE IT THAT WAY.</p>

<p>This wouldn’t be so bad, really, if not for a second issue I’ve underestimated: <strong>OS X is WAY too proprietary</strong>.  I was quite amazed to learn that <em>there’s no way to change OS X’s appearance</em>, except using a <a href="http://unsanity.com/haxies/shapeshifter">third-party add-on</a>.  Which costs money.  Worse yet, it’s proprietary, so you can’t fix e.g. the fact that it doesn’t work in Leopard.  I searched for some Japanese dictionaries, and — guess what? — all I could find were proprietary and paid, despite using free edict data underneath. I’ve been using GNU/Linux since 2001, and being back to the proprietary world was not a pleasing experience; suddenly I’d be in the hands of companies again, unable to work on my system myself.</p>

<p>I don’t mind paying money for good software, really.  But when a company’s core system is sold in a proprietary model, their users can’t improve it.  And, because of that, users fall into a “consumer” role instead of being creators, and depend passively on other companies to do everything, and thus the whole software landscape has incentive to be proprietary.  I’ll just run Debian in my Macbook, thank you very much.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/why-i%e2%80%99m-not-switching-to-osx/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Death by tune2fs</title>
		<link>http://namakajiri.net/complog/death-by-tune2fs/</link>
		<comments>http://namakajiri.net/complog/death-by-tune2fs/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 13:43:53 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://namakajiri.net/complog/death-by-tune2fs/</guid>
		<description><![CDATA[Suppose you want to shrink your root filesystem a bit, to make up some space for World of Warcraft in that old Windows partition.  You fire up a rescue disk, and parted complains about “unsupported feature”.  It doesn’t say which feature though, so you google around and try to tune2fs -O ^dir_index the [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you want to shrink your root filesystem a bit, to make up some space for World of Warcraft in that old Windows partition.  You fire up a rescue disk, and parted complains about “unsupported feature”.  It doesn’t say <em>which</em> feature though, so you google around and try to <code>tune2fs -O ^dir_index</code> the partition.  parted is still not satisfied, so you say what the hell, I’ll just turn off everything, resize, and then turn’em on back again.  Can’t do no harm, right?</p>

<p>Then you clear <code>sparse_super</code> and tune2fs warns you to run e2fsck.  At this point, since you’re eager to see what your Female Human Mage alter ego will loook like,  you might think you can save some time by turning off <code>filetype</code> too, and then fscking just once.  Don’t do that.  I mean, don’t be stupid.  What kind of <em>moron</em> would ignore that warning when dealing with his primary, most important filesystem with all your cherised data in it?</p>

<p>/me lost everything</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/death-by-tune2fs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Trouble using utf-8 with ncurses?</title>
		<link>http://namakajiri.net/complog/trouble-using-utf-8-with-ncurses/</link>
		<comments>http://namakajiri.net/complog/trouble-using-utf-8-with-ncurses/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 01:49:56 +0000</pubDate>
		<dc:creator>leoboiko</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

		<category><![CDATA[full-width]]></category>

		<category><![CDATA[gauche scheme]]></category>

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

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

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

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

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

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

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

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

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

		<category><![CDATA[utf-8]]></category>

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

		<guid isPermaLink="false">http://namakajiri.net/complog/trouble-using-utf-8-with-ncurses/</guid>
		<description><![CDATA[Disclaimer: these are experimental results and I’m not too sure about what’s going on.

First of all, link to -lncursesw instead of -lncurses (from packages libncursesw5{,-dev} on Debian/Ubuntu).

I assume your source files are in utf-8.  This will not work:



  #include &#60;curses.h&#62;
  int main(void)I
  {
         [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer</strong>: these are experimental results and I’m not too sure about what’s going on.</p>

<p>First of all, link to <code>-lncursesw</code> instead of <code>-lncurses</code> (from packages <code>libncursesw5{,-dev}</code> on Debian/Ubuntu).</p>

<p>I assume your source files are in utf-8.  This will not work:</p>

<p><span id="more-20"></span></p>

<pre><code>  #include &lt;curses.h&gt;
  int main(void)I
  {
          initscr();
          mvaddstr(0, 0, "こんにちは世界！");
          refresh();
          endwin();
  }
</code></pre>

<p>Neither will this:</p>

<pre><code>+ #include &lt;ncursesw/curses.h&gt;
  int main(void)
  {
          initscr();
+         mvaddwstr(0, 0, "こんにちは世界！");
          refresh();
          endwin();
  }
</code></pre>

<p>This does work, as long as it is run under an utf-8 terminal:</p>

<pre><code>  #include &lt;ncursesw/ncurses.h&gt;
+ #include &lt;locale.h&gt;

  int main(void)
  {
+         setlocale(LC_CTYPE, "en_US.UTF-8");
          initscr();
+         mvaddstr(0, 0, "こんにちは世界！"); /* NOT mvaddwstr() */
          refresh();
          endwin();
  }
</code></pre>

<p>This too works in utf-8 terminals, as long as the user did set his <code>LC_ALL</code> (or <code>LC_CTYPE</code>) to an <code>*._UTF-8</code> locale:</p>

<pre><code>#include &lt;ncursesw/ncurses.h&gt;
#include &lt;locale.h&gt;

int main(void)
{
+       setlocale(LC_CTYPE, "");
        initscr();
        mvaddstr(0, 0, "こんにちは世界！");
        refresh();
        endwin();
}
</code></pre>

<p>I think the last example might also work for other encodings, as long as 1) the user has set his environment to the same encoding as the terminal, 2) all characters you use are available in the legacy encoding, and 3) <del>you manually detect non–utf-8 environments and convert the strings through <code>iconv(3)</code></del><ins>you convert your utf-8 strings to wchar_t with <code>mbstowcs(3)</code> and use <code>mvadd<strong>w</strong>str()</code>, etc.</ins>.  I’m not interested enough in legacy encodings to try.</p>

<p>The <code>setlocale(3)</code> call must be <em>before</em> <code>initscr()</code>.  I managed to reproduce the same results in gauche scheme (using the amazing <a href="http://homepage.mac.com/naoki.koguro/prog/c-wrapper/index.html">c-wrapper</a>), but I had no luck with ruby-ncurses, even after installing the locale extension and calling <code>Locale::setlocale</code>.</p>

<p>Finally, be careful about Unicode characters which take two columns of text, such as the “<a href="http://en.wikipedia.org/wiki/Fullwidth_forms">full-width</a>” Han symbols and Japanese kana above.  This is a visual property; it has nothing to to with the number of bytes the character has in a given representation — confusingly, pre-Unicode people used the term “wide char” to mean characters <em>represented</em> by more than one byte in some binary encoding.  libncursesw can handle these “wide” characters just fine, but if you write a full-width glyph to line/column (0, 0), it actually occupies (0, 0) and (0, 1).  If you then output anything else to (0, 1), garbling may ensue.  This example screenshot may help to clarify:</p>

<p><img src="/pics/fullwidth-ncurses.png" width="200" height="200" alt="screenshot of ncurses application, comparing width of Japanese text to ASCII characters" title="actually made with ncurses on scheme!" /></p>

<p>Notice how the full-width string beginning at column 0 aligns with even columns? If you want to replace one of the Japanese characters with half-width glyphs (that is, mostly everything else), it’s safest to write two characters over it, beginning at its starting column; complete with a space if you only want to write one.</p>
]]></content:encoded>
			<wfw:commentRss>http://namakajiri.net/complog/trouble-using-utf-8-with-ncurses/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
