<?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>With sufficient thrust, pigs fly just fine. &#187; Creations</title>
	<atom:link href="http://slinky.imukuppi.org/category/creations/feed/" rel="self" type="application/rss+xml" />
	<link>http://slinky.imukuppi.org</link>
	<description>Personal weblog of Jani Nurminen. Contains ideas, links, my creations, about me, and so on.</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:01:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Toshiba L650D-15G Tip of the Day</title>
		<link>http://slinky.imukuppi.org/2011/10/09/toshiba-l650d-15g-tip-of-the-day/</link>
		<comments>http://slinky.imukuppi.org/2011/10/09/toshiba-l650d-15g-tip-of-the-day/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 13:17:50 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Babbling]]></category>
		<category><![CDATA[Creations]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[2.6.38]]></category>
		<category><![CDATA[ACPI]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[boot messages stop but system is running]]></category>
		<category><![CDATA[disabling ASPM]]></category>
		<category><![CDATA[fglrx]]></category>
		<category><![CDATA[host bridge window]]></category>
		<category><![CDATA[L650D]]></category>
		<category><![CDATA[no video]]></category>
		<category><![CDATA[pci_root]]></category>
		<category><![CDATA[radeon]]></category>
		<category><![CDATA[spurious response]]></category>
		<category><![CDATA[toshiba]]></category>
		<category><![CDATA[toshiba L650D]]></category>
		<category><![CDATA[toshiba L650D-15G]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=1145</guid>
		<description><![CDATA[Problem You&#8217;ve upgraded to Ubuntu 11.04, it comes with a kernel newer than 2.6.32; and now booting doesn&#8217;t work. Grub runs OK, initrd starts up, kernel boots all right, but early at boot you get a blank screen &#8211; or if you enable text boot, the last thing you see is somewhere around the &#8220;pci_root [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You&#8217;ve upgraded to Ubuntu 11.04, it comes with a kernel newer than 2.6.32; and now booting doesn&#8217;t work. Grub runs OK, initrd starts up, kernel boots all right, but early at boot you get a blank screen &#8211; or if you enable text boot, the last thing you see is somewhere around the &#8220;pci_root PNP0A08:00: host bridge window&#8221; lines.</p>
<p>If you examine the kern.log, there&#8217;s nothing too obvious, except perhaps this:</p>
<blockquote><p>
pci0000:00: Requesting ACPI _OSC control (0x1d)<br />
Unable to assume _OSC PCIe control. Disabling ASPM
</p></blockquote>
<p>Perhaps you&#8217;ll also see a &#8220;hda_intel: spurious response 0&#215;0:0&#215;0, last cmd=0x0f0000&#8243; repeated hundreds of times. This causes also a quite audible pop from the DAC when the system gets here &#8211; you&#8217;ll hear a big &#8220;snap!&#8221; from the speakers.</p>
<p><strong>Solution</strong></p>
<p>Use the &#8220;pcie_aspm=off&#8221; <a href="http://kernel.org/doc/Documentation/kernel-parameters.txt">kernel parameter</a> when booting.</p>
<p>This turns off PCIe <a href="http://en.wikipedia.org/wiki/Active_State_Power_Management">ASPM</a> support.</p>
<p>Become root, edit /etc/default/grub. Append the parameter to GRUB_CMDLINE_LINUX_DEFAULT. Then run update-grub2. </p>
<p>After this, ASPM will be always off, but boot is OK, suspend works, audio works, overall the system works just fine like in 2.6.32 kernels. The downsides? Haven&#8217;t seen any so far, then again, the laptop is &#8220;always&#8221; AC powered. <a href="http://www.lesswatts.org/index.php">Powertop</a> reports about 260 wakeups-from-idle per second as I&#8217;m writing this, I&#8217;ve not tweaked it. The estimate with battery power hovers around 3h which is well in spec for this laptop.</p>
<p>CPU speed settings are OnDemand for all cores.</p>
<p>PS. The ATI Catalyst driver (fglrx) was used, but I don&#8217;t think it makes a difference. I had some problem with Compiz with Radeon (too old Mesa libs probably) so I went for fglrx instead.</p>
<p>PS2. Another route might be to upgrade the BIOS. However, Toshiba (or Insyde or both) currently provides a Windows-only upgrade .exe which can&#8217;t run in DOS mode, so no FreeDOS USB/.iso boot tricks work. The .exe won&#8217;t really run under Wine, and even if it did, upgrading the BIOS under Wine is somewhat too extreme sports (for me anyway).</p>
<p>A message to Toshiba: please always, always, always provide a BIOS update which can run under DOS, or better yet, Linux. I don&#8217;t give a shit if &#8220;Toshiba does not support Linux&#8221;, you don&#8217;t need to support Linux, you just need to stop actively preventing people from supporting Linux themselves. Oh, and thanks for the great laptop, I love it.</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/10/09/toshiba-l650d-15g-tip-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Principles of Ubiquitous Computing</title>
		<link>http://slinky.imukuppi.org/2011/08/27/principles-of-ubiquitous-computing/</link>
		<comments>http://slinky.imukuppi.org/2011/08/27/principles-of-ubiquitous-computing/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 20:24:17 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Babbling]]></category>
		<category><![CDATA[Creations]]></category>
		<category><![CDATA[Ubicomp]]></category>
		<category><![CDATA[2006]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[big brother society]]></category>
		<category><![CDATA[calm technology]]></category>
		<category><![CDATA[cyanogenmod]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mark weiser]]></category>
		<category><![CDATA[smart phone]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[spam society]]></category>
		<category><![CDATA[ssotc]]></category>
		<category><![CDATA[summer school of telecommunications]]></category>
		<category><![CDATA[the coming age of calm technology]]></category>
		<category><![CDATA[ubiquitous computing]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=1137</guid>
		<description><![CDATA[Here&#8217;s a presentation I made at the 15th Summer School of Telecommunications in 2006. The subject is &#8220;Principles of Ubiquitous Computing&#8221;. SSOTC06 Principles of Ubiquitous Computing In retrospect, there are some notes to be made. Back then when I was reading the available literature and research, there was a kind of concensus that the peer-to-peer [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a presentation I made at the 15th Summer School of Telecommunications in 2006. The subject is &#8220;Principles of Ubiquitous Computing&#8221;.</p>
<p><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/08/ssotc06_principles_of_ubicomp.pdf">SSOTC06 Principles of Ubiquitous Computing</a></p>
<p>In retrospect, there are some notes to be made. Back then when I was reading the available literature and research, there was a kind of concensus that the peer-to-peer model of communication &#8211; device-to-device communication without intermediaries &#8211; would play a big role, as this would let the device deployments scale without requiring new or existing static network infrastructure. However, the bulk of the ubiquitous computing devices of today (sensors, smart phones, electrical consumption readers, etc.) rely on static communications infrastructure to function.</p>
<p>Also, the &#8220;Spam/Big Brother Society&#8221; is as relevant a danger as then. As I see it, the danger has merely evolved and is even more extensive today.</p>
<p>Today, more and more information about private individuals are collected with the justification of &#8220;with the information, we can show you more relevant advertisements&#8221;. The infrastructure of knowing who you are, what you think and who you know is in place to learn what stuff or services we might be currently missing.</p>
<p>At the moment the Spam Society is very benign. However, once this infrastructure and data is in place, it can be hard to remove it or to escape its reach, or to prevent it from transforming into a Big Brother Society. Even if one were to vanish as the target of the data collection today, the previously obtained information would still contain a lot of data that could be misused.</p>
<p>For example, what can happen if a political party with a violent agenda takes power, one way or another? If your profile indicates you have been thinking wrong thoughts, instead of getting advertisements, you would get night-time visitors taking you for a long car ride that culminates in a neck-shot in the woods. Interestingly enough, there is prior art in this kind of horror scenario: <a href="http://www.ibmandtheholocaust.com/">the Nazi government used census data which they data mined with IBM&#8217;s help</a> to weed out people with Jewish ancestry.</p>
<p>As for the current state of ubiquitous computing devices, the smart phone stands as a lone king. It helps people organize their lives, entertains them, helps them keep connected with others, helps them document their lives with photographs and videos, and so on.</p>
<p>Although not quite as invisible as Weiser envisioned it, for those who have one, the smart phone is always present, ready to serve &#8211; and with modern UIs, it tries to not get in the way too much. I&#8217;d say at the moment the smart phone is closest to Weiser&#8217;s vision of calm technology. Also, over time, the smart phone has gotten only better and I expect this trend to continue.</p>
<p>Generally, a big downside I see with all current smart phones is the level of trust that needs to be placed on the maintainers and owners of the smartphone ecosystem to not abuse the data they collect (the location data, contact data, calendar data, etc.).</p>
<p>For example, Google backs up your WLAN passwords if you enable the Backup My Data option. It&#8217;s convenient in case you lose your phone, but do you know who in the end has access to the data and what they do with it? If you disable the option, the data is said to be removed. Fine; now, how will you know this to be true? You can&#8217;t know this, there is no way to check, so you just have to have trust. There are technical ways to remove the reliance on trust (e.g. encrypt the backup locally with a user-given key and then upload it), but at the moment such techniques are not used.</p>
<p>That said, I am a happy user of an Android smart phone. Android is open enough and the phone hardware it runs on is documented enough to let a community of enthusiasts make their own aftermarket firmware. Therefore, if I ever become unhappy with the stock Android, I can always install <a href="http://www.cyanogenmod.com/">Cyanogenmod</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/08/27/principles-of-ubiquitous-computing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zenburn v2.21</title>
		<link>http://slinky.imukuppi.org/2011/04/26/zenburn-v2-21/</link>
		<comments>http://slinky.imukuppi.org/2011/04/26/zenburn-v2-21/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 12:34:05 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[Zenburn]]></category>
		<category><![CDATA[eye-friendly]]></category>
		<category><![CDATA[FoldColumn]]></category>
		<category><![CDATA[Folded]]></category>
		<category><![CDATA[make coding not suck]]></category>
		<category><![CDATA[TabLine]]></category>
		<category><![CDATA[vim color scheme]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=1087</guid>
		<description><![CDATA[New version, v2.21, contains color fixes for the Folded, FoldColumn and TabLine colors. The colors are also aligned in both UI and 256-color versions. Many thanks to Paweł Piekarski &#8211; lay off the coffee man ;) Note: Originally I intended to fix the &#8220;TODO&#8221; around this area in version v2.19 fast, and submit a new [...]]]></description>
			<content:encoded><![CDATA[<p>New version, v2.21, contains color fixes for the Folded, FoldColumn and TabLine colors. The colors are also aligned in both UI and 256-color versions. Many thanks to Paweł Piekarski &#8211; lay off the coffee man ;)</p>
<p>Note: Originally I intended to fix the &#8220;TODO&#8221; around this area in version v2.19 fast, and submit a new version the next day. But what can one do, things don&#8217;t always work as planned&#8230; I had no time to do that. The Folded, FoldColumn and TabLine in v2.19 were quite messed up. Now they work OK!</p>
<p>Here&#8217;s a console Zenburn with :set fdc=4 and :set tabline.</p>
<p><center><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/zenburn_fdc_tabline_256color.png"><img src="https://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/zenburn_fdc_tabline_256color-150x150.png" alt="Zenburn with fdc and TabLine in 256-color mode." title="Zenburn with fdc and TabLine in 256-color mode." width="150" height="150" class="aligncenter size-thumbnail wp-image-1088" /></a></center></p>
<p>Grab the fresh copy from <a href="http://vim.sourceforge.net/scripts/script.php?script_id=415">vim.sf.net</a> or from the <a href="http://slinky.imukuppi.org/zenburnpage/">official Zenburn page</a>.</p>
<p>Stay in the zone!</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/04/26/zenburn-v2-21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zenburn v2.19</title>
		<link>http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/</link>
		<comments>http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 10:54:20 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[Zenburn]]></category>
		<category><![CDATA[alien fruit salad]]></category>
		<category><![CDATA[colour scheme]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[high contrast]]></category>
		<category><![CDATA[linenr]]></category>
		<category><![CDATA[low contrast]]></category>
		<category><![CDATA[stay in the zone]]></category>
		<category><![CDATA[stop eyes from hurting when coding]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[visual mode]]></category>
		<category><![CDATA[zone]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=1051</guid>
		<description><![CDATA[v2.19 has been stewing like a ragù, and now it&#8217;s done. Changes LineNr bugfix, fix for directory styles; thank you to Clayton Parker. Christophe-Marie Duquesne suggested support for ctags_highlighting by Al Budden. Thanks! I like the idea of more fine-grained syntax groups. Experimental support is now in and will be enabled if you have the [...]]]></description>
			<content:encoded><![CDATA[<p>v2.19 has been stewing like a <a href="http://en.wikipedia.org/wiki/Rag%C3%B9">ragù</a>, and now it&#8217;s done.</p>
<p><strong>Changes</strong></p>
<ul>
<li>LineNr bugfix, fix for directory styles; thank you to <a href="http://www.sixfeetup.com/">Clayton Parker</a>.</li>
<li>Christophe-Marie Duquesne suggested support for <a href="http://sites.google.com/site/abudden/contents/Vim-Scripts/ctags-highlighting">ctags_highlighting by Al Budden</a>. Thanks! I like the idea of more fine-grained syntax groups. Experimental support is now in and will be enabled if you have the plugin. If you want to disable it manually, let g:zenburn_disable_ctags_highlighting_support = 1. Help is needed with this one.</li>
<li>New darker Visual is now the default. It doesn&#8217;t stick out now and fits the overall colourscheme better even with LineNr. Using the old-style Visual is still possible: let g:zenburn_old_Visual = 1.</li>
</ul>
<p><strong>Screen shots</strong></p>

<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/console_hc_visual/' title='256-color console high-contrast Visual'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/console_hc_visual-150x150.png" class="attachment-thumbnail" alt="256-color console high-contrast Visual" title="256-color console high-contrast Visual" /></a>
<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/console_lc_directory_linenr/' title='256-color console low-contrast directory explorer and LineNr'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/console_lc_directory_linenr-150x150.png" class="attachment-thumbnail" alt="256-color console low-contrast directory explorer and LineNr" title="256-color console low-contrast directory explorer and LineNr" /></a>
<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/console_lc_visual_linenr/' title='256-color console low-contrast Visual and LineNr'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/console_lc_visual_linenr-150x150.png" class="attachment-thumbnail" alt="256-color console low-contrast Visual and LineNr" title="256-color console low-contrast Visual and LineNr" /></a>
<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/gvim_hc_visual/' title='Gvim high-contrast Visual'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/gvim_hc_visual-150x150.png" class="attachment-thumbnail" alt="Gvim high-contrast Visual" title="Gvim high-contrast Visual" /></a>
<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/gvim_hc_visual_linenr/' title='Gvim high-contrast Visual and LineNr'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/gvim_hc_visual_linenr-150x150.png" class="attachment-thumbnail" alt="Gvim high-contrast Visual and LineNr" title="Gvim high-contrast Visual and LineNr" /></a>
<a href='http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/gvim_lc_visual_linenr/' title='Gvim low-contrast Visual and LineNr'><img width="150" height="150" src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2011/04/gvim_lc_visual_linenr-150x150.png" class="attachment-thumbnail" alt="Gvim low-contrast Visual and LineNr" title="Gvim low-contrast Visual and LineNr" /></a>

<p>Looks repetitive? Console and Gvim do look quite much the same, but then again, that&#8217;s the point :)</p>
<p><strong>Download it!</strong></p>
<p>You can download Zenburn v2.19 from <a href="http://vim.sourceforge.net/scripts/script.php?script_id=415">Vim.sf.net</a> or from <a href="http://slinky.imukuppi.org/zenburnpage/">the Zenburn page</a>.</p>
<p>As usual, please see the Zenburn.vim for more details, and happy zenburning!</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/04/17/zenburn-v2-19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Low Pitched Voice Call Audio in Skype</title>
		<link>http://slinky.imukuppi.org/2011/01/16/fixing-low-pitched-voice-call-audio-in-skype/</link>
		<comments>http://slinky.imukuppi.org/2011/01/16/fixing-low-pitched-voice-call-audio-in-skype/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 15:46:52 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Babbling]]></category>
		<category><![CDATA[Creations]]></category>
		<category><![CDATA[ALC883]]></category>
		<category><![CDATA[ALSA]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[darth vader]]></category>
		<category><![CDATA[echo123]]></category>
		<category><![CDATA[HD Audio]]></category>
		<category><![CDATA[low pitch]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[Skype audio problem]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=1000</guid>
		<description><![CDATA[I don&#8217;t really use Skype at home that often. Today I did, and I ran into a problem which I remembered having a long time ago: the voice call audio from me to others sounds lower in pitch, like Darth Vader, or one of those &#8220;voice altered to protect the identity&#8221; things on TV. This [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t really use Skype at home that often. Today I did, and I ran into a problem which I remembered having a long time ago: the voice call audio from me to others sounds lower in pitch, like Darth Vader, or one of those &#8220;voice altered to protect the identity&#8221; things on TV.</p>
<p>This time, I was arsed enough to fix the Skype issue.</p>
<p>The cause is quite simple: Skype&#8217;s SILK voice codec wants to record audio in 24 kHz. However, my HD Audio using Realtek ALC883 chip does not support that sampling rate. Instead, it defaults to 44.1 kHz. The result sounds interesting, but useless for talking over Skype.</p>
<p>So how to fix this? Theory of operation: whatever sampling rate Skype asks you for, just say yes, record in whatever the hardware supports, then rate convert to the sampling rate asked by Skype. This will solve the problem.</p>
<p>To do this in practise, using ALSA, is as follows. First, quit Skype. Don&#8217;t just log out, quit the whole thing.</p>
<p>Then, let&#8217;s add a software SRC into the proper point in the voice audio uplink path (nerdy!) by adding the following to your ~/.asoundrc:</p>
<pre>
pcm.skype {
    type plug
    slave {
        # normal ALC883
        pcm "hw:0,0"                                                                         

        # skype wants 24 kHz recording input,
        # but ALC883 doesn't support that.
        # do a rate conversion on the fly.
        rate 48000
    }
}
</pre>
<p>Note: change the pcm &#8220;hw:0,0&#8243; line to whatever is your device &#8211; this one uses the default.</p>
<p>To test your new .asoundrc, you can use the command <code>arecord -f S16_LE -c 2 -r 24000 -D skype -d 20 test.wav</code></p>
<p>If the recording gave no errors, play it back with <code>aplay test.wav</code>. If it sounds OK, you&#8217;re good to go.</p>
<p>Next, start Skype. Then go to Options, and set the recording audio device to be &#8220;(plug) skype&#8221;.</p>
<p>It worked for me, testing using Skype&#8217;s echo123 service yields crystal clear audio!</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/01/16/fixing-low-pitched-voice-call-audio-in-skype/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Statemachine for Python</title>
		<link>http://slinky.imukuppi.org/2011/01/08/simple-statemachine-for-python/</link>
		<comments>http://slinky.imukuppi.org/2011/01/08/simple-statemachine-for-python/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 12:54:14 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=988</guid>
		<description><![CDATA[My secret evil scientist projects needed a simple and straightforward way to implement (Mealy) FSAs in Python. I didn&#8217;t find an appropriate one, so I made one from scratch which turned out to be a fun learning experience. You can download it here: statemachine.zip It&#8217;s quite simple to use, please see the runner.py and runner2.py [...]]]></description>
			<content:encoded><![CDATA[<p>My secret evil scientist projects needed a simple and straightforward way to implement (<a href="http://en.wikipedia.org/wiki/Mealy_machine">Mealy</a>) <a href="http://en.wikipedia.org/wiki/Finite-state_machine">FSAs</a> in Python. I didn&#8217;t find an appropriate one, so I made one from scratch which turned out to be a fun learning experience.</p>
<p>You can download it here: <a href="http://slinky.imukuppi.org/statemachine.zip">statemachine.zip</a></p>
<p>It&#8217;s quite simple to use, please see the runner.py and runner2.py scripts for a demonstration.</p>
<p>The major &#8220;selling point&#8221; here is that it&#8217;s light-weight, and each state defines the transitions; there is no global transition-table. I find it simpler to implement state machines in such OO way. When the FSA is sketched (on paper! Yep I&#8217;m old skool), I find it easier to map the transitions correctly by just focusing on one state at a time, seeing what conditions transition to it, what outputs/actions does it make (I don&#8217;t really use <a href="http://en.wikipedia.org/wiki/Moore_machine">Moore</a>) and where does it transition to, and so on.</p>
<p>If you need a <strike>quick-and-dirty</strike> agile and simple solution, do have a look.</p>
<p>There are downsides: each State-derived state-specialization has to be unique (currently it&#8217;s not possible to &#8220;share&#8221; a state class instance by variating an instance to become a different state based on parameters given during construction time, this is due to the way the FSA builds a list of the states; it&#8217;s easy to change though), and you have to pass data either in some data container class, or use global variables.</p>
<p><strong>How to use it</strong></p>
<p>Please see runner.py and runner2.py.</p>
<p>In a nutshell: Inherit your specialized states from State. Implement enter, work or exit methods, you need at least the work-method. State transition is done in the work-method: <code>return states[SomeClass]</code> to transition to SomeClass, or <code>return STATE_MACHINE_EXIT</code> when the FSA is done.</p>
<p>The initialization is done by giving the FSA class a list of your state instances in the constructor. The initializing state must be the first one in the list. Then you can refer to these state instances inside the states with <code>states[SomeStateClassOfYours]</code>.</p>
<p>Run the FSA by calling <code>work()</code> on it. It returns a generator, so that you can run the FSA in steps, if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2011/01/08/simple-statemachine-for-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pseudorandom Blast from the Past</title>
		<link>http://slinky.imukuppi.org/2010/11/14/pseudorandom-blast-from-the-past/</link>
		<comments>http://slinky.imukuppi.org/2010/11/14/pseudorandom-blast-from-the-past/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 21:35:43 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[blast from the past]]></category>
		<category><![CDATA[co-prime]]></category>
		<category><![CDATA[Galois configuration]]></category>
		<category><![CDATA[LCG]]></category>
		<category><![CDATA[LFSR]]></category>
		<category><![CDATA[m-sequence]]></category>
		<category><![CDATA[Mersenne exponent]]></category>
		<category><![CDATA[PRNG]]></category>
		<category><![CDATA[pseudorandom numbers]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=942</guid>
		<description><![CDATA[A friend was messing around with pseudo-random number generators, so I dug this thing up from the historical archives for him. It&#8217;s a PRNG implementation done while I was a university student. The main idea is simple: run multiple Galois-configuration m-sequence LFSRs in parallel, combining their outputs with XOR, thus making an LFSR with a [...]]]></description>
			<content:encoded><![CDATA[<p>A friend was messing around with pseudo-random number generators, so I dug this thing up from the historical archives for him.</p>
<p>It&#8217;s a PRNG implementation done while I was a university student.</p>
<p>The main idea is simple: run multiple Galois-configuration <a href="http://en.wikipedia.org/wiki/Maximum_length_sequence">m-sequence</a> LFSRs in parallel, combining their outputs with XOR, thus making an LFSR with a longer sequence than would be possible by running an <a href="http://en.wikipedia.org/wiki/Linear_congruential_generator">LCG</a> in the given machine architecture. This is possible because the m-sequences are all <a href="http://en.wikipedia.org/wiki/Co-prime">co-prime</a> (the length in bits of each individual component LFSR is a <a href="http://en.wikipedia.org/wiki/Mersenne_prime">Mersenne exponent</a>).<br />
<span id="more-942"></span></p>
<p>There are several defects: it&#8217;s not cryptographically secure, nor does it pass <a href="http://en.wikipedia.org/wiki/Diehard_tests">Marsaglia&#8217;s Diehard test battery</a> nor the more modern <a href="http://www.phy.duke.edu/~rgb/General/dieharder.php">Dieharder</a>. The LSB is always even. However, it still might be &#8220;good enough&#8221; for some kind of embedded use, or to be used as a starting point for something better.</p>
<p>The example implementation has a period of about 2^93, using eight 32-bit values as the internal state and eight bit-masks. The implementation is also quite simple.</p>
<p>Grab it here: <a href="http://slinky.imukuppi.org/lfsr-prng.tar.gz">lfsr-prng.tar.gz</a>.</p>
<p>The implementation consists of two parts; prng.c contains the actual PRNG, and prngdriver.c exercises the PRNG to output values in some format. As an example it now outputs things in Dieharder-format.</p>
<p>The description from prng.c using my own words (I removed my old mail address):</p>
<blockquote><p>
/* Simple PRNG using a linear feedback shift register (LFSR)<br />
 * in Galois configuration.<br />
 *<br />
 * A primitive polynomial modulo 2 is used for LFSR taps.<br />
 * Thus each LFSR outputs an m-sequence. The length (in bits)<br />
 * of each LFSR is a Mersenne exponent. Thus the length of<br />
 * the m-sequence is a prime number (2^m-1).<br />
 *<br />
 * Since the individual periods are relatively prime, the output<br />
 * period length of LFSR generator combination is the product<br />
 * of individual LFSR period lengths:<br />
 *<br />
 * (2^2-1) * (2^3-1) * (2^5-1) * (2^7-1) * (2^13-1) * (2^17-1)<br />
 *  * (2^19-1) * (2^31-1) = about 2^96.34<br />
 *<br />
 * This PRNG was intended for use with machines without /dev/random<br />
 * (eg. old DOS boxes found from parent&#8217;s place etc.)<br />
 *<br />
 * NOTE: This generator is not good for cryptographical applications!<br />
 */
</p></blockquote>
<p>Have fun with it!</p>
<p>Edit: added the More-tag, post was a bit too long.</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2010/11/14/pseudorandom-blast-from-the-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zenburn v2.16</title>
		<link>http://slinky.imukuppi.org/2010/10/24/zenburn-v2-16/</link>
		<comments>http://slinky.imukuppi.org/2010/10/24/zenburn-v2-16/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 18:22:36 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[Zenburn]]></category>
		<category><![CDATA[alien fruit salad]]></category>
		<category><![CDATA[coding colors]]></category>
		<category><![CDATA[CursorColumn]]></category>
		<category><![CDATA[CursorLine]]></category>
		<category><![CDATA[easy for the eyes]]></category>
		<category><![CDATA[editor colours]]></category>
		<category><![CDATA[xterm-256color vim]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=911</guid>
		<description><![CDATA[Yet a new Zenburn version! What&#8217;s new this time in v2.16: The licensing is clarified: latest GPL applies. Thanks to Martin Langasek. Support for autocompletion of configuration parameters, thanks to Marcin Szamotulski. CursorColumn and CursorLine colour improvements. A new configuration parameter has been added for this, please see the Zenburn.vim file. Thanks to Andrew Wagner. [...]]]></description>
			<content:encoded><![CDATA[<p>Yet a new Zenburn version! What&#8217;s new this time in v2.16:</p>
<ul>
<li>The licensing is clarified: latest GPL applies. Thanks to Martin Langasek.</li>
<li>Support for autocompletion of configuration parameters, thanks to Marcin Szamotulski.</li>
<li>CursorColumn and CursorLine colour improvements. A new configuration parameter has been added for this, please see the Zenburn.vim file. Thanks to Andrew Wagner.</li>
</ul>
<p><span id="more-911"></span><br />
<strong>Licensing Questions</strong></p>
<p>As for the licensing, Martin had some additional questions. My answer in a nutshell to him was: if you modify Zenburn.vim for use with Vim, the new scheme has to be under GPL, just like Zenburn is. If you port Zenburn to some totally different editor, environment, or such, or use a subset of the &#8220;Zenburn colours&#8221;, it would be nice if you could GPL-license it to ensure that changes and improvements will come back to everyone &#8211; however, in such a case it is really up to you as the author to choose the license.</p>
<p>The reasoning is two-fold:</p>
<ol>
<li>I consider the Zenburn colour scheme to be analogous to an algorithm implemented in a certain programming language; if you derive a Foobar.vim from the actual implementation (=Zenburn.vim) you should follow whatever license the original was put under. But you can of course re-implement the algorithm in a different &#8220;programming language&#8221;.</li>
<li>It is not practical to try to impose strict licensing over a set of colours (especially since that the colour space is finite and actually quite small, even though we&#8217;re talking about a 24-bit RGB space).</li>
</ol>
<p>Nevertheless, for derived works, I do ask for attribution: something like &#8220;Based on the Zenburn colour scheme by Jani Nurminen. http://slinky.imukuppi.org/zenburnpage&#8221; is sufficient and will make me very happy. This is my personal take on the issue.</p>
<p><strong>CursorColumn and CursorLine Changes</strong></p>
<p>As for the CursorColumn and CursorLine, currently the CursorColumn colour is brighter than CursorLine. I personally find this visually somewhat better, but I understand that in some cases it can be nicer to have CursorColumn the same colour as CursorLine. This &#8220;unification&#8221; is now achieved by a new configuration parameter g:zenburn_unified_CursorColumn. By setting this to 1, CursorColumn follows the colouring of CursorLine. Note: to see this, you must do &#8220;:set cursorline cursorcolumn&#8221;. (To turn them off, use &#8220;:set nocursorline nocursorcolumn&#8221;). Thanks to Andrew.</p>
<p><strong>Configuration Parameter Autocompletion</strong></p>
<p>Also, now the configuration parameters can be autocompleted. Just type &#8220;:let g:zenburn_&#8221; and hit TAB or CTRL-d to see the alternatives. Note, after setting a parameter you need to reload the colour file with &#8220;:colors zenburn&#8221;. For details, please open zenburn.vim itself and read the comments at the beginning of the file. Props to Marcin.</p>
<p><strong>Screenshots</strong></p>
<p>People have mailed me and wished to see more screenshots, so here are (finally) some! These screenshots also demonstrate nicely that the 256-colour terminal version is quite close to the GVim colouring, although not 100% exact. Note: all pictures have &#8220;:set cursorline cursorcolumn&#8221; enabled.</p>
<p>GVim and xterm-256color modes with the new &#8220;unified CursorColumn&#8221; setting: </p>
<p><center><div id="attachment_923" class="wp-caption aligncenter" style="width: 160px"><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/gvim_cursorline_cursorcolumn_highcontrast_unified.png"><img src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/gvim_cursorline_cursorcolumn_highcontrast_unified-150x150.png" alt="GVim high contrast, unified CursorColumn" title="GVim high contrast, unified CursorColumn" width="150" height="150" class="size-thumbnail wp-image-923" /></a><p class="wp-caption-text">GVim high contrast, unified CursorColumn</p></div></center></p>
<p><center><div id="attachment_925" class="wp-caption aligncenter" style="width: 160px"><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/xterm256_cursorline_cursorcolumn_highcontrast_unified.png"><img src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/xterm256_cursorline_cursorcolumn_highcontrast_unified-150x150.png" alt="xterm256 high contrast, unified CursorColumn" title="xterm256 high contrast, unified CursorColumn" width="150" height="150" class="size-thumbnail wp-image-925" /></a><p class="wp-caption-text">xterm256 high contrast, unified CursorColumn</p></div></center></p>
<p>And then a few other combinations:</p>
<p><center><div id="attachment_916" class="wp-caption aligncenter" style="width: 160px"><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/xterm256_cursorline_cursorcolumn_default.png"><img src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/xterm256_cursorline_cursorcolumn_default-150x150.png" alt="xterm256 default contrast, default CursorColumn" title="xterm256 default contrast, default CursorColumn" width="150" height="150" class="size-thumbnail wp-image-916" /></a><p class="wp-caption-text">xterm256 default contrast, default CursorColumn</p></div></center></p>
<p><center><div id="attachment_919" class="wp-caption aligncenter" style="width: 160px"><a href="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/gvim_cursorline_cursorcolumn_default_unified.png"><img src="http://slinky.imukuppi.org/wpress/wp-content/uploads/2010/10/gvim_cursorline_cursorcolumn_default_unified-150x150.png" alt="GVim default contrast, unified CursorColumn" title="GVim default contrast, unified CursorColumn" width="150" height="150" class="size-thumbnail wp-image-919" /></a><p class="wp-caption-text">GVim default contrast, unified CursorColumn</p></div></center></p>
<p><strong>Download It From&#8230;</strong></p>
<p>As usual, grab <a href="http://slinky.imukuppi.org/zenburn/zenburn.vim">a local copy of the latest Zenburn</a>, visit <a href="http://www.vim.org/scripts/script.php?script_id=415">vim.sf.net</a> for additional downloads, or check out <a href="http://slinky.imukuppi.org/zenburnpage">the Zenburn page</a> for more details.</p>
<p>If you download from vim.sf.net your download will be counted, which is nice from a statistical point of view.</p>
<p>Have fun and stay in the zone!</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2010/10/24/zenburn-v2-16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zenburn v2.14</title>
		<link>http://slinky.imukuppi.org/2010/10/13/zenburn-v2-14/</link>
		<comments>http://slinky.imukuppi.org/2010/10/13/zenburn-v2-14/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 20:46:12 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[Zenburn]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=899</guid>
		<description><![CDATA[Zenburn v2.14 is released! Featuring the proper colourization of CursorColumn syntax group (&#8220;:set cursorline cursorcolumn&#8221;). Many thanks to Drew. Previously everything in the column falling under the CursorColumn would have the same foreground colour. This looks silly and was unintentional. With the fix only the background is highlighted. Grab it from vim.sf.net or the official [...]]]></description>
			<content:encoded><![CDATA[<p>Zenburn v2.14 is released!</p>
<p>Featuring the proper colourization of CursorColumn syntax group (&#8220;:set cursorline cursorcolumn&#8221;). Many thanks to Drew.</p>
<p>Previously everything in the column falling under the CursorColumn would have the same foreground colour. This looks silly and was unintentional. With the fix only the background is highlighted.</p>
<p>Grab it from <a href="http://vim.sourceforge.net/scripts/script.php?script_id=415">vim.sf.net</a> or <a href="http://slinky.imukuppi.org/zenburnpage/">the official Zenburn page</a>. A Vimball is also available, see the vim.sf.net page.</p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2010/10/13/zenburn-v2-14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Share Your Pictures with kevlarkitten.com</title>
		<link>http://slinky.imukuppi.org/2010/09/22/share-your-pictures-with-kevlarkitten-com/</link>
		<comments>http://slinky.imukuppi.org/2010/09/22/share-your-pictures-with-kevlarkitten-com/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 20:49:49 +0000</pubDate>
		<dc:creator>slinky</dc:creator>
				<category><![CDATA[Creations]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[hassle-free]]></category>
		<category><![CDATA[kevlar]]></category>
		<category><![CDATA[kevlarkitten]]></category>
		<category><![CDATA[kevlarkitten.com]]></category>
		<category><![CDATA[kitten]]></category>
		<category><![CDATA[picture sharing]]></category>
		<category><![CDATA[safe]]></category>
		<category><![CDATA[send image]]></category>
		<category><![CDATA[send picture]]></category>
		<category><![CDATA[share picture]]></category>
		<category><![CDATA[share pictures]]></category>
		<category><![CDATA[share your pic]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[time restricted]]></category>
		<category><![CDATA[web frameworks]]></category>
		<category><![CDATA[www.kevlarkitten.com]]></category>

		<guid isPermaLink="false">http://slinky.imukuppi.org/?p=849</guid>
		<description><![CDATA[Problem You need to quickly share images with your friends. Not all of your friends use the same chat programs, social networks, etc. Solution kevlarkitten.com runs to the rescue. It works like this: you upload an image and set an expiration period. You then get a special web address. Before the image expires, it can [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You need to quickly share images with your friends. Not all of your friends use the same chat programs, social networks, etc.</p>
<p><strong>Solution</strong></p>
<p><a href="http://kevlarkitten.com/">kevlarkitten.com</a> runs to the rescue.</p>
<p>It works like this: you upload an image and set an expiration period. You then get a special web address. Before the image expires, it can be seen through this address. After the image expires, it&#8217;s gone forever.</p>
<p>It&#8217;s very fast, simple to use and 100% hassle-free. You don&#8217;t need to login or anything! And only the persons who know the link can see the picture.</p>
<p><strong>History</strong></p>
<p>Many months ago I wanted to learn a web framework, just to learn how it works. Then I just implemented a project I had had in mind. I had a domain which I wasn&#8217;t using, so I put it up at <a href="http://kevlarkitten.com">kevlarkitten.com</a> and told a few of my friends about it to get some beta testers.</p>
<p>A few days later, another friend was asking me &#8220;what&#8217;s the best way to just quickly get you guys these pictures of a potential new office space I&#8217;m looking at&#8221;. I pointed him to the site and he sent us several image links for our amusement. Success!</p>
<p>The site has been up for some time now, so it should be somewhat bug-free. A wider audience is very welcome. If the site makes your life easier, very good.</p>
<p><strong>Note</strong></p>
<p>Huge image sizes are not supported. If you that bothers you, try resizing the image &#8211; I think in normal use you won&#8217;t get such problems. I might implement support for very huge pictures later, but given that I pay for bandwidth, it&#8217;s not a really high priority for me :P</p>
<p><strong><a href="http://kevlarkitten.com">kevlarkitten.com</a> &#8211; it purrs</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://slinky.imukuppi.org/2010/09/22/share-your-pictures-with-kevlarkitten-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

