<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Tang&apos;s DW</title>
  <link>https://tangaroa.dreamwidth.org/</link>
  <description>Tang&apos;s DW - Dreamwidth Studios</description>
  <lastBuildDate>Wed, 14 May 2014 16:47:17 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>tangaroa</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
<item>
  <guid isPermaLink='true'>https://tangaroa.dreamwidth.org/79000.html</guid>
  <pubDate>Wed, 14 May 2014 16:47:17 GMT</pubDate>
  <title>Nifty link of the nonce</title>
  <link>https://tangaroa.dreamwidth.org/79000.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;https://jakevdp.github.io/blog/2014/05/09/why-python-is-slow/&quot;&gt;&quot;Why Python Is Slow&quot;&lt;/a&gt; is a quick read on Python&apos;s dynamic typing. I had not known that it was possible to change the value of an integer constant in Python.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tangaroa&amp;ditemid=79000&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tangaroa.dreamwidth.org/79000.html</comments>
  <category>python</category>
  <category>programming</category>
  <category>computers</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tangaroa.dreamwidth.org/72161.html</guid>
  <pubDate>Wed, 09 Apr 2014 03:43:49 GMT</pubDate>
  <title>Proprietary Value Decomposition</title>
  <link>https://tangaroa.dreamwidth.org/72161.html</link>
  <description>&lt;p&gt;Math has a concept called &lt;a href=&quot;https://en.wikipedia.org/wiki/Singular_value_decomposition&quot;&gt;singular value decomposition&lt;/a&gt;. The short version is that you put in one matrix and get three out. This apparently being a well known concept in engineering, it is implemented in the data analysis language &lt;a href=&quot;http://www.exelisvis.com/docs/SVDC.html&quot;&gt;IDL&lt;/a&gt; and in the &lt;a href=&quot;http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.svd.html&quot;&gt;NumPY&lt;/a&gt; library for Python, and you can probably guess where this is going. The singular value decomposition functions in IDL and NumPy produce different matrices for the same input matrix.

&lt;ul&gt;
&lt;li&gt;All three output matrices have their columns swapped.
&lt;li&gt;One of the columns in the &apos;u&apos; matrix is the negative of the matching column in the other language. 
&lt;li&gt;One of the rows in the &apos;v&apos; matrix is the negative of the matching row in the other language. 
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;I&apos;ve only tested one chunk of data, so I do not know if the pattern will hold for different input matrices.&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tangaroa&amp;ditemid=72161&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tangaroa.dreamwidth.org/72161.html</comments>
  <category>numpy</category>
  <category>idl</category>
  <category>programming</category>
  <category>python</category>
  <category>computers</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tangaroa.dreamwidth.org/69279.html</guid>
  <pubDate>Sun, 23 Mar 2014 13:44:38 GMT</pubDate>
  <title>Obscure bug of the nonce</title>
  <link>https://tangaroa.dreamwidth.org/69279.html</link>
  <description>Python easy_install on Windows sometimes fails with a UnicodeDecodeError:

&lt;blockquote&gt;
UnicodeDecodeError: &apos;ascii&apos; codec can&apos;t decode byte 0xc3 in position 6034: ordinal not in range(128)
&lt;/blockquote&gt;

&lt;a href=&quot;http://stackoverflow.com/questions/19536068/mitmproxy-installation-by-the-python-setuptools-easy-install-got-error-decoding&quot;&gt;The solution is to comment out the &lt;code&gt;config = config.decode(&apos;ascii&apos;)&lt;/code&gt; line in Lib/site-packages/setuptools/easy_install.py&lt;/a&gt;.

&lt;hr /&gt;

&lt;p&gt;Here&apos;s an even more fun one: 

&lt;blockquote&gt;&lt;pre&gt;
  File &quot;geopts.py&quot;, line 128, in xp2str
    s = etree.tostring(resultset[0], method=&quot;text&quot;)
  File &quot;lxml.etree.pyx&quot;, line 3165, in lxml.etree.tostring (src\lxml\lxml.etree.
c:69399)

exceptions.TypeError: Type &apos;_ElementStringResult&apos; cannot be serialized.
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;This says that the XML library&apos;s own tostring() function cannot convert one of its own string types to a string. What&apos;s especially brilliant about this is that &lt;a href=&quot;http://lxml.de/2.1/api/lxml.etree._ElementStringResult-class.html&quot;&gt;_ElementStringResult inherits from the native string class&lt;/a&gt;. 

&lt;p&gt;Here is a hacky attempt to manage the problem:

&lt;blockquote&gt;&lt;pre&gt;
r = resultset[0]
if isinstance(r, etree._ElementStringResult):
    s = r
else:
    s = etree.tostring(r, method=&quot;text&quot;)

&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tangaroa&amp;ditemid=69279&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tangaroa.dreamwidth.org/69279.html</comments>
  <category>debugging</category>
  <category>computers</category>
  <category>i18n</category>
  <category>python</category>
  <category>programming</category>
  <category>xml</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tangaroa.dreamwidth.org/68628.html</guid>
  <pubDate>Wed, 19 Mar 2014 00:31:13 GMT</pubDate>
  <title>easy_fail_to_install</title>
  <link>https://tangaroa.dreamwidth.org/68628.html</link>
  <description>This is only my opinion fwiw, but library/add-on packages for a high-level scripting language should not require a C compiler, any version of Visual Studio, or any development environment for any different lower-level language.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tangaroa&amp;ditemid=68628&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tangaroa.dreamwidth.org/68628.html</comments>
  <category>computers</category>
  <category>python</category>
  <category>programming</category>
  <category>windows</category>
  <category>perl</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tangaroa.dreamwidth.org/18218.html</guid>
  <pubDate>Fri, 31 Aug 2012 07:12:31 GMT</pubDate>
  <title>Scrap dump: Key handling in PyGame</title>
  <link>https://tangaroa.dreamwidth.org/18218.html</link>
  <description>&lt;p&gt;Some notes on keypress handling in Python&apos;s PyGame library, from about seven years ago: 

&lt;span class=&quot;cut-wrapper&quot;&gt;&lt;span style=&quot;display: none;&quot; id=&quot;span-cuttag___1&quot; class=&quot;cuttag&quot;&gt;&lt;/span&gt;&lt;b class=&quot;cut-open&quot;&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class=&quot;cut-text&quot;&gt;&lt;a href=&quot;https://tangaroa.dreamwidth.org/18218.html#cutid1&quot;&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;b class=&quot;cut-close&quot;&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;display: none;&quot; id=&quot;div-cuttag___1&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tangaroa&amp;ditemid=18218&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tangaroa.dreamwidth.org/18218.html</comments>
  <category>computers</category>
  <category>video games</category>
  <category>python</category>
  <category>programming</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
