<?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>Ivan Kozik&#039;s weblog</title>
	<atom:link href="http://ludios.org/ivank/feed/" rel="self" type="application/rss+xml" />
	<link>http://ludios.org/ivank</link>
	<description></description>
	<lastBuildDate>Sun, 11 Mar 2012 20:57:39 +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>Python NaN equality rules (and cw.eq.equals)</title>
		<link>http://ludios.org/ivank/2012/01/python-nan-equality-rules-and-cw-eq-equals/</link>
		<comments>http://ludios.org/ivank/2012/01/python-nan-equality-rules-and-cw-eq-equals/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 22:42:19 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[coreweb]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=441</guid>
		<description><![CDATA[>>> float('nan') == float('nan') False >>> n = float('nan') >>> n nan >>> n == n False >>> [float('nan')] == [float('nan')] False # Note: in PyPy, True >>> [n] == [n] True >>> nl = [float('nan')] >>> nl == nl True Got it? Good. (The behavior above is caused by various object-identity shortcuts for either [...]]]></description>
			<content:encoded><![CDATA[<p><code>>>> float('nan') == float('nan')<br />
False<br />
>>> n = float('nan')<br />
>>> n<br />
nan<br />
>>> n == n<br />
False<br />
>>> [float('nan')] == [float('nan')]<br />
False # Note: in PyPy, True<br />
>>> [n] == [n]<br />
True<br />
>>> nl = [float('nan')]<br />
>>> nl == nl<br />
True<br />
</code></p>
<p>Got it? Good.  (The behavior above is caused by various object-identity shortcuts for either the NaN or the <code>list</code> object.)</p>
<p>If you&#8217;re wondering how this works in JavaScript, well, it doesn&#8217;t, because JavaScript doesn&#8217;t have any kind of deep-equality comparison.  JavaScript Arrays and Objects compare by identity.  But in <a href="https://github.com/ludios/Coreweb/blob/master/js_coreweb/cw/eq.js">Coreweb&#8217;s cw.eq.equals</a>, I didn&#8217;t implement the object-identity shortcut, so NaN comparison works correctly:</p>
<p><code>>>> Number.NaN == Number.NaN<br />
false<br />
>>> n = Number.NaN<br />
NaN<br />
>>> n == n<br />
false<br />
>>> cw.eq.equals([Number.NaN], [Number.NaN])<br />
false<br />
>>> cw.eq.equals([n], [n])<br />
false<br />
>>> nl = [Number.NaN]<br />
[NaN]<br />
>>> cw.eq.equals(nl, nl)<br />
false<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2012/01/python-nan-equality-rules-and-cw-eq-equals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sublime Text + Samba + GHC problem</title>
		<link>http://ludios.org/ivank/2011/07/sublime-text-samba-ghc-problem/</link>
		<comments>http://ludios.org/ivank/2011/07/sublime-text-samba-ghc-problem/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 22:14:03 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech Support]]></category>
		<category><![CDATA[annoyances]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=425</guid>
		<description><![CDATA[If you&#8217;re using Sublime Text on Windows to edit files on a network drive powered by Samba, and then run a Haskell program on the system running Samba (not the machine running Sublime Text), you might see: openBinaryFile: resource exhausted (Resource temporarily unavailable) or openFile: resource exhausted (Resource temporarily unavailable) This problem is caused by [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using Sublime Text on Windows to edit files on a network drive powered by Samba, and then run a Haskell program on the system running Samba (<em>not</em> the machine running Sublime Text), you might see:</p>
<p><code>openBinaryFile: resource exhausted (Resource temporarily unavailable)</code></p>
<p>or</p>
<p><code>openFile: resource exhausted (Resource temporarily unavailable)</code></p>
<p>This problem is caused by Samba grabbing oplocks (opportunistic locks) on the files being edited.  Sublime Text makes system calls that result in the oplocks being grabbed, while most other editors (including Wordpad) do not.  You can work around the problem by adding <code>oplocks = no</code> in the configuration for your share in <code>smb.conf</code>.  <em>Using Samba</em> has <a href="http://oreilly.com/catalog/samba/chapter/book/ch05_05.html">some reading on oplocks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2011/07/sublime-text-samba-ghc-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preserving italics in pastes from webpages</title>
		<link>http://ludios.org/ivank/2011/04/preserving-italics-in-pastes-from-webpages/</link>
		<comments>http://ludios.org/ivank/2011/04/preserving-italics-in-pastes-from-webpages/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 02:30:26 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=396</guid>
		<description><![CDATA[Tired of losing italics in pastes from websites to your plain-text editor? For a while, I thought I needed to switch to a rich-text editor to handle these pastes, but that would be a pain for several reasons. A few days ago I realized I just needed to mutate the webpage by surrounding italic text [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of losing italics in pastes from websites to your plain-text editor?  For a while, I thought I needed to switch to a rich-text editor to handle these pastes, but that would be a pain for several reasons.  A few days ago I realized I just needed to mutate the webpage by surrounding italic text with slashes.  I would run a bookmarklet, then copy/paste.  (<a href="#working-bkm">Skip below for a working bookmarklet</a>).</p>
<p>My first attempt at this used the <code>:before</code> and <code>:after</code> CSS pseudo-elements:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="javascript"><pre class="de1">javascript<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw2">var</span> newSS<span class="sy0">,</span> styles<span class="sy0">=</span><span class="st0">'em:before, em:after, i:before, i:after { content: &quot;/&quot; }'</span><span class="sy0">;</span>
	<span class="kw1">if</span><span class="br0">&#40;</span>document.<span class="me1">createStyleSheet</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		document.<span class="me1">createStyleSheet</span><span class="br0">&#40;</span><span class="st0">&quot;javascript:'&quot;</span> <span class="sy0">+</span> styles <span class="sy0">+</span> <span class="st0">&quot;'&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
		newSS <span class="sy0">=</span> document.<span class="me1">createElement</span><span class="br0">&#40;</span><span class="st0">'link'</span><span class="br0">&#41;</span><span class="sy0">;</span>
		newSS.<span class="me1">rel</span> <span class="sy0">=</span> <span class="st0">'stylesheet'</span><span class="sy0">;</span>
		newSS.<span class="me1">href</span> <span class="sy0">=</span> <span class="st0">'data:text/css,'</span> <span class="sy0">+</span> escape<span class="br0">&#40;</span>styles<span class="br0">&#41;</span><span class="sy0">;</span>
		document.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&quot;head&quot;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>.<span class="me1">appendChild</span><span class="br0">&#40;</span>newSS<span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>If you run the above (paste into your URL bar and hit enter), it looks like it works until you try to paste the text containing slashes; neither Chrome 10 or Firefox 4 will put the slashes in your clipboard.  I threw out the simple clean non-working code and went for a terrible hack:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="javascript"><pre class="de1">javascript<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> document.<span class="me1">body</span>.<span class="me1">innerHTML</span> <span class="sy0">=</span> document.<span class="me1">body</span>.<span class="me1">innerHTML</span>.
	<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/&lt;em(\s.*?)?&gt;([\s\S]+?)&lt;\/em&gt;/gi</span><span class="sy0">,</span> <span class="st0">&quot;/&lt;em$1&gt;$2&lt;/em&gt;/&quot;</span><span class="br0">&#41;</span>.
	<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/&lt;i(\s.*?)?&gt;([\s\S]+?)&lt;\/i&gt;/gi</span><span class="sy0">,</span> <span class="st0">&quot;/&lt;i$1&gt;$2&lt;/i&gt;/&quot;</span><span class="br0">&#41;</span>.
	<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/&lt;span style=&quot;font-style: italic;&quot;&gt;([\s\S]+?)&lt;\/span&gt;/gi</span><span class="sy0">,</span> <span class="st0">'/&lt;span style=&quot;font-style: italic;&quot;&gt;$1&lt;/span&gt;/'</span><span class="br0">&#41;</span>.
	<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/&lt;strong(\s.*?)?&gt;([\s\S]+?)&lt;\/strong&gt;/gi</span><span class="sy0">,</span> <span class="st0">&quot;*&lt;strong$1&gt;$2&lt;/strong&gt;*&quot;</span><span class="br0">&#41;</span>.
	<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/&lt;b(\s.*?)?&gt;([\s\S]+?)&lt;\/b&gt;/gi</span><span class="sy0">,</span> <span class="st0">&quot;*&lt;b$1&gt;$2&lt;/b&gt;*&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>This above replaces <code>document.body.innerHTML</code> with a new string where italics are surrounded with &#8220;/&#8221; and bold surrounded by &#8220;*&#8221;.  This is terrible in several ways: it may break or re-run JavaScript code on the page, or somehow make you vulnerable to XSS (in a manner likely similar to the IE8 XSS &#8220;blocker&#8221;).  Only while writing this post did I realize the security implications of the above.  I decided to implement it using DOM manipulation (requires CSS3 selectors and <a href="http://caniuse.com/queryselector">querySelectorAll</a>):<br />
<span id="working-bkm"></span></p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="javascript"><pre class="de1">javascript<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> 
	<span class="kw2">var</span> wrapElements <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>selector<span class="sy0">,</span> wrapperText<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw2">var</span> elements <span class="sy0">=</span> document.<span class="me1">querySelectorAll</span><span class="br0">&#40;</span>selector<span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> elements.<span class="me1">length</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
			<span class="kw2">var</span> surround <span class="sy0">=</span> elements<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="sy0">;</span>
			<span class="kw1">if</span><span class="br0">&#40;</span>surround.<span class="me1">parentNode</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
				surround.<span class="me1">parentNode</span>.<span class="me1">insertBefore</span><span class="br0">&#40;</span>
					document.<span class="me1">createTextNode</span><span class="br0">&#40;</span>wrapperText<span class="br0">&#41;</span><span class="sy0">,</span> surround<span class="br0">&#41;</span><span class="sy0">;</span>
			<span class="br0">&#125;</span>
			surround.<span class="me1">appendChild</span><span class="br0">&#40;</span>
				document.<span class="me1">createTextNode</span><span class="br0">&#40;</span>wrapperText<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="br0">&#125;</span>
	<span class="br0">&#125;</span><span class="sy0">;</span>
&nbsp;
	<span class="kw2">var</span> getStyleAttrVariations <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>elem<span class="sy0">,</span> property<span class="sy0">,</span> value<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw1">return</span> <span class="br0">&#91;</span>
			 elem <span class="sy0">+</span> <span class="st0">'[style=&quot;'</span> <span class="sy0">+</span> property <span class="sy0">+</span> <span class="st0">': '</span> <span class="sy0">+</span> value <span class="sy0">+</span> <span class="st0">';&quot;]'</span>
			<span class="sy0">,</span>elem <span class="sy0">+</span> <span class="st0">'[style=&quot;'</span> <span class="sy0">+</span> property <span class="sy0">+</span> <span class="st0">': '</span> <span class="sy0">+</span> value <span class="sy0">+</span> <span class="st0">'&quot;]'</span>
			<span class="sy0">,</span>elem <span class="sy0">+</span> <span class="st0">'[style=&quot;'</span> <span class="sy0">+</span> property <span class="sy0">+</span> <span class="st0">':'</span>  <span class="sy0">+</span> value <span class="sy0">+</span> <span class="st0">';&quot;]'</span>
			<span class="sy0">,</span>elem <span class="sy0">+</span> <span class="st0">'[style=&quot;'</span> <span class="sy0">+</span> property <span class="sy0">+</span> <span class="st0">':'</span>  <span class="sy0">+</span> value <span class="sy0">+</span> <span class="st0">'&quot;]'</span>
		<span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span><span class="sy0">;</span>
&nbsp;
	wrapElements<span class="br0">&#40;</span><span class="st0">'em, i, span[class~=&quot;emphasis&quot;], span[class~=&quot;italic&quot;]'</span><span class="sy0">,</span> <span class="st0">'/'</span><span class="br0">&#41;</span><span class="sy0">;</span>
	wrapElements<span class="br0">&#40;</span>getStyleAttrVariations<span class="br0">&#40;</span><span class="st0">'span'</span><span class="sy0">,</span> <span class="st0">'font-style'</span><span class="sy0">,</span> <span class="st0">'italic'</span><span class="br0">&#41;</span>.<span class="me1">join</span><span class="br0">&#40;</span><span class="st0">' ,'</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="st0">'/'</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
	wrapElements<span class="br0">&#40;</span><span class="st0">'strong, b, span[class~=&quot;bold&quot;]'</span><span class="sy0">,</span> <span class="st0">'*'</span><span class="br0">&#41;</span><span class="sy0">;</span>
	wrapElements<span class="br0">&#40;</span>getStyleAttrVariations<span class="br0">&#40;</span><span class="st0">'span'</span><span class="sy0">,</span> <span class="st0">'font-weight'</span><span class="sy0">,</span> <span class="st0">'bold'</span><span class="br0">&#41;</span>.<span class="me1">join</span><span class="br0">&#40;</span><span class="st0">' ,'</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="st0">'*'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>If you don&#8217;t want to manually create a bookmark with the above code, you can drag this link to your toolbar or bookmarks:</p>
<p><big><b><a href="javascript:(function()%20{%20%20var%20wrapElements%20=%20function(selector,%20wrapperText)%20{%20var%20elements%20=%20document.querySelectorAll(selector);%20for(var%20i=0;%20i%20<%20elements.length;%20i++)%20{%20var%20surround%20=%20elements[i];%20if(surround.parentNode)%20{%20surround.parentNode.insertBefore(%20document.createTextNode(wrapperText),%20surround);%20}%20surround.appendChild(%20document.createTextNode(wrapperText));%20}%20};%20%20var%20getStyleAttrVariations%20=%20function(elem,%20property,%20value)%20{%20return%20[%20%20elem%20+%20'[style=%22'%20+%20property%20+%20':%20'%20+%20value%20+%20';%22]'%20,elem%20+%20'[style=%22'%20+%20property%20+%20':%20'%20+%20value%20+%20'%22]'%20,elem%20+%20'[style=%22'%20+%20property%20+%20':'%20%20+%20value%20+%20';%22]'%20,elem%20+%20'[style=%22'%20+%20property%20+%20':'%20%20+%20value%20+%20'%22]'%20];%20};%20%20wrapElements('em,%20i,%20span[class~=%22emphasis%22],%20span[class~=%22italic%22]',%20'/');%20wrapElements(getStyleAttrVariations('span',%20'font-style',%20'italic').join('%20,'),%20'/');%20%20wrapElements('strong,%20b,%20span[class~=%22bold%22]',%20'*');%20wrapElements(getStyleAttrVariations('span',%20'font-weight',%20'bold').join('%20,'),%20'*');%20})();">Preserve italics and bold</a></b></big></p>
<p>I use a bookmark keyword in Firefox to activate it; keywords are not just for searches.</p>
<p>Here&#8217;s some bold and italic text so you know it&#8217;s working: <b>bold</b>, <i>italic</i>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2011/04/preserving-italics-in-pastes-from-webpages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git repos have moved to GitHub</title>
		<link>http://ludios.org/ivank/2010/12/git-repos-have-moved-to-github/</link>
		<comments>http://ludios.org/ivank/2010/12/git-repos-have-moved-to-github/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 00:26:43 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[administrativia]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=382</guid>
		<description><![CDATA[In case you cloned Monoclock or Protojson, http://ludios.net/git/ no longer exists; everything is now at https://github.com/ludios]]></description>
			<content:encoded><![CDATA[<p>In case you cloned Monoclock or Protojson, <del datetime="2010-12-02T00:23:22+00:00">http://ludios.net/git/</del> no longer exists; everything is now at <a href="https://github.com/ludios">https://github.com/ludios</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/12/git-repos-have-moved-to-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance improvements in Python Protocol Buffers</title>
		<link>http://ludios.org/ivank/2010/11/performance-improvements-in-python-protocol-buffers/</link>
		<comments>http://ludios.org/ivank/2010/11/performance-improvements-in-python-protocol-buffers/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 15:53:05 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[protobuf]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=358</guid>
		<description><![CDATA[protobuf&#8216;s Python implementation has been known for its slowness, but that might be changing. From a 2010-11-01 changelog: Python * Added an experimental C++ implementation for Python messages via a Python extension. Implementation type is controlled by an environment variable PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python") The default value is currently "python" but will be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/protobuf/">protobuf</a>&#8216;s Python implementation has been known for its slowness, but that might be changing.  From a 2010-11-01 changelog:</p>
<pre>
  Python
  * Added an experimental  C++ implementation for Python messages via a Python
    extension. Implementation type is controlled by an environment variable
    PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
    The default value is currently "python" but will be changed to "cpp" in
    future release.
  * Improved performance on message instantiation significantly.
    Most of the work on message instantiation is done just once per message
    class, instead of once per message instance.
  * Improved performance on text message parsing.
</pre>
<p>&#8211; <a href="http://code.google.com/p/protobuf/source/detail?r=349">http://code.google.com/p/protobuf/source/detail?r=349</a></p>
<p>Also, if you like Protocol Buffers <em>and</em> JSON, check out <a href="http://ludios.org/ivank/2010/07/protojson-json-serialization-for-protocol-buffers/">Protojson</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/performance-improvements-in-python-protocol-buffers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the total size of a built-in Python object</title>
		<link>http://ludios.org/ivank/2010/11/getting-the-total-size-of-a-builtin-python-object/</link>
		<comments>http://ludios.org/ivank/2010/11/getting-the-total-size-of-a-builtin-python-object/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 14:28:35 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=337</guid>
		<description><![CDATA[Ever notice how sys.getsizeof doesn&#8217;t include the size of the object&#8217;s children? &#62;&#62;&#62; sys.getsizeof&#40;&#123;&#125;&#41; 136 &#62;&#62;&#62; sys.getsizeof&#40;&#123;&#34;1&#34;: &#34;x&#34; * 1000000&#125;&#41; 136 I don&#8217;t know if there is a truly good use for this, but someone in #python wanted it, so here it is: import sys &#160; def totalSizeOf&#40;obj, _alreadySeen=None&#41;: &#34;&#34;&#34; Get the size of object [...]]]></description>
			<content:encoded><![CDATA[<p>Ever notice how <code><a href="http://docs.python.org/dev/library/sys.html#sys.getsizeof">sys.getsizeof</a></code> doesn&#8217;t include the size of the object&#8217;s children?</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="sy0">&gt;&gt;&gt;</span> <span class="kw3">sys</span>.<span class="me1">getsizeof</span><span class="br0">&#40;</span><span class="br0">&#123;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>       
<span class="nu0">136</span>
<span class="sy0">&gt;&gt;&gt;</span> <span class="kw3">sys</span>.<span class="me1">getsizeof</span><span class="br0">&#40;</span><span class="br0">&#123;</span><span class="st0">&quot;1&quot;</span>: <span class="st0">&quot;x&quot;</span> * <span class="nu0">1000000</span><span class="br0">&#125;</span><span class="br0">&#41;</span>
<span class="nu0">136</span></pre></div></div></div></div></div></div></div>


<p>I don&#8217;t know if there is a truly good use for this, but someone in <a href="http://pound-python.org/">#python</a> wanted it, so here it is:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="kw1">import</span> <span class="kw3">sys</span>
&nbsp;
<span class="kw1">def</span> totalSizeOf<span class="br0">&#40;</span>obj<span class="sy0">,</span> _alreadySeen<span class="sy0">=</span><span class="kw2">None</span><span class="br0">&#41;</span>:
	<span class="st0">&quot;&quot;&quot;
	Get the size of object C{obj} using L{sys.getsizeof} on the object
	itself and all of its children recursively.  If the same object appears
	more than once inside C{obj}, it is counted only once.
&nbsp;
	This only works properly if C{obj} is a str, unicode, list, tuple, dict,
	set, frozenset, bool, NoneType, int, complex, float, long, or any nested
	combination of the above.  C{obj} is allowed to have circular references.
&nbsp;
	This might be useful for getting a good estimate of how much memory a
	JSON-decoded object is using after receiving it.
&nbsp;
	Design notes: L{sys.getsizeof} returns reasonable numbers, but does not
	recurse into the object's children.  As we recurse into the children, we
	keep track of objects we've already counted for two reasons:
		- If we've already counted the object's memory usage, we don't
		want to count it again.
		- As a bonus, we handle circular references gracefully.
&nbsp;
	This function assumes that containers do not modify their children as
	they are traversed.
	&quot;&quot;&quot;</span>
	<span class="kw1">if</span> _alreadySeen <span class="kw1">is</span> <span class="kw2">None</span>:
		_alreadySeen <span class="sy0">=</span> <span class="kw2">set</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
	total <span class="sy0">=</span> <span class="kw3">sys</span>.<span class="me1">getsizeof</span><span class="br0">&#40;</span>obj<span class="br0">&#41;</span>
	_alreadySeen.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">id</span><span class="br0">&#40;</span>obj<span class="br0">&#41;</span><span class="br0">&#41;</span>
&nbsp;
	<span class="kw1">if</span> <span class="kw2">isinstance</span><span class="br0">&#40;</span>obj<span class="sy0">,</span> <span class="kw2">dict</span><span class="br0">&#41;</span>:
		<span class="co1"># Count the memory usage of both the keys and values.</span>
		<span class="kw1">for</span> k<span class="sy0">,</span> v <span class="kw1">in</span> obj.<span class="me1">iteritems</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:
			<span class="kw1">if</span> <span class="kw1">not</span> <span class="kw2">id</span><span class="br0">&#40;</span>k<span class="br0">&#41;</span> <span class="kw1">in</span> _alreadySeen:
				total +<span class="sy0">=</span> totalSizeOf<span class="br0">&#40;</span>k<span class="sy0">,</span> _alreadySeen<span class="br0">&#41;</span>
			<span class="kw1">if</span> <span class="kw1">not</span> <span class="kw2">id</span><span class="br0">&#40;</span>v<span class="br0">&#41;</span> <span class="kw1">in</span> _alreadySeen:
				total +<span class="sy0">=</span> totalSizeOf<span class="br0">&#40;</span>v<span class="sy0">,</span> _alreadySeen<span class="br0">&#41;</span>
	<span class="kw1">else</span>:
		<span class="kw1">try</span>:
			iterator <span class="sy0">=</span> obj.<span class="kw4">__iter__</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
		<span class="kw1">except</span> <span class="br0">&#40;</span><span class="kw2">TypeError</span><span class="sy0">,</span> <span class="kw2">AttributeError</span><span class="br0">&#41;</span>:
			<span class="kw1">pass</span>
		<span class="kw1">else</span>:
			<span class="kw1">for</span> item <span class="kw1">in</span> iterator:
				<span class="kw1">if</span> <span class="kw1">not</span> <span class="kw2">id</span><span class="br0">&#40;</span>item<span class="br0">&#41;</span> <span class="kw1">in</span> _alreadySeen:
					total +<span class="sy0">=</span> totalSizeOf<span class="br0">&#40;</span>item<span class="sy0">,</span> _alreadySeen<span class="br0">&#41;</span>
&nbsp;
	<span class="kw1">return</span> total</pre></div></div></div></div></div></div></div>


<p><a href="http://creativecommons.org/publicdomain/zero/1.0/">No &copy;</a> on the above, enjoy.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="sy0">&gt;&gt;&gt;</span> totalSizeOf<span class="br0">&#40;</span><span class="br0">&#123;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>
<span class="nu0">136</span>
<span class="sy0">&gt;&gt;&gt;</span> totalSizeOf<span class="br0">&#40;</span><span class="br0">&#123;</span><span class="st0">&quot;1&quot;</span>: <span class="st0">&quot;x&quot;</span> * <span class="nu0">1000000</span><span class="br0">&#125;</span><span class="br0">&#41;</span>  
<span class="nu0">1000179</span></pre></div></div></div></div></div></div></div>


<p>If you want unit tests, see <a href="https://github.com/ludios/Mypy/blob/master/mypy/test/test_objops.py">mypy/test/test_objops.py</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/getting-the-total-size-of-a-builtin-python-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A template for immutable Python objects</title>
		<link>http://ludios.org/ivank/2010/11/a-template-for-immutable-python-objects/</link>
		<comments>http://ludios.org/ivank/2010/11/a-template-for-immutable-python-objects/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 13:03:47 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[immutability]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=279</guid>
		<description><![CDATA[First, the immutable object template, then the explanation: import operator &#160; class Circle&#40;tuple&#41;: __slots__ = &#40;&#41; # An immutable and unique marker, used to make sure different # tuple subclasses are not equal to each other. _MARKER = object&#40;&#41; &#160; size = property&#40;operator.itemgetter&#40;1&#41;&#41; color = property&#40;operator.itemgetter&#40;2&#41;&#41; &#160; def __new__&#40;cls, size, color&#41;: &#34;&#34;&#34; @param size: an [...]]]></description>
			<content:encoded><![CDATA[<p>First, the immutable object template, then the explanation:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="kw1">import</span> <span class="kw3">operator</span>
&nbsp;
<span class="kw1">class</span> Circle<span class="br0">&#40;</span><span class="kw2">tuple</span><span class="br0">&#41;</span>:
	<span class="kw4">__slots__</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#41;</span>
	<span class="co1"># An immutable and unique marker, used to make sure different</span>
	<span class="co1"># tuple subclasses are not equal to each other.</span>
	_MARKER <span class="sy0">=</span> <span class="kw2">object</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
	size <span class="sy0">=</span> <span class="kw2">property</span><span class="br0">&#40;</span><span class="kw3">operator</span>.<span class="me1">itemgetter</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
	color <span class="sy0">=</span> <span class="kw2">property</span><span class="br0">&#40;</span><span class="kw3">operator</span>.<span class="me1">itemgetter</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
&nbsp;
	<span class="kw1">def</span> <span class="kw4">__new__</span><span class="br0">&#40;</span>cls<span class="sy0">,</span> size<span class="sy0">,</span> color<span class="br0">&#41;</span>:
		<span class="st0">&quot;&quot;&quot;
		@param size: an int
		@param color: a str
		&quot;&quot;&quot;</span>
		<span class="kw1">return</span> <span class="kw2">tuple</span>.<span class="kw4">__new__</span><span class="br0">&#40;</span>cls<span class="sy0">,</span> <span class="br0">&#40;</span>cls._MARKER<span class="sy0">,</span> size<span class="sy0">,</span> color<span class="br0">&#41;</span><span class="br0">&#41;</span>
&nbsp;
	<span class="kw1">def</span> <span class="kw4">__repr__</span><span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:
		<span class="kw1">return</span> <span class="st0">'%s(%r, %r)'</span> % <span class="br0">&#40;</span><span class="kw2">self</span>.__class__.__name__<span class="sy0">,</span> <span class="kw2">self</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="kw2">self</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span>
&nbsp;
        <span class="kw1">def</span> double<span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:
                <span class="st0">&quot;&quot;&quot;
                Get a Circle twice the size of this one.
                &quot;&quot;&quot;</span>
                <span class="kw1">return</span> <span class="kw2">self</span>.__class__<span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">size</span> * <span class="nu0">2</span><span class="sy0">,</span> <span class="kw2">self</span>.<span class="me1">color</span><span class="br0">&#41;</span></pre></div></div></div></div></div></div></div>


<p>Why bother?  Well, compared to normal user-defined class instances, <code>Circle</code> instances are immutable, have a <code>__hash__</code> (hashes contents), and have better default comparison operators (compares contents).  Everything works as you would expect:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="sy0">&gt;&gt;&gt;</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span> <span class="sy0">==</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span>
<span class="kw2">True</span>
<span class="sy0">&gt;&gt;&gt;</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span> <span class="sy0">==</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;orange&quot;</span><span class="br0">&#41;</span>
<span class="kw2">False</span>
<span class="sy0">&gt;&gt;&gt;</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span>
<span class="kw2">False</span>
<span class="sy0">&gt;&gt;&gt;</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span>.<span class="me1">size</span>
<span class="nu0">3</span>
<span class="sy0">&gt;&gt;&gt;</span> Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span>.<span class="me1">color</span>
<span class="st0">'red'</span>
<span class="sy0">&gt;&gt;&gt;</span> a <span class="sy0">=</span> <span class="kw2">set</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> a.<span class="me1">add</span><span class="br0">&#40;</span>Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> a.<span class="me1">add</span><span class="br0">&#40;</span>Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> a.<span class="me1">add</span><span class="br0">&#40;</span>Circle<span class="br0">&#40;</span><span class="nu0">4</span><span class="sy0">,</span> <span class="st0">&quot;green&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> 
<span class="sy0">&gt;&gt;&gt;</span> a
<span class="kw2">set</span><span class="br0">&#40;</span><span class="br0">&#91;</span>Circle<span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st0">'red'</span><span class="br0">&#41;</span><span class="sy0">,</span> Circle<span class="br0">&#40;</span><span class="nu0">4</span><span class="sy0">,</span> <span class="st0">'green'</span><span class="br0">&#41;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> c <span class="sy0">=</span> Circle<span class="br0">&#40;</span><span class="nu0">2</span><span class="sy0">,</span> <span class="st0">&quot;red&quot;</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> c.<span class="me1">double</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
Circle<span class="br0">&#40;</span><span class="nu0">4</span><span class="sy0">,</span> <span class="st0">'red'</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> c.<span class="me1">color</span> <span class="sy0">=</span> <span class="st0">'blue'</span>
Traceback <span class="br0">&#40;</span>most recent call last<span class="br0">&#41;</span>:
  File <span class="st0">&quot;&lt;stdin&gt;&quot;</span><span class="sy0">,</span> line <span class="nu0">1</span><span class="sy0">,</span> <span class="kw1">in</span> <span class="sy0">&lt;</span>module<span class="sy0">&gt;</span>
<span class="kw2">AttributeError</span>: can<span class="st0">'t set attribute</span></pre></div></div></div></div></div></div></div>


<p>If you wanted <code>hash</code>ibility and good comparisons, couldn&#8217;t you just add <code>__hash__</code> and comparison operators to your normal class?  Yes, but then hashing and comparison would call into slower<small><sup>[1]</sup></small> Python code rather than <code>tuple</code>&#8216;s native methods.  And since your object is not really immutable, a user of your API might be tempted to mutate an object that really shouldn&#8217;t be mutated.  </p>
<p>The above hack is actually built in to Python as <a href="http://docs.python.org/dev/library/collections.html#collections.namedtuple">collections.namedtuple</a> (<a href="http://svn.python.org/projects/python/trunk/Lib/collections.py">see the source</a>).  It works by generating code (like the above template) and <code>exec</code>ing it.  There are a few reasons you might not want it, though:</p>
<p>1. <code>namedtuple</code> is available in Python 2.6+ only (though there are some alternate implementations).<br />
2. You cannot add your own methods or customize the <code>__repr__</code>.<br />
3. You cannot validate parameters passed to the constructor.<br />
4. If you want to add docstrings to your <code>namedtuple</code>, you <a href="http://stackoverflow.com/questions/1606436/adding-docstrings-to-namedtuples-in-python">probably have to subclass it</a>.<br />
5. Completely different <code>namedtuple</code>s are equal to each other if they have the same contents:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="python"><pre class="de1"><span class="sy0">&gt;&gt;&gt;</span> <span class="kw1">from</span> <span class="kw3">collections</span> <span class="kw1">import</span> namedtuple
<span class="sy0">&gt;&gt;&gt;</span> A <span class="sy0">=</span> namedtuple<span class="br0">&#40;</span><span class="st0">'A'</span><span class="sy0">,</span> <span class="st0">'x y'</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> B <span class="sy0">=</span> namedtuple<span class="br0">&#40;</span><span class="st0">'B'</span><span class="sy0">,</span> <span class="st0">'z t'</span><span class="br0">&#41;</span>
<span class="sy0">&gt;&gt;&gt;</span> A<span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">&#41;</span> <span class="sy0">==</span> B<span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">&#41;</span>
<span class="kw2">True</span></pre></div></div></div></div></div></div></div>


<p>Then again, there&#8217;s reasons not to use the above &#8220;immutable object template&#8221; either: it&#8217;s very easy to mess up, you need rather superfluous unit tests for attribute access, and it might scare away new Python programmers.  There are also a few surprises: <code>Circle</code> is <code>len()</code>able, indexable, and sliceable.  But it is the least-terrible solution I could come up with.</p>
<p><small><sup>[1]</sup> this might not be the case with <a href="http://codespeak.net/pypy/">PyPy</a><br />
</small></p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/a-template-for-immutable-python-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worthwhile programming talks</title>
		<link>http://ludios.org/ivank/2010/11/worthwhile-programming-talks/</link>
		<comments>http://ludios.org/ivank/2010/11/worthwhile-programming-talks/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 11:17:05 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[talks]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=270</guid>
		<description><![CDATA[Rich Hickey: Persistent Data Structures and Managed References: Clojure&#8217;s approach to Identity and State Cliff Click: Not Your Father&#8217;s Von Nuemann Machine: A Crash Course in Modern Hardware Simon Peyton Jones: Data Parallel Haskell I might update this post if I find any more great talks in the next few months.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey">Rich Hickey: Persistent Data Structures and Managed References: Clojure&#8217;s approach to Identity and State</a></p>
<p><a href="http://www.infoq.com/presentations/click-crash-course-modern-hardware">Cliff Click: Not Your Father&#8217;s Von Nuemann Machine: A Crash Course in Modern Hardware</a></p>
<p><a href="http://www.youtube.com/watch?v=NWSZ4c9yqW8">Simon Peyton Jones: Data Parallel Haskell</a></p>
<p><small>I might update this post if I find any more great talks in the next few months.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/worthwhile-programming-talks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Clo*ure namespace is officially full</title>
		<link>http://ludios.org/ivank/2010/11/the-closure-namespace-is-officially-full/</link>
		<comments>http://ludios.org/ivank/2010/11/the-closure-namespace-is-officially-full/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 11:48:29 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[closure]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=262</guid>
		<description><![CDATA[closure (English), closure (programming), Clojure (language), Clozure (language), Closure Library, Closure Compiler, Clojure Library, and that&#8217;s not all&#8230;.]]></description>
			<content:encoded><![CDATA[<p><a><a href="http://www.thefreedictionary.com/closure">closure (English)</a>,<br />
<a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29">closure (programming)</a>,<br />
<a href="http://clojure.org/">Clojure (language)</a>,<br />
<a href="http://www.clozure.com/">Clozure (language)</a>,<br />
<a href="http://code.google.com/closure/library/">Closure Library</a>,<br />
<a href="http://code.google.com/closure/compiler/">Closure Compiler</a>,<br />
<a href="http://www.assembla.com/wiki/show/clojure/Clojure_Library_Coding_Standards">Clojure Library</a>,<br />
<a href="http://en.wikipedia.org/wiki/Closure">and that&#8217;s not all&#8230;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/the-closure-namespace-is-officially-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe is finally working on Flash Socket write() feedback</title>
		<link>http://ludios.org/ivank/2010/11/adobe-is-finally-working-on-flash-socket-write-feedback/</link>
		<comments>http://ludios.org/ivank/2010/11/adobe-is-finally-working-on-flash-socket-write-feedback/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 10:45:04 +0000</pubDate>
		<dc:creator>ivank</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://ludios.org/ivank/?p=252</guid>
		<description><![CDATA[A reason to rejoice: We are working on this feature. It is definitely under work, so it will be available soon guys. &#8211; Socket class write() &#8211; information feedback This will allow you to know how much written data has actually made it to your kernel. Without this information, you cannot do flow control unless [...]]]></description>
			<content:encoded><![CDATA[<p>A reason to rejoice:</p>
<blockquote><p>
We are working on this feature. It is definitely under work, so it will be available soon guys.
</p></blockquote>
<p>&#8211; <a href="http://bugs.adobe.com/jira/browse/FP-6">Socket class write() &#8211; information feedback</a></p>
<p>This will allow you to know how much written data has actually made it to your kernel.  Without this information, you cannot do flow control unless the server is constantly responding with TCP-level data.</p>
<p>This &#8220;write feedback&#8221; information is available in WebSocket (in the <code>bufferedAmount</code> property), but <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-March/025635.html">ideally it would dispatch events too</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ludios.org/ivank/2010/11/adobe-is-finally-working-on-flash-socket-write-feedback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

