<?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>Jamie&#039;s Blog &#187; rails</title>
	<atom:link href="http://www.angelforge.org/wordpress/tags/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.angelforge.org/wordpress</link>
	<description>My life is words.</description>
	<lastBuildDate>Sat, 28 Jan 2012 04:35:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sandwich Roulette</title>
		<link>http://www.angelforge.org/wordpress/programming/software/sandwich-roulette/</link>
		<comments>http://www.angelforge.org/wordpress/programming/software/sandwich-roulette/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 04:30:21 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.angelforge.org/wordpress/?p=3123</guid>
		<description><![CDATA[Over the weekend I had the idea to create an app which creates a random sandwich for you to get at Wawa. The result is the Sandwich Roulette! Here&#8217;s the source on Github.]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I had the idea to create an app which creates a random sandwich for you to get at Wawa. The result is the <a href="http://sandwich-roulette.heroku.com/">Sandwich Roulette</a>! Here&#8217;s the <a href="https://github.com/jamiely/sandwich-roulette">source on Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.angelforge.org/wordpress/programming/software/sandwich-roulette/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Innovation Tournament</title>
		<link>http://www.angelforge.org/wordpress/programming/software/innovation-tournament/</link>
		<comments>http://www.angelforge.org/wordpress/programming/software/innovation-tournament/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 12:00:24 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[free lottery]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[lottery]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[social storefront]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[yelp]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[youtube api]]></category>

		<guid isPermaLink="false">http://www.angelforge.org/wordpress/?p=2863</guid>
		<description><![CDATA[This week I was in San Francisco participating in a Wharton class about innovation. We had a week to sort through various ideas for web products and create a prototype. I worked on two projects. One is a lottery site, with a simple demo available. I got to use the Youtube API for playing a [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was in San Francisco participating in a Wharton class about innovation. We had a week to sort through various ideas for web products and create a prototype. I worked on two projects. One is a lottery site, with a <a href="http://angelforge.org/lottery">simple demo available</a>. I got to use the Youtube API for playing a video and then performing some action upon completion. It was Â a little clunky to get setup, but afterwards worked flawlessly.</p>
<p>The other was an idea for a social dashboard for restaurants to keep them up to date with the latest reviews on sites like FourSquare and Yelp. I worked with a great programmer named Sean, who worked mostly on integrating the 3rd-party APIs. It was a Rails app that we pushed to Heroku.
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxd/' title='Social Store Front Splash'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxd-150x150.png" class="attachment-thumbnail" alt="Social Store Front Splash" title="Social Store Front Splash" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxe/' title='Social Storefront - Dashboard Various APIs'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxe-150x150.png" class="attachment-thumbnail" alt="Social Storefront - Dashboard Various APIs" title="Social Storefront - Dashboard Various APIs" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxg/' title='Social Storefront - Analytics (Highcharts)'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxg-150x150.png" class="attachment-thumbnail" alt="Social Storefront - Analytics (Highcharts)" title="Social Storefront - Analytics (Highcharts)" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxh/' title='Social Storefront - Chatter View'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxh-150x150.png" class="attachment-thumbnail" alt="Social Storefront - Chatter View" title="Social Storefront - Chatter View" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxi/' title='Social Storefront - Follow Up Screen'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxi-150x150.png" class="attachment-thumbnail" alt="Social Storefront - Follow Up Screen" title="Social Storefront - Follow Up Screen" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxn/' title='Lottery Page - Video Ad (Youtube)'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxn-150x150.png" class="attachment-thumbnail" alt="Lottery Page - Video Ad (Youtube)" title="Lottery Page - Video Ad (Youtube)" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/769277-213201160637am/' title='Lottery Page'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/769277-213201160637am-150x150.png" class="attachment-thumbnail" alt="Lottery Page" title="Lottery Page" /></a>
<a href='http://www.angelforge.org/wordpress/programming/software/innovation-tournament/attachment/8vxu/' title='Lottery - Numbers Selected'><img width="150" height="150" src="http://www.angelforge.org/wordpress/wp-content/uploads/2011/02/8Vxu-150x150.png" class="attachment-thumbnail" alt="Lottery - Numbers Selected" title="Lottery - Numbers Selected" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.angelforge.org/wordpress/programming/software/innovation-tournament/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Philly Give Camp 2010: Part 5</title>
		<link>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-5/</link>
		<comments>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-5/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 10:00:13 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[camp]]></category>
		<category><![CDATA[erb]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[MECA]]></category>
		<category><![CDATA[PAAL]]></category>
		<category><![CDATA[Philly Give Camp]]></category>
		<category><![CDATA[Philly Give Camp 2010]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.angelforge.org/wordpress/?p=2695</guid>
		<description><![CDATA[The Builder To keep the teams working as separately as possible with the least interference, we decided that the PAAL Builder, the tool used to build student schedules and lessons, would be completely HTML and Javascript. That means that there would be no server-side code, no ERB or HAML template files, and no Rails special [...]]]></description>
			<content:encoded><![CDATA[<h2>The Builder</h2>
<p>To keep the teams working as separately as possible with the least interference, we decided that the PAAL Builder, the tool used to build student schedules and lessons, would be completely HTML and Javascript. That means that there would be no server-side code, no ERB or HAML template files, and no Rails special sauce. This allowed the designers to work without developer support, and allowed developers who did not know Ruby or Rails to work solely on Javascript code. The Builder would interact with the API via ajax calls with JSON responses. A simple format for the response envelope was designed:</p>
<pre class="brush: jscript; title: ; notranslate">

{
version: 0.1,
error: '',

data: {
  task: {
    id: 1,
    name: 'Brush Teeth'
  }
}
}
</pre>
<p>This is an example response upon the creation of a task with the name &#8220;Brush Teeth.&#8221; On each request, the error property would be checked to make sure that it was blank. The version property would also allow changing the API in the future without breaking the application.</p>
<p>In the previous post I discussed the problems of having a simple API. One common scenario is to create a task and link it with a parent task. This would happen if you wanted to create a task like &#8220;Brush Teeth&#8221; and steps underneath it like &#8220;get toothpaste,&#8221; &#8220;get toothbrush&#8221;, &#8220;brush front teeth.&#8221; Here is the code necessary to do that (I am just posting the necessary jQuery calls rather than the wrapper functions I wound up writing):</p>
<pre class="brush: jscript; title: ; notranslate">
// create the task via a POST
$.post(
  '/tasks',
  taskData,
  function(envelope, textStatus, request) {
    if ( envelope.error != '' ) {
      // error
    }
    else {
      // on success, tie the newly created task
      // to a parent task
      function callbackSuccess(newTask, envelope) {
        $.post(
          '/task_parents',
          {
            task_parent: {
              task_id: newTask.id,
              task_parent_id: some_parent_id
            }
          },
          function(innerEnvelope, textStatus, request) {
            if ( innerEnvelope.error != '' ) {
              // error
            }
            else {
              // success!
            }
          },
          'json'
        );
      }

      callbackSuccess(envelope.data.task, envelope);

    }
  },
  'json'
);
</pre>
<p>Wrapper functions make this simpler to understand, but the fact that it requires two posts troubled me. Still, I avoided adding a new method to the API to do this all in one step.</p>
<p>When we were working on the project, the designers and another developer worked mostly on basic UI. I then worked on &#8220;installing the plumbing&#8221; as I put it, making all the API calls and using the live data. A lot of this plumbing went into the product after Give Camp. One aspect of the project I found hard after Give Camp was figuring out how a feature or UI element would work. Often, I&#8217;d be hooking up the plumbing, but be unsure of whether they wanted a stand-up shower or a bathtub. Both would get the job done, but I wasn&#8217;t sure what they had in mind, and it wasn&#8217;t clear from the design.</p>
<p>Part of this was due to the fact that I didn&#8217;t have the most recent design. We switched versioning systems two times during the course of Give Camp, and repository locations 3-4 times. Part of this was due to lack of notes or obvious visual stimuli. In general, after Give Camp was over, it was hard to coordinate with each other.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Philly Give Camp 2010: Part 4</title>
		<link>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-4/</link>
		<comments>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-4/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 10:00:50 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[camp]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[MECA]]></category>
		<category><![CDATA[monotouch]]></category>
		<category><![CDATA[PAAL]]></category>
		<category><![CDATA[Philly Give Camp]]></category>
		<category><![CDATA[Philly Give Camp 2010]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[unconference]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.angelforge.org/wordpress/?p=2693</guid>
		<description><![CDATA[Thinking about the problem domain, Trevor, Sebastian, and I decided to abstract away the complexity. The problem (as I understood it then) can be explained thusly: Students need a way to follow a list of scheduled tasks throughout the day, to assist them in performing daily activities. These tasks can be broken into more detailed [...]]]></description>
			<content:encoded><![CDATA[<p>Thinking about the problem domain, Trevor, Sebastian, and I decided to abstract away the complexity. The problem (as I understood it then) can be explained thusly:</p>
<p style="padding-left: 30px;">Students need a way to follow a list of scheduled tasks throughout the day, to assist them in performing daily activities. These tasks can be broken into more detailed tasks with steps or choices. A choice, such as what to have for lunch, is non-linear. A choice helps a student develop his sense of independence. Each choice and task may have accompanying text and audio.</p>
<p style="padding-left: 30px;">Day to day within a week, the schedule of tasks may be different. Weeks can also differ from each other.</p>
<p>Given these simple business requirements, we decided that a step, a task, and a choice were all the same in that they had a name, audio content, text content, and that they had a parent-child relationship with each other. We decided that all of these would be &#8220;tasks&#8221; and that there would be a &#8220;task type&#8221; field to differentiate between these. The &#8220;task&#8221; paradigm yields the following definitions:</p>
<ul>
<li>A task is a task with linear/sequential sub-tasks</li>
<li>A step is a task with no sub-tasks</li>
<li>A choice is a task with non-linear, non-sequential sub-tasks</li>
</ul>
<p>We also decided, after further discussion to make certain other things tasks. We thought that days and weeks were similar enough to a task in the parent-child relationship. We decided that</p>
<ul>
<li>A day is a task with linear/sequential sub-tasks whose name is a weekday</li>
<li>A week is a task with day sub-tasks (days as defined above)</li>
</ul>
<p>This allowed us to have a single Task model, and a Task Parent model, which greatly simplified the API. Instead of making REST calls to create a step, create a week, or create a choice, there would be just one create call, with a task type defining the behavior of the task. This would also make copying tasks and task trees easier, since we would only have to work with one model when doing a deep copy of a task tree.</p>
<p>Although this made the API really quick to build, when I started writing the builder code, interacting with the API, I found the API to be a bit low level. For example, I would have to make two calls to bind a new task to a user. First, I would have to create the task via the API, and then create the user-task relationship via the API. As I was writing nested callbacks with the jQuery ajax functions, I questioned our decision to make the API so simple. Still, I think the API is a thing of beauty, and I am still proud of what we did that weekend.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Philly Give Camp 2010: Part 3</title>
		<link>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-3/</link>
		<comments>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-3/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 02:17:54 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[camp]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[MECA]]></category>
		<category><![CDATA[monotouch]]></category>
		<category><![CDATA[PAAL]]></category>
		<category><![CDATA[Philly Give Camp]]></category>
		<category><![CDATA[Philly Give Camp 2010]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[unconference]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.angelforge.org/wordpress/?p=2686</guid>
		<description><![CDATA[As the MECA staff were describing the application, I didn&#8217;t have a clear sense of how beneficial our work would be. To illustrate how our application would help people, they showed us a video of a student going to a gym. In the first clip, the student has trouble following directions and signage about the [...]]]></description>
			<content:encoded><![CDATA[<p>As the <a href="http://mecaautism.org/">MECA</a> staff were describing the application, I didn&#8217;t have a clear sense of how beneficial our work would be. To illustrate how our application would help people, they showed us a video of a student going to a gym. In the first clip, the student has trouble following directions and signage about the use of gym equipment. In the second clip, the student is following auditory prompts and exercising at the gym with little trouble.Â  Another student was able to prepare a meal with the help of visual prompts from a PDA. It was illuminating to see the difference that prompts could in someone&#8217;s daily life and spurred us to work even harder.</p>
<p>We decided to split the application into 3 components:</p>
<ul>
<li>A REST API written using Rails</li>
<li>A HTML/Ajax builder web application</li>
<li>An iPhone user application</li>
</ul>
<p>We had a team of about eight people, and we knew we had to separate tasks somehow. There were some individuals with iPhone experience (mostly novice stuff like simple view demos), and some with Ruby experience, and then there were two designers with CSS and some jQuery experience.</p>
<p>We figured Trevor, who has extensive Rails experience should lead the API effort, and that Brian, who has done the most, albeit little, iPhone development using MonoTouch should lead the student application effort, while the designers should focus on designing and implementing some of the builder code. (The interface for the user application had already been worked out by group consensus.)</p>
<p>I decided I could best help with the API, so I worked with Trevor on that. Something that I think amazed all of us was that once we had assigned ourselves to teams and broken the project up, we functioned seamlessly, all of us entering <em>the zone</em> in our respective areas. It&#8217;s the kind of synergy and flow you get when the majority of your team <strong>knows their shit</strong>. It was an incredible experience to be a part of that.</p>
<p>We had a good framework and sample response API for the student interface and builder to start building plumbing by the time we left on Friday. Meanwhile, the iPhone app team had gotten some samples working using Monotouch. The builder interface was looking really sharp. We were off to a good start when we decided to break for the night around midnight.</p>
<p>In the next post, I will describe some of the insights behind the API.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.angelforge.org/wordpress/events/philly-give-camp-2010-part-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

