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

<channel>
	<title>Stop Being Carbon &#187; Technology</title>
	<atom:link href="http://www.stopbeingcarbon.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stopbeingcarbon.com</link>
	<description>The philosophy of being 01.</description>
	<pubDate>Tue, 18 Nov 2008 20:30:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Flip an image with Scriptaculous</title>
		<link>http://www.stopbeingcarbon.com/2008/11/flip-an-image-with-scriptaculous/</link>
		<comments>http://www.stopbeingcarbon.com/2008/11/flip-an-image-with-scriptaculous/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:30:46 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=679</guid>
		<description><![CDATA[I was the need of a flip effect for scriptaculous and came up with this solution:


Effect.Flip = Class.create&#40;&#41;;
Object.extend&#40;Object.extend&#40;Effect.Flip.prototype,
  Effect.Base.prototype&#41;, &#123;
&#160;
    initialize: function&#40;element, flip_graphic, original_graphic&#41; &#123;
      var options = arguments&#91;3&#93; &#124;&#124; &#123;&#125;;
&#160;
      this.element = $&#40;element&#41;;
      this.flip_graphic = [...]]]></description>
			<content:encoded><![CDATA[<p>I was the need of a flip effect for scriptaculous and came up with this solution:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">Effect.<span style="color: #660066;">Flip</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">Class</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
Object.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Object.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Effect.<span style="color: #660066;">Flip</span>.<span style="color: #660066;">prototype</span><span style="color: #339933;">,</span>
  Effect.<span style="color: #660066;">Base</span>.<span style="color: #660066;">prototype</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> flip_graphic<span style="color: #339933;">,</span> original_graphic<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> arguments<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span> || <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>;
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span>;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip_graphic</span> <span style="color: #339933;">=</span> flip_graphic;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">original_graphic</span> <span style="color: #339933;">=</span> original_graphic;
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'src'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip_graphic</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip_graphic</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">original_graphic</span>;
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">original_graphic</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'src'</span><span style="color: #009900;">&#41;</span>;
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> options.<span style="color: #660066;">width</span> || <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">delta</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">2</span>;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span>;
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span>;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    update<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>position<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>    
&nbsp;
      <span style="color: #003366; font-weight: bold;">var</span> change <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0.5</span> <span style="color: #339933;">-</span> position<span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">delta</span>;
      <span style="color: #003366; font-weight: bold;">var</span> padding <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span> <span style="color: #009966; font-style: italic;">/ 2 - change /</span> <span style="color: #CC0000;">2</span>;
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        width<span style="color: #339933;">:</span> change <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #339933;">,</span>
        padding<span style="color: #339933;">:</span> <span style="color: #3366CC;">'0 0 0 '</span> <span style="color: #339933;">+</span> padding <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>change <span style="color: #339933;">&lt;</span> 0<span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">writeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> src<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip_graphic</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">flip</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span>;
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>


<p>You can use it like that:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Effect.<span style="color: #660066;">Flip</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> <span style="color: #3366CC;">'graphics/original.jpg'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'graphics/flip.png'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">120</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>


<p>I will post a demo tomorrow - I promise, it looks cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/11/flip-an-image-with-scriptaculous/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mini DVI to Mini DisplayPort</title>
		<link>http://www.stopbeingcarbon.com/2008/11/mini-dvi-to-mini-displayport/</link>
		<comments>http://www.stopbeingcarbon.com/2008/11/mini-dvi-to-mini-displayport/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 21:50:53 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Technology]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=677</guid>
		<description><![CDATA[I&#8217;m really thinking about getting the new 24&#8243; LED Cinema Display from Apple. Comparable devices from Dell, for example, are a bit cheaper but I really like the idea of connecting my MacBook with the display and getting a MagSafe and USB connection, too. The only question I have is: Is there a Mini DVI [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really thinking about getting the new 24&#8243; LED Cinema Display from Apple. Comparable devices from Dell, for example, are a bit cheaper but I really like the idea of connecting my MacBook with the display and getting a MagSafe and USB connection, too. The only question I have is: Is there a Mini DVI to Mini DisplayPort adapter available from Apple? If not, do I need to get a new MacBook to use the new display? Sounds bizarre.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/11/mini-dvi-to-mini-displayport/feed/</wfw:commentRss>
		</item>
		<item>
		<title>acts_as_geocodable in tests</title>
		<link>http://www.stopbeingcarbon.com/2008/08/acts_as_geocodable-in-tests/</link>
		<comments>http://www.stopbeingcarbon.com/2008/08/acts_as_geocodable-in-tests/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 15:46:32 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Technology]]></category>

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

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

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=658</guid>
		<description><![CDATA[The last few days I wrote some unit tests for a project I&#8217;m currently working on (and which, by the way, should be released to public in a few weeks time). To easily be able to change attributes of my models and not rely on fixtures, I&#8217;m using the fixture_replacement plugin and actsasgeocodable to easily [...]]]></description>
			<content:encoded><![CDATA[<p>The last few days I wrote some unit tests for a project I&#8217;m currently working on (and which, by the way, should be released to public in a few weeks time). To easily be able to change attributes of my models and not rely on fixtures, I&#8217;m using the <a href="http://replacefixtures.rubyforge.org/">fixture_replacement</a> plugin and <a href="http://github.com/collectiveidea/acts_as_geocodable/tree/master">acts<em>as</em>geocodable</a> to easily deal with address translations and that stuff (it introduces various attributes, like street, country, postal code,&#8230;). The last one comes with a nice option, normalized_address, which will update the information in your model with the information it got from the geocoding service (and thus will correct invalid postal codes, etc.).</p>

<p>Well, again, this feature is really handy but can lead to problems if you forgot that you activated it and just want to change the postal code of one of your models. Because the geocoder will still find the right address (mainly because the street name is the same) and acts<em>as</em>geocodable will <em>correct</em> the invalid postal code for you. And you gonna have no clue why it won&#8217;t take the postal code you&#8217;ve used in fixture_replacement&#8217;s helper methods.</p>

<p>A simple fix for that is to add the following setup method into your unit tests:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> setup
  <span style="color:#008000; font-style:italic;"># This ensures that we can set individual attributes of our model</span>
  <span style="color:#008000; font-style:italic;"># without being overridden by acts_as_geocodable.</span>
  Property.<span style="color:#9900CC;">acts_as_geocodable_options</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:normalize_address</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/08/acts_as_geocodable-in-tests/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wildcards for phone numbers</title>
		<link>http://www.stopbeingcarbon.com/2008/08/wildcards-for-phone-numbers/</link>
		<comments>http://www.stopbeingcarbon.com/2008/08/wildcards-for-phone-numbers/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 09:39:11 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Technology]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=655</guid>
		<description><![CDATA[Working for quite a big company has the disadvantage that you cannot now all the people there and their respective telephone numbers (especially when you were lucky enough not to get one of those Blackberry things). I&#8217;m pretty bad at remembering telephone numbers - which is actually not quite true, I still know all the [...]]]></description>
			<content:encoded><![CDATA[<p>Working for quite a big company has the disadvantage that you cannot now all the people there and their respective telephone numbers (especially when you were lucky enough <em>not</em> to get one of those Blackberry things). I&#8217;m pretty bad at remembering telephone numbers - which is actually not quite true, I still know all the numbers of my primary school friends - so for me it would be quite useful if my Nokia phone would support wildcards for phone numbers. So that I could even tell that the call is coming from within my company, even if I don&#8217;t have the exact name of the caller.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/08/wildcards-for-phone-numbers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I always knew that coffee is my lifesaver</title>
		<link>http://www.stopbeingcarbon.com/2008/08/i-always-knew-that-coffee-is-my-lifesaver/</link>
		<comments>http://www.stopbeingcarbon.com/2008/08/i-always-knew-that-coffee-is-my-lifesaver/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 12:20:11 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Technology]]></category>

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

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=653</guid>
		<description><![CDATA[I guess every Mac users know the problem: You&#8217;re talking with your friends, showing them some drawing, snippet of code or website, talk even more with them and your Mac activates its screensaver and locks down the Keychain. For me that results in entering my password three times (one for login, one for iScrobbler and [...]]]></description>
			<content:encoded><![CDATA[<p>I guess every Mac users know the problem: You&#8217;re talking with your friends, showing them some drawing, snippet of code or website, talk even more with them and your Mac activates its screensaver and locks down the Keychain. For me that results in entering my password three times (one for login, one for iScrobbler and one for Safari&#8217;s Keychain access). Annoying.</p>

<p>But I discovered (or merely googled) a small tool which prevents your Mac from activating the screensaver, dimming down the screen or even going to sleep: <a href="http://www.lightheadsw.com/caffeine/">Caffeine</a>. Trust me, you <em>need</em> this tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/08/i-always-knew-that-coffee-is-my-lifesaver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Strange module error with Hpricot</title>
		<link>http://www.stopbeingcarbon.com/2008/08/strange-module-error-with-hpricot/</link>
		<comments>http://www.stopbeingcarbon.com/2008/08/strange-module-error-with-hpricot/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 14:27:56 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=633</guid>
		<description><![CDATA[I got some strange error today when I tried to deploy one of my rails projects to my slice at slicehost. The problem was that I had a newer version of Hpricot running on the slice (0.6.161) versus 0.6 on my local machine. The following line failed:


Hpricot::XChar::PREDEFINED_U.merge!&#40;&#123;&#34;&#38;nbsp;&#34; =&#62; 32&#125;&#41;


Ahm, okay. I didn&#8217;t see any changes [...]]]></description>
			<content:encoded><![CDATA[<p>I got some strange error today when I tried to deploy one of my rails projects to my slice at slicehost. The problem was that I had a newer version of Hpricot running on the slice (0.6.161) versus 0.6 on my local machine. The following line failed:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Hpricot::XChar::PREDEFINED_U</span>.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;&amp;nbsp;&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">32</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>


<p>Ahm, okay. I didn&#8217;t see any changes made to the overall layout of Hpricot so I suspect that line <em>should</em> work. Any ideas?</p>

<p>(If anyone is interested in the meaning of the above line, check <a href="http://code.whytheluckystiff.net/hpricot/ticket/137">this ticket</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/08/strange-module-error-with-hpricot/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading osm files with Python - python-osm</title>
		<link>http://www.stopbeingcarbon.com/2008/07/reading-osm-file-with-python-python-osm/</link>
		<comments>http://www.stopbeingcarbon.com/2008/07/reading-osm-file-with-python-python-osm/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 10:19:14 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[open source]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=620</guid>
		<description><![CDATA[A few days ago I experimented with some data files from the Open Street Map Project. Because I do most of my quick&#8217;n'dirty prototyping with Python, I looked for a Python module which would read osm files (which is, to be fair, really no problem because it&#8217;s clean XML).

I stumbled over Rory McCann&#8217;s python-osm lib [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I experimented with some data files from the <a href="http://www.openstreetmap.org/">Open Street Map Project</a>. Because I do most of my quick&#8217;n'dirty prototyping with Python, I looked for a Python module which would read osm files (which is, to be fair, really no problem because it&#8217;s clean XML).</p>

<p>I stumbled over Rory McCann&#8217;s <a href="http://github.com/rory/python-osm/tree/master">python-osm</a> lib over at Github. His version was missing the relation feature of the osm data structure but it was a one minute walk to implement it.</p>

<p>You can access the forked project <a href="http://github.com/Kitto/python-osm/tree/master">@Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/07/reading-osm-file-with-python-python-osm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Possible bug in Lightbox (and fix)</title>
		<link>http://www.stopbeingcarbon.com/2008/05/possible-bug-in-lightbox-and-fix/</link>
		<comments>http://www.stopbeingcarbon.com/2008/05/possible-bug-in-lightbox-and-fix/#comments</comments>
		<pubDate>Mon, 26 May 2008 20:55:08 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/?p=617</guid>
		<description><![CDATA[I&#8217;m currently working on some Rails project which makes use of the great attachment_fu plugin by Technoweenie (which led to my first bugfix for an Open Source project).

Yesterday I stumbled over some glitch with Lightbox (or Script.aculo.us, I&#8217;m not really sure) which results in a mal-sized picture. For the sample, go here. The fix is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on some Rails project which makes use of the great attachment_fu plugin by Technoweenie (which led to <a href="http://github.com/technoweenie/attachment_fu/commit/834553ad3d876541b986ed6de115ea0023070bb5">my first bugfix</a> for an Open Source project).</p>

<p>Yesterday I stumbled over some glitch with Lightbox (or Script.aculo.us, I&#8217;m not really sure) which results in a mal-sized picture. For the sample, <a href="http://www.stopbeingcarbon.com/lightbox_bug">go here</a>. The fix is quite simple, you have to explicitly set the width of the image (that should be around line #260):</p>


<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">imgPreloader.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lightboxImage</span>.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeImage</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>;
    <span style="color: #006600; font-style: italic;">// The following line will fix the glitch:</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lightboxImage</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> imgPreloader.<span style="color: #660066;">width</span>;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeImageContainer</span><span style="color: #009900;">&#40;</span>imgPreloader.<span style="color: #660066;">width</span><span style="color: #339933;">,</span> imgPreloader.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>;
imgPreloader.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeImage</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/05/possible-bug-in-lightbox-and-fix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharpMap modifications</title>
		<link>http://www.stopbeingcarbon.com/2008/03/sharpmap-modifications/</link>
		<comments>http://www.stopbeingcarbon.com/2008/03/sharpmap-modifications/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 15:02:16 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

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

		<category><![CDATA[.net]]></category>

		<category><![CDATA[c#]]></category>

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

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/2008/03/sharpmap-modifications/</guid>
		<description><![CDATA[Wow, nearly three weeks since my last blog post (but I do post some updates more frequently on Twitter).

[Warning: tech stuff follows]
Anyway, I&#8217;m doing quite fine. My bachelor project is slowly taking shape. Currently I am modifying SharpMap for our needs (adding a dynamic layer for our data, adding some events to know what&#8217;s going [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, nearly three weeks since my last blog post (but I do post some updates more frequently on <a href="http://twitter.com/clupprich">Twitter</a>).</p>

<p>[Warning: tech stuff follows]
Anyway, I&#8217;m doing quite fine. My bachelor project is slowly taking shape. Currently I am modifying <a href="http://www.codeplex.com/SharpMap">SharpMap</a> for our needs (adding a dynamic layer for our data, adding some events to know what&#8217;s going on inside of SharpMap,&#8230;).</p>

<p>I&#8217;ve also touched the clipping function, which really sucked. I replaced it with Sutherland-Hodgman&#8217;s polygon-clipping algorithm which works like a charm. This move was necessary because GDI+ has some problems rendering invalid data (meaning data which is far outside of the viewport). The process doing the drawing will block all others and your system will come to a halt  - no moving cursors, no task manager, no nothing.</p>

<p>Because SharpMap is released under the LGPL, I will post the .diff patches as soon as the major work is finished.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/03/sharpmap-modifications/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby sum</title>
		<link>http://www.stopbeingcarbon.com/2008/01/ruby-sum/</link>
		<comments>http://www.stopbeingcarbon.com/2008/01/ruby-sum/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 16:46:12 +0000</pubDate>
		<dc:creator>Christoph</dc:creator>
		
		<category><![CDATA[Coding]]></category>

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

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

		<guid isPermaLink="false">http://www.stopbeingcarbon.com/2008/01/ruby-sum/</guid>
		<description><![CDATA[
def sum&#40;enum, &#38;block&#41;
  sum = 0
  enum.each do &#124;value&#124;
    v = block.call&#40;value&#41;
    sum = v ? v + sum : sum
  end
  sum
end

]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> sum<span style="color:#006600; font-weight:bold;">&#40;</span>enum, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
  sum = 0
  enum.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> |value|
    v = block.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>
    sum = v ? v <span style="color:#006600; font-weight:bold;">+</span> sum : sum
  <span style="color:#9966CC; font-weight:bold;">end</span>
  sum
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.stopbeingcarbon.com/2008/01/ruby-sum/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
