<?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>Unterbahn &#187; code</title>
	<atom:link href="http://unterbahn.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://unterbahn.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 17:26:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Object.hasOwnProperty() in JavaScript</title>
		<link>http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/</link>
		<comments>http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 21:27:33 +0000</pubDate>
		<dc:creator>Jeffrey Warren</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://unterbahn.com/?p=1564</guid>
		<description><![CDATA[On StackOverflow, user Pablo Cabrera points out: As slashnick pointed out, you can use the &#8220;for in&#8221; construct to iterate over an object for its attribute names. However you&#8217;ll be iterating over all attribute names in the object&#8217;s prototype chain. If you want to iterate only over the object&#8217;s own attributes, you can make use [...]]]></description>
			<content:encoded><![CDATA[<p>On <a href="http://stackoverflow.com/questions/208016/how-to-list-the-properties-of-a-javascript-object">StackOverflow</a>, user Pablo Cabrera points out:</p>
<blockquote><p>As slashnick pointed out, you can use the &#8220;for in&#8221; construct to iterate over an object for its attribute names. However you&#8217;ll be iterating over all attribute names in the object&#8217;s prototype chain. If you want to iterate only over the object&#8217;s own attributes, you can make use of the Object#hasOwnProperty() method. Thus having the following.</p>
<p>for (var key in obj) {<br />
    if (obj.hasOwnProperty(key)) {<br />
        /* useful code here */<br />
    }<br />
}
</p></blockquote>
<p>Wish I&#8217;d known of that a year ago.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://unterbahn.com/2010/04/ruby-singleton-classes-explained/" rel="bookmark" class="crp_title">Ruby singleton classes explained</a></li><li><a href="http://unterbahn.com/2010/01/tidying-up-cartagen-a-bit-with-tips-from-dev-opera-com/" rel="bookmark" class="crp_title">Tidying up Cartagen a bit with tips from dev.opera.com</a></li><li><a href="http://unterbahn.com/2008/08/%e2%80%9cif-it-walks-like-a-duck-and-quacks-like-a-duck-i-would-call-it-a-duck%e2%80%9d-%e2%80%94-james/" rel="bookmark" class="crp_title">&#8220;“If it walks like a duck and quacks like a duck, I would call it a duck.” — James&#8230;&#8221;</a></li><li><a href="http://unterbahn.com/2009/04/manhattan-mapped-in-cartagen-htmljavascript-with-gss/" rel="bookmark" class="crp_title">Manhattan mapped in Cartagen html/javascript with gss</a></li><li><a href="http://unterbahn.com/2011/10/christopher-schmidt-there-isnt-one-map-of-the-world/" rel="bookmark" class="crp_title">Christopher Schmidt: &#8220;There isn&#8217;t one map of the world&#8221;</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Need for a scene graph in Canvas</title>
		<link>http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/</link>
		<comments>http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:54:01 +0000</pubDate>
		<dc:creator>Jeffrey Warren</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://unterbahn.com/?p=1399</guid>
		<description><![CDATA[Samuli Kaipiainen and Matti Paksula from the University of Helsinki Department of Computer Science wrote a great overview of SVG and Canvas performance issues. The above summarizes some of their thoughts specifically about the need for a scene graph, something I&#8217;ve wished for (esp. in regard to WebGL). Read more And I&#8217;m not just putting [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://unterbahn.com/wp-content/uploads/2010/04/camima.png"><img src="http://unterbahn.com/wp-content/uploads/2010/04/camima.png" alt="" title="camima" width="500" height="285" class="alignnone size-full wp-image-1400" /></a></p>
<p>Samuli Kaipiainen and Matti Paksula from the University of Helsinki Department of Computer Science wrote a great overview of SVG and Canvas performance issues. The above summarizes some of their thoughts specifically about the need for a scene graph, something I&#8217;ve wished for (esp. in regard to WebGL).</p>
<p><a href="http://svgopen.org/2009/papers/54-SVG_vs_Canvas_on_Trivial_Drawing_Application/#need_for_scene_graph">Read more</a></p>
<p>And I&#8217;m not just putting this up because they referenced my post on <a href="/2009/08/svg-vs/">SVG vs. Canvas</a>. Really.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://unterbahn.com/2009/08/svg-vs/" rel="bookmark" class="crp_title">SVG vs. Canvas</a></li><li><a href="http://unterbahn.com/2009/11/michal-migurski-html5-map-warping/" rel="bookmark" class="crp_title">Michal Migurski: HTML5 Map Warping</a></li><li><a href="http://unterbahn.com/2008/04/3d-canvas-example/" rel="bookmark" class="crp_title">3d Canvas example</a></li><li><a href="http://unterbahn.com/2010/07/comparison-of-svg-and-canvas-in-openlayers/" rel="bookmark" class="crp_title">Comparison of SVG and Canvas in OpenLayers</a></li><li><a href="http://unterbahn.com/2008/06/canvas-photo-experiment/" rel="bookmark" class="crp_title">Canvas Photo Experiment</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Instiki &#8216;Permission denied&#8217; problem</title>
		<link>http://unterbahn.com/2010/04/instiki-permission-denied-problem/</link>
		<comments>http://unterbahn.com/2010/04/instiki-permission-denied-problem/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 23:12:19 +0000</pubDate>
		<dc:creator>Jeffrey Warren</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://unterbahn.com/?p=1392</guid>
		<description><![CDATA[I run a few Instiki sites on Phusion Passenger, and they occasionally break &#8211; namely, they give a &#8216;Permission denied&#8217; message which is hard to track. The problem is that there are temp files like /tmp/passenger.1234 which have some kind of permissions problem. To resolve this, you can simply delete those files, like with: sudo [...]]]></description>
			<content:encoded><![CDATA[<p>I run a <a href="http://wiki.cartagen.org">few</a> Instiki <a href="http://wiki.grassrootsmapping.org">sites</a> on <a href="http://www.modrails.com/">Phusion Passenger</a>, and they occasionally break &#8211; namely, they give a &#8216;Permission denied&#8217; message which is hard to track.</p>
<p>The problem is that there are temp files like <code>/tmp/passenger.1234</code> which have some kind of permissions problem. </p>
<p>To resolve this, you can simply delete those files, like with:</p>
<p><code>sudo rm -r /tmp/passenger*</code></p>
<p>and reboot Instiki (Apache, really):</p>
<p><code>sudo apachectl graceful</code></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://unterbahn.com/2010/03/instiki-add-an-auto-redirect-to-the-default-web/" rel="bookmark" class="crp_title">Instiki: add an auto redirect to the default web</a></li><li><a href="http://unterbahn.com/2009/05/installing-the-mysql-ruby-gem-on-leopard-server-on-a-g5-xserve/" rel="bookmark" class="crp_title">Installing the mysql ruby gem on Leopard Server on a g5 xServe</a></li><li><a href="http://unterbahn.com/2009/03/connecting-a-ruby-on-rails-application-to-twitter/" rel="bookmark" class="crp_title">Sending and receiving text messages in Rails with Twitter</a></li><li><a href="http://unterbahn.com/2009/07/warcraft-map-stylesheet/" rel="bookmark" class="crp_title">Warcraft map stylesheet for London</a></li><li><a href="http://unterbahn.com/2010/01/fixing-cache-images-plugin-in-wordpress-on-mediatemple/" rel="bookmark" class="crp_title">Fixing Cache Images plugin in WordPress on MediaTemple</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://unterbahn.com/2010/04/instiki-permission-denied-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instiki: add an auto redirect to the default web</title>
		<link>http://unterbahn.com/2010/03/instiki-add-an-auto-redirect-to-the-default-web/</link>
		<comments>http://unterbahn.com/2010/03/instiki-add-an-auto-redirect-to-the-default-web/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:12:06 +0000</pubDate>
		<dc:creator>Jeffrey Warren</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://unterbahn.com/?p=1333</guid>
		<description><![CDATA[I have a few Instiki instances out there: wiki.grassrootsmapping.org and wiki.cartagen.org &#8211; and the Grassroots Mapping wiki now has two &#8216;webs&#8217;. Initially when I added a second web, the front page at wiki.grassrootsmapping.org began showing a list of webs instead of the HomePage of the main web&#8230; if you&#8217;re an Instiki user you&#8217;ll know what [...]]]></description>
			<content:encoded><![CDATA[<p>I have a few Instiki instances out there: <a href="http://wiki.grassrootsmapping.org">wiki.grassrootsmapping.org</a> and <a href="http://wiki.cartagen.org">wiki.cartagen.org</a> &#8211; and the Grassroots Mapping wiki now has two &#8216;webs&#8217;. Initially when I added a second web, the front page at wiki.grassrootsmapping.org began showing a list of webs instead of the HomePage of the main web&#8230; if you&#8217;re an Instiki user you&#8217;ll know what I&#8217;m talking about. You can see the page I saw here: <a href="http://wiki.grassrootsmapping.org/web_list">wiki.grassrootsmapping.org/web_list</a></p>
<p>Instiki allows you to define a DEFAULT_WEB in your <b>/config/environment.rb</b>, but it won&#8217;t redirect the web root to that web&#8217;s HomePage, which would seem to be the point. Darn. So I <a href="http://github.com/jywarren/instiki">forked and patched Instiki on Github</a>, adding the following code to replace line 26 of <b>/app/controllers/wiki_controller.rb</b>:</p>
<pre>      if defined? DEFAULT_WEB
        @web_name = DEFAULT_WEB
        redirect_home
      else
        redirect_to :action => 'web_list'
      end
</pre>
<p>Now if I go to <a href="http://wiki.grassrootsmapping.org">wiki.grassrootsmapping.org</a>, I see the HomePage of my default web. Hooray!</p>
<p><em><b>Update:</b> OK, my bad. This is unnecessary:</em></p>
<p>As <b>distler</b> <a href="http://github.com/jywarren/instiki/commit/fc88bc64e47bd92068058ddb5e41b45f49c7a2c4#comments">pointed out on Github</a>, defining DEFAULT_WEB should work out of the box. Why didn&#8217;t it work for me, I wondered?</p>
<p>Well, I put the line:</p>
<pre>DEFAULT_WEB = 'wiki'</pre>
<p>in environment.rb, but I put it OUTSIDE the <b>Rails::Initializer.run do |config|</b> block. Putting that line inside that code block solved my problem. </p>
<p>I&#8217;m leaving this all up for future generations to learn from my mistakes. (Most likely me in a year or so.)</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://unterbahn.com/2010/04/instiki-permission-denied-problem/" rel="bookmark" class="crp_title">Instiki &#8216;Permission denied&#8217; problem</a></li><li><a href="http://unterbahn.com/2010/02/illustrated-guide-to-grassroots-mapping/" rel="bookmark" class="crp_title">Illustrated guide to grassroots mapping</a></li><li><a href="http://unterbahn.com/2010/04/kite-balloon-prototyping/" rel="bookmark" class="crp_title">Kite-balloon prototyping</a></li><li><a href="http://unterbahn.com/2010/05/grassroots-mapping-the-gulf-oil-spill/" rel="bookmark" class="crp_title">Grassroots Mapping the Gulf Oil Spill</a></li><li><a href="http://unterbahn.com/2010/02/cartagen-is-now-on-github/" rel="bookmark" class="crp_title">Cartagen is now on Github</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://unterbahn.com/2010/03/instiki-add-an-auto-redirect-to-the-default-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

