<?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>LinuxSoftware &#187; Renouftxt</title>
	<atom:link href="http://linuxsoftware.co.nz/blog/tag/renouftxt/feed" rel="self" type="application/rss+xml" />
	<link>http://linuxsoftware.co.nz/blog</link>
	<description>Coding and tramping in Aotearoa / New Zealand</description>
	<lastBuildDate>Tue, 08 May 2012 09:41:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fun with Javascript</title>
		<link>http://linuxsoftware.co.nz/blog/2009/10/fun-with-javascript</link>
		<comments>http://linuxsoftware.co.nz/blog/2009/10/fun-with-javascript#comments</comments>
		<pubDate>Sat, 31 Oct 2009 02:24:45 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[LCA2008]]></category>
		<category><![CDATA[LinuxSoftware]]></category>
		<category><![CDATA[NZOSS]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ECMAscript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Renouftxt]]></category>

		<guid isPermaLink="false">http://linuxsoftware.co.nz/blog/?p=631</guid>
		<description><![CDATA[The RenoufTxt Algorithm: Tim came up with the idea of using an automatic txt compression on fixed length fields, where the input being entered is just a little bit too long for the field size. It&#8217;d be better to increase the size of the field, but maybe there might be some situation where that is [...]]]></description>
			<content:encoded><![CDATA[<p><b>The RenoufTxt Algorithm:</b> Tim came up with the idea of using an automatic txt compression on fixed length fields, where the input being entered is just a little bit too long for the field size.  It&#8217;d be better to increase the size of the field, but maybe there might be some situation where that is not possible.  This was back when I had more free time, so I coded it up.  It was a good excuse to write some Javascript (I should say ECMAscript) code anyway.  Javascript is a very interesting language, the way objects are just dictionaries with member functions just values being stored by function name.  Python is similar, but has a few more restrictions.  </p>
<p><strike>Here&#8217;s an example of an input field with RenoufTxt enabled on it.  </strike></p>
<p>Updated: It seems later versions of Firefox wisely block bits of Javascript sitting inside blog posts.  You&#8217;ll have to go to <a href="http://linuxsoftware.co.nz/renouftxt">this page</a> to see the script in action.</p>
<p>And, here is the source code: <a href="http://linuxsoftware.co.nz/renouftxt/renouftxt.js">renouftxt.js</a>.  </p>
<p>My implementation tries four different methods [toNumber, abbrev, innerAbbrev, removeVowels] to compress each word and tries to choose the words and methods which give the most compression for the best readability.  That&#8217;s probably way over-engineered, but this was &#8220;just for fun&#8221;.  A simpler implementation might just remove vowels.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsoftware.co.nz/blog/2009/10/fun-with-javascript/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

