<?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>CAIH.org</title>
	<atom:link href="http://caih.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://caih.org</link>
	<description>Movies, life and python</description>
	<lastBuildDate>Mon, 14 Dec 2009 00:31:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Wave Notifications in your iPhone</title>
		<link>http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/</link>
		<comments>http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 00:31:52 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[wave-email-notifications]]></category>

		<guid isPermaLink="false">http://caih.org/?p=192</guid>
		<description><![CDATA[I have some news about the Notifiy robot (wave-email-notifications@googlewave.com). It can now send notifications to your iPhone when a wave is updated. The application will be available at the App Store very soon.


Related posts:Google Wave Email Notifications
Google Wave
Checking for updates in subversion



Related posts:<ol><li><a href='http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/' rel='bookmark' title='Permanent Link: Google Wave Email Notifications'>Google Wave Email Notifications</a></li>
<li><a href='http://caih.org/movies/139/' rel='bookmark' title='Permanent Link: Google Wave'>Google Wave</a></li>
<li><a href='http://caih.org/open-source-software/checking-for-updates-in-subversion/' rel='bookmark' title='Permanent Link: Checking for updates in subversion'>Checking for updates in subversion</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div id="attachment_193" class="wp-caption aligncenter" style="width: 330px"><a href="http://caih.org/wp-content/uploads/2009/12/iphone-notifiy.png" rel="shadowbox[post-192];player=img;"><img src="http://caih.org/wp-content/uploads/2009/12/iphone-notifiy.png" alt="Wave Notifications on the iPhone" title="iphone-notifiy" width="320" height="480" class="size-full wp-image-193" /></a><p class="wp-caption-text">Wave Notifications on the iPhone</p></div>
<p>I have some news about the Notifiy robot (wave-email-notifications@googlewave.com). It can now send notifications to your iPhone when a wave is updated. The application will be available at the App Store very soon.</p>


<p>Related posts:<ol><li><a href='http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/' rel='bookmark' title='Permanent Link: Google Wave Email Notifications'>Google Wave Email Notifications</a></li>
<li><a href='http://caih.org/movies/139/' rel='bookmark' title='Permanent Link: Google Wave'>Google Wave</a></li>
<li><a href='http://caih.org/open-source-software/checking-for-updates-in-subversion/' rel='bookmark' title='Permanent Link: Checking for updates in subversion'>Checking for updates in subversion</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Wave Email Notifications</title>
		<link>http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/</link>
		<comments>http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 17:02:03 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[wave-email-notifications]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://caih.org/?p=182</guid>
		<description><![CDATA[I just created a google wave robot that sends email notifications when a wave is updated. To try it out just add: wave-email-notifications@appspot.com to the wave and that&#8217;s it. It&#8217;s currently in a beta stage so there are no guarantees. Visit the project home page at:
http://wave-email-notifications.googlecode.com/


Related posts:Google Wave Notifications in your iPhone
Google Wave



Related posts:<ol><li><a href='http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/' rel='bookmark' title='Permanent Link: Google Wave Notifications in your iPhone'>Google Wave Notifications in your iPhone</a></li>
<li><a href='http://caih.org/movies/139/' rel='bookmark' title='Permanent Link: Google Wave'>Google Wave</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I just created a google wave robot that sends email notifications when a wave is updated. To try it out just add: wave-email-notifications@appspot.com to the wave and that&#8217;s it. It&#8217;s currently in a beta stage so there are no guarantees. Visit the project home page at:</p>
<p><a href="http://wave-email-notifications.googlecode.com/">http://wave-email-notifications.googlecode.com/</a></p>


<p>Related posts:<ol><li><a href='http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/' rel='bookmark' title='Permanent Link: Google Wave Notifications in your iPhone'>Google Wave Notifications in your iPhone</a></li>
<li><a href='http://caih.org/movies/139/' rel='bookmark' title='Permanent Link: Google Wave'>Google Wave</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Tri-state checkbox in JavaScript</title>
		<link>http://caih.org/open-source-software/tri-state-checkbox-in-javascript/</link>
		<comments>http://caih.org/open-source-software/tri-state-checkbox-in-javascript/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 00:52:28 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tri-state]]></category>

		<guid isPermaLink="false">http://caih.org/?p=155</guid>
		<description><![CDATA[I found myself needing to implement a tri-state checkbox in javascript. A checkbox has initially 2 states: on or off. From the html perspective if the checkbox is checked then the value is submitted, if it is not then the value is not submitted. From the javascript perspective you can use:
if &#40;checkbox.checked&#41; &#123;
&#160; &#160; alert&#40;&#34;This [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I found myself needing to implement a tri-state checkbox in javascript. A checkbox has initially 2 states: on or off. From the html perspective if the checkbox is checked then the value is submitted, if it is not then the value is not submitted. From the javascript perspective you can use:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;This checkbox is checked&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Some times a true or false is not enough. Other development platforms have tri-state checkboxes that can have either a true, false or null value. The following snippet adds a &#8220;greyable&#8221; functionality to checkboxes:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:400px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Element.<span style="color: #660066;">addMethods</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;INPUT&quot;</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><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> changeHandler <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &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;">greyed</span> <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setGreyed</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">greyed</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">greyed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checked</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> setGreyed<span style="color: #009900;">&#40;</span>checkbox<span style="color: #339933;">,</span> greyed<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; checkbox.<span style="color: #660066;">greyed</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">typeof</span> greyed <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">?</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">:</span> <span style="color: #339933;">!!</span>greyed<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; checkbox.<span style="color: #660066;">setOpacity</span><span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">greyed</span> <span style="color: #339933;">?</span> 0.33 <span style="color: #339933;">:</span> 1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">greyed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; checkbox.<span style="color: #660066;">checked</span> <span style="color: #339933;">=</span> checkbox.<span style="color: #660066;">greyedState</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> setGreyable<span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> enable<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>element <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/checkbox|radiobutton/i</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>element.<span style="color: #660066;">type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> element.<span style="color: #660066;">greyedState</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">||</span> enable<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">observe</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;change&quot;</span><span style="color: #339933;">,</span> changeHandler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">setGreyState</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">setGreyed</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">stopObserving</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;change&quot;</span><span style="color: #339933;">,</span> changeHandler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">setGreyed</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">checked</span> <span style="color: #339933;">=</span> element.<span style="color: #660066;">greyedState</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">greyedState</span> <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">greyed</span> <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> setGreyState<span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> greyedState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>element <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/checkbox|radiobutton/i</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>element.<span style="color: #660066;">type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">greyedState</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">typeof</span> greyedState <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">?</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">!!</span>greyedState<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setGreyed<span style="color: #339933;">:</span> setGreyed<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setGreyable<span style="color: #339933;">:</span> setGreyable<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setGreyState<span style="color: #339933;">:</span> setGreyState<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>This currently requires <a href="http://www.prototypejs.org" target="_blank">prototypejs</a> but could be easily modified to not depend on it. To enable it on some element do something like this:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">checkbox.<span style="color: #660066;">setGreyable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>To check if it is greyed or not:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">greyed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;This checkbox is greyed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>You can also change the state of the checkbox when it is greyed. To set this use the following:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">checkbox.<span style="color: #660066;">setGreyState</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>The parameter indicates whether the checkbox is checked when grey. Clicking on the checkbox (or changing the state by keyboard) loops through 3 states: checked, not checked and greyed.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/tri-state-checkbox-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for updates in subversion</title>
		<link>http://caih.org/open-source-software/checking-for-updates-in-subversion/</link>
		<comments>http://caih.org/open-source-software/checking-for-updates-in-subversion/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 19:04:44 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>

		<guid isPermaLink="false">http://caih.org/?p=142</guid>
		<description><![CDATA[If you are constantly running &#8220;svn up&#8221; or &#8220;svn status -u&#8221; or maybe &#8220;svn log -rBASE:HEAD&#8221; then you might find this piece of code useful:
#!/bin/sh &#160;
&#160; 
dir=&#34;$1&#34;

cd $dir
&#160; 
updated=`svn st -u &#124; grep '*'` 

if &#91; &#34;$updated&#34; &#93;; then
&#160; &#160; notify-send SVN &#34;$updated&#34;
fi
What id does is check for updates in subversion and if it finds [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you are constantly running &#8220;svn up&#8221; or &#8220;svn status -u&#8221; or maybe &#8220;svn log -rBASE:HEAD&#8221; then you might find this piece of code useful:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh &nbsp;</span><br />
&nbsp; <br />
<span style="color: #c20cb9; font-weight: bold;">dir</span>=<span style="color: #ff0000;">&quot;$1&quot;</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$dir</span><br />
&nbsp; <br />
<span style="color: #007800;">updated</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">svn</span> st <span style="color: #660033;">-u</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'*'</span><span style="color: #000000; font-weight: bold;">`</span> <br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$updated</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; notify-send SVN <span style="color: #ff0000;">&quot;<span style="color: #007800;">$updated</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span></div></div>
<p>What id does is check for updates in subversion and if it finds any then shows a notification using notify-send. Tested on openSUSE 11.1 with subversion 1.6. Add a crontab entry and you are done.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/checking-for-updates-in-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Wave</title>
		<link>http://caih.org/movies/139/</link>
		<comments>http://caih.org/movies/139/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 23:03:51 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Movies]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://caih.org/uncategorized/139/</guid>
		<description><![CDATA[Google Wave Developer Preview at Google I/O 2009

After watching this video many ideas came to my mind! I&#8217;ve always wanted to have some sort of a system where you could collaboratively construct stories, movie scripts, etc. When I get my hands on an invitation for wave that&#8217;s the first thing I&#8217;m going to do. Would [...]


Related posts:<ol><li><a href='http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/' rel='bookmark' title='Permanent Link: Google Wave Email Notifications'>Google Wave Email Notifications</a></li>
<li><a href='http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/' rel='bookmark' title='Permanent Link: Google Wave Notifications in your iPhone'>Google Wave Notifications in your iPhone</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><b>Google Wave Developer Preview at Google I/O 2009</b><br />
<object width="425" height="350"><param name="movie" value="http://youtube.com/v/v_UyVmITiYQ"></param><embed src="http://youtube.com/v/v_UyVmITiYQ" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
<p>After watching this video many ideas came to my mind! I&#8217;ve always wanted to have some sort of a system where you could collaboratively construct stories, movie scripts, etc. When I get my hands on an invitation for wave that&#8217;s the first thing I&#8217;m going to do. Would make celtx look so old fashioned!</p>


<p>Related posts:<ol><li><a href='http://caih.org/open-source-software/wave-email-notifications/google-wave-email-notifications/' rel='bookmark' title='Permanent Link: Google Wave Email Notifications'>Google Wave Email Notifications</a></li>
<li><a href='http://caih.org/open-source-software/google-wave-notifications-in-your-iphone/' rel='bookmark' title='Permanent Link: Google Wave Notifications in your iPhone'>Google Wave Notifications in your iPhone</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/movies/139/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>B# tree and Array intersection in javascript</title>
		<link>http://caih.org/open-source-software/b-tree-and-array-intersection-in-javascript/</link>
		<comments>http://caih.org/open-source-software/b-tree-and-array-intersection-in-javascript/#comments</comments>
		<pubDate>Wed, 20 May 2009 23:16:16 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>

		<guid isPermaLink="false">http://caih.org/?p=125</guid>
		<description><![CDATA[I was in need for a solution to search a very large set of data in a javascript application. I thought of a b+ tree. Looking for a javascript implementation of it, google didn&#8217;t help much. So, I just gave up and decided to implement it myself. This is the result: not really a B+ [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I was in need for a solution to search a very large set of data in a javascript application. I thought of a <a href="http://en.wikipedia.org/wiki/B%2B_tree" target="_blank">b+ tree</a>. Looking for a javascript implementation of it, google didn&#8217;t help much. So, I just gave up and decided to implement it myself. This is the result: not really a B+ tree but a variation that works better in this case. I call it a B# tree. It depends on the <a href="http://www.prototypejs.org/" target="_blank">prototype framework</a> but I&#8217;m planning on making some changes to it so it would work stand-alone.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:400px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> BSharpTree <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;">&#123;</span><br />
&nbsp; &nbsp; root<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
<br />
&nbsp; &nbsp; initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>comparator<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span> <span style="color: #339933;">=</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">comparator</span> <span style="color: #339933;">=</span> comparator <span style="color: #339933;">||</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> x<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
<br />
&nbsp; &nbsp; add<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #339933;">,</span> object<span style="color: #339933;">,</span> node<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> node <span style="color: #339933;">=</span> node <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; node.<span style="color: #660066;">objects</span> <span style="color: #339933;">=</span> node.<span style="color: #660066;">objects</span> <span style="color: #339933;">||</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>node <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node.<span style="color: #660066;">objects</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>text.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> chr <span style="color: #339933;">=</span> text.<span style="color: #660066;">charCodeAt</span><span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">32</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> next <span style="color: #339933;">=</span> node<span style="color: #009900;">&#91;</span>chr<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> chr <span style="color: #339933;">==</span> 0 <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span> <span style="color: #339933;">:</span> node<span style="color: #009900;">&#91;</span>chr<span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>text.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>1<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> object<span style="color: #339933;">,</span> next<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
<br />
&nbsp; &nbsp; search<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #339933;">,</span> objects<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> node <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> result <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>text.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> chr <span style="color: #339933;">=</span> text.<span style="color: #660066;">charCodeAt</span><span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">32</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text <span style="color: #339933;">=</span> text.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>char <span style="color: #339933;">==</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span>text<span style="color: #339933;">,</span> result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node <span style="color: #339933;">=</span> node<span style="color: #009900;">&#91;</span>chr<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>node<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result <span style="color: #339933;">=</span> node.<span style="color: #660066;">objects</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>objects<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>node <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> objects<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">intersect</span><span style="color: #009900;">&#40;</span>result<span style="color: #339933;">,</span> objects<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>node <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">root</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> result<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
<br />
&nbsp; &nbsp; intersect<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> intersect <span style="color: #339933;">=</span> $A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; a <span style="color: #339933;">=</span> a.<span style="color: #660066;">sortBy</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">comparator</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; b <span style="color: #339933;">=</span> b.<span style="color: #660066;">sortBy</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">comparator</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">&lt;</span> a.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;&amp;</span> j <span style="color: #339933;">&lt;</span> b.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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;">comparator</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</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;">comparator</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; intersect.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <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;">comparator</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">comparator</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> intersect<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>It contains a very efficient intersect method. To use it just do something like this:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> bst <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> BSharpTree<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
bst.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;some string&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;my object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
bst.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;some other string&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;other object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
bst.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;last string&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;last object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
bst.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;string&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// returns [&quot;my object&quot;, &quot;other object&quot;, &quot;last object&quot;]</span><br />
bst.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;some string&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// returns [&quot;my object&quot;, &quot;other object&quot;]</span></div></div>
<p>You can set any object as the second parameter to the BSharpTree#add method but then you might need to pass a comparator function to the BSharpTree constructor. Use it as you may see fit! </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/b-tree-and-array-intersection-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading javascript: execScript and testing</title>
		<link>http://caih.org/open-source-software/loading-javascript-execscript-and-testing/</link>
		<comments>http://caih.org/open-source-software/loading-javascript-execscript-and-testing/#comments</comments>
		<pubDate>Thu, 14 May 2009 12:14:33 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[modularjs]]></category>

		<guid isPermaLink="false">http://caih.org/?p=113</guid>
		<description><![CDATA[After a lot of time of searching what is the best way to synchronously load javascript from javascript I finally found a way to do it that works in almost any browser. The hardest part of it all is not loading and eval&#8217;ing the script, but allowing the script to set new variables in the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>After a lot of time of searching what is the best way to synchronously load javascript from javascript I finally found a way to do it that works in almost any browser. The hardest part of it all is not loading and eval&#8217;ing the script, but allowing the script to set new variables in the global scope.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">execScript</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; window.<span style="color: #660066;">execScript</span><span style="color: #009900;">&#40;</span>contents<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span>contents<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>This is what I&#8217;m finally using on my <a href="http://modularjs.googlecode.com">open source modular javascript project</a>. To test it out I also found <a href="http://browsershots.com" rel="nofollow">this website</a> very useful. What I did was to create a test page that loaded a script, declared some global variables in different ways:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> someVariable <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
someVariableWithoutVar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;var someVariableWithEval = true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;someVariableWithEvalWithoutVar = true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Then loaded the website through browsershots and the results came in a few minutes. The <a href="http://browsershots.org/http://modularjs.googlecode.com/svn/trunk/test/index.html" target="_blank">tests passed</a> on a lot of browsers including all versions I could test of Firefox, Opera, MSIE, Safari, with some minor exceptions: Safari 3.2.1 on Windows XP and OS X 10.5, Opera 7.54 on Windows XP, Konqueror 4.2 on Ubuntu 9.04.</p>
<p>The case with Safari 3.2.1 is that it cannot set global variables declared with <em>var</em> inside a eval&#8217;ed script. There&#8217;s a newer 3.2.3 version that I would like to test on to see if there is any difference. As for Opera, it&#8217;s an old version that nobody is probably using anymore. But for Konqueror I really don&#8217;t know the source of the error.</p>
<p>Take the <a href="http://modularjs.googlecode.com/svn/trunk/test/index.html">test</a> yourself. If you would like to see how the tests were done take a look at the sources <a href="http://code.google.com/p/modularjs/source/browse/#svn/trunk/test">here</a>.</p>
<p><strong>Update:</strong> The test suite now passes in almost every browser with the exception of some older versions of opera <img src='http://caih.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/loading-javascript-execscript-and-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving the control back to filesystem</title>
		<link>http://caih.org/open-source-software/dejumble/giving-the-control-back-to-filesystem/</link>
		<comments>http://caih.org/open-source-software/dejumble/giving-the-control-back-to-filesystem/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 03:58:55 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[dejumble]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[organization]]></category>

		<guid isPermaLink="false">http://caih.org/?p=48</guid>
		<description><![CDATA[A long time ago computers started to be able to store &#8220;things&#8221; in memory. Even though there&#8217;s no doubt that today we mostly store &#8220;files&#8221; in computers, that doesn&#8217;t mean that&#8217;s the only thing we can store. There&#8217;s a real world analogy from some terms we use to store data in our computers. Quoting from [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>A long time ago computers started to be able to store &#8220;things&#8221; in memory. Even though there&#8217;s no doubt that today we mostly store &#8220;files&#8221; in computers, that doesn&#8217;t mean that&#8217;s the only thing we can store. There&#8217;s a real world analogy from some terms we use to store data in our computers. Quoting from <a href="http://wiktionary.org">wiktionary.org</a>:</p>
<blockquote>
<dl>
<dt>file</dt>
<dd>A collection of papers collated and archived together.</dd>
<dt>folder/directory</dt>
<dd>An organizer that papers are kept in, usually with an index tab, to be stored as a single unit in a filing cabinet.</dd>
<dt>library</dt>
<dd>A collection of books or other forms of stored information. An individual may refer to his collection of books and other items as his library.</dd>
<dd>An equiavlent collection of analogous information in a non-printed form, e.g. record library</dd>
<dt>index</dt>
<dd>An alphabetical listing of items and their location; for example, the index of a book lists words or expressions and the pages of the book upon which they are to be found.</dd>
</dl>
</blockquote>
<p>Some time in the past century <a href="http://arstechnica.com/articles/paedia/past-present-future-file-systems.ars">the file system was created</a>. Since then a thousand file systems had come to existence. Most of them can store basically two things: folders and files. Well, most of them also store information about these two items like dates and sizes, and permissions, and extended attributes. But are they indexable? Can anybody do a fast search on those attributes? From the btrfs changelog:</p>
<blockquote><p>
Btrfs indexes directories in two ways. The first index allows fast name lookups, and the second is optimized to return inodes in something close to disk order for readdir. The second index is an important part of good performance for full filesystem backups.
</p></blockquote>
<p>But is there any filesystem that creates indexes on anything else? Well many desktop searching applications create their own indexes. You have Spotlight on the mac, beagle, tracker, etc on Linux, google desktop search on windows. They can really get out of sync. If you take your external hard drive from a mac to a Linux machine copy some files and then back again you need to wait to Spotlight to catch up. Sometimes I just want to search for a file and I only remember it was an image I copied yesterday. Browsing through a whole messy external hard drive to find that can take forever.</p>
<p>That&#8217;s why I started working on <a href="http://dejumble.googlecode.com/" target="_blank">dejumble</a>. I don&#8217;t want to organize my files on folders anymore. I just want to find them!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/dejumble/giving-the-control-back-to-filesystem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Inkscape in Mac OS X</title>
		<link>http://caih.org/open-source-software/fixing-inkscape-in-mac-os-x/</link>
		<comments>http://caih.org/open-source-software/fixing-inkscape-in-mac-os-x/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 23:07:44 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[inkscape]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://caih.org/?p=75</guid>
		<description><![CDATA[I had this error for a very long time when trying to use extensions in Inkscape 0.46 for Mac OS X:
&#8220;The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension&#8221;
After many hours of trying to find a solution I got it to work. This is what I did:
sudo easy_install lxml
cd /Applications/Inkscape.app/Contents/Resources/lib
mv [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I had this error for a very long time when trying to use extensions in Inkscape 0.46 for Mac OS X:</p>
<blockquote><p>&#8220;The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension&#8221;</p></blockquote>
<p>After many hours of trying to find a solution I got it to work. This is what I did:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> easy_install lxml<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>Inkscape.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>lib<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> libxml2.2.dylib libxml2.2.dylib.old<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libxml2.dylib</div></div>
<p>After that, all extensions (those found under the effects menu) started to work.</p>
<p><strong>Update:</strong><br />
The problem seems to be fixed on the <a href="http://inkscape.modevia.com/macosx-snap/?C=M;O=D" target="_blank">latest development version</a>.</p>
<p><strong>Update 2:</strong><br />
Fixed typo. Thanks to Bill Gathen for your comment.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/fixing-inkscape-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>A small patch for ProjectPier language support</title>
		<link>http://caih.org/open-source-software/a-small-patch-for-projectpier-language-support/</link>
		<comments>http://caih.org/open-source-software/a-small-patch-for-projectpier-language-support/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 20:27:39 +0000</pubDate>
		<dc:creator>César Izurieta</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://caih.org/?p=61</guid>
		<description><![CDATA[When using ProjectPier in a different language than English you may come to see a bug when browsing through the dashboard. Some translations include html code in their strings (because of a migration from activeCollab?). ProjectPier escapes this strings and the code leaks to the user interface.
For example there is this Spanish translation:
'log add projectmessages' [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>When using <a title="ProjectPier" href="http://www.projectpier.org/" target="_blank">ProjectPier</a> in a different language than English you may come to see a bug when browsing through the dashboard. Some translations include html code in their strings (because of a migration from activeCollab?). ProjectPier escapes this strings and the code leaks to the user interface.</p>
<p>For example there is this Spanish translation:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">'log add projectmessages'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">%</span>s<span style="color: #0000ff;">' &lt;strong&gt;agregado&lt;/strong&gt;'</span><span style="color: #339933;">,</span></div></div>
<p>On a first instance, %s is replaced by some string that may contain html, lets say &#8220;A&amp;B&#8221;. Then ProjectPier scapes the resulting string and ends up like:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">A<span style="color: #ddbb00;">&amp;amp;</span>B <span style="color: #ddbb00;">&amp;lt;</span>strong<span style="color: #ddbb00;">&amp;gt;</span>agregado<span style="color: #ddbb00;">&amp;lt;</span>/strong<span style="color: #ddbb00;">&amp;gt;</span></div></div>
<p>And the end user-visible result is:</p>
<blockquote><p>
A&amp;B &lt;strong&gt;agregado&lt;/strong&gt;
</p></blockquote>
<p>I&#8217;ve attached a patch to this post that fixes this. This patch is a temporary solution for the problem, but a real solution would be filter the real content before it is inserted in the translated string. This is for ProjectPier v.0.8.0.3.</p>
<p>Download: <a href='http://caih.org/wp-content/uploads/2009/02/projectpier-lang.patch'>projectpier-lang.patch</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://caih.org/open-source-software/a-small-patch-for-projectpier-language-support/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
