<?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>memamsa</title>
	<atom:link href="http://blog.memamsa.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.memamsa.com</link>
	<description>Ideas &#38; Investigations</description>
	<lastBuildDate>Sun, 31 Jan 2010 05:47:58 +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>gClouds and iDevices</title>
		<link>http://blog.memamsa.com/2010/01/30/gclouds-and-idevices/</link>
		<comments>http://blog.memamsa.com/2010/01/30/gclouds-and-idevices/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 05:44:18 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[insights]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=212</guid>
		<description><![CDATA[The recent unveiling of the Apple iPad is portent for the evolution for Mac OS X towards the iPhone OS. Existing iPhone apps will run on the iPad, with presumably the same App Store model. Apple has also (carefully, purposely) not included Adobe Flash support for the iPhone and now the iPad. This implies that [...]]]></description>
			<content:encoded><![CDATA[<p>The recent unveiling of the Apple iPad is portent for the evolution for Mac OS X towards the iPhone OS. Existing iPhone apps will run on the iPad, with presumably the same App Store model. Apple has also (carefully, purposely) <a href="http://theflashblog.com/?p=1703">not included Adobe Flash support</a> for the iPhone and now the iPad. This implies that Apple is deadly serious about creating a third party developer ecosystem that is tied to its own SDK, licensing, runtime and payment mechanism.</p>
<p>While Webkit and Safari remain at the forefront of web, HTML5 and Javascript support, given the evolution of Apple devices and custom interface gestures (e.g. pinch, expand, hold, etc.) as well as new revenue models through App Store downloads and in-app purchases, there is an emerging Dilemma for software developers and small companies to consider.</p>
<p><em><strong>Do you want to be in the cloud or on the device?</strong></em><span id="more-212"></span></p>
<p>Let me elaborate. Large companies rarely bet. They hedge. They will &#8220;continue to leverage their core website operations in creating and nurturing a viable consumer touchpoint through their iPhone applications strategy&#8221;. But competent developers know that platforms and tools shape your thinking. When you live and breathe a world-view, you are more likely to be productive and create something worthwhile.</p>
<p>Being in the cloud is hardly revolutionary, since everyone is already in the cloud, or talking about being in the cloud. We are talking about specializing in the cloud. Sure, there will be ways to deliver your service front-end to multiple devices using general purpose browser technology, but the winning devices will offer specialized experiences and you will not have the time or expertise to invest in them while defending yourself from Google-grabs and other pure-play cloud competitors.</p>
<p>Today, making an iPhone app is a few weeks of work. Figure another two weeks for doing an Android version. But, the devices are going to be richer, there will be more bells and whistles and knobs on the platform, more hoops to jump through to get into the app stores, all the while thinking of more hooks to keep your users engaged.</p>
<p>You might be able to do both, a rare possibility. A three-person-minimum company can emulate Apple &#8211; one guy doing the cloud part, another doing the device app, and the third channeling Jobs, exercising taste and overall control.</p>
<p>Here is another thing to ponder about and wager on. In a future with separate cloud and device ecosystems, would the total opportunity space for independent players shrink or grow?</p>
<p>Where are you placing your bets?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2010/01/30/gclouds-and-idevices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI-driven Database Snapshot &amp; Restore</title>
		<link>http://blog.memamsa.com/2010/01/07/ui-driven-database-snapshot-restore/</link>
		<comments>http://blog.memamsa.com/2010/01/07/ui-driven-database-snapshot-restore/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 00:23:21 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=197</guid>
		<description><![CDATA[For most people, backing application databases is usually (touch wood) a one-way operation. You take your precautionary measures, employ some kind of hosted or scripted backup solution, and hope that you only infrequently, if ever, have to restore from an old database.
But, what if you want to take a database snapshot at any time, keep [...]]]></description>
			<content:encoded><![CDATA[<p>For most people, backing application databases is usually (touch wood) a one-way operation. You take your precautionary measures, employ some kind of hosted or scripted backup solution, and hope that you only infrequently, if ever, have to restore from an old database.</p>
<p>But, what if you want to take a database snapshot at any time, keep a list of such snapshots and restore at will from any of them at any time? And you want to do it from the UI? Sounds far-fetched?</p>
<p>Here is one scenario.</p>
<ol>
<li>Your sales guy has lined up multiple demos for your app and he wants to tailor the data and demo aspects for each client.</li>
<li>Your dev team is too busy to spend time crafting a whole new admin console just to make a whiz-bang demo.</li>
<li>ssh? mysqldump? redirect output? &gt;, &lt; #@*?</li>
</ol>
<p>With Rails and Rake, here is how you can make your sales guy happy and get him to buy you some Mai Tais.<span id="more-197"></span></p>
<p>Introduce two new rake tasks, db:snapshot and db:restore which take DIR and NAME from the environment (as well as the Rails environment).<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># lib/tasks/db.rake</span>
namespace <span style="color:#ff3333; font-weight:bold;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">'Store a snapshot of the database with the given name'</span>
  task <span style="color:#ff3333; font-weight:bold;">:snapshot</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    path = ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;DIR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#996600;">&quot;db/snapshots&quot;</span>
    stamp = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%Y%m%d&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">tv_sec</span>.<span style="color:#9900CC;">to_s</span>.<span style="color:#9900CC;">slice</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">-</span>6..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    file = ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;NAME&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#996600;">&quot;#{stamp}_snapshot.sql&quot;</span>
&nbsp;
    dbconf = <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">configurations</span><span style="color:#006600; font-weight:bold;">&#91;</span>RAILS_ENV<span style="color:#006600; font-weight:bold;">&#93;</span>
    dbcmd = <span style="color:#996600;">&quot;mysqldump -u #{dbconf['username']} -p#{dbconf['password']} &quot;</span>
    dbcmd <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;#{dbconf['database']} &gt; #{path}/#{file}&quot;</span>
    sh dbcmd
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">'Load database from a previously stored snapshot'</span>
  task <span style="color:#ff3333; font-weight:bold;">:restore</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    path = ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;DIR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#996600;">&quot;db/snapshots&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;NAME&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      filename = <span style="color:#996600;">&quot;#{path}/#{ENV[&quot;</span>NAME<span style="color:#996600;">&quot;]}&quot;</span>
      dbconf = <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">configurations</span><span style="color:#006600; font-weight:bold;">&#91;</span>RAILS_ENV<span style="color:#006600; font-weight:bold;">&#93;</span>
      dbcmd = <span style="color:#996600;">&quot;mysql -u #{dbconf['username']} -p#{dbconf['password']} &quot;</span>
      dbcmd <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;#{dbconf['database']} &lt; #{filename}&quot;</span>
      sh dbcmd
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#ff6633; font-weight:bold;">$stderr</span>.<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;No snapshot name provided. Nothing to do.&quot;</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></code><br />
Enable controllers to invoke these rake tasks in the background.<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># application_controller.rb</span>
protected
<span style="color:#9966CC; font-weight:bold;">def</span> invoke_rake<span style="color:#006600; font-weight:bold;">&#40;</span>task, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:rails_env</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span>= Rails.<span style="color:#9900CC;">env</span>
  args = options.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>k, v<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;#{k.to_s.upcase}='#{v}'&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  rake = <span style="color:#996600;">&quot;rake #{task} #{args.join(' ')} --trace 2&gt;&amp;1 &gt;&gt; #{Rails.root}/log/rake.log &amp;&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">system</span> rake
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p></code><br />
Wrap the snapshot storage and lookup in a pseudo-model.<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># app/models/snapshot.rb</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Snapshot <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  DIR = Demo.<span style="color:#9900CC;">getval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'snapshots_dir'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> APP_CONFIG<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:snapshots_dir</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  SUFFIX = APP_CONFIG<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:snapshot_suffix</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#996600;">'.snap.sql'</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">all</span>
    list = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
    files = <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{DIR}/*#{SUFFIX}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    files.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>snap<span style="color:#006600; font-weight:bold;">|</span>
      list <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span>
        snap.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">last</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{SUFFIX}/).first,</span>
        <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">stat</span><span style="color:#006600; font-weight:bold;">&#40;</span>snap<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">ctime</span>
      <span style="color:#006600; font-weight:bold;">&#93;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
   list
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
    name.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>\s\<span style="color:#006600; font-weight:bold;">&amp;</span>\@\!\<span style="color:#008000; font-style:italic;">#\$\%\^\*\(\)\+]/, '-')</span>
    <span style="color:#006600; font-weight:bold;">&#123;</span>:dir <span style="color:#006600; font-weight:bold;">=&gt;</span> DIR, <span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> name <span style="color:#006600; font-weight:bold;">+</span> SUFFIX<span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>And put the pieces together as you want through appropriate views and controllers. (Thanks,<a href="http://railscasts.com/episodes/127-rake-in-background">Railscasts</a> and <a href="http://blog.craigambrose.com/articles/2007/03/01/a-rake-task-for-database-backups">Craig Ambrose</a>)</p>
<p>Happy New Year!</p>
<p>But, wait, you want some previous year back? Sorry, we can't do that yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2010/01/07/ui-driven-database-snapshot-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails-style jQuery UI Menu</title>
		<link>http://blog.memamsa.com/2009/11/22/rails-style-jquery-ui-menu/</link>
		<comments>http://blog.memamsa.com/2009/11/22/rails-style-jquery-ui-menu/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 21:08:27 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=177</guid>
		<description><![CDATA[Some people love the drop-down, drill-down fly-out menu, which is now working its way into the official jQuery UI code-base.
The menu looks great, but is a bit tedious to construct. In fact, its downright onerous for the railszers used as we are to select_tag and options_for_select.
Ruby to the rescue!
The rails-jquery-dropdown helper generates the drop-down HTML [...]]]></description>
			<content:encoded><![CDATA[<p>Some people love the <a href="http://www.filamentgroup.com/lab/jquery_ipod_style_and_flyout_menus/">drop-down, drill-down fly-out menu</a>, which is now <a href="http://wiki.jqueryui.com/Menu">working its way</a> into the official <a href="http://jqueryui.com/">jQuery UI</a> code-base.</p>
<p>The menu looks great, but is a bit tedious to construct. In fact, its downright onerous for the railszers used as we are to <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001730">select_tag</a> and <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M001627">options_for_select</a>.</p>
<p>Ruby to the rescue!</p>
<p>The <a href="http://github.com/dkeskar/rails-jquery-dropdown">rails-jquery-dropdown</a> helper generates the drop-down HTML markup, places menu items and values and optionally sub-menus using a passed-in Array, and wires up the Javascript behavior using jQuery.</p>
<p>Get it from GitHub:<br />
<a href="http://github.com/dkeskar/rails-jquery-dropdown"> http://github.com/dkeskar/rails-jquery-dropdown</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/11/22/rails-style-jquery-ui-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On News</title>
		<link>http://blog.memamsa.com/2009/11/14/on-news/</link>
		<comments>http://blog.memamsa.com/2009/11/14/on-news/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 07:39:06 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[insights]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[thanks]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=157</guid>
		<description><![CDATA[The TiE Oregon event on Unfolding News was a frank and insightful discussion anchored by newspaper veteran Peter Bhatia and news entrepreneur Steve Woodward.
News about newspapers is either increasingly dire, or dramatic. The list of defunct newspaper continues to grow. Online, a news mogul mulls withdrawing news content from the Google index. Sitting face-to-face and talking [...]]]></description>
			<content:encoded><![CDATA[<p>The TiE Oregon event on <a href="http://bit.ly/tienov">Unfolding News</a> was a frank and insightful discussion anchored by newspaper veteran <a href="http://blog.oregonlive.com/oregonianeditors/about.html">Peter Bhatia</a> and news entrepreneur <a href="http://twitter.com/nozzlsteve">Steve Woodward</a>.</p>
<p>News about newspapers is either <a href="http://www.google.com/search?q=newspapers+dying">increasingly dire</a>, or dramatic. The <a href="http://en.wikipedia.org/wiki/List_of_defunct_newspapers_of_the_United_States">list of defunct newspaper</a> continues to grow. Online, a news mogul mulls <a href="http://www.telegraph.co.uk/finance/newsbysector/mediatechnologyandtelecoms/digital-media/6559694/Rupert-Murdoch-to-remove-News-Corps-content-from-Google-in-months.html">withdrawing news content from the Google index</a>. Sitting face-to-face and talking with thoughtful people with real stories from the trenches quickly brings into focus the salient issues.</p>
<p>Here are some of the key points from the discussion.<span id="more-157"></span></p>
<ol>
<li>Newspapers have historically been highly lucrative for their owners, providing greater than 25% margins. This is a for-profit business which is protected by constitutional amendments, and has enjoyed special dispensation such as preferred postal carrier rates and legal protections.</li>
<li>Printing presses have modernized, computerized and become efficient, yet they are costly to operate. Home delivery of printed news (in its American form) involves a large distribution organization.</li>
<li>Yet, print ads are highly lucrative. A full page spread in a metro newspapers such as The Oregonian may cost upwards of $12,000. Assuming a <a href="http://portland.bizjournals.com/portland/stories/2009/04/27/daily1.html">daily circulation of 300,000</a>, that&#8217;s the equivalent of $40 CPM. For comparison, online ad payouts are generally a small fraction even at $5, and typically just fractions of a dollar.</li>
<li>Newspapers are thus faced with the <a href="http://www.amazon.com/Innovators-Dilemma-Revolutionary-Business-Essentials/dp/0060521996?tag=memamsa-20">Innovators&#8217; Dilemma</a>. Their product offering with current technology is highly lucrative, enjoys wide margins, and faces certain decline. Yet, their organizational structure and DNA cannot embrace the cheapness of blogs and technology mediated aggregators.</li>
<li>Newspapers are vested in their identity around investigative journalism, political coverage and social issues. Sadly, unlike financial and business news (Reuters, WSJ) or trade news, a paying market for such news content is non-existent.</li>
<li>Newspapers and news staff are proud of their objectivity. Perversely, the audience for and profits in non-objective formats for political coverage (Rush, Lars, Glenn et al) are much higher.</li>
</ol>
<p>With challenges like these, it was refreshing to see Peter&#8217;s upbeat outlook about the future. Combining technology with editorial expertise, pioneering new content domains such as hyper-local coverage and securing a funding model for investigative journalism, Peter is confident that newspapers will thrive in the emerging Internet and device-centric world.</p>
<p>Steve provided great insights about the art and craft of news reporting as well as some of the radical innovation underway. Steve is of course acting on the future, with <a href="http://nozzlmedia.com">Nozzl Media</a> close to releasing a real-time mobile distribution and monetization engine for publishers.</p>
<p>Thanks and all the best to Peter and Steve.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/11/14/on-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AirDB Join Table Attributes</title>
		<link>http://blog.memamsa.com/2009/11/13/airdb-join-table-attributes/</link>
		<comments>http://blog.memamsa.com/2009/11/13/airdb-join-table-attributes/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 23:43:52 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[airdb]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=159</guid>
		<description><![CDATA[In some cases, it becomes necessary to have additional attributes associated with a many-many relationship.
This is typically true of &#8220;has_and_belongs_to_many&#8221; associations which end up mirroring some kind of &#8220;membership&#8221; between the joined models. For example, a library system might track borrowing of books by patrons, with extra attributes for return dates and accrued fines.
The Django guys [...]]]></description>
			<content:encoded><![CDATA[<p>In some cases, it becomes necessary to have additional attributes associated with a many-many relationship.</p>
<p>This is typically true of &#8220;has_and_belongs_to_many&#8221; associations which end up mirroring some kind of &#8220;membership&#8221; between the joined models. For example, a library system might track borrowing of books by patrons, with extra attributes for return dates and accrued fines.</p>
<p>The Django guys have a handy example about <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships">musicians and bands with extra attributes</a> such as the membership role and date of joining. In my case, I needed to track sharing status of Photos across Photosets.</p>
<p>AirDB now has support for such join table attributes. Its a bit of a hack, in the interests of time, code size and abstraction concessions. The new things, which make it all possible include:</p>
<ol>
<li>An optional argument to <a href="http://airdb.memamsa.com/com/memamsa/airdb/Migrator.html#joinTable()">Migrator.joinTable</a>()</li>
<li><a href="http://airdb.memamsa.com/com/memamsa/airdb/DB.html#execute()">DB.execute</a>(sql) to allow tweaking an existing join table.</li>
<li>Associator methods: <a href="http://airdb.memamsa.com/com/memamsa/airdb/Associator.html#setAttr()">setAttr</a>, <a href="http://airdb.memamsa.com/com/memamsa/airdb/Associator.html#findAllByAttr()">findAllByAttr</a>, <a href="http://airdb.memamsa.com/com/memamsa/airdb/Associator.html#countByAttr()">countByAttr</a>, <a href="http://airdb.memamsa.com/com/memamsa/airdb/Associator.html#getAttrVal()">getAttrVal</a>.</li>
</ol>
<p>Here are some actual code excerpts (in the Photoset model)<span id="more-159"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">   <span style="color: #009900;">// The new migration directive</span>
   <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>my<span style="color: #000000; font-weight: bold;">:</span>Migrator<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #6699cc; font-weight: bold;">var</span> statusCol<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #000000;">&#91;</span><span style="color: #990000;">'status'</span>, DB.Field.VarChar, <span style="color: #000000;">&#123;</span>
         limit<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">4</span>, <span style="color: #990000;">'default'</span><span style="color: #000000; font-weight: bold;">:</span> Photo.ShareStatus.None<span style="color: #000000;">&#125;</span>
      <span style="color: #000000;">&#93;</span>;
      DB.execute<span style="color: #000000;">&#40;</span>
         <span style="color: #990000;">&quot;ALTER TABLE photos_photosets ADD COLUMN &quot;</span> <span style="color: #000000; font-weight: bold;">+</span>
         DB.fieldMap<span style="color: #000000;">&#40;</span>statusCol<span style="color: #000000;">&#41;</span>
      <span style="color: #000000;">&#41;</span>
   <span style="color: #000000;">&#125;</span></pre></div></div>

<p>Setting the sharing status for a particular photo in this photoset</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">   <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> photoSent<span style="color: #000000;">&#40;</span>photo<span style="color: #000000; font-weight: bold;">:</span>Photo<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
      <span style="color: #0033ff; font-weight: bold;">this</span>.photos.setAttr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">status</span><span style="color: #000000; font-weight: bold;">:</span> Photo.ShareStatus.Sent<span style="color: #000000;">&#125;</span>, photo<span style="color: #000000;">&#41;</span>;
   <span style="color: #000000;">&#125;</span></pre></div></div>

<p>If no target is specified, the specified attributes are set for all associated photos in this photoset.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">    <span style="color: #0033ff; font-weight: bold;">this</span>.photos.setAttr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">status</span><span style="color: #000000; font-weight: bold;">:</span> Photo.ShareStatus.Sent<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Count the number of photos based on some attribute.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">   <span style="color: #6699cc; font-weight: bold;">var</span> xfrCond<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;status = '&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> Photo.ShareStatus.Sent;
   <span style="color: #0033ff; font-weight: bold;">this</span>.photos.countByAttr<span style="color: #000000;">&#40;</span>xfrCond<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Ideally, and with some coding leisure, this would be best done as a new has_many_through association. If you know of ActionScript language mechanisms to ease the implementation, I would be interested in hearing about them.</p>
<p>Meanwhile, we have functional join tables attributes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/11/13/airdb-join-table-attributes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery(&#8216;.contributors&#8217;).thanks();</title>
		<link>http://blog.memamsa.com/2009/09/11/jqueryresigpluginwriterscontributorsthanks/</link>
		<comments>http://blog.memamsa.com/2009/09/11/jqueryresigpluginwriterscontributorsthanks/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 23:08:23 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[thanks]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=152</guid>
		<description><![CDATA[I stumbled upon jQuery when it was still in its early stages when all it did was offer powerful CSS and regexp style selectors. It immediately made DOM manipulation from within JavaScript easy, simple and reliable.

Within a few months of my discovery, jQuery had fixed cross-browser issues, and actually made it the choice for ensuring [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon jQuery when it was still in its early stages when all it did was offer powerful CSS and regexp style selectors. It immediately made DOM manipulation from within JavaScript easy, simple and reliable.</p>
<p><a href="http://jquery.com/"><img class="alignright" style="background-color: black; padding: 10px;" title="jQuery" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" alt="" width="215" height="53" /></a></p>
<p>Within a few months of my discovery, jQuery had fixed cross-browser issues, and actually made it the choice for ensuring cross-browser support.</p>
<p>Here are some of the things that led me to consistently choose jQuery over Prototype, even if it meant eschewing the Rails/Prototype coupling and doing things the hard way.</p>
<ul>
<li>CSS-style and RegExp selectors.</li>
<li>Light-weight &#8211; smaller file size, faster download, quicker load.</li>
<li>Plays nice with others - jQuery.noConflict();</li>
<li>Many powerful mechanisms for traversing and manipulating the DOM.</li>
<li>Queue up onload logic from multiple places with jQuery(document).ready()</li>
<li>Convenient call chaining  - jQuery(&#8216;#thing&#8217;).doThis().that().more();</li>
<li>Extensibility and lots of plugins.</li>
<li>Excellent, fine-grained AJAX support.</li>
</ul>
<p>With such features, it is no surprise that the jQuery has evolved into a thriving, distributed ecosystem providing <a href="http://plugins.jquery.com/">innumerable plugins</a> and UI and effects frameworks on top such as <a href="http://jqueryui.com">jqueryUI</a>.</p>
<p>Thanks to all the <a href="http://docs.jquery.com/Contributors">contributors</a> who make it happen.</p>
<p><code>jQuery("#resig,plugin.writers,.contributors").thanks();</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/09/11/jqueryresigpluginwriterscontributorsthanks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Labels for Software Practitioners</title>
		<link>http://blog.memamsa.com/2009/08/10/labels-for-software-practitioners/</link>
		<comments>http://blog.memamsa.com/2009/08/10/labels-for-software-practitioners/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 05:41:40 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[investigations]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=145</guid>
		<description><![CDATA[People who earn a living writing software tend to describe themselves (and be described) in myriad different ways. Whether in blog posts, job boards, business plans and discussion forums, a few distinct terms and usage patterns emerge.
All too often, names and labels end up defining, more than just denoting something. Perhaps Shakespeare was being ironic [...]]]></description>
			<content:encoded><![CDATA[<p>People who earn a living writing software tend to describe themselves (and be described) in myriad different ways. Whether in blog posts, job boards, business plans and discussion forums, a few distinct terms and usage patterns emerge.</p>
<p>All too often, names and labels end up defining, more than just denoting something. Perhaps Shakespeare was being ironic when he gave the quote about roses for Juliet to say, who then suffers so famously. Most programmers would agree that it is better to have meaningful variable names. Why then, should we not give careful considerations to how we describe ourselves?<span id="more-145"></span></p>
<p>Without further ado, here are some of the terms, and their general connotations.</p>
<ol>
<li><strong>Programmer</strong>. Quaint, archaic but retro-chic. Persists in usage despite mechanistic connotations, commonly  with linguistic prefix and sometimes with desirable attributes (e.g. pragmatic).</li>
<li><strong>Coder</strong>. Probable insult. Most likely used sarcastically and/or for self-denigration. Bonus points for poetic amalgamations with the rodent or primate family.</li>
<li><strong>Engineer</strong>. Putting code blocks together to meet specified tolerances and performance criteria. An Organization Man, probably, who develops mission-critical platforms.</li>
<li><strong>Developer</strong>. Bland, but with a hint of creation and coordination. Probably a more evolved specimen than a mere Programmer and more ambitious than an Engineer?</li>
<li><strong>Computer Scientist</strong>. A theoretical bent of mind, and mastery of algorithms. True sighting in the field are rare, but rumored to create whole new paradigms and fields of work for others to toil in.</li>
<li><strong>Hacker</strong>. Notions of brilliance and mental ability coupled with enthusiasm for software and systems, mostly in pulling off the unachievable. An insider&#8217;s badge, since the mainstream media persists in conflating hackers and criminals.</li>
</ol>
<p>Less common, but more fanciful are the Software Artists, Masters, Wizards and <a href="http://en.wikipedia.org/wiki/Pham_Nuwen">Programmer-At-Arms</a>.</p>
<p>So, how do you describe yourselves? PHP Programmer, Code Monkey, Application Developer, Senior Software Engineer or Kernel Hacker? Or perhaps you prefer being a Rockstar Programmer, Ninja Developer or Software Samurai?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/08/10/labels-for-software-practitioners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Stark Example of Product Evolution</title>
		<link>http://blog.memamsa.com/2009/08/03/a-stark-example-of-product-evolution/</link>
		<comments>http://blog.memamsa.com/2009/08/03/a-stark-example-of-product-evolution/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 05:32:38 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[insights]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=134</guid>
		<description><![CDATA[Today I got a really cool poster for the upcoming Iron Man sequel, which shows the Iron Man Mark 1, 2 and 3 models.
As a kid, I was not a big Iron Man fan. I did like the movie, and I had always liked the way they picked that old song for the movie theme. [...]]]></description>
			<content:encoded><![CDATA[<p>Today I got a really cool poster for the upcoming Iron Man sequel, which shows the Iron Man Mark 1, 2 and 3 models.</p>
<div id="attachment_138" class="wp-caption aligncenter" style="width: 490px"><img class="size-full wp-image-138 " title="Iron Man Evolution" src="http://blog.memamsa.com/wp-content/uploads/2009/08/img_4931_2.png" alt="Iron Man Mark I, II, III and IV" width="480" height="245" /><p class="wp-caption-text">Iron Man Mark I, II, III and IV</p></div>
<p>As a kid, I was not a big Iron Man fan. I did like the movie, and I had always liked the way they picked that old song for the movie theme. (<a href="http://flixiq.com/?rc=246">What&#8217;s your FlixIQ on that?</a>)</p>
<p>But to me, the poster clearly showed product evolution in action. You only have so much time, limited resources, and few friends. You build what you can build to break out. As long as you survive, you can make improvements. But you have to keep testing and making refinements, before you get that super-cool and powerful product. It worked for Tony Stark, and it is a good visual for product evolution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/08/03/a-stark-example-of-product-evolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuing FlixIQ</title>
		<link>http://blog.memamsa.com/2009/08/02/cuing-flixiq/</link>
		<comments>http://blog.memamsa.com/2009/08/02/cuing-flixiq/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 17:32:46 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[ideas]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=127</guid>
		<description><![CDATA[Give the Clue, Flix I Cue. That&#8217;s FlixIQ. And it is now live at http://flixiq.com
If you have not yet clicked to see for yourselves, here is some wordiness.

FlixIQ lets you cue a video clue to create and share quizzes. We are talking video clues here, which means movies, music, sports, or anything where images flickering [...]]]></description>
			<content:encoded><![CDATA[<p>Give the Clue, Flix I Cue. That&#8217;s FlixIQ. And it is now live at <a href="http://flixiq.com">http://flixiq.com</a></p>
<p><a href="http://flixiq.com"></a>If you have not yet clicked to see for yourselves, here is some wordiness.</p>
<p style="text-align: center;"><a href="http://flixiq.com"><img class="aligncenter" title="FlixIQ" src="http://flixiq.com/images/flixiq-logo.png" alt="" width="222" height="84" /></a></p>
<p>FlixIQ lets <strong><em>you</em></strong> cue a video clue to create and share quizzes. We are talking video clues here, which means movies, music, sports, or anything where images flickering 24 times a second (a.k.a flix) trigger some memory or mental connection.</p>
<p>So, show off your total recall by answering those questions. If that&#8217;s too easy for you, stump others by finding a telling scene, and create tough challenges for others.</p>
<p><a href="http://flixiq.com/?rc=297">Verdomme, dat is kicken</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/08/02/cuing-flixiq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git init community</title>
		<link>http://blog.memamsa.com/2009/07/30/git-init-community/</link>
		<comments>http://blog.memamsa.com/2009/07/30/git-init-community/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 23:49:52 +0000</pubDate>
		<dc:creator>dkeskar</dc:creator>
				<category><![CDATA[thanks]]></category>

		<guid isPermaLink="false">http://blog.memamsa.com/?p=116</guid>
		<description><![CDATA[Late in February, at the Recent Changes Camp, I noticed some familiar faces and so walked into the Calagator Hacking session, hoping to spend a few hours learning and contributing to the code.
Alas, I was ill-equipped, lacking git. I had heard several people evangelize git, hold training sessions and in general rhapsodize about it. All the [...]]]></description>
			<content:encoded><![CDATA[<p>Late in February, at the Recent Changes Camp, I noticed some familiar faces and so walked into the Calagator Hacking session, hoping to spend a few hours learning and contributing to the code.</p>
<p>Alas, I was ill-equipped, lacking <a href="http://www.git-scm.org/">git</a>. I had heard several people evangelize git, hold training sessions and in general rhapsodize about it. All the cool kids were using it. For several time and efficiency reasons, I had put off switching to git. Meanwhile, I was dealing with the practical annoyances, since many of my svn:externals were deserting to git repositories, forcing me to download tarballs.</p>
<p><a href="http://twitter.com/igalko"><img class="alignright" title="Igal Koshevoy" src="http://s3.amazonaws.com/twitter_production/profile_images/65580283/angstorm.com_2003-06-04_portraitbyjimmy_s2_bigger.jpg" alt="Igal Koshevoy" width="73" height="73" /></a><a href="http://twitter.com/reidab"><img class="alignright" title="Reid Beels" src="http://s3.amazonaws.com/twitter_production/profile_images/111642683/avarar_bigger.jpg" alt="" width="75" height="75" /></a></p>
<p>So that day, with some help from some of the friendly <a href="http://calagator.org/">Calagator</a> folks, I got myself git. From there it was a short step to using github, and short time before I switched multiple client and project repositories to git.</p>
<p>As a result, my coding workflow has improved tremendously.</p>
<p>Sometimes, we need a nudge to stop putting things off and start doing something that improves our lives. And community meet-ups such as <a href="http://recentchangescamp.org/">RCC</a>, <a href="http://www.barcamp.org/">BarCamp</a>, and <a href="http://opensourcebridge.org/">OSBridge</a>, are great at connecting and catalyzing people to do just that.</p>
<p>Thanks to all the great folks who infuse Portland with this community spirit.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.memamsa.com/2009/07/30/git-init-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
