<?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/"
	>

<channel>
	<title>crickets in peril</title>
	<atom:link href="http://cricketsinperil.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cricketsinperil.com</link>
	<description>computer magic et cetera</description>
	<pubDate>Wed, 02 Jul 2008 04:10:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stricter validation for Rails attachment_fu plugin</title>
		<link>http://cricketsinperil.com/2008/01/31/stricter-validation-for-rails-attachment_fu-plugin/</link>
		<comments>http://cricketsinperil.com/2008/01/31/stricter-validation-for-rails-attachment_fu-plugin/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 16:25:20 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[attachment_fu]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2008/01/31/stricter-validation-for-rails-attachment_fu-plugin/</guid>
		<description><![CDATA[I came across a little snag while using Rick Olson&#8217;s excellent attachment_fu plugin to resize images via ImageScience.  The problem is that ImageScience version 1.1.3 gets very unhappy when asked to resize a file that isn&#8217;t an image.  As mentioned here, if you pass ImageScience a simple ASCII text file, it will unceremoniously [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a little snag while using <a href="http://techno-weenie.net/">Rick Olson&#8217;s</a> excellent <a href="http://clarkware.com/cgi/blosxom/2007/02/24">attachment_fu</a> plugin to resize images via <a href="http://seattlerb.rubyforge.org/ImageScience.html">ImageScience</a>.  The problem is that ImageScience version 1.1.3 gets very unhappy when asked to resize a file that isn&#8217;t an image.  As mentioned <a href="http://www.spacebabies.nl/2007/10/19/rails-terminate-called-after-throwing-an-instance-of-int/">here</a>, if you pass ImageScience a simple ASCII text file, it will unceremoniously abort your Ruby process, dumping the cryptic message &#8220;terminate called after throwing an instance of ‘int’.&#8221;</p>
<p>I stumbled on this behavior in a unit test, but a user could get it by uploading a text file with an image extension (e.g. JPG).  Right now attachment_fu does check that an uploaded file is of a certain MIME type, but it uses the MIME type reported by the CGI module to do so.  Presumably CGI is only looking at the filename&#8217;s extension, so it&#8217;s quite easy to dupe.</p>
<p>I didn&#8217;t feel like having to switch back to RMagick for image processing (eyes bleeding installation, arcane configuration, memory leaks, etc), so I added a little stricter content type validation to attachment_fu.  The patch uses the Unix <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?file">file</a> command to actually sniff the uploaded file&#8217;s starting bits and ensure it&#8217;s really one of the allowed content types.  Couldn&#8217;t think of a good way to do this cross-platform, but if anyone has suggestions let me know.</p>
<p>The patch is <a href="http://cricketsinperil.com/wp-content/uploads/2008/01/attachment_fu-strict_content_type_validation.patch">here</a> if you want it.  To turn on strict validation, add the following to your has_attachment call:</p>
<blockquote><p>:content_type_validation =&gt; true</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2008/01/31/stricter-validation-for-rails-attachment_fu-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>more from the geek humor dept</title>
		<link>http://cricketsinperil.com/2008/01/25/more-from-the-geek-humor-dept/</link>
		<comments>http://cricketsinperil.com/2008/01/25/more-from-the-geek-humor-dept/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 03:45:34 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[geek]]></category>

		<category><![CDATA[humor]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[star_wars]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2008/01/25/more-from-the-geek-humor-dept/</guid>
		<description><![CDATA[From Code Like a Pythonista: Idiomatic Python, an excellent introduction to python idiom:

from module import *
You&#8217;ve probably seen this &#8220;wild card&#8221; form of the import statement. You may even like it. Don&#8217;t use it.
To paraphrase a well-known exchange:
(Exterior Dagobah, jungle, swamp, and mist.)
LUKE: Is from module import * better than explicit imports?
YODA: No, not better. [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html">Code Like a Pythonista: Idiomatic Python</a>, an excellent introduction to python idiom:</p>
<blockquote>
<pre>from module import *</pre>
<p>You&#8217;ve probably seen this &#8220;wild card&#8221; form of the import statement. You may even like it. Don&#8217;t use it.</p>
<p>To paraphrase a well-known exchange:</p>
<p>(Exterior Dagobah, jungle, swamp, and mist.)</p>
<p>LUKE: Is from module import * better than explicit imports?<br />
YODA: No, not better. Quicker, easier, more seductive.<br />
LUKE: But how will I know why explicit imports are better than the wild-card form?<br />
YODA: Know you will when your code you try to read six months from now.</p></blockquote>
<p>Oh dear.</p>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2008/01/25/more-from-the-geek-humor-dept/feed/</wfw:commentRss>
		</item>
		<item>
		<title>new machine profiles at amazon ec2</title>
		<link>http://cricketsinperil.com/2007/12/22/new-machine-profiles-at-amazon-ec2/</link>
		<comments>http://cricketsinperil.com/2007/12/22/new-machine-profiles-at-amazon-ec2/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 22:51:50 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[amazon]]></category>

		<category><![CDATA[ec2]]></category>

		<category><![CDATA[hardware]]></category>

		<category><![CDATA[memcached]]></category>

		<category><![CDATA[memory]]></category>

		<category><![CDATA[solr]]></category>

		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2007/12/22/new-machine-profiles-at-amazon-ec2/</guid>
		<description><![CDATA[We&#8217;re targeting amazon&#8217;s amazing ec2 service to host our alpha.  Computing in the cloud is great for us &#8212; no installation/maintenance hassles, elastic expansibility as we need to scale, ability to create peripheral instances (such as staging) on the fly and turn them off when we&#8217;re done.
However, I was a bit worried about how [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re targeting amazon&#8217;s amazing <a href="http://www.amazon.com/gp/browse.html?node=201590011">ec2 </a>service to host our alpha.  Computing in the cloud is great for us &#8212; no installation/maintenance hassles, elastic expansibility as we need to scale, ability to create peripheral instances (such as staging) on the fly and turn them off when we&#8217;re done.</p>
<p>However, I was a bit worried about how the slim machine profile (1.7 G RAM, single processor) would fare for database and <a href="http://lucene.apache.org/solr/">solr</a> work.  Fortunately, I just discovered that they&#8217;ve released new machine profiles with higher RAM, more processor cores, and more, faster storage.  Rad.  These folks know what&#8217;s up, and make it ever easier to run a startup.</p>
<p>Now I just need a solid memcached/web server machine profile (low CPU, high RAM, low storage) that shoots the gap between the small (0.10/hr) and the medium (0.40/hr).  Something like 2 cores and 4-8 GB of RAM would be nice.  Wonder how long it is before these specs themselves become configurable?</p>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2007/12/22/new-machine-profiles-at-amazon-ec2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>reading your code</title>
		<link>http://cricketsinperil.com/2007/11/14/reading-your-code/</link>
		<comments>http://cricketsinperil.com/2007/11/14/reading-your-code/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 08:01:05 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2007/11/14/reading-your-code/</guid>
		<description><![CDATA[Reading code can be more difficult than writing it.   Coding Horror quoting Stan Kelley-Bootle&#8217;s book &#8220;The Devil&#8217;s Dp Dictionary&#8221;:
your program (n): a maze of non-sequiturs littered with clever-clever tricks and irrelevant comments. Compare MY PROGRAM.
my program (n): a gem of algorithmic precision, offering the most sublime balance between compact, efficient coding on the one hand, [...]]]></description>
			<content:encoded><![CDATA[<p>Reading code can be more difficult than writing it.   <a href="http://www.codinghorror.com/blog/archives/000992.html">Coding Horror</a> quoting Stan Kelley-Bootle&#8217;s book &#8220;The Devil&#8217;s Dp Dictionary&#8221;:</p>
<blockquote><p><em><strong>your program</strong></em> (n): a maze of non-sequiturs littered with clever-clever tricks and irrelevant comments. Compare <em>MY PROGRAM</em>.</p>
<p><em><strong>my program</strong></em> (n): a gem of algorithmic precision, offering the most sublime balance between compact, efficient coding on the one hand, and fully commented legibility for posterity on the other. Compare <em>YOUR PROGRAM</em>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2007/11/14/reading-your-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>solr rocks</title>
		<link>http://cricketsinperil.com/2007/11/14/solr-rocks/</link>
		<comments>http://cricketsinperil.com/2007/11/14/solr-rocks/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 07:46:59 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[search]]></category>

		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2007/11/14/solr-rocks/</guid>
		<description><![CDATA[If you want to add search to your site, I highly recommend solr, a search server that builds on the lucene java information retrieval library.  It does many powerful things out of the box&#8211;faceted search, highlighting,  caching, etc&#8211;and the community around it is stellar.  Plus it plays nice with ruby and python, [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to add search to your site, I highly recommend <a href="http://lucene.apache.org/solr/">solr</a>, a search server that builds on the <a href="http://lucene.apache.org/java/docs/">lucene java</a> information retrieval library.  It does many powerful things out of the box&#8211;<a href="http://people.apache.org/~hossman/apachecon2006us/faceted-searching-with-solr.pdf">faceted search</a>, highlighting,  caching, etc&#8211;and the community around it is stellar.  Plus it plays nice with ruby and python, giving you eval-ready output formats for both languages.</p>
<p>Over at the <a href="http://rooftophq.com/">Rooftop Collective</a> I&#8217;ve been hacking together some fun stuff on top it, adding local search and social search to the mix.  After working w/ the code for a while, a couple things I really like about solr:</p>
<ul>
<li><a href="http://wiki.apache.org/solr/SchemaXml#head-82dba16404c8e3318021320638b669b3a6d780d0">dynamic fields</a>:  This is sweet.  You specify a wildcard pattern (say &#8216;*_f &#8216;), associate a type with it (say, float) and then can define a new field on the fly as you&#8217;re indexing a document (say, my_field_f).  This is far more flexibility than I&#8217;ve ever seen a database provide, particularly at runtime.  In practice, it lets you describe and search your data in ways that evolve as the application runs.</li>
<li><a href="http://wiki.apache.org/solr/FunctionQuery">function queries</a>: <a href="http://www.joelonsoftware.com/items/2006/08/01.html">functional programming</a> sneaks into Java.  You can create and compose arbitrary functions that run on your data set, mainly for sorting, but also for displaying calculations (like distance from a point).</li>
</ul>
<p>Messing w/ solr also reminded me that I still don&#8217;t like hacking Java.  Don&#8217;t like the verbosity.  Don&#8217;t need the type safety&#8211;I can think clearly and write unit tests instead, thanks.  Also, miss the built-in looping constructs from ruby.  Also, miss the built-in fixtures from Rails.  Don&#8217;t, however, miss the under-documented APIs from Ruby or Rails.  Though it&#8217;s always fun to skim through random blog posts to figure out just what frob.foo() is really up to, why my computer spits fire when I call it, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2007/11/14/solr-rocks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>*feed* by m.t. anderson</title>
		<link>http://cricketsinperil.com/2007/11/11/feed-by-mt-anderson/</link>
		<comments>http://cricketsinperil.com/2007/11/11/feed-by-mt-anderson/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 20:13:15 +0000</pubDate>
		<dc:creator>ddaniels</dc:creator>
		
		<category><![CDATA[advertising]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://cricketsinperil.com/2007/11/11/feed-by-mt-anderson/</guid>
		<description><![CDATA[Very powerful, very well-written, very dark.I would have like a more hopeful ending.  It took me a day to get over the feeling I closed the book with.  While disintegration of humanity is memorable and powerful, it&#8217;s also irresponsible to leave it in shambles with no hope.
Feed made me think a lot about [...]]]></description>
			<content:encoded><![CDATA[<p>Very powerful, very well-written, very dark.I would have like a more hopeful ending.  It took me a day to get over the feeling I closed the book with.  While disintegration of humanity is memorable and powerful, it&#8217;s also irresponsible to leave it in shambles with no hope.</p>
<p>Feed made me think a lot about facebook.  In some ways it&#8217;s different than Anderson imagined it&#8211;up until now, we&#8217;ve mainly been broadcasting to ourselves instead of the companies broadcasting to us.  True, the structure of our messages is controlled, steering our thoughts toward easily consumable, re-displayable sound bites, but that&#8217;s a general trend in online culture (aside from blogs).</p>
<p>Now though, with last week&#8217;s launch of the facebook social ad program, facebook takes an eerie turn toward the structures in anderson&#8217;s book.  You (supposedly) tell facebook the things you consume, the bands/brands (their merger, clever folks they are) you like, and then facebook crafts advertisements for both you and your friends that are specifically tailored to these preferences.</p>
<p>This is presented as a service. No, <a href="http://blog.facebook.com/blog.php?post=6972252130">really</a>.  I mean, I get it&#8211;advertisements are a semi-necessary evil to support media services.  I may need to use them to support the service I&#8217;m building too (sigh).  But how creepy of facebook to pretend that we should like them, that we should be happy when they pin us to a demographic more accurately.</p>
<p>And the part about crafting advertisements for you based on what your friends bought?  Creepy.  I mean, is this the 50s?  Are we all keeping up with the Jones, lusting after the goods our neighbors own?   Sure, maybe it&#8217;ll work, but as the great stoop-side philosopher Arash Pessian once observed, &#8220;Does it make the sort of world you want to live in?&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://cricketsinperil.com/2007/11/11/feed-by-mt-anderson/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
