<?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>blueslugs.com</title> <atom:link href="http://blueslugs.com/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://blueslugs.com/wordpress</link> <description>Observations from a West Coast family</description> <lastBuildDate>Fri, 30 Jul 2010 00:07:54 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Bookmarks for 1 July through 19 July</title><link>http://blueslugs.com/wordpress/2010/07/19/bookmarks-for-1-july-through-19-july/</link> <comments>http://blueslugs.com/wordpress/2010/07/19/bookmarks-for-1-july-through-19-july/#comments</comments> <pubDate>Mon, 19 Jul 2010 19:01:14 +0000</pubDate> <dc:creator>Stephen</dc:creator> <category><![CDATA[Bookmarks]]></category><guid
isPermaLink="false">http://blueslugs.com/wordpress/?p=31614</guid> <description><![CDATA[3 shell scripts: Kill weasel words, avoid the passive, eliminate duplicates &#8211; &#34;So, I&#039;ve decided to replace myself with a shell script. In particular, I&#039;ve created shell scripts for catching three problems: the passive voice, weasel words, and&#60;br /&#62; lexical illusions.&#34; [0811.0113] A Bayesian Framework for Opinion Updates &#8211; &#34;Opinion Dynamics lacks a theoretical basis. [...]]]></description> <content:encoded><![CDATA[<ul><li><a
href="http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/">3 shell scripts: Kill weasel words, avoid the passive, eliminate duplicates</a> &#8211; &quot;So, I&#039;ve decided to replace myself with a shell script. In particular, I&#039;ve created shell scripts for catching three problems: the passive voice, weasel words, and&lt;br /&gt;
lexical illusions.&quot;</li><li><a
href="http://arxiv.org/abs/0811.0113">[0811.0113] A Bayesian Framework for Opinion Updates</a> &#8211; &quot;Opinion Dynamics lacks a theoretical basis. In this article, I propose to use a decision-theoretic framework, based on the updating of subjective probabilities, as that basis. We will see we get a basic tool for a better understanding of the interaction between the agents in Opinion Dynamics problems and for creating new models.&quot;</li><li><a
href="http://www.texotela.co.uk/code/jquery/newsticker/">TexoTela jQuery &#8211; newsticker</a> &#8211; A fade-in/fade-out newsticker for jQuery.</li><li><a
href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html">jQuery liScroll &#8211; a jQuery News Ticker</a> &#8211; &quot;liScroll is a jQuery plugin that transforms any given unordered list into a scrolling News Ticker.&quot;</li><li><a
href="http://en.wikipedia.org/wiki/Taguchi_methods">Taguchi methods &#8211; Wikipedia, the free encyclopedia</a> &#8211; &quot;Taguchi methods are statistical methods developed by Genichi Taguchi to improve the quality of manufactured goods, and more recently also applied to, engineering, biotechnology, marketing and advertising.&quot;</li></ul> <img
src="http://blueslugs.com/wordpress/?ak_action=api_record_view&id=31614&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://blueslugs.com/wordpress/2010/07/19/bookmarks-for-1-july-through-19-july/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bookmarks for 8 June through 29 June</title><link>http://blueslugs.com/wordpress/2010/06/29/bookmarks-for-8-june-through-29-june/</link> <comments>http://blueslugs.com/wordpress/2010/06/29/bookmarks-for-8-june-through-29-june/#comments</comments> <pubDate>Wed, 30 Jun 2010 04:02:31 +0000</pubDate> <dc:creator>Stephen</dc:creator> <category><![CDATA[Bookmarks]]></category><guid
isPermaLink="false">http://blueslugs.com/wordpress/?p=31581</guid> <description><![CDATA[[1006.5169] Hyperbolic Geometry of Complex Networks &#8211; Interesting. Learning about Network Theory &#8211; A brief introduction, with links to resources. NetworkX v1.1 &#8211; &#34;NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.&#34; [1006.1786] Measuring Meaning on the World-Wide Web &#8211; A brief paper exploring [...]]]></description> <content:encoded><![CDATA[<ul><li><a
href="http://arxiv.org/abs/1006.5169">[1006.5169] Hyperbolic Geometry of Complex Networks</a> &#8211; Interesting.</li><li><a
href="http://measuringmeasures.com/blog/2010/6/9/learning-about-network-theory.html">Learning about Network Theory</a> &#8211; A brief introduction, with links to resources.</li><li><a
href="http://networkx.lanl.gov/">NetworkX v1.1</a> &#8211; &quot;NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.&quot;</li><li><a
href="http://arxiv.org/abs/1006.1786">[1006.1786] Measuring Meaning on the World-Wide Web</a> &#8211; A brief paper exploring word-word correlations on the Web, with some interesting specific examples.</li><li><a
href="http://arxiv.org/abs/1006.1231">[1006.1231] On the Insertion Time of Cuckoo Hashing</a> &#8211; &quot;Cuckoo hashing is an efficient technique for creating large hash tables with high space utilization and guaranteed constant access times. There, each item can be placed in a location given by any one out of k different hash functions.&quot;</li></ul> <img
src="http://blueslugs.com/wordpress/?ak_action=api_record_view&id=31581&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://blueslugs.com/wordpress/2010/06/29/bookmarks-for-8-june-through-29-june/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>adirent.[ch]: Adding d_type to struct dirent on OpenSolaris</title><link>http://blueslugs.com/wordpress/2010/06/13/adirent-ch-adding-d_type-to-struct-dirent-on-opensolaris/</link> <comments>http://blueslugs.com/wordpress/2010/06/13/adirent-ch-adding-d_type-to-struct-dirent-on-opensolaris/#comments</comments> <pubDate>Mon, 14 Jun 2010 02:47:47 +0000</pubDate> <dc:creator>Stephen</dc:creator> <category><![CDATA[Software]]></category> <category><![CDATA[opensolaris]]></category><guid
isPermaLink="false">http://blueslugs.com/wordpress/?p=31588</guid> <description><![CDATA[An occasional porting problem you may encounter when compiling programs for OpenSolaris is the absence of d_type in the directory entry structure returned by readdir(3C). I hit this issue when experimenting with mu as a search solution for my accumulated email. A trivial example of the failure you might see would be caused by the [...]]]></description> <content:encoded><![CDATA[<p>An occasional porting problem you may encounter when compiling programs for OpenSolaris is the absence of <code>d_type</code> in the directory entry structure returned by <code>readdir</code>(3C).  I  hit this issue when experimenting with <a
href="http://www.djcbsoftware.nl/code/mu/">mu</a> as a search solution for my accumulated email.</p><p>A trivial example of the failure you might see would be caused by the following program:</p><pre><code>#include &lt;sys/types.h&gt;
#include &lt;dirent.h&gt;
#include &lt;err.h&gt;
#include &lt;stdio.h&gt;

int
main(int argc, char *argv[])
{
        DIR *d;
        struct dirent *e;

        if ((d = opendir("/")) == NULL)
                err(1, "opendir failed");

        for (e = readdir(d); e != NULL; e = readdir(d)) {
                    if (e-&gt;d_type != DT_UNKNOWN)
                        (void) printf("recognized filetype for '%s'\n",
                            e-&gt;d_name);
        }

        (void) closedir(d);

        return (0);
 }
</code></pre><p>When we attempt to compile this program with <code>gcc</code>, we get something like</p><pre><code>$ gcc a.c
a.c: In function `main':
a.c:16: error: structure has no member named `d_type'
a.c:16: error: `DT_UNKNOWN' undeclared (first use in this function)
a.c:16: error: (Each undeclared identifier is reported only once
a.c:16: error: for each function it appears in.)
</code></pre><p>Studio <code>cc</code> will give similar output:</p><pre><code>$ /opt/SunStudioExpress/bin/cc a.c
"a.c", line 16: undefined struct/union member: d_type
"a.c", line 16: undefined symbol: DT_UNKNOWN
cc: acomp failed for a.c
</code></pre><p>The addition of <code>d_type</code> to <code>struct dirent</code> came first for the BSD Unixes and was later added to Linux.  Because it&#8217;s not easy to add members to well-known structures and preserve binary compatibility, OpenSolaris and Solaris lack this field, as well as the <code>DT_*</code> constant definitions.  (If <code>d_type</code> were to become part of the Unix standards, Solaris would likely have to introduce a second family of <code>opendir()</code>/<code>readdir()</code>/<code>closedir()</code> functions and a second version of the structure, similar to how large files were introduced for 32-bit programs.)</p><p>Because we fail at compilation time, our workaround has to modify either the program&#8217;s source code or its build environment.  (Preloading is too late.)  It&#8217;s probably possible to combine a few definitions and a shared object that we include via <code>LD_PRELOAD</code> but it seems easier to just provide a C wrapper around <code>readdir</code>(3C) and an alternate <code>struct dirent</code>.  We develop this approach in the next section.</p><h2><code>DIRENT</code> and <code>READDIR</code></h2><p>The approach we take is</p><ol><li>Introduce <code>DIRENT</code> and <code>READDIR</code> via <code>adirent.h</code>.</li><li>Change the source program such that each call to <code>readdir()</code> is replaced by <code>READDIR()</code> and each use of <code>struct dirent</code> is replaced by <code>DIRENT</code>.  In each file so modified, add a <code>#include &lt;adirent.h&gt;</code>.</li><li>Compile adirent.c via <code>gcc -I. -O2 -c adirent.c</code> or equivalent.</li><li>Add <code>adirent.o</code> to the link line for each binary that includes one of the files modified in step 2.</li></ol><p>If we apply these steps to our example above, we get</p><pre><code>#include &lt;sys/types.h&gt;
#include &lt;adirent.h&gt;
#include &lt;err.h&gt;
#include &lt;stdio.h&gt;

int
main(int argc, char *argv[])
{
        DIR *d;
        DIRENT *e;

        if ((d = opendir("/")) == NULL)
                err(1, "opendir failed");

        for (e = READDIR(d); e != NULL; e = READDIR(d)) {
                    if (e-&gt;d_type != DT_UNKNOWN)
                        (void) printf("recognized filetype for '%s'\n",
                            e-&gt;d_name);
        }

        (void) closedir(d);

        return (0);
 }
</code></pre><p>with the result that compilation and execution now work</p><pre><code>$ gcc -O2 -I. -c adirent.c
$ gcc -I. a.c adirent.o
$ ./a.out
</code></pre><p>This shim function and definitions should be sufficient for most ports around this incompatibility, but there are some additional comments worth making.</p><p><em>Performance.</em> Because many programs expect <code>d_type</code> to be one of <code>DT_REG</code> or <code>DT_DIR</code> to save on a <code>stat</code>(2) call, this shim will force those programs into an alleged &#8220;slow&#8221; path.  The actual impact of returning <code>DT_UNKNOWN</code> on every call will be program- and situation-dependent; it didn&#8217;t seem to affect my mail indexing.</p><p><em>Multithreaded programs.</em> The current implementation does not protect the static structure defined in <code>adirent.c</code>.  Programs with multiple threads performing <code>readdir</code>(3C) calls through <code>READDIR()</code> will get unexpected results.  It should be relatively straightforward to dynamically allocate one <code>struct adirent</code> for each thread coming through <code>READDIR()</code> for the first time.</p><h2>Downloads</h2><p>I suppose these should be in a repository on Bitbucket or GitHub.  For now, they&#8217;re just simple downloads:</p><ul><li><a
href="http://blueslugs.com/~sch/adirent/adirent.c" title="Function implementation">adirent.c</a></li><li><a
href="http://blueslugs.com/~sch/adirent/adirent.h" title="Header definitions">adirent.h</a></li></ul><h2>Acknowledgments</h2><p>I discussed this problem with <a
href="http://blogs.sun.com/dp">Dan</a>, who in particular noted that <code>DT_UNKNOWN</code> was always a legal return value for <code>d_type</code>. <a
href="http://blogs.sun.com/barts">Bart</a> looked over my shoulder and spied at least one error during the debugging phase.</p> <img
src="http://blueslugs.com/wordpress/?ak_action=api_record_view&id=31588&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://blueslugs.com/wordpress/2010/06/13/adirent-ch-adding-d_type-to-struct-dirent-on-opensolaris/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A cruise for World Oceans Day</title><link>http://blueslugs.com/wordpress/2010/06/12/a-cruise-for-world-oceans-day/</link> <comments>http://blueslugs.com/wordpress/2010/06/12/a-cruise-for-world-oceans-day/#comments</comments> <pubDate>Sun, 13 Jun 2010 05:44:15 +0000</pubDate> <dc:creator>Stephen</dc:creator> <category><![CDATA[Family]]></category> <category><![CDATA[Peninsula]]></category> <category><![CDATA[Photo]]></category><guid
isPermaLink="false">http://blueslugs.com/wordpress/2010/06/12/a-cruise-for-world-oceans-day/</guid> <description><![CDATA[We went on the Marine Science Institute&#8216;s cruise today, which was in part to celebrate World Oceans Day 2010. Part of the cruise involved sampling the bay floor and a short trawl with a net. (All animals caught are returned to the bay later in the day.) Ben got to hold a juvenile leopard shark.]]></description> <content:encoded><![CDATA[<p><a
href="http://www.flickr.com/photos/schahn/4695196952/" title="photo sharing"><img
src="http://farm5.static.flickr.com/4069/4695196952_272cb6d3d8_m.jpg" alt="" style="border: solid 0px #000000;" /></a> <br
clear="all" /></p><p>We went on the <a
href="http://www.sfbaymsi.org/">Marine Science Institute</a>&#8216;s cruise today, which was in part to celebrate <a
href="http://en.wikipedia.org/wiki/World_Oceans_Day">World Oceans Day 2010</a>.  Part of the cruise involved sampling the bay floor and a short trawl with a net.  (All animals caught are returned to the bay later in the day.)  Ben got to hold a juvenile leopard shark.</p> <img
src="http://blueslugs.com/wordpress/?ak_action=api_record_view&id=31584&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://blueslugs.com/wordpress/2010/06/12/a-cruise-for-world-oceans-day/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bookmarks for 18 May through 2 June</title><link>http://blueslugs.com/wordpress/2010/06/02/bookmarks-for-18-may-through-2-june/</link> <comments>http://blueslugs.com/wordpress/2010/06/02/bookmarks-for-18-may-through-2-june/#comments</comments> <pubDate>Wed, 02 Jun 2010 16:03:57 +0000</pubDate> <dc:creator>Stephen</dc:creator> <category><![CDATA[Bookmarks]]></category><guid
isPermaLink="false">http://blueslugs.com/wordpress/?p=31412</guid> <description><![CDATA[[1006.0200] The 1958 Pekeris-Accad-WEIZAC Ground-Breaking Collaboration that computed Ground States of Two-Electron Atoms (and its 2010 Redux) &#8211; Koutschan and Zeilberger examine and &#34;re-enact&#34; Pekeris&#39;s 1958 calculation of the ground state of the two-electron atom. Dictionary of Algorithms and Data Structures &#8211; &#34;This is a dictionary of algorithms, algorithmic techniques, data structures, archetypal problems, and [...]]]></description> <content:encoded><![CDATA[<ul><li><a
href="http://arxiv.org/abs/1006.0200">[1006.0200] The 1958 Pekeris-Accad-WEIZAC Ground-Breaking Collaboration that computed Ground States of Two-Electron Atoms (and its 2010 Redux)</a> &#8211; Koutschan and Zeilberger examine and &quot;re-enact&quot; Pekeris&#39;s 1958 calculation of the ground state of the two-electron atom.</li><li><a
href="http://www.itl.nist.gov/div897/sqg/dads/">Dictionary of Algorithms and Data Structures</a> &#8211; &quot;This is a dictionary of algorithms, algorithmic techniques, data structures, archetypal problems, and related definitions.&quot;  Hosted at NIST.</li><li><a
href="https://www.ohloh.net/p/pkg5">pkg(5) on ohloh.net</a> &#8211; pkg(5)&#39;s repository is now mirrored at genunix.org, so we have ohloh&#39;s code and commit analysis.  I&#39;ll never catch any of those guys.</li><li><a
href="http://developer.yahoo.net/blogs/hadoop/2010/05/towards_enterpriseclass_compat.html?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+YDNHadoop+%28Hadoop+and+Distributed+Computing+at+Yahoo%21%29&amp;utm_content=Google+Reader">Towards Enterprise-Class Compatibility for Apache Hadoop (Hadoop and Distributed Computing at Yahoo!)</a> &#8211; The Yahoo! Hadoop team has classified the Hadoop interfaces, using a taxonomy derived from the OpenSolaris ARC interface taxonomy.</li><li><a
href="http://queue.acm.org/detail.cfm?id=1506423">Eric Schrock, Debugging AJAX in production &#8211; ACM Queue</a> &#8211; I missed this article last year, but Eric&#39;s written a nice essay with some example code for improving the debuggability of AJAX applications.</li></ul> <img
src="http://blueslugs.com/wordpress/?ak_action=api_record_view&id=31412&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://blueslugs.com/wordpress/2010/06/02/bookmarks-for-18-may-through-2-june/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)

Served from: blueslugs.com @ 2010-09-03 20:42:47 -->