<?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>corprewland</title>
	<atom:link href="http://www.corprew.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.corprew.org</link>
	<description>(dis)information organization</description>
	<lastBuildDate>Thu, 04 Feb 2010 20:48:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>stack overflow</title>
		<link>http://www.corprew.org/blog/2010/02/04/stack-overflow/</link>
		<comments>http://www.corprew.org/blog/2010/02/04/stack-overflow/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 20:48:34 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[computer programming]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[social networking]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=247</guid>
		<description><![CDATA[Over the last month, I&#8217;ve been learning a lot of things and stuff by participating at stackoverflow.com daily, and I am slowly growing obsessed with it.  The &#8216;help/learn/repeat&#8217; cycle that they have is pretty well optimized for my learning style.  
I&#8217;ve even had decent luck recommending it to other people; more and more [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last month, I&#8217;ve been learning a lot of things and stuff by participating at <a href="http://stackoverflow.com/users/240015/corprew">stackoverflow</a>.com daily, and I am slowly growing obsessed with it.  The &#8216;help/learn/repeat&#8217; cycle that they have is pretty well optimized for my learning style.  </p>
<p>I&#8217;ve even had decent luck <a href="http://twitter.com/loresjoberg/status/8426237391">recommending it to other people</a>; more and more of my relevant search results for dev-relevant things were appearing there, so eventually I signed up and I&#8217;m happy I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2010/02/04/stack-overflow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Authlogic and the iPhone</title>
		<link>http://www.corprew.org/blog/2010/01/27/authlogic-and-objectiveresource/</link>
		<comments>http://www.corprew.org/blog/2010/01/27/authlogic-and-objectiveresource/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 00:45:45 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[computer programming]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[defensive programming]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ObjectiveResource]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[UserSession]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=235</guid>
		<description><![CDATA[So, I&#8217;ve based a couple of apps on a combination of authlogic and the iPhone Objective Resource package, and when I mentioned this on the relevant lists I got a bunch of people asking me questions, so I thought I&#8217;d post about what I did generally.
There are a couple of steps, most of which are [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve based a couple of apps on a combination of <a href="http://github.com/binarylogic/authlogic">authlogic</a> and the iPhone <a href="http://iphoneonrails.com/">Objective Resource</a> package, and when I mentioned this on the relevant lists I got a bunch of people asking me questions, so I thought I&#8217;d post about what I did generally.</p>
<p>There are a couple of steps, most of which are geared towards having authlogic not produce redirects and instead produce http status codes that are interpretable to the applications.  Here&#8217;s an example of what I mean from my ApplicationController on an app</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> require_user
    <span style="color:#9966CC; font-weight:bold;">unless</span> current_user
      store_location
      flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:notice</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;You must be logged in to access this page&quot;</span>
      respond_to <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#006600; font-weight:bold;">&#123;</span> redirect_to new_user_session_url <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span>  <span style="color:#006600; font-weight:bold;">&#123;</span> render <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;you must be logged in to access this page.&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:status</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:unauthorized</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>In the default implementation of this filter, it always returns a redirect.  ObjectiveResource can follow the redirect (if you have a recent enough version), but it doesn&#8217;t really do it a lot of good.  This way, you get a status code that you can use.</p>
<p>Since Authlogic focuses on RESTful creation of things, a lot of operations map naturally.  To create an account on the Rails app, create a User object, and to test whether the user can log in, create a user session.  My application stores credentials between iPhone App invocations, so it creates a UserSession at startup if you have stored credentials.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>applicationDidFinishLaunching<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application <span style="color: #002200;">&#123;</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">// ... blah blah blah all sorts of stuff removed.</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
	UserPrefsManager<span style="color: #002200;">*</span> prefs <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UserPrefsManager sharedInstance<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>prefs isLoggedIn<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		UserSession <span style="color: #002200;">*</span> us <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UserSession alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
&nbsp;
		us.login <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>prefs username<span style="color: #002200;">&#93;</span>;
		us.password <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>prefs password<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span> err <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
&nbsp;
		<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span>us createRemoteWithResponse<span style="color: #002200;">:&amp;</span>err<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
		<span style="color: #002200;">&#123;</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  ... my actual detection stuff removed and just the default left ...</span>
<span style="color: #11740a; font-style: italic;">//</span>
			<span style="color: #002200;">&#91;</span>AlertHelper showAlertWithError<span style="color: #002200;">:</span>err<span style="color: #002200;">&#93;</span>;
			<span style="color: #002200;">&#91;</span>prefs clearLogin<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#91;</span>ObjectiveResourceConfig setUser<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>prefs username<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>ObjectiveResourceConfig setPassword<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>prefs password<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">// ... and proceed on with your app's normal course of things ...</span>
<span style="color: #11740a; font-style: italic;">//	</span>
    <span style="color: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span>tabBarController.view<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>You see here that i&#8217;m creating an UserSession here and testing to see if it works and setting the ObjectiveResourceConfig properties if it does.  I have some logic where if there isn&#8217;t saved credentials you will get a dialog asking you to login or create an account (or whatever) later on, which is the point of <code>[prefs clearLogin];</code>.  This is matched by a change to the create method of the UserSessionController:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">      respond_to <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">format</span> <span style="color:#006600; font-weight:bold;">|</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#9966CC; font-weight:bold;">do</span>
          flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:notice</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;Login successful!&quot;</span>
          redirect_back_or_default account_url
        <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span> <span style="color:#9966CC; font-weight:bold;">do</span>
          render <span style="color:#ff3333; font-weight:bold;">:xml</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@user_session</span>, <span style="color:#ff3333; font-weight:bold;">:status</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:created</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>(For brevity, I&#8217;ve just shown the successful branch)</p>
<p>This should be enough to get people going &#8212; all the other changes you have to make can be figured out from these two statements, and when I have some spare time I&#8217;m going to create a version of the demo application that works with ObjectiveResource.  The only other suggestion I have is to use the withResponse: versions of everything and code defensively, and note that in some versions of ObjectiveResource getting an error from your application will cause the application to throw.  In the meantime, feel free to ask me any questions</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2010/01/27/authlogic-and-objectiveresource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ebooks</title>
		<link>http://www.corprew.org/blog/2010/01/27/ebooks/</link>
		<comments>http://www.corprew.org/blog/2010/01/27/ebooks/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 23:47:11 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=233</guid>
		<description><![CDATA[So, I&#8217;m currently making ebooks for people, and it&#8217;s come up enough that I thought I should make it generally known that I&#8217;m doing so.  I&#8217;ve been doing this more or less since the mid-90s when I was working part time at a scientific press (which is how I got involved in early HTML [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;m currently making ebooks for people, and it&#8217;s come up enough that I thought I should make it <a href="http://cuneiverse.com/kraken-ebooks/">generally known</a> that I&#8217;m doing so.  I&#8217;ve been doing this more or less since the mid-90s when I was working part time at a scientific press (which is how I got involved in early HTML standards efforts.)</p>
<p>I&#8217;m also doing some other ebook related things, but I thought I&#8217;d mention this on my blog because a lot of my friends are authors, writers, and &amp;c, and they&#8217;ve been turning around and telling their friends, &amp;c, &amp;c, and it&#8217;s become clear I should link up those two efforts.  I&#8217;m currently extending and redesigning the cuneiverse website as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2010/01/27/ebooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone app beta users sought</title>
		<link>http://www.corprew.org/blog/2009/11/29/iphone-app-beta-users-sought/</link>
		<comments>http://www.corprew.org/blog/2009/11/29/iphone-app-beta-users-sought/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 07:55:10 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[computer programming]]></category>
		<category><![CDATA[infosci]]></category>
		<category><![CDATA[location-based]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=231</guid>
		<description><![CDATA[Hey folks, I&#8217;ve been working on a couple iPhone applications recently, and things are at the point where I could use a couple beta users.  If you&#8217;re interested in any of these, let me know by commenting or emailing me &#8212; email temp200911@corprew.org.  You can also use the contact page at corprew.org.

I&#8217;m looking [...]]]></description>
			<content:encoded><![CDATA[<p>Hey folks, I&#8217;ve been working on a couple iPhone applications recently, and things are at the point where I could use a couple beta users.  If you&#8217;re interested in any of these, let me know by commenting or emailing me &#8212; email temp200911@corprew.org.  You can also use the <a href="http://www.corprew.org/contact/">contact page at corprew.org</a>.</p>
<ul>
<li>I&#8217;m looking for some users for App A, and it would help if you lived in the Seattle or Portland area and had Celiac disease for this one to be helpful for you (and for you to provide useful data for me.)
</li>
<li>I&#8217;m looking for some users for App B, mostly for people who travel a lot.  If you&#8217;re traveling by air this holiday season, you&#8217;re welcome to give it a shot.
</li>
<li>I&#8217;m also testing a game for the iPhone.  For this, it would be handy if you lived in the Capitol Hill region of Seattle and liked fun.  As strange as it seems, some people don&#8217;t like fun.  This should be fun.
</li>
</ul>
<p>All of these are useful and/or fun.  Android versions will be coming relatively soon after the iPhone versions, ideally.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/11/29/iphone-app-beta-users-sought/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>soa / drupal</title>
		<link>http://www.corprew.org/blog/2009/11/04/soa-drupal/</link>
		<comments>http://www.corprew.org/blog/2009/11/04/soa-drupal/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 17:28:38 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[briefnotes]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=227</guid>
		<description><![CDATA[Drupal has a module for doing SOA that is about to be available in &#945;lpha release.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.drupal.org/">Drupal</a> has a <a href="http://drupal.org/project/Services">module</a> for doing <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">SOA</a> that is about to be available in &alpha;lpha release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/11/04/soa-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>more from the wordpress toolbox</title>
		<link>http://www.corprew.org/blog/2009/11/02/more-from-the-wordpress-toolbox/</link>
		<comments>http://www.corprew.org/blog/2009/11/02/more-from-the-wordpress-toolbox/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:35:59 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[menus]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.corprew.org/blog/2009/11/02/more-from-the-wordpress-toolbox/</guid>
		<description><![CDATA[This is a trivial something that seems to come up staggeringly often when translating design to implementation in word press sites, so I thought I&#8217;d post it up here so I don&#8217;t have to recreate from scratch next time I need it. 
So, you have a long, carefully contrived, SEO-friendly title for your pages (or [...]]]></description>
			<content:encoded><![CDATA[<p>This is a trivial something that seems to come up staggeringly often when translating design to implementation in word press sites, so I thought I&#8217;d post it up here so I don&#8217;t have to recreate from scratch next time I need it. </p>
<p>So, you have a long, carefully contrived, SEO-friendly title for your pages (or really just a minimally descriptive one), but you don&#8217;t want that to show up in the navigation menus.  There are a variety of complex ways to fix this, but one of the easiest is to use code like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php 
    <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> get_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;parent=0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># returns parent pages</span>
      <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$x_page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$option</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_page_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x_page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$short_title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$short_title</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x_page</span> <span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;nav_title&quot;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$short_title</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$option</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$x_page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
                <span style="color: #000088;">$option</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$short_title</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">end</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$option</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">echo</span> <span style="color: #000088;">$option</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This usually ends up in header.php, and is a good patch for the problem.  There are a couple of plugins that attempt to work around this by detecting whether or not you&#8217;re in the loop (the loop being the name for the main part of post/page printing), but invariably widgets screw this up somehow, and this solution seems to work a bit better for me, especially for a navigation header (hence the name.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/11/02/more-from-the-wordpress-toolbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classy</title>
		<link>http://www.corprew.org/blog/2009/10/07/classy/</link>
		<comments>http://www.corprew.org/blog/2009/10/07/classy/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:14:37 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[online class]]></category>

		<guid isPermaLink="false">http://www.corprew.org/blog/2009/10/07/classy/</guid>
		<description><![CDATA[I&#8217;m developing an online class about categorizing web content, mostly aimed at users of content management systems.  If you&#8217;re interested in being part of the trial audience for this class, comment or contact me.  Ideally, this will be a series of short videos each of which will be on some particular topic.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m developing an online class about categorizing web content, mostly aimed at users of content management systems.  If you&#8217;re interested in being part of the trial audience for this class, comment or contact me.  Ideally, this will be a series of short videos each of which will be on some particular topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/10/07/classy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubber Duck Regatta @ Cal Anderson Park @ 7pm</title>
		<link>http://www.corprew.org/blog/2009/07/30/rubber-duck-regatta-cal-anderson-park-7pm/</link>
		<comments>http://www.corprew.org/blog/2009/07/30/rubber-duck-regatta-cal-anderson-park-7pm/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 20:47:46 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.corprew.org/blog/2009/07/30/rubber-duck-regatta-cal-anderson-park-7pm/</guid>
		<description><![CDATA[



My bag

Originally uploaded by Corprew / Zeitgeist


Examine the contents of this bag.
Rubber Duck Regatta in Cal Anderson Park’s fountain tonight at 7pm.  I&#8217;ll hold another next week as well.
There are a variety of duck vendors in town for those who wish to ‘prepare.’ Archie McPhee’s come to mind. Check your bathtub for suspects as [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
<a href="http://www.flickr.com/photos/corprew/3772410021/" title="photo sharing"><img src="http://farm3.static.flickr.com/2618/3772410021_e8668e1a61_m.jpg" alt="" style="border: solid 2px #000000;" /></a><br />
<br />
<span style="font-size: 0.9em; margin-top: 0px;"><br />
<a href="http://www.flickr.com/photos/corprew/3772410021/">My bag</a><br />
<br />
Originally uploaded by <a href="http://www.flickr.com/people/corprew/">Corprew / Zeitgeist</a><br />
</span>
</div>
<p>Examine the contents of this bag.</p>
<p>Rubber Duck Regatta in Cal Anderson Park’s fountain tonight at 7pm.  I&#8217;ll hold another next week as well.</p>
<p>There are a variety of duck vendors in town for those who wish to ‘prepare.’ Archie McPhee’s come to mind. Check your bathtub for suspects as well.</p>
<p>There will be round robin with ducks, and also heats for any sort of random things that people want to enter into the competition.</p>
<p>The rules:<br />
1. ducks get put into the fountain<br />
2. ducks float downstream through all the rocks and bricks.<br />
3. eventually, a duck reaches the end.</p>
<p>Isn’t that just… ducky.</p>
<p>This will happen again in a couple of weeks. A more exotic web page to follow after we try this and see what kind of web page it needs.<br />
<br clear="all" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/07/30/rubber-duck-regatta-cal-anderson-park-7pm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>federated search party (tl; dr)</title>
		<link>http://www.corprew.org/blog/2009/07/23/federated-search-party-tl-dr/</link>
		<comments>http://www.corprew.org/blog/2009/07/23/federated-search-party-tl-dr/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:39:05 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[computer programming]]></category>
		<category><![CDATA[infosci]]></category>
		<category><![CDATA[aboutLastNight]]></category>
		<category><![CDATA[celiaq]]></category>
		<category><![CDATA[content serach]]></category>
		<category><![CDATA[federated search]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[relevance]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[tfidf]]></category>
		<category><![CDATA[yourmomusesinformationscienceconcepts]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=217</guid>
		<description><![CDATA[I&#8217;m making this post to elucidate some conversations I had late night last night, none of this is particularly rocket science or necessarily even model rocket science.  One hilarious thing that keeps coming up is federating search &#8212; combining search results from multiple datastores, which is a moderately hard problem to come up with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m making this post to elucidate some conversations I had late night last night, none of this is particularly rocket science or necessarily even model rocket science.  One hilarious thing that keeps coming up is federating search &#8212; combining search results from multiple datastores, which is a moderately hard problem to come up with a general solution for, but relatively easy (frequently) to come up with a solution for a particular purpose.</p>
<p>Complicated general solutions (such as that found in <a href="http://jcp.org/en/jsr/detail?id=170>JSR 170 and similar systems</a>), involve figuring out the relationships between properties and their search indices.  For example, all documents in a content management system have a title, right?  Well, some might have a title but have it indexed in lower case and others might have a name property indexed in the case it was entered into the system in and so on.</p>
<p>celiaq, for example, has three different search stores that it uses, a &#8216;normal&#8217; database (mysql), a full text database (also using mysql), and it also searches amazon&#8217;s catalog.  (It also searches <a href="http://geonames.org/">GeoNames</a> for a lot of content information, but it doesn&#8217;t federate that with other results and uses a couple of other data sources that aren&#8217;t relevant to this.)</p>
<p>Here&#8217;s the (relatively trivial) code that does &#8216;content&#8217; (normally: fulltext but in content management systems called &#8216;content search&#8217;) searching.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Contentsearch
  <span style="color:#9966CC; font-weight:bold;">module</span> ClassMethods; <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>klass<span style="color:#006600; font-weight:bold;">&#41;</span>
    klass.<span style="color:#9900CC;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span>ClassMethods<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> ft_index
    logger.<span style="color:#9900CC;">debug</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;[contentsearch::ftindex] submitting #{self.id} #{self.name}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    Bj.<span style="color:#9900CC;">submit</span> <span style="color:#996600;">&quot;./script/runner jobs/add_to_consearch.rb -t #{self.class.name.downcase} -i #{self.id}&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> ft_deindex
    logger.<span style="color:#9900CC;">debug</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;[contentsearch::ftdeindex] removing #{self.id} #{self.name}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    Bj.<span style="color:#9900CC;">submit</span> <span style="color:#996600;">&quot;./script/runner jobs/remove_from_consearch.rb -t #{self.class.name.downcase} -i #{self.id}&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">module</span> ClassMethods
    <span style="color:#9966CC; font-weight:bold;">def</span> ft_search<span style="color:#006600; font-weight:bold;">&#40;</span>kw_string<span style="color:#006600; font-weight:bold;">&#41;</span>
      clsname = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">name</span>.<span style="color:#9900CC;">downcase</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;s&quot;</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">find_by_sql</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;select distinct #{clsname}.id, lots of stuff i deleted here, MATCH(content) against (?) as relevance FROM #{clsname},consearches WHERE consearches.ftable_id = #{clsname}.id and consearches.ftable_type='#{self.name}' and match(content) against (?) order by relevance limit 6&quot;</span>,kw_string,kw_string<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This example is written in Ruby (on Rails), and the first part is just a convention for putting class methods into a ruby class.  How Ruby (and smalltalk and similar languages) handle methods is a fascinating but different discussion but essentially it&#8217;s a <a href="http://en.wikipedia.org/wiki/Metaprogramming">metaprogramming</a> party and everyone&#8217;s invited.</p>
<p>Ruby makes this relatively simple to add as a module to pretty much any class.  The reason that ft_index and ft_deindex run in a background process is because taking a document in or out of a fulltext indexed mysql database is way slower than you would want to present to the user in an interactive process.  This is common in web applications and is part of why you see things like &#8220;your [whatever] may not appear in searches right away&#8221; from a lot of applications.  If you leave them to run on their own they&#8217;re fast enough but generally would make the user unhappy.</p>
<p>But basically, what&#8217;s going on here is that there&#8217;s two separate tables (and different table types in mysql &#8212; one of which does fulltext searching and the other of which has ACID properties.)  By joining these two tables together, you can search against the content tables and get results back from the main table that stores domain objects.  This is probably the simplest version of federating two different search types together.  It works pretty smoothly and this sort of thing is in a number of different products.  </p>
<p>(And for rails people, the relevant string in the model classes for this is <code>has_one :consearch, :as => :ftable</code>)</p>
<p>But this is obviously trivially simple:  the objects in the content search table are <em>representations</em> of the objects in the main table, and there are entirely <em>separate</em> semantics between the two tables (and unfortunately i deleted the examples using both the main and consearch table, but it&#8217;s a join and you get the idea.)  One of the tables does &#8216;field operator value&#8217; type searching (ie: relational) and the other is the kind referred to these days as &#8216;google searching.&#8217;</p>
<p>Things get progressively more difficult when one of these things aren&#8217;t true &#8212; that there isn&#8217;t a store that has the single unified version of the document or that the semantics are related but not either identical or entirely different.  For example, if I&#8217;m searching two different instantiations of my own product, it&#8217;s fairly easy &#8212; all the fields mean the same thing between the two different databases.</p>
<p>If the products differ by schema or meaning of the schema, you have to make a (semantic) translation between the two to make the search work, and also you have to make some sort of translation on the search results to have the results displayed to the user in a way that makes sense.  This might be as simple as &#8216;one repository has names and one things have titles&#8217; or it might be more complex (names versus ids, names in particular formats, URLs versus descriptive strings, date formats that give seconds versus those that are accurate to the day, etc&#8230;)</p>
<p>It&#8217;s when you start combining these sorts of things that stuff starts getting more complex.  (This is also leaving aside the issue that the <em>protocols</em> to access all of this information is different (although these days more and more of this becomes an adventure in XML parsing and not DLL hell.)  Let&#8217;s take a simple example, sorting.</p>
<p>Say I have three different datastores Repo1 &#8211; Repo3, and they both return objects with titles on them, and I&#8217;m sorting the titles:</p>
<p>Repo1: [Alpha, Bravo, Charlie, Delta, Echo, Foxtrot ]<br />
Repo2: [Able, Baker, Charlie, Dog, Easy, Fox]<br />
Repo3: [Alligator, Crocodile, Pterosaur]</p>
<p>It&#8217;s fairly easy to implement this sort, there are a few small issues (like paging results versus the page sizes of the underlying repositories, but regardless alphabetic sorts are well-understood in most locales.</p>
<p>However, if you&#8217;re searching by something more like &#8216;<a href="http://en.wikipedia.org/wiki/Relevance_%28information_retrieval%29">relevance</a>&#8216;, you get back a  number associated with each result (so the document that had the &#8216;Alpha&#8217; before might have a score of &#8216;0.91&#8242;).  It&#8217;s simple to order numbers as well, but how do you tell that a number in one datastore corresponds to a number in another?  For one thing, those numbers are calculated (mostly) with regards to the particular collection of documents on a given datastore and for another, one repository may just tend to return a higher number for documents that are theoretically as relevant (because there isn&#8217;t any agreement about what 0.91 means, it&#8217;s just what a function returns.)</p>
<p>So those two things are where it starts to get more complex and needing actual customization and specialization. </p>
<p>In conclusion, this is way too (f) long for the blog, but I was typing it up to explain things that I was talking about yesterday anyway.  HTH.  Feel free to comment, but if you&#8217;re the person I&#8217;m proximately writing this for, you should probably send email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/07/23/federated-search-party-tl-dr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>celiaq &#8212; the last while</title>
		<link>http://www.corprew.org/blog/2009/07/01/celiaq-the-last-while/</link>
		<comments>http://www.corprew.org/blog/2009/07/01/celiaq-the-last-while/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 19:14:23 +0000</pubDate>
		<dc:creator>corprew</dc:creator>
				<category><![CDATA[computer programming]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[celiac]]></category>
		<category><![CDATA[celiaq]]></category>
		<category><![CDATA[gluten]]></category>
		<category><![CDATA[tempus fugit]]></category>

		<guid isPermaLink="false">http://www.corprew.org/?p=214</guid>
		<description><![CDATA[So, for the last while I&#8217;ve been working on celiaq.com.  It&#8217;s a social network for people with Celiac disease and other forms of Gluten Intolerance.  It&#8217;s designed around the resources that that community has trouble getting reliable information about on the internet, and I think that it&#8217;s coming along pretty well.
Right now, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>So, for the last while I&#8217;ve been working on <a href="http://celiaq.com/">celiaq.com</a>.  It&#8217;s a social network for people with Celiac disease and other forms of Gluten Intolerance.  It&#8217;s designed around the resources that that community has trouble getting reliable information about on the internet, and I think that it&#8217;s coming along pretty well.</p>
<p>Right now, it&#8217;s looking like that will be done and in a somewhat stable state by 7/15.  It&#8217;s based on rails and hosted at slicehost right now, although I suspect that it will be moving to Amazon EC2, CloudFront and S3 as it scales to make things easier.  It&#8217;s a rails/mysql application for the most past, although it would probably run on other db backends.</p>
<p>It&#8217;s been an interesting time taking this entire application from vision to deployment, and it&#8217;s been a good time.  Currently it&#8217;s in a beta state, and is soft launched to let interested people enter resources and test the system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corprew.org/blog/2009/07/01/celiaq-the-last-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
