<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Projects and thoughts around programming and technology</description><title>brain.code</title><generator>Tumblr (3.0; @braincode)</generator><link>http://braincode.tumblr.com/</link><item><title>Knockback-Inspector for Backbone.Models and Backbone.Collections</title><description>&lt;p&gt;It has been a while since I last posted, but I have some news!&lt;/p&gt;
&lt;p&gt;After releasing &lt;a href="http://kmalakoff.github.com/knockback/release_notes.html#0_15_0"&gt;Knockback 0.15.1&lt;/a&gt;, I wanted to show how easy it is to generate and render Backbone.Model and Backbone.Collection graphs&amp;#8230;just the sort of thing you need to render relationships when you use Backbone-Relational.&lt;/p&gt;
&lt;p&gt;So after creating an &lt;a href="https://github.com/kmalakoff/knockback-inspector"&gt;inspector library&lt;/a&gt; and &lt;a href="http://kmalakoff.github.com/knockback/tutorial_inspector_library.html"&gt;accompanying tutorial&lt;/a&gt;, I would like to announce Knockback-Inspector 0.1.0.&lt;/p&gt;
&lt;p&gt;What it allows you to do is embed a tree view in your application to inspect and edit JSON data that you store in your models and collection&amp;#8230;think of it as a light debugger. Here is an example of what it can do:&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="400px" src="http://jsfiddle.net/kmalakoff/FRhEV/embedded/result,js,html,css,resources/" width="100%"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Download Knockback-Inspector now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development:  &lt;a href="https://github.com/kmalakoff/knockback-inspector/raw/master/knockback-inspector.js"&gt;knockback-inspector.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/knockback-inspector/raw/master/knockback-inspector.min.js"&gt;knockback-inspector.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/24050654738</link><guid>http://braincode.tumblr.com/post/24050654738</guid><pubDate>Wed, 30 May 2012 02:10:00 -0400</pubDate><category>knockback.js</category><category>knockbackjs</category><category>knockback-inspector</category><category>knockoutjs</category><category>backbonejs</category><category>backbone-relational</category></item><item><title>Response to UI Technology Paradigm Shift by Paul Hammant</title><description>&lt;p&gt;Before writing his &lt;a href="http://paulhammant.com/2012/01/23/ui-technology-paradigm-shift/"&gt;post&lt;/a&gt;, Paul and I briefly spoke about the &amp;#8220;state of union&amp;#8221; given the proliferation of MVC/MVVM client-side micro frameworks. He raises some important points in his post posting and it is a good read to complement this &lt;a href="http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/"&gt;MVC frameworks comparison table&lt;/a&gt;.&lt;/p&gt;
&lt;div&gt;When we spoke, Paul quite rightly raised the key risk today being that the number of frameworks is likely to continue to grow and each one may end up taking the best features from the others while reimplementing them in their own way causing further fragmentation. &lt;/div&gt;
&lt;div&gt; &lt;br/&gt;What this means to me is that:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;&lt;li&gt;we will end up with a too many frameworks with brilliant pieces and also not so brilliant pieces, but we will be forced to take the good with the bad rather than just take the good (if you’ve looked at Sproutcore 1.x, you know we are all fortunate that Yehuda Katz was involved with Ember/Sproutcore 2.0)&lt;/li&gt;
&lt;li&gt;programmers will need to jump from framework to framework whenever they change projects that have chosen yet another, slightly different MVC/MVVM framework until things consolidate. As each framework grows, their communities will need to devote more time to not only help programmers up the learning curve, but also to explain common solutions and best practices given their specific framework (Knockout is amazing at this by the way!)&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;I believe we need to step back a little further and look at what is going on and what we need. &lt;br/&gt; &lt;br/&gt;What’s going on? Well, innovation obviously! We are in the middle of a (client side) &lt;em&gt;&lt;strong&gt;Javascript and Coffeescript &lt;/strong&gt;&lt;strong&gt;Renaissance&lt;/strong&gt;&lt;/em&gt; and we’re lucky enough to be standing on the shoulders of giants while applying new techniques to make even more interactive client side applications (and HTML5/CSS3 isn&amp;#8217;t so bad either!).&lt;br/&gt;&lt;br/&gt;But what do we need? I believe we need to have the flexibly to pick and choose. Some personal examples:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;Backbone’s Models and Collections are really quick and intuitive to learn, but their View (or partial-Controller) implementation is quite limited. Combining Backbone with Knockout into Knockback allowed me to iterate quickly and make beautiful, dynamic Views (easily using multiple Backbone models per View) with a templating engine that I was comfortable with.&lt;/li&gt;
&lt;li&gt;jQuery Mobile’s default approach is a page per screen so they implement history and screen transitions as part of their framework. I originally chose JQM hoping that their Themeroller would be great for a designer, but each new release required me to disable more of their code to quickly get a single page app working again&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;p&gt;So how do we pick and choose? I like Rails 3 modularity and believe it should be used for inspiration. Do we need modules like Active Resource, Action Contoller, Rack middleware-compliance, etc? Do we use CommonJS/RequireJS/AMD, a nano-framework framework like &lt;a href="https://github.com/kmalakoff/mixin"&gt;Mixin&lt;/a&gt;, or just use conventions? &lt;/p&gt;
&lt;div&gt;Maybe we just need to agree on the components for a good client side app and allow for different configurable distributions like &lt;a href="https://github.com/brunch/brunch"&gt;Brunch&lt;/a&gt;? &lt;br/&gt;&lt;br/&gt;I believe development teams should be able to make choices like between Pathjs or Backbone Routers for history/routing, eco or Mustache for templates, Backbone or Spline models, Backbone Views or a binding library like Knockout, Sprockets or Brunch for asset packaging, Less or SCSS or CSS for stylesheets, etc. &lt;br/&gt;&lt;br/&gt;And if something better comes along, taking a modular approach now should make it easier to replace a single component and its touch-points rather than being forced into an “all of nothing” decision down the line (which is almost never a good thing!). &lt;br/&gt;&lt;br/&gt;Best of all, rather than make a huge upfront MVC framework decision you can incrementally and iteratively choose the best available modules for whatever will make your client side application standout and be incredible! &lt;br/&gt;&lt;br/&gt;To put my money where my mouth is&amp;#8230;I would welcome a larger community like from Backbone to reverse-takeover Knockback and make it into a standard (but separate!) Backbone Model adapter library for different binding libraries like Angular, Batman, or something new (but not in the Backbone Model/Collection core). &lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Alternatively, split Backbone into 3 modules: 1) Routing (Routers/History), 2) ORM (Models/Collections), and 3) Controller (View). Then, request proposals from the community for a replacement for the Controller (View) module (or even consider deprecating it) because with all of the recent innovations in the MVC space, there are already much better ways to do it.&lt;/div&gt;
&lt;div&gt;&amp;#8230;&lt;/div&gt;
&lt;div&gt;Tear down these walls!&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&amp;#8230;&lt;/div&gt;
&lt;/div&gt;</description><link>http://braincode.tumblr.com/post/16351440663</link><guid>http://braincode.tumblr.com/post/16351440663</guid><pubDate>Mon, 23 Jan 2012 16:00:23 -0500</pubDate><category>knockback</category><category>knockbackjs</category><category>knockoutjs</category><category>knockout</category><category>backbone</category><category>backbonejs</category><category>angular</category><category>Paul Hammant</category></item><item><title>Knockback website is live!</title><description>&lt;p&gt;Knockback is starting to take off so it was about time to have a proper website and here it is: &lt;a href="http://kmalakoff.github.com/knockback/"&gt;&lt;a href="http://kmalakoff.github.com/knockback/"&gt;http://kmalakoff.github.com/knockback/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is a great comparison table to explain how Backbone, Knockout, and Knockback shine together as a complete MVVM solution. A big thank you to  &lt;a href="https://github.com/yuchi"&gt;Pier Paolo Ramon&lt;/a&gt; for all his hard work to make this site so informative and slick!&lt;/p&gt;
&lt;p&gt;Also, be sure to check out the documentation:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;a href="https://github.com/kmalakoff/knockback"&gt;Knockback repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kmalakoff/knockback-todos"&gt;Knockout-Todos repository&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;And the demos:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;a href="http://kmalakoff.github.com/knockback-todos"&gt;Knockback-Todos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsfiddle.net/kmalakoff/QSkpv/"&gt;jsfiddle&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Download Knockback.js now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.js"&gt;knockback.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.min.js"&gt;knockback.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Knockback.js works with both Knockout1.2.1 and Knockout1.3&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Kevin&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/13823238534</link><guid>http://braincode.tumblr.com/post/13823238534</guid><pubDate>Tue, 06 Dec 2011 06:55:37 -0500</pubDate><category>knockout</category><category>backbone</category><category>knockback</category></item><item><title>Knockback Todos Demo</title><description>&lt;p&gt;I&amp;#8217;ve put together a demo of Knockback using the obligatory todo app&amp;#8230;with a twist!&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t want to do just a simple technical display of coolness, but something a little more real world. Until we get a proper Knockback website up and running, check out the &lt;a href="https://github.com/kmalakoff/knockback-todos"&gt;github page&lt;/a&gt; and the three demos:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Todos Classic&lt;/strong&gt; - a minimal version of the todo&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Todos&lt;/strong&gt; - a version that shows off the power of Knockback: live changes synchronized across views, localization from day one, dynamic list sorting, etc&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Todos Mockup&lt;/strong&gt; - this is where I started with the concept. It isn&amp;#8217;t interactive, but is a good resource for understanding the architecture of a Knockback app without having to get into any framework implementation details.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Try it live:&lt;/strong&gt; &lt;a href="http://kmalakoff.github.com/knockback-todos"&gt;http://kmalakoff.github.com/knockback-todos&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/knockback"&gt;https://github.com/kmalakoff/knockback&lt;/a&gt; and here: &lt;a href="https://github.com/kmalakoff/knockback-todos"&gt;https://github.com/kmalakoff/knockback-todos&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download Knockback.js now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.js"&gt;knockback.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.min.js"&gt;knockback.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Knockback.js works with both Knockout1.2.1 and Knockout1.3&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/13026270065</link><guid>http://braincode.tumblr.com/post/13026270065</guid><pubDate>Sat, 19 Nov 2011 15:44:00 -0500</pubDate><category>knockback</category><category>knockback.js</category><category>knockout</category><category>knockout.js</category><category>knockoutjs</category><category>backbone</category><category>backbone.js</category><category>backbonejs</category><category>knockbackjs</category></item><item><title>Backbone.ModelRef: A small library for lazy Backbone models </title><description>&lt;p&gt;OK. This is a little smaller of a library than usual, but still useful! &lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve made a small Backbone.ModelRef class which stores a collection and model id, and notifies you when it is loaded and unloaded using bindable Backbone.Events: &amp;#8216;loaded&amp;#8217; and &amp;#8216;unloaded&amp;#8217;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example: A view with states depending on the model being loaded or not&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;  class MyView extends Backbone.View
    constructor: (@model_ref) -&amp;gt;
      super; _.bindAll(this, 'render', 'renderWaiting')
      @model_ref.bind('loaded', @render); @model_ref.bind('unloaded', @renderWaiting)
      if @model_ref.isLoaded() then @render() else @renderWaiting()

    render: -&amp;gt; @is_waiting = false
    renderWaiting: -&amp;gt; @is_waiting = true

  collection = new MyCollection()
  view = new MyView(new Backbone.ModelRef(collection, 'dog'))
  # view is now rendering in waiting state

  collection.add(collection.parse([{id: 'dog'}]))
  # view is now rendering in loaded state

  collection.reset()
  # view is now rendering in waiting state

&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Personal Use:&lt;/strong&gt; I use this often because my web site my have a URL like &amp;#8220;{host}/models/2&amp;#8221; and if you refresh the page, the model isn&amp;#8217;t loaded yet (and it may never load if the model has been deleted). Rather than waiting or writing some custom code for each view, I have two states for my model views with loading messages while waiting and timeouts for when the load fails (using &amp;#8220;Mixin.Timeouts&amp;#8221; from: &lt;a href="https://github.com/kmalakoff/mixin"&gt;Mixin.js&lt;/a&gt;).  &lt;/p&gt;
&lt;p&gt;Also, Backbone.ModelRef is supported by Knockback.js (&lt;a href="https://github.com/kmalakoff/knockback"&gt;Knockback.js&lt;/a&gt; and &lt;a href="http://braincode.tumblr.com/post/12236265843/knockback-js-you-got-your-knockout-in-my-backbone"&gt;this blog post&lt;/a&gt;) so if you like, you can set default values in fields while you wait.&lt;/p&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/backbone-modelref"&gt;&lt;a href="https://github.com/kmalakoff/backbone-modelref"&gt;https://github.com/kmalakoff/backbone-modelref&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/backbone-modelref/raw/master/backbone-modelref.js"&gt;backbone-modelref.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/backbone-modelref/raw/master/backbone-modelref.min.js"&gt;backbone-modelref.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><link>http://braincode.tumblr.com/post/12236626414</link><guid>http://braincode.tumblr.com/post/12236626414</guid><pubDate>Wed, 02 Nov 2011 06:37:00 -0400</pubDate><category>backbone</category><category>backbone.js</category><category>backbone-modelref</category><category>backbone-modelref.js</category><category>knockback.js</category><category>knockback</category><category>knockout</category><category>knockout.js</category></item><item><title>Knockback.js: You got your Knockout in my Backbone</title><description>&lt;p&gt;I&amp;#8217;m really excited about releasing this. Knockback.js provides Backbone model and collection bindings for Knockout.&lt;/p&gt;
&lt;p&gt;This means you can now put different views of the same models on your web page and they can automatically update&amp;#8230;one or two way, and localization is a breeze. Take a look at this jsFiddle:  &lt;a href="http://jsfiddle.net/kmalakoff/QSkpv/"&gt;&lt;a href="http://jsfiddle.net/kmalakoff/QSkpv/"&gt;http://jsfiddle.net/kmalakoff/QSkpv/&lt;/a&gt;&lt;/a&gt; and you can see:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;it dynamically localizes all the labels and event the text inputs&lt;/li&gt;
&lt;li&gt;it dynamically sorts the model views based on the &lt;span&gt;sortedIndex function &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;all changes in a model are updated in real time using Knockout bindings&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Example: A simple model attributes binding&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;  The view model:

    ContactViewModel = (model) -&amp;gt;
      kb.observables(model, {
        name:     {key:'name'}
        email:    {key:'email', write: true, default: 'your.name@yourplace.com'}
        date:     {key:'date', write: true, localizer: LongDateLocalizer}
      }, this)

  The HTML:

    &amp;lt;label&amp;gt;Name: &amp;lt;/label&amp;gt;&amp;lt;input data-bind="value: name" /&amp;gt;
    &amp;lt;label&amp;gt;Email: &amp;lt;/label&amp;gt;&amp;lt;input data-bind="value: email" /&amp;gt;
    &amp;lt;label&amp;gt;Birthdate: &amp;lt;/label&amp;gt;&amp;lt;input data-bind="value: date" /&amp;gt;

  And...engage:

    view_model = new ContactViewModel(collection.get('some_id'))
    ko.applyBindings(view_model)


&lt;/pre&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/knockback%C2%A0"&gt;https://github.com/kmalakoff/knockback &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.js"&gt;knockback.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/knockback/raw/master/knockback.min.js"&gt;knockback.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Knockback.js works with both Knockout1.2.1 and Knockout1.3&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/12236265843</link><guid>http://braincode.tumblr.com/post/12236265843</guid><pubDate>Wed, 02 Nov 2011 06:12:00 -0400</pubDate><category>backbone</category><category>backbone.js</category><category>coffeescript</category><category>javascript</category><category>knockout</category><category>knockout.js</category><category>knockback</category><category>knockback.js</category></item><item><title>Mixin.js: Example for writing your own mixins</title><description>&lt;p&gt;I realized that all the mixin examples were about how to use existing mixins&amp;#8230;not write your own! &lt;span&gt;There are a couple of things to know.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;First, you use Mixin.registerMixin with an object providing your mixin name, the object to mixin, and optionally an initialize and/or destroy method. For example: Mixin.registerMixin({mixin_name: &amp;#8216;MyMixin&amp;#8217;, mixin_object: {myFunction: -&amp;gt;}})&lt;/p&gt;
&lt;p&gt;Second, you can create and access instance data per mixed in instance using a dual-purpose function Mixin.instanceData. Set the data with Mixin.instanceData(instance, &amp;#8216;MyMixin&amp;#8217;, SOMETHING) and get the data with &lt;span&gt;Mixin.instanceData(instance, &amp;#8216;MyMixin&amp;#8217;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span&gt;Example: Create Your Own Mixin&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;# define a new mixin for a superstar with fans
Mixin.registerMixin({
  mixin_name: 'Superstar'

  initialize: -&amp;gt;
    # create instance data with an array of fans
    Mixin.instanceData(this, 'Superstar', {fans: []})

  mixin_object: {
    addFan: (fan) -&amp;gt;
      # get the instance data, and add the fan to the fans array
      Mixin.instanceData(this, 'Superstar').fans.push(fan)
      return this # allow chaining
    getFans: -&amp;gt;
      return Mixin.instanceData(this, 'Superstar').fans
  }
})

# make rockstar1 a superstar
class Rockstar
rockstar1 = new Rockstar()
Mixin.in(rockstar1, 'Superstar')

# create new fans of rockstar1
class Fan
fan1 = new Fan(); fan2 = new Fan()
rockstar1.addFan(fan1).addFan(fan2)

# fan1 now becomes a superstar and rockstar1 loses his status
Mixin.in(fan1, 'Superstar'); Mixin.out(rockstar1, 'Superstar')

# now everyone becomes a fan of fan1 (even rockstar1!)
fan1.addFan(fan2).addFan(rockstar1)

# cleanup after the new 'Superstar' (he doesn't do anything for himself anymore)
Mixin.out(fan1)
&lt;/pre&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you try out Mixin.js, please share your stories and your mixins!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.js"&gt;Mixin.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.min.js"&gt;Mixin.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><link>http://braincode.tumblr.com/post/11318127396</link><guid>http://braincode.tumblr.com/post/11318127396</guid><pubDate>Tue, 11 Oct 2011 11:41:00 -0400</pubDate><category>mixin</category><category>mixin.js</category><category>javascript</category><category>coffeescript</category></item><item><title>Underscore-Awesomer: _.parseJSON for CouchDB model</title><description>&lt;p&gt;This is an example showing a recent modification to _.parseJSON. Besides introducing a convention for serializing plain-old-JSON (POJ) into live instances, what I wanted to do was 1) introduce some flexibility into which field is used to look up the parseJSON methods, and 2) provide a way to not pollute the global namespace with your parseJSON methods.&lt;/p&gt;
&lt;pre&gt;# set up for CouchDB 'type' convention 
_.PARSE_JSON_TYPE_FIELD = 'type'
# make a Constructors namespace known to Underscore
root = this; root.Constructors||root.Constructors={}
_.PARSE_JSON_CONSTRUCTOR_ROOTS.push(root.Constructors)

class SomeModel
  constructor: (@key, @value) -&amp;gt;
  toJSON = -&amp;gt; return { type:'some_model', key:this.key, value:this.value }
  @parseJSON = (json) -&amp;gt;
    throw new Error('unexpected type') if (json.type!='some_model')
    return new SomeModel(json.key, json.value)
root.Constructors.some_model = SomeModel # add constructor to Constructors namespace

# assume this comes back from the server
json = {type:'some_model', key:'abcdef', value: {x:1, y:2, z:3} }

# deserialize - _.parseJSON finds 'root.Constructors.some_model'
some_model_instance = _.parseJSON(json)
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Personal uses&lt;/strong&gt;: Using my Backbone-Articulation.js library (&lt;a href="https://github.com/kmalakoff/backbone-articulation"&gt;Backbone-Articulation.js&lt;/a&gt;), I now automatically serialize the JSON from the server into instances inside my model attributes on the client. It means I am able to combine data with functionality on the client behind-the-scenes and just start interacting with the attributes directly.&lt;/p&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/underscore-awesomer/raw/master/underscore-awesomer.js"&gt;Underscore-Awesomer.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/underscore-awesomer/raw/master/underscore-awesomer-min.js"&gt;Underscore-Awesomer.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/underscore-awesomer"&gt;&lt;a href="https://github.com/kmalakoff/underscore-awesomer"&gt;https://github.com/kmalakoff/underscore-awesomer&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/11269018370</link><guid>http://braincode.tumblr.com/post/11269018370</guid><pubDate>Mon, 10 Oct 2011 06:37:00 -0400</pubDate><category>underscore.js</category><category>underscore-awesomer</category><category>underscore-awesomer.js</category><category>underscore</category><category>_.parseJSON</category><category>couch</category><category>couchdb</category></item><item><title>Background.js: Multiple array iteration example</title><description>&lt;p&gt;I realized that there weren&amp;#8217;t any Background.js examples on the blog. That&amp;#8217;s changing today!&lt;/p&gt;
&lt;pre&gt;queue = new Background.JobQueue(10) # create a queue that processes each 10 milliseconds
iterator = null  # declare the iterator here so it is available in the init and run loop
test_array1 = [3,7,11]; test_array2 = [3,5]; test_array3 = [13,3,23]
iteration_count = 0; result = 0

queue.push(
  (-&amp;gt;
    # set up the iterator for the arrays in batches of 3
    iterator = new Background.ArrayIterator_xN([test_array1,test_array2,test_array3],3)
  ),
  (-&amp;gt;
    iteration_count++
    return iterator.nextByItems((items)-&amp;gt; result += items[0]*items[1]*items[2])
  )
)
&lt;/pre&gt;
&lt;p&gt;This example shows how you can iterate over the combinations of items in any number of arrays in equal-sized steps and when the job is done, it comes off the queue and if there is one, the next job runs (Note: you could just as easily use a Background.JobList and run multiple jobs in parallel if sequential processing isn&amp;#8217;t important to you).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Personal uses&lt;/strong&gt;: I used something similar to apply identical filters to a collection of models and then rendered the results in batches in a second job that was executed after the filtering job was complete. Also, any time a new filter arrived I used JobContainer.clear() to immediately clear the previous jobs and to start again rather than queuing more jobs since the original jobs were now out-of-date. &lt;/p&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.js"&gt;Background.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production: &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.min.js"&gt;Background.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/background"&gt;&lt;a href="https://github.com/kmalakoff/background"&gt;https://github.com/kmalakoff/background&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/11268418597</link><guid>http://braincode.tumblr.com/post/11268418597</guid><pubDate>Mon, 10 Oct 2011 05:53:00 -0400</pubDate><category>array iteration</category><category>background</category><category>background.js</category><category>task</category><category>job</category><category>javascript</category><category>coffeescript</category></item><item><title>Mixin.js - Subscriptions example</title><description>&lt;p&gt;I&amp;#8217;ve tried to come up with a simple example demonstrating the Mixin.Subscriptions mixin and also the dynamic nature of mixins. Hopefully this hits the nail on the head!&lt;/p&gt;
&lt;pre&gt;class DynamicBroadcasterListener
  constructor: -&amp;gt;
    Mixin.in(this, ['RefCount', =&amp;gt; Mixin.out(this)])
    @sent = []; @unsent = []; @received = [];

  sendUpdate: -&amp;gt;
    args = Array.prototype.slice.call(arguments)
    if Mixin.hasMixin(this, 'Observable') and @hasSubscription('update')
      @notifySubscribers.apply(this, ['update'].concat(args))
      @sent.push(args)
    else
      @unsent.push(args)

  receiveUpdate: -&amp;gt;
    @received.push(Array.prototype.slice.call(arguments))

# create two dynamic/flexible instances and then make one Observable and the other both
dynamic1 = new DynamicBroadcasterListener()
Mixin.in(dynamic1, 'Observable', 'update')
dynamic2 = new DynamicBroadcasterListener()
Mixin.in(dynamic2, 'ObservableSubscriber')
dynamic1.addSubscriber(dynamic2, 'update', dynamic2.receiveUpdate)

# broadcast something and then unmix Observability, send something else (which is unsent)
dynamic1.sendUpdate('Hello')
Mixin.out(dynamic1, 'Observable') # remove Observable and clear all subscribers
dynamic1.sendUpdate('Insane') # not mixed in so will be unsent

# remix, reconfigure and send something new
Mixin.in(dynamic1, 'Observable', 'update')
dynamic1.sendUpdate('Strange and Crazy') # no one subscribed but still sent
dynamic1.addSubscriber(dynamic2, 'update', dynamic2.receiveUpdate)
dynamic1.sendUpdate('World!')
&lt;/pre&gt;
&lt;p&gt;You can find this example and more here: &lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you try out Mixin.js, please share your stories and your mixins!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.js"&gt;Mixin.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.min.js"&gt;Mixin.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><link>http://braincode.tumblr.com/post/11265571365</link><guid>http://braincode.tumblr.com/post/11265571365</guid><pubDate>Mon, 10 Oct 2011 02:37:26 -0400</pubDate><category>mixin</category><category>mixin.js</category><category>subscription</category><category>subscriptions</category><category>javascript</category><category>coffeescript</category></item><item><title>Mixin.js: View with model loading timeout</title><description>&lt;p&gt;I&amp;#8217;m still excited about finally releasing Mixin.js yesterday&amp;#8230;and hope other people find it as exciting as me!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve started a repository with examples from my various project (&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;) and added the following first example for Mixin.js.&lt;/p&gt;
&lt;pre&gt;class ViewWithModelLoadingTimeout
  constructor: -&amp;gt;
    Mixin.in(this, ['RefCount', =&amp;gt; Mixin.out(this)], 'AutoMemory', 'Timeouts')
    @id = _.uniqueId('model_view')
    @el = $("&amp;lt;div id='#{@id}' class='model_loading'&amp;gt;&amp;lt;/div&amp;gt;").appendTo($('body'))[0]
    @autoWrappedProperty('el', 'remove')
    @addTimeout('Waiting for Model', (=&amp;gt;@render(false)), 20)

  render: (successful_load) -&amp;gt;
    $(@el).remove()
    if successful_load
      @el = $("&amp;lt;div id='#{@id}' class='model_loaded'&amp;gt;&amp;lt;/div&amp;gt;").appendTo($('body'))[0]
    else
      @el = $("&amp;lt;div id='#{@id}' class='model_failed'&amp;gt;&amp;lt;/div&amp;gt;").appendTo($('body'))[0]

  callbackModelLoaded: -&amp;gt;
    @killTimeout('Waiting for Model'); @render(true)

# create a view and send tell is that it's model was loaded
view_successful_loading = new ViewWithModelLoadingTimeout()
view_successful_loading.callbackModelLoaded()

# create a view and let the timer get called triggering it to move into a failed state
view_failed_loading = new ViewWithModelLoadingTimeout()&lt;/pre&gt;
&lt;pre&gt;# LATER...
# cleanup - elements removed, timers killed
view_successful_loading.release()
view_failed_loading.release()
&lt;/pre&gt;
&lt;p&gt;If you try out Mixin.js, please share your stories and your mixins!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.js"&gt;Mixin.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.min.js"&gt;Mixin.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/mixin"&gt;&lt;a href="https://github.com/kmalakoff/mixin"&gt;https://github.com/kmalakoff/mixin&lt;/a&gt;&lt;/a&gt; and look at the tests folder for many more examples!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/11100271168</link><guid>http://braincode.tumblr.com/post/11100271168</guid><pubDate>Thu, 06 Oct 2011 10:06:00 -0400</pubDate><category>javascript</category><category>coffeescript</category><category>mixin.js</category><category>mixin</category></item><item><title>Backbone-articulation with localized string example</title><description>&lt;p&gt;As Jeremy recommended, I&amp;#8217;ve listed Backbone-Articulation on the Backbone Wiki. To prepare for some questions (maybe!), I&amp;#8217;ve prepared an example:&lt;/p&gt;
&lt;pre&gt;ENV.LOCALIZED_STRINGS =
  &lt;span&gt;1&lt;/span&gt;: &lt;span&gt;'bonjour'&lt;/span&gt;
  &lt;span&gt;2&lt;/span&gt;: &lt;span&gt;'mes'&lt;/span&gt;
  &lt;span&gt;3&lt;/span&gt;: &lt;span&gt;'amis'&lt;/span&gt;

class LocalizedString
  constructor: (&lt;span&gt;@&lt;/span&gt;id) -&amp;gt;
    &lt;span&gt;@&lt;/span&gt;string = &lt;span&gt;if&lt;/span&gt; (&lt;span&gt;@&lt;/span&gt;id!=&lt;span&gt;undefined&lt;/span&gt;) and ENV.LOCALIZED_STRINGS and ENV.LOCALIZED_STRINGS.hasOwnProperty(&lt;span&gt;@&lt;/span&gt;id) &lt;span&gt;then&lt;/span&gt; ENV.LOCALIZED_STRINGS[&lt;span&gt;@&lt;/span&gt;id] &lt;span&gt;else&lt;/span&gt; &lt;span&gt;'undefined'&lt;/span&gt;

  toJSON: -&amp;gt; &lt;span&gt;return&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; (&lt;span&gt;@&lt;/span&gt;id!=&lt;span&gt;undefined&lt;/span&gt;) &lt;span&gt;then&lt;/span&gt; {_type:&lt;span&gt;'LocalizedString'&lt;/span&gt;, id: &lt;span&gt;@&lt;/span&gt;id} &lt;span&gt;else&lt;/span&gt; &lt;span&gt;null&lt;/span&gt;

  &lt;span&gt;@&lt;/span&gt;parseJSON: (json) -&amp;gt;
    &lt;span&gt;throw&lt;/span&gt; &lt;span&gt;new&lt;/span&gt; Error(&lt;span&gt;"LocalizedString.parseJSON: unrecognized json"&lt;/span&gt;) &lt;span&gt;if&lt;/span&gt; json._type!=&lt;span&gt;'LocalizedString'&lt;/span&gt;
    &lt;span&gt;return&lt;/span&gt; &lt;span&gt;new&lt;/span&gt; LocalizedString(json.id)

&lt;span&gt;# create some models with attributes that need to be serailized and deserialized&lt;/span&gt;
model1_1 = &lt;span&gt;new&lt;/span&gt; Backbone.Model({id:&lt;span&gt;1&lt;/span&gt;, string: &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;1&lt;/span&gt;)})
model1_2 = &lt;span&gt;new&lt;/span&gt; Backbone.Model({id:&lt;span&gt;2&lt;/span&gt;, array: [&lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;1&lt;/span&gt;), &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;2&lt;/span&gt;), &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;3&lt;/span&gt;)]})
model1_3 = &lt;span&gt;new&lt;/span&gt; Backbone.Model({id:&lt;span&gt;3&lt;/span&gt;, object: {hello: &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;1&lt;/span&gt;), my: &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;2&lt;/span&gt;), friend: &lt;span&gt;new&lt;/span&gt; LocalizedString(&lt;span&gt;3&lt;/span&gt;)}})

&lt;span&gt;# put them into collection1, serialize collection1, deserialize the json into collection2&lt;/span&gt;
collection1 = &lt;span&gt;new&lt;/span&gt; Backbone.Collection([model1_1, model1_2, model1_3])
json = collection1.toJSON()

&lt;span&gt;# now imagine the next time the collection is fetched...collection2 is deserialized with the localized strings&lt;/span&gt;
collection2 = &lt;span&gt;new&lt;/span&gt; Backbone.Collection(); collection2.add(collection2.parse(json))
&lt;/pre&gt;
&lt;p&gt;You can find this example and more (eventually) here: &lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;&lt;a href="https://github.com/kmalakoff/examples-kmalakoff"&gt;https://github.com/kmalakoff/examples-kmalakoff&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/11058901225</link><guid>http://braincode.tumblr.com/post/11058901225</guid><pubDate>Wed, 05 Oct 2011 08:48:00 -0400</pubDate><category>backbone.articulation</category><category>backbone.js</category><category>backbone</category><category>backbone.articulation.js</category></item><item><title>Mixin.js: the Javascript nano-framework</title><description>&lt;p&gt;A few months ago, I was using Backbone.Views and many views (or categories of views) had slightly different needs. For example, if one view needed a timeout to check if model failed to load, did all of my views need the timeout functionality. &lt;/p&gt;
&lt;p&gt;I was faced with a fundamental architecture decision. Should I keep pushing functionality higher in my Backbone.View hierarchy to expose the functionality and cause bloat super class bloat, or was there a better way?&lt;/p&gt;
&lt;p&gt;I think I found a better way&amp;#8230;mixins! &lt;/p&gt;
&lt;p&gt;I started with just mixing in simple Javascript objects, but as I kept developing the idea, I realized that sometimes I needed initialization or cleanup code, and I needed to know which instances had been initialized with which mixins, etc. Plus, it was getting really exciting to try to push my code to the DRYest state possible&amp;#8230;.&lt;/p&gt;
&lt;p&gt;After a few months, I&amp;#8217;ve developed quite a sophisticated solution and I think it is mature enough to share publicly so i spent a few days packaging it, writing tests, etc.  I just had to release it because it is so fun and flexible to use!&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a taster:&lt;/p&gt;
&lt;pre&gt;class StatusBar
  constructor: -&amp;gt; Mixin.in('Subscriber')
  updateProgress: (progress) -&amp;gt; # update bar
  workerDone: -&amp;gt; # clear bar

class HardWorker 
  constructor: -&amp;gt;
    Mixin.in(['Observable', 'progress_update'], 'AutoMemory', 'Backbone.Events')
    @list = new Background.List(100); @autoProperty('list', 'destroy')
    @list.append(null, (=&amp;gt;doWork()))
  doWork: -&amp;gt;
    # do something
    @notifySubscribers('progress_update', progress)

status_bar = app.getStatusBar()
worker = new HardWorker()
worker.addSubscriber(status_bar, 'progress_update', status_bar.updateProgress, 
&lt;span&gt;	&lt;/span&gt;{destroy:status_bar.workerDone})

# later use a Backbone.Event to kill the worker and and the status bar 
# is notified (workerDone) and the background list (BGList) is cleaned up
worker.trigger('destroy')
&lt;/pre&gt;
&lt;p&gt;I&amp;#8217;ll write more examples over the coming days and weeks. Enjoy!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.js"&gt;Mixin.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/mixin/raw/master/mixin.min.js"&gt;Mixin.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/mixin"&gt;&lt;a href="https://github.com/kmalakoff/mixin"&gt;https://github.com/kmalakoff/mixin&lt;/a&gt;&lt;/a&gt; &lt;/p&gt;</description><link>http://braincode.tumblr.com/post/11026285083</link><guid>http://braincode.tumblr.com/post/11026285083</guid><pubDate>Tue, 04 Oct 2011 14:04:00 -0400</pubDate><category>mixin</category><category>mixin.js</category><category>Javascript</category><category>nano-framework</category><category>Coffeescript</category></item><item><title>Introducing Backbone.Articulation!</title><description>&lt;p&gt;Have you ever wished that you can control the lifecycle or serialization/deserialization of your Backbone.Model attributes? Well, now you can!&lt;/p&gt;
&lt;p&gt;Backbone.Articulation complies with various attribute lifecycle conventions of your attributes:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;clone() and destroy()&lt;/li&gt;
&lt;li&gt;retain() and release()&lt;/li&gt;
&lt;li&gt;new() only and using Javascript&amp;#8217;s garbage collection&lt;/li&gt;
&lt;li&gt;plain old JSON (with no custom serialization)&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;And if you want custom serialization/deserialization, just add toJSON() &lt;span&gt;instance&lt;/span&gt; method and parseJSON &lt;span&gt;class&lt;/span&gt; or factory method to your classes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Please note the difference between toJSON and parseJSON&lt;/em&gt;&lt;/strong&gt;: toJSON will be found on your instance whereas parseJSON will be found in the global namespace (just like Javascript&amp;#8217;s Date.parse()).&lt;/p&gt;
&lt;p&gt;All of this is achieved using underscore enhancements&amp;#8230;(&lt;a href="http://braincode.tumblr.com/post/10682303919/addawesomefeatures"&gt;http://braincode.tumblr.com/post/10682303919/addawesomefeatures&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/backbone-articulation/raw/master/backbone-articulation.js"&gt;Backbone-Articulation.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/backbone-articulation/raw/master/backbone-articulation-min.js"&gt;Background-Articulation.min.js&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/backbone-articulation%C2%A0"&gt;https://github.com/kmalakoff/backbone-articulation &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;pre&gt;Until the dependent changes have been merged into and released with the &lt;br/&gt; main projects, please use my modified versions of:&lt;br/&gt;
- Underscore.js &lt;a href="https://github.com/kmalakoff/underscore"&gt;&lt;a href="https://github.com/kmalakoff/underscore"&gt;https://github.com/kmalakoff/underscore&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;
- Backbone.js (&lt;a href="https://github.com/kmalakoff/backbone"&gt;&lt;a href="https://github.com/kmalakoff/backbone"&gt;https://github.com/kmalakoff/backbone&lt;/a&gt;&lt;/a&gt;&lt;/pre&gt;</description><link>http://braincode.tumblr.com/post/10682432555</link><guid>http://braincode.tumblr.com/post/10682432555</guid><pubDate>Mon, 26 Sep 2011 05:17:00 -0400</pubDate><category>backbone</category><category>backbone.js</category><category>underscore.js</category><category>underscore</category><category>backbone.articulation</category></item><item><title>_.addAwesomeFeatures()</title><description>&lt;p&gt;As you can see from the title, I&amp;#8217;m quite excited (!) by a few things I&amp;#8217;ve taken from my personal project and have repackaged, tested, and sent a pull request to the main DocumentCloud/underscore repository.&lt;/p&gt;
&lt;p&gt;Highlights:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1) Keypaths (_.hasKeypath, _.keypath, _.keypathValueOwner)&lt;/strong&gt; - rather than just using simple keys to reference properties, you can use keypaths (dot-delimited strings or arrays of strings) to traverse you object.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;_.keypath({hello: {world: &amp;#8216;!&amp;#8217;} }, &amp;#8216;hello.world&amp;#8217;); // returns &amp;#8216;!&amp;#8217;&lt;/li&gt;
&lt;li&gt;_.keypathValueOwner({hello: {world: &amp;#8216;!&amp;#8217;} }, &amp;#8216;hello.world&amp;#8217;); // returns hello&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;2) Type Conversions (_.resolveConstructor, _.toType)&lt;/strong&gt; - _.toType introduces a convention of _.to{SomeType} and complies with underscore&amp;#8217;s _.is{SomeType} convention if the constructor name or instanceof don&amp;#8217;t find a match. Useful it you wrap a class inside another.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;var constructor = _.resolveConstructor(&amp;#8216;SomeNamespace.SomeClass&amp;#8217;), instance = new constructor();&lt;/li&gt;
&lt;li&gt;var actual_date = _.toType(wrapped_date, &amp;#8216;Date&amp;#8217;);&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;3) Removal (_.remove)&lt;/strong&gt; - provides many variants on how to remove something from an array or object collection. &lt;/p&gt;
&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;var removed = _.remove([2,4,2], 2); _.isEqual(removed, 2);&lt;/li&gt;
&lt;li&gt;var removed = _.remove({bob: 1, fred: 3, george: 5}, [&amp;#8216;bob&amp;#8217;, &amp;#8216;george&amp;#8217;]); _.isEqual(removed, [1,5]);&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;4) JSON serialization (_.toJSON, _.parseJSON)&lt;/strong&gt; - provides a convention for serializing and deserializing class instances (with a configurable _type property).&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;var plain_old_json = _.toJSON(some_instance), some_instance_copy = _.parseJSON(plain_old_json);&lt;/li&gt;
&lt;li&gt;var namespaced_instance = _.parseJSON({_type: &amp;#8216;SomeNamepace.SomeClass&amp;#8217;, prop1: 1, prop2: 2});&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;5) Object Lifecycle (_.own, _.disown)&lt;/strong&gt; - handles individual objects, arrays, and object properties that comply with some lifecycle conventions:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;clone() and destroy()&lt;/li&gt;
&lt;li&gt;retain() and release()&lt;/li&gt;
&lt;li&gt;clone() and Javascript memory management&lt;/li&gt;
&lt;li&gt;plain old JSON &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;var an_object = new Object(); var owned_copy_object = _.own(an_object); _.disown(an_object);&lt;/li&gt;
&lt;li&gt;var an_array = [new Object(), &amp;#8216;hello&amp;#8217;, new Object()]; var owned_copy_array = _.own(an_array); _.disown(an_array);&lt;/li&gt;
&lt;li&gt;var an_object = {one: new Object(), two: new Object(), three: &amp;#8216;there&amp;#8217;}; var owned_copy_object = _.own(an_object, {properties:true}); _.disown(an_object);&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;6) Compare for the rest of us (_.compare)&lt;/strong&gt; - wraps built in compare with self-evident return types (_.COMPARE_EQUAL, _.COMPARE_ASCENDING, _.COMPARE_DESCENDING) and allows objects to provide custom compare methods.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Examples:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;if (_.compare(&amp;#8216;x&amp;#8217;, &amp;#8216;y&amp;#8217;) === _.COMPARE_ASCENDING) return &amp;#8216;y&amp;#8217; &lt;/li&gt;
&lt;li&gt;if (_.compare(&amp;#8216;こんにちは&amp;#8217;, &amp;#8216;さようなら&amp;#8217;, &amp;#8216;localeCompare&amp;#8217;) === _.COMPARE_ASCENDING) return &amp;#8216;さようなら&amp;#8217;; &lt;/li&gt;
&lt;li&gt;if (_.compare(custom_compare_instance, &amp;#8216;a string&amp;#8217;) === _.COMPARE_ASCENDING) return custom_compare_instance;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;7) &lt;strong&gt;Super helpers&lt;/strong&gt; (&lt;strong&gt;_.getSuperFunction/_.superCall/_.superApply&lt;/strong&gt;) - useful if you don&amp;#8217;t know what the super class will be ahead of time:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;local_backbone_collection_mixin { _add: function(model) { if (!model.id) model.id = model.cid;); _.superApply(this, &amp;#8216;_add&amp;#8217;, arguments); } };&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;And more: _.cloneToDepth, _pluck with remove, _.findIndex, _.functionExists/_.callIfExists, and _.getValue with default if missing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hopefully, these will get integrated into the main branch, but if not, you can find an add-on pack at: &lt;span&gt;&lt;a href="https://github.com/kmalakoff/underscore-awesomer"&gt;&lt;a href="https://github.com/kmalakoff/underscore-awesomer"&gt;https://github.com/kmalakoff/underscore-awesomer&lt;/a&gt;&lt;/a&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/underscore-awesomer/raw/master/underscore-awesomer.js"&gt;Underscore-Awesomer.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/underscore-awesomer/raw/master/underscore-awesomer-min.js"&gt;Underscore-Awesomer.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/10682303919</link><guid>http://braincode.tumblr.com/post/10682303919</guid><pubDate>Mon, 26 Sep 2011 05:06:00 -0400</pubDate><category>underscore</category><category>underscore.js</category><category>underscore-awesomer</category><category>underscore-awesomer.js</category><category>awesome</category></item><item><title>Background.js now with multi-dimensional arrays!</title><description>&lt;p&gt;I had a need for combining arrays on a background thread and after a bit of thought, I came up with a simple way to iterate over any number of arrays in fixed sized batches.&lt;/p&gt;
&lt;p&gt;For example, you may want to apply the same list of filters to some models and then based on the results, so some more heavy processing. Take a look at this &lt;a href="https://gist.github.com/1225029"&gt;gist&lt;/a&gt; for a code snippet.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.js"&gt;Background.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production: &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.min.js"&gt;Background.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/background"&gt;&lt;a href="https://github.com/kmalakoff/background"&gt;https://github.com/kmalakoff/background&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/10355820408</link><guid>http://braincode.tumblr.com/post/10355820408</guid><pubDate>Sun, 18 Sep 2011 08:37:00 -0400</pubDate><category>background.js</category><category>javascript</category><category>coffeescript</category><category>background</category><category>job</category><category>task</category><category>thread</category></item><item><title>Background.js</title><description>&lt;p&gt;I&amp;#8217;ve been writing a single page CoffeeScript web app and needed to put some processing on a background thread so my GUI would remain responsive.&lt;/p&gt;
&lt;p&gt;I found some articles referring to a good &lt;a href="http://thereisamoduleforthat.com/content/workerqueue-background-tasks-javascript"&gt;JavaScript WorkerQueue library&lt;/a&gt; so I gave it a shot.&lt;/p&gt;
&lt;p&gt;After playing with it, I realized that I needed some extra functionality:&lt;/p&gt;
&lt;p&gt;1) set up and clean up before and after the worker is run&lt;/p&gt;
&lt;p&gt;2) the ability to destroy the worker queue (to support a single page app) &lt;/p&gt;
&lt;p&gt;3) Array iterator helpers to keep the code DRY&lt;/p&gt;
&lt;p&gt;If you are interested in theses capabilities in an easy to use background queue and list library, download now (Right-click, and use &amp;#8220;Save As&amp;#8221;):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Development: &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.js"&gt;Background.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Production:  &lt;a href="https://github.com/kmalakoff/background/raw/master/build/background.min.js"&gt;Background.min.js&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Or check out the project here: &lt;a href="https://github.com/kmalakoff/background"&gt;&lt;a href="https://github.com/kmalakoff/background"&gt;https://github.com/kmalakoff/background&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/9449127004</link><guid>http://braincode.tumblr.com/post/9449127004</guid><pubDate>Sat, 27 Aug 2011 04:05:00 -0400</pubDate><category>Coffeescript</category><category>Javascript</category><category>WorkerQueue</category><category>background</category><category>background.js</category><category>jobs</category><category>tasks</category><category>thread</category></item><item><title>git flow release finish first_missing_piece_android</title><description>&lt;p&gt;I was able to port the Objective-C CouchMover to Java for the android version!&lt;/p&gt;
&lt;p&gt;The interface is basically the same so it should be familiar:&lt;/p&gt;
&lt;pre&gt;PasswordAuthentication credential = new PasswordAuthentication("admin", 
   "admin".toCharArray());
credential = null; // NO USER/PASSWORD ON ANDROID
CouchMover couchMover = new CouchMover(serverURL, credential, "mycouchapp_db");
    
couchMover.loadDocumentFromAssetManager(getAssets(), "_design/mycouchapp", 
   "mycouchapp.json", "mycouchapp.version");
couchMover.loadDocumentFromAssetManager(getAssets(), "mydata", 
   "mydata.json", "mydata.version");

couchMover.gotoAppPage("_design/mycouchapp", appView, "index.html");
&lt;/pre&gt;
&lt;p&gt;I also wrote a small helper CouchStarter that encapsulates the installation process for Couchbase. I&amp;#8217;m not planning on maintaining it for production purposes, but it should be useful for getting up and running quickly. &lt;/p&gt;
&lt;p&gt;You can find the code, samples, and a README here: &lt;a href="https://github.com/kmalakoff/phonegap-couchbase-xplatform%C2%A0"&gt;https://github.com/kmalakoff/phonegap-couchbase-xplatform &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: it works reasonably well, but I believe due to the refactoring of the Couchbase android version, the underlying couchlib-android library has a few limitations (it should work on Android SDK 2.1, 2.2 and 2.3 although I only tested on Android 2.3.1 and 2.3.3, and view generation seems to cause an exception in Couchbase). Once it works flawlessly, I&amp;#8217;ll update this post.  &lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/6938164284</link><guid>http://braincode.tumblr.com/post/6938164284</guid><pubDate>Sun, 26 Jun 2011 10:41:00 -0400</pubDate></item><item><title>git flow release finish first_missing_piece</title><description>&lt;p&gt;Today, I published what I solution to the first missing piece:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Allow for offline CouchApp loading since you cannot assume there will be a connection to download a CouchApp&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;that I hope others will find useful and efficient to use in their day-to-day development workflow.&lt;/p&gt;
&lt;h2&gt;Workflow&lt;/h2&gt;
&lt;p&gt;To end up with a nicely packaged couchapp, views, and application seed data, you need to decide what workflow you want to follow during development, testing, release, etc. I chose the following process:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;use source files for everything&lt;/strong&gt;. I originally tried to edit views in futon, but besides not having source files that could be checked into version control, after the first edit, the web formatting made it difficult to maintain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;develop and debug on my laptop to take advantage of a full suite of browser developer tools&lt;/strong&gt;. If you want to get a feel for how difficult directly testing in phonegap can be, take a look at the following post: http://www.phonegap.com/2011/05/18/debugging-phonegap-javascript.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;run on a mobile simulator or hardware periodically after testing on laptop/PC&lt;/strong&gt;. This should catch device-specific problems and differences after the general problems have been fixed in a more productive laptop/PC development environment.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;In order to achieve this result, I am using the following development workflow:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;use soca on my local filesystem to have source files for everything including the couchapp, views, and application seed data.&lt;/li&gt;
&lt;li&gt;use &amp;#8216;soca autopush&amp;#8217; to propagate any local changes into a couch development server. Note: I added a new flag to soca&amp;#8217;s config.js file so until the main branch picks it up (fingers crossed), you will need to use my copy in GitHub.&lt;/li&gt;
&lt;li&gt;use &amp;#8216;couchpack database_url destination_file &amp;#8212;auto&amp;#8217; to watch for and pack all changes into my iOS project&amp;#8217;s Resources directory. I wrote the couchpack and couchwatcher gems for this purpose.&lt;/li&gt;
&lt;li&gt;build and run in XCode&lt;/li&gt;
&lt;li&gt;use an Objective-C class called &amp;#8216;CouchMover&amp;#8217; to check packed version files for changes at runtime and to upload on app launch. I released this class in the phonegap-couchbase-xplatform GitHub repository.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Note: currently, this workflow has only been tested on the Mac OSX platform and does not yet have sample code for an android version. Volunteers are welcome!&lt;/p&gt;
&lt;h2&gt;Setup details&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Install: &lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;strong&gt;soca &lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;For now, you&amp;#8217;ll need to get a local copy from GitHub and to build/install a local copy:&lt;/p&gt;
&lt;pre&gt;sudo gem uninstall soca
git clone git@github.com:kmalakoff/soca.git
cd soca
sudo rake install&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Install: &lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;couchpack &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo gem install couchpack&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Usage - Laptop/PC&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I recommend you download the cross-platform demo project at: https://github.com/kmalakoff/phonegap-couchbase-xplatform. It demonstrates the workflow and you won&amp;#8217;t be slowed down with setting up a PhoneGap/Couchbase project from scratch.&lt;/p&gt;
&lt;p&gt;In the demo project, you will find a file called couch_automate.rb. It demonstrates how you can launch all of the soca and couchpack watching with one command &amp;#8216;ruby couch_automate.rb&amp;#8217;. Here&amp;#8217;s the meaningful parts:&lt;/p&gt;
&lt;pre&gt;exec 'cd soca/mycouchapp; soca autopush'
exec 'cd phonegap-couchbase-ios/phonegap-couchbase-ios/Resources; 
   couchpack document http://localhost:5984/mycouchapp_db/_design/mycouchapp 
      mycouchapp --auto'&lt;/pre&gt;
&lt;p&gt;The first line starts watching the soca project and pushes changes into the couchdb document; the second line starts watching the couchdb document and packs any changes into the iOS Xcode project Resources directory.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Usage - Objective-C&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When you receive the &lt;span&gt;CouchbaseDelegate&lt;/span&gt;&amp;#8217;s method callback &lt;span&gt;couchbaseDidStart &lt;/span&gt;you can use the CouchMover class to check for version changes in your packed Resources and if there are changes, upload them to the iOS Couchbase CouchDB using the following:&lt;/p&gt;
&lt;pre&gt;NSURLCredential *credential = [NSURLCredential credentialWithUser:@"admin" 
  password:@"admin" persistence:NSURLCredentialPersistenceForSession];
CouchMover* couchMover = [[CouchMover alloc] init:serverURL 
  serverCredential:credential databaseName:@"mycouchapp_db"];
[couchMover loadDocumentFromBundle:[NSBundle mainBundle] 
  documentName:@"_design/mycouchapp" 
  documentBundlePath:@"mycouchapp.json" 
  versionBundlePath:@"mycouchapp.version"];
[couchMover gotoAppPage:@"_design/mycouchapp" webView:self.webView 
  page:@"index.html"];
[couchMover release];
&lt;/pre&gt;
&lt;p&gt;The CouchMover class is flexible enough to upload documents which can be packaged couchapps, views, or application seed data to any database (just call &amp;#8216;[couchMover setDatabaseName:@&amp;#8221;yourdatadatabasename&amp;#8221;]&amp;#8217; to switch databases) and can be used without the bundles if you prefer (just call &amp;#8216;[couchMover loadDocument:documentName version:version getAppAsJSONDataBlock:yourblock_returningNSData]&amp;#8217;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Got&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;chas&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are many and I&amp;#8217;ll maintain this list based on your feedback:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;To get the sample running on actual hardware, you&amp;#8217;ll need to register the app with Apple using these PhoneGap instructions: http://wiki.phonegap.com/w/page/39991939/Getting-Started-with-PhoneGap-iOS-using-Xcode-4-(Template-Version&lt;/li&gt;
&lt;li&gt;After you pack your couchdb documents for the first time, you need to drag them into your XCode project&amp;#8217;s Resources directory.&lt;/li&gt;
&lt;li&gt;In order to not have your PhoneApp switch to the local Safari app when you call [webView stringByEvaluatingJavaScriptFromString:couchappApgeURL], you need to add localhost to the ExternalHosts key in your PhoneGap.plist. Select your PhoneGap.plist in the &amp;#8220;Supporting Files&amp;#8221; directory, and add the following 2 items as separate entries: 127.0.0.1 and 0.0.0.0.&lt;/li&gt;
&lt;li&gt;The CouchMover Objective-C class  current has dependencies on TouchFoundation&amp;#8217;s classes on NSData &lt;span&gt;asBase64EncodedString. &lt;/span&gt;If you aren&amp;#8217;t linking with TouchFoundation, include the files that you find in the sample project&amp;#8217;s Vendor/TouchFoundation_MinimalExtraction in your project.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Done! Well, if only reality were that simple&amp;#8230; I&amp;#8217;m happy to update this post and answer your questions as you are confronted with real-world problems in getting this to work.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;p&gt;Kevin&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/6695557990</link><guid>http://braincode.tumblr.com/post/6695557990</guid><pubDate>Sun, 19 Jun 2011 14:41:00 -0400</pubDate><category>CouchMover</category><category>couchbase</category><category>couchdb</category><category>couchpack</category><category>couchwatcher</category><category>phonegap-couchbase-xplatform</category><category>soca</category><category>phonegap</category></item><item><title>open.("source")</title><description>&lt;p&gt;A colleague at work (thank you Stephane!) recommended that I consider Couchbase-iOS (&lt;a href="https://github.com/couchbaselabs/iOS-Couchbase"&gt;https://github.com/couchbaselabs/iOS-Couchbase&lt;/a&gt;) for my mobile project.&lt;/p&gt;
&lt;p&gt;Before choosing RhoSync as my syncing solution a few months ago, I spent weeks investigating options for a syncable offline database solution for cross-platform mobile applications - RhoSync seemed to be the only show in town. With Couchbase-iOS, I have to admit that I was a bit hesitant because it is still in beta and there were some obviously missing pieces, but after doing some research into CouchDB, it became clear that it wasn&amp;#8217;t a matter of &amp;#8220;if&amp;#8221; Couchbase takes off, but &amp;#8220;when&amp;#8221;. So I decided to jump in and help to open source community build some of those missing pieces!&lt;/p&gt;
&lt;p&gt;To address some of the missing pieces, I drafted a list of currently missing pieces:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Allow for offline CouchApp loading since you cannot assume there will be a connection to download a CouchApp.&lt;/li&gt;
&lt;li&gt;Provide a standard way for users to to authorized locally and to create an account on a remote server.&lt;/li&gt;
&lt;li&gt;Provide best practice samples for organizing and syncing local and remote databases. For example: using local databases like &amp;#8220;appdata_db&amp;#8221; with server databases like &amp;#8220;myusername/appdata_db&amp;#8221; and making sure authentication and authorization is secure.&lt;/li&gt;
&lt;li&gt;Allow for users to trigger synchronizations from their mobile device while handling B. and C.&lt;/li&gt;
&lt;li&gt;Cross-platform project creation in as simple and trouble free way as possible.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Also, I created a demonstration project (&lt;a href="https://github.com/kmalakoff/phonegap-couchbase-xplatform"&gt;https://github.com/kmalakoff/phonegap-couchbase-xplatform&lt;/a&gt;) on GitHub that I hope will demonstrate solutions to these and more design problems.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Kevin&lt;/p&gt;</description><link>http://braincode.tumblr.com/post/6694992036</link><guid>http://braincode.tumblr.com/post/6694992036</guid><pubDate>Sun, 19 Jun 2011 14:23:00 -0400</pubDate><category>couchbase</category><category>couchbase-ios</category><category>phonegap-couchbase-xplatform</category></item></channel></rss>
