<?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/"
	>

<channel>
	<title>Citrusbyte Blog &#124; Web Development &#38; Web Strategy</title>
	<atom:link href="http://blog.citrusbyte.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.citrusbyte.com</link>
	<description>The Official Citrusbyte Blog</description>
	<pubDate>Fri, 01 Oct 2010 21:51:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What&#8217;s new in Ohm 0.1.0</title>
		<link>http://blog.citrusbyte.com/2010/10/01/whats-new-in-ohm-0-1-0/</link>
		<comments>http://blog.citrusbyte.com/2010/10/01/whats-new-in-ohm-0-1-0/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 18:44:09 +0000</pubDate>
		<dc:creator>Cyril David</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=411</guid>
		<description><![CDATA[Ohm 0.1.0 is out and listed in this post are the most important changes. It&#8217;s important to note that it requires Redis 2.0.0 or better, and as usual the documentation can be found at http://ohm.keyvalue.org.
Hashes
Model attributes are now stored using Redis hashes. If you have been following Redis closely, this also means that you get [...]]]></description>
			<content:encoded><![CDATA[<p>Ohm 0.1.0 is out and listed in this post are the most important changes. It&#8217;s important to note that it requires Redis 2.0.0 or better, and as usual the documentation can be found at <a href="http://ohm.keyvalue.org">http://ohm.keyvalue.org</a>.</p>
<h2 id='hashes'>Hashes</h2>
<p>Model attributes are now stored using Redis hashes. If you have been following Redis closely, this also means that you <a href='http://antirez.com/post/redis-weekly-update-7.html'>get huge memory savings</a> for free. The main Redis key space will also be a lot less cluttered.</p>
<p>From an API perspective, you probably won&#8217;t notice a significant change. If you plan to upgrade to Ohm 0.1.0, you simply have to execute the code:</p>
<p><script src='http://gist.github.com/606605.js?file=ohm-upgrading.rb' type='text/javascript'></script></p>
<h2 id='nest'>Nest</h2>
<p>In Ohm 0.0.x, most raw Redis operations were done using the following approach:</p>
<p><script src='http://gist.github.com/606606.js?file=pre-nest-example.rb' /></script></p>
<p>Ohm 0.1.0 introduces a dependency called <a href='http://github.com/soveran/nest'>Nest</a>. Aside from making the API a little more object oriented, it also allows you to create key hierarchies in a very terse manner. Let&#8217;s see the example above written in the new style:</p>
<p><script src='http://gist.github.com/606607.js?file=ohm-with-nest-example.rb' /></script></p>
<h2 id='array_syntax_in_lists'>Array Syntax in Lists</h2>
<p>Getting a subset of an existing <code>List</code> was possible only through raw Redis commands. If you had something like:</p>
<p><script src='http://gist.github.com/606610.js?file=old-lists-syntax.rb' /></script></p>
<p>Ohm 0.1.0 introduces a syntax similar to Ruby&#8217;s standard <code>Array#[]</code> method. The example above would be:</p>
<p><script src='http://gist.github.com/606614.js?file=new-lists-syntax.rb' /></script></p>
<h2 id='improved_documentation_and_tutorials'>Improved Documentation and Tutorials</h2>
<p>We believe in good documentation, so much that we have spent a lot of time improving the <a href='http://ohm.keyvalue.org'>API Documentation</a>.</p>
<p>In addition, since a lot of people learn best through examples, we&#8217;ve written up a couple of <a href='http://ohm.keyvalue.org/index.html#tutorials'>tutorials</a> to help you get up to speed and get some insight on the different design philosophy that comes with using Ohm and Redis.</p>
<p>If you have any questions, problems or suggestions just head up to #ohm at irc.freenode.net or checkout our <a href='http://groups.google.com/group/ohm-ruby'>Google group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/10/01/whats-new-in-ohm-0-1-0/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Toggle Widget By Example</title>
		<link>http://blog.citrusbyte.com/2010/09/17/jquery-toggle-widget-by-example/</link>
		<comments>http://blog.citrusbyte.com/2010/09/17/jquery-toggle-widget-by-example/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 17:59:05 +0000</pubDate>
		<dc:creator>Chris Schneider</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=401</guid>
		<description><![CDATA[Lots of people learn better by example, than by lecture.  Here is a heavily commented piece of widget code that can get you headed in the right direction.  Think of this post as the homework worksheet that goes with my post from yesterday about jQuery widgets.

]]></description>
			<content:encoded><![CDATA[<p>Lots of people learn better by example, than by lecture.  Here is a heavily commented piece of widget code that can get you headed in the right direction.  Think of this post as the homework worksheet that goes with my <a href="http://blog.citrusbyte.com/2010/09/16/jquery-widgets-bringing-sanity/">post from yesterday</a> about jQuery widgets.</p>
<p><script src="http://gist.github.com/584609.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/09/17/jquery-toggle-widget-by-example/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Widgets - Bringing Sanity to Complex Apps</title>
		<link>http://blog.citrusbyte.com/2010/09/16/jquery-widgets-bringing-sanity/</link>
		<comments>http://blog.citrusbyte.com/2010/09/16/jquery-widgets-bringing-sanity/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 23:11:11 +0000</pubDate>
		<dc:creator>Chris Schneider</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=382</guid>
		<description><![CDATA[update: I posted a piece of annoated source code that demos some of what I describe here: jQuery Toggle Widget By Example
What&#8217;s a Widget?
The widget infrastructure was introduced by the jQuery-ui library.  You can think of it as a class that&#8217;s tied to a dom object.  $("#foo").my_widget(); would instantiate a new copy of the my_widget widget on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update: I posted a piece of annoated source code that demos some of what I describe here: <a href="http://blog.citrusbyte.com/2010/09/17/jquery-toggle-widget-by-example/">jQuery Toggle Widget By Example</a></strong></p>
<h2>What&#8217;s a Widget?</h2>
<p>The widget infrastructure was introduced by the jQuery-ui library.  You can think of it as a class that&#8217;s tied to a dom object.  <code>$("#foo").my_widget();</code> would instantiate a new copy of the my_widget widget on the #foo DOM element. A key thing to note is that if you have a list of jQuery objects <code>$("p").my_widget()</code>, you&#8217;d get a separate instance of the widget for each item in that list.  A widget is only attached to a single DOM element.</p>
<h2>Why Widgets?</h2>
<p class="p2">
<p class="p1">There are a few key reasons to use jQuery&#8217;s widgets for your interaction code.</p>
<ul>
<li>The biggest is that it provides the level of code organization that is very hard to maintain outside of a widget structure.  It changes the code from being imperative (&#8221;do this, then that, then another thing, bind to click&#8221;) to declarative (&#8221;act like an expando thing&#8221;).  This frees you up to define what &#8220;expando thing&#8221; means, while not cluttering or changing the outer layer of your app.  No more multi-hundred line long <code>$(document).ready()</code> blocks.</li>
<li>Instance variables inside the widget allows you to avoid having global lookup hashes, and similar code smells.</li>
<li>Easy developer cooperation.  You&#8217;re working with another guy, he&#8217;s in toggle.js, you&#8217;re in window.js, and you know that you&#8217;re not going to accidentally step on each other.</li>
</ul>
<h2>What we use Widgets for at Citrusbyte</h2>
<p><strong>The Small Time Stuff</strong></p>
<ul>
<li>Our home-grown tab library (show/hide various divs, custom events &amp; callbacks)</li>
<li>Togglable on/off switches</li>
<li>jQuery UI Built-in widgets for draggable, droppable, resizable, and the rest.  Often as building blocks for</li>
<li>Shared widgets between clients.  It&#8217;s pretty often that we need to write a generic widget that gets added to our library of easy-to-modify code.  Copy into new project, tweak, and deploy.  Saves us time, and our clients money.</li>
</ul>
<p><strong>The Big Time Stuff</strong></p>
<ul>
<li>100% JS interfaces where elements have significant state, change views, with custom events.  Look for our future case study regarding this particular client.</li>
</ul>
<p class="p2">
<h2>What&#8217;s a basic widget look like?</h2>
<p><script src="http://gist.github.com/580938.js" type="text/javascript"></script> Key things to note:</p>
<ul>
<li>Widgets strings all start with `ui.` in their names.  Don&#8217;t be fooled into thinking this is a namespace. It&#8217;s not. You&#8217;re required to use `ui.` there. I&#8217;m not sure of the design decision behind this, but you need to watch out for it.</li>
<li>Methods with an underscore are private, _init() is a magic one that jQuery calls when you initialize things</li>
<li>Methods without an underscore are public.</li>
</ul>
<h2>Calling Methods After you&#8217;ve init&#8217;d the widget</h2>
<p><script src="http://gist.github.com/580940.js" type="text/javascript"></script></p>
<p class="p1">
<p class="p2">
<h2>Multiple Widgets on a Single DOM Element</h2>
<p><script src="http://gist.github.com/580943.js" type="text/javascript"></script></p>
<h2>Accessing the element from the Widget</h2>
<p><script src="http://gist.github.com/580947.js" type="text/javascript"></script></p>
<p class="p1">The <code>my_widget</code> variable contains a reference to the current scope.  So you can call methods, and so on.  I like making it an explicit variable, rather than the implicit `this` because then it doesn&#8217;t get clobbered by event handler callbacks.</p>
<p class="p1">The <code>$my_widget</code> variable is the DOM element that this widget instance is attached to.  Just like any other jQuery DOM element, you can search for <code>parents()</code>, <code>children()</code>, <code>appendTo()</code>, <code>toggle()</code>, attach events like <code>click()</code>, <code>hover()</code>, and whatever else you need to do.</p>
<h2>Composing Widgets</h2>
<p class="p1">A fun trick is to have your widget initializer define further widgets it&#8217;s own element. Any given DOM element can have many attached widgets.  So you can define your own widget, and use composition to build out it&#8217;s features.</p>
<p class="p1">For instance:</p>
<p class="p2">
<p><script src="http://gist.github.com/580954.js" type="text/javascript"></script></p>
<p>As far as the jQuery outside world is concerned, you have a widget that attaches all that functionality in a single call to <code>$("#foo").my_widget()</code>. The element just automatically becomes draggable, resizable, or any other custom widget behavior you implement.</p>
<h2>The Options Hash</h2>
<p><script src="http://gist.github.com/580956.js" type="text/javascript"></script></p>
<p class="p2">
<p class="p1">You can pass an arbitrary hash of values into a widget.  These can include callbacks, strings, numbers, objects, or whatever else you have.</p>
<p class="p2">
<p class="p2">
<h2>Default Options</h2>
<p><script src="http://gist.github.com/580963.js" type="text/javascript"></script></p>
<p>You can set default options for your widget by simply having an options variable set.  Any options passed in by the user will overwrite your defaults.</p>
<h2>Inheritance</h2>
<p><script src="http://gist.github.com/580964.js" type="text/javascript"></script></p>
<p class="p2">
<p class="p1">Inheritance in jQuery widgets isn&#8217;t quite as smart as real class-based languages or Javascript frameworks.  What is happening is that it is starting with the parent widget (ui.world), and merging in the child widget&#8217;s hash of definitions (from ui.hello). Because there&#8217;s no true inheritance, there is no easily accessible way to call <code>super</code>.  You can still do it by doing some gymnastics with $.ui.world.prototype if you need to call the super&#8217;s copy. You can easily form a chain of widgets, each inheriting from another.</p>
<p class="p1">We&#8217;ve used this when we&#8217;ve needed to build out a set of different kinds of widgets that all needed similar base functionality (like drag&amp;drop, or right-click-menu, or similar).</p>
<p class="p2">
<p class="p1">This kind of base functionality is provided by the jQuery UI library in the mouse class</p>
<p class="p2">
<p class="p2">
<h2>Official Docs</h2>
<p class="p3"><span class="s1"><a href="http://jqueryui.com/docs/Developer_Guide">http://jqueryui.com/docs/Developer_Guide</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/09/16/jquery-widgets-bringing-sanity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fixing Resque</title>
		<link>http://blog.citrusbyte.com/2010/05/21/fixing-resque/</link>
		<comments>http://blog.citrusbyte.com/2010/05/21/fixing-resque/#comments</comments>
		<pubDate>Fri, 21 May 2010 15:21:53 +0000</pubDate>
		<dc:creator>Michel Martens</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=369</guid>
		<description><![CDATA[Since redis-rb 2.0.0 came out, a lot of Resque users realized that redis-namespace (a Resque dependency) was incompatible with the most recent Redis client. It didn&#8217;t come as a surprise: I even notified Chris Wanstrath (author of Resque and redis-namespace) about this issue when we were rolling release candidates. At that time, his proposed solution [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href='http://blog.citrusbyte.com/2010/05/14/redis-rb-200/'>redis-rb 2.0.0 came out</a>, a lot of <a href='http://github.com/defunkt/resque'>Resque</a> users realized that <a href='http://github.com/defunkt/redis-namespace'>redis-namespace</a> (a Resque dependency) was incompatible with the most recent Redis client. It didn&#8217;t come as a surprise: I even notified Chris Wanstrath (author of Resque and redis-namespace) about this issue when we were rolling release candidates. At that time, his proposed solution was to lock Resque to redis-rb 1.0.x. I also hinted that once Redis 2 comes out, the old client would no longer work because of a change in the protocol.</p>
<p>For some background, Resque is a Redis-backed Ruby library for creating background jobs, placing those jobs on multiple queues, and processing them later. It uses redis-namespace, a 187 sloc gem that adds a Redis::Namespace class which can be used to namespace Redis keys.</p>
<p>Yesterday, a discussion took place in <a href='irc://irc.freenode.net/redis'>#redis</a> regarding redis-namespace compatibility with redis-rb 2.0.0. There even was a suggestion to incorporate redis-namespace into redis-rb, so all libraries could profit from that solution. Even if I opposed that move (I consider redis-namespace the wrong solution to a simple problem), the underlying issue was not with redis-namespace, but with Resque itself. None of the participants in that discussion were direct redis-namespace users: they only wanted Resque to work with redis-rb 2.0.0.</p>
<p>Not being a Resque user myself, I had not bothered looking at its code before. Turns out I was able to make Resque 100% compatible with redis-rb 2.0.0 by replacing redis-namespace with&#8230; nothing. It wasn&#8217;t needed at all, and the namespacing functionality is now handled by an attr_accessor called namespace.</p>
<p>This code lives at my <a href='http://github.com/soveran/resque/tree/without-redis-namespace'>without-redis-namespace</a> branch. I sent a pull request yesterday, I hope it will be incorporated soon to the main repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/05/21/fixing-resque/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Redis-rb 2.0.0</title>
		<link>http://blog.citrusbyte.com/2010/05/14/redis-rb-200/</link>
		<comments>http://blog.citrusbyte.com/2010/05/14/redis-rb-200/#comments</comments>
		<pubDate>Sat, 15 May 2010 01:39:56 +0000</pubDate>
		<dc:creator>Michel Martens</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=355</guid>
		<description><![CDATA[After a few weeks with very stable release candidates, we have just pushed version 2.0.0. Here&#8217;s a quick rundown on what&#8217;s new with the Ruby client for Redis:
Explicit &#62; Implicit
The previous version of the client relied on method_missing to execute commands against Redis. While this was great for quickly putting together a simple client, it [...]]]></description>
			<content:encoded><![CDATA[<p>After a few weeks with very stable release candidates, we have just pushed version 2.0.0. Here&#8217;s a quick rundown on what&#8217;s new with the <a href='http://rubygems.org/gems/redis'>Ruby client for Redis</a>:</p>
<h4 id='explicit__implicit'>Explicit &gt; Implicit</h4>
<p>The previous version of the client relied on <code>method_missing</code> to execute commands against Redis. While this was great for quickly putting together a simple client, it proved insufficient for more advanced commands like pub/sub, blocking pop, etc. Plus, relying on this technique lead to longer and more branched methods as new features were added to Redis.</p>
<p>The new version explicitly defines each command as a method in the <code>Redis</code> class. We strongly believe that explicit beats implicit. This way it&#8217;s much easier to follow what is going on for each command. We did leave <code>method_missing</code> in there because it&#8217;s a nice way of being able to run simple commands that are not yet known to the client, but we&#8217;ll keep adding new commands as needed.</p>
<p>A nice consequence of this change is that the complexity of the code was reduced drastically. Many branches were removed in favor of separate, smaller methods (this is something that could only be done with an explicit method for each command).</p>
<h4 id='new_protocol'>New protocol</h4>
<p>This version uses the new protocol only. It means people running a Redis version older than 1.2 will be stuck with the 1.0 branch. This multi-bulk protocol is binary safe and will be the only one available once Redis 2.0 is released, for which a release candidate is expected soon.</p>
<h4 id='faster'>Faster!</h4>
<p>One of our concerns when refactoring was the impact on performance this decoupling would bring. We agreed that a good goal would be to have the new version performing at least as fast as the old one. To our surprise &#8211;and probably because of the removal of branches, hash look-ups and by avoiding <code>method_missing</code>&#8211; the new version performed even better.</p>
<p>Before:</p>
<pre><code>$ ruby -Ilib benchmarking/speed.rb
7.88 Kops</code></pre>
<p>After:</p>
<pre><code>$ ruby -Ilib benchmarking/speed.rb
8.79 Kops</code></pre>
<p>The higher the number, the better. It means that the new version executes almost a thousand operations more per second.</p>
<h4 id='redisdistributed'>Redis::Distributed</h4>
<p>The old client shipped with DistRedis, which included a hashring algorithm and supported a small subset of operations. As it wasn&#8217;t tested or documented, we started by defining all the test cases and proceeded to implement them. Some operations are impossible in a distributed scenario, but we would cover a lot of interesting cases and it is now a very reliable tool. Check the <a href='http://github.com/ezmobius/redis-rb/blob/master/test/distributed_test.rb'>testing suite</a> to see the range of commands that are now possible.</p>
<h4 id='supportbugshelp'>Support/Bugs/Help</h4>
<p>Jump to IRC if you need instant help. We are most of the time available at #redis-rb on Freenode. If nobody can help you there, try #redis. You can also <a href='http://github.com/ezmobius/redis-rb/issues'>create an issue</a> on GitHub, or fork the project and send a patch directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/05/14/redis-rb-200/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ohm, now using Redis Hashes</title>
		<link>http://blog.citrusbyte.com/2010/05/10/ohm-now-using-redis-hashes/</link>
		<comments>http://blog.citrusbyte.com/2010/05/10/ohm-now-using-redis-hashes/#comments</comments>
		<pubDate>Tue, 11 May 2010 04:05:48 +0000</pubDate>
		<dc:creator>Michel Martens</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=342</guid>
		<description><![CDATA[Redis 2.0.0 is around the corner, but many of us are already using 1.3.x even in production. The new version has a lot of goodies, and of special interest for libraries that map objects to Redis is the hash data type.
By using hashes, Ohm is able to squeeze all the object attributes in a single [...]]]></description>
			<content:encoded><![CDATA[<p>Redis 2.0.0 is around the corner, but many of us are already using 1.3.x even in production. The new version has a lot of goodies, and of special interest for libraries that map objects to Redis is the hash data type.</p>
<p>By using hashes, <a href='http://ohm.keyvalue.org'>Ohm</a> is able to squeeze all the object attributes in a single key instead of using one key per attribute, a common pattern in key/value datastores (for some history, check the article that inspired Ohm almost one year ago: <a href='http://code.google.com/p/redis/wiki/TwitterAlikeExample'>case study for a Twitter clone</a>).</p>
<p>This release candidate uses <a href='http://github.com/ezmobius/redis-rb/'>Redis-rb 2.0.0.rc3</a>, the new client that is faster, binary safe and no longer relies on method_missing for building the commands.</p>
<h2 id='upgrading_your_database'>Upgrading your database</h2>
<p>You will need to migrate your database if you want to use <a href='http://github.com/soveran/ohm'>Ohm 0.1.0</a>. It comes with a helper just for that, <a href='http://gist.github.com/396791'>follow the example code to upgrade</a>.</p>
<p>You will also need Redis 1.3.10 or newer, grab it from <a href='http://github.com/antirez/redis'>http://github.com/antirez/redis</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/05/10/ohm-now-using-redis-hashes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Citrusbyte delivers last minute Sony Facebook tab for 180LA</title>
		<link>http://blog.citrusbyte.com/2010/05/07/citrusbyte-delivers-last-minute-sony-facebook-tab-for-180la/</link>
		<comments>http://blog.citrusbyte.com/2010/05/07/citrusbyte-delivers-last-minute-sony-facebook-tab-for-180la/#comments</comments>
		<pubDate>Fri, 07 May 2010 23:01:37 +0000</pubDate>
		<dc:creator>PaulAllen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[180la]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[results]]></category>

		<category><![CDATA[rush]]></category>

		<category><![CDATA[sony]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=315</guid>
		<description><![CDATA[180LA engaged Citrusbyte to deliver a simple Facebook tab showcasing Sony Electronic&#8217;s new iSweep Panorama digital camera technology.  While not a technically challenging project, 180LA needed a product representative of the Sony brand quality and they needed it as soon as possible.
Within a day of the request, Citrusbyte had the new frame up and running [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-317" title="180 logo" src="http://blog.citrusbyte.com/wp-content/uploads/2010/05/180-logo.jpg" alt="180 logo" width="85" height="75" />180LA engaged Citrusbyte to deliver a simple Facebook tab showcasing Sony Electronic&#8217;s new iSweep Panorama digital camera technology.  While not a technically challenging project, 180LA needed a product representative of the Sony brand quality and they needed it as soon as possible.</p>
<p>Within a day of the request, Citrusbyte had the new frame up and running on the <a href="http://www.facebook.com/sonyelectronics?v=app_4949752878">Official Sony Electronics Facebook</a> page.  Take a look for yourself:</p>
</p>
<div class="mceTemp" style="text-align: center;">
<dl id="attachment_314" class="wp-caption  alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a title="Sony Electronics iSweep Panorama Facebook Tab" href="http://www.facebook.com/sonyelectronics?v=app_4949752878"><img class="size-medium wp-image-314" title="Sony iSweep Panorama Facebook Application" src="http://blog.citrusbyte.com/wp-content/uploads/2010/05/screen-shot-2010-05-07-at-34252-pm-300x284.png" alt="Sony iSweep Panorama Facebook Page" width="300" height="284" /></a></dt>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/05/07/citrusbyte-delivers-last-minute-sony-facebook-tab-for-180la/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Monk updated to use Sinatra 1.0</title>
		<link>http://blog.citrusbyte.com/2010/04/13/monk-updated-to-use-sinatra-10/</link>
		<comments>http://blog.citrusbyte.com/2010/04/13/monk-updated-to-use-sinatra-10/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 17:43:36 +0000</pubDate>
		<dc:creator>Michel Martens</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=307</guid>
		<description><![CDATA[Monk&#8217;s default skeleton now ships with Sinatra 1.0 and the latest versions of Webrat and Ohm.
It also includes tasks for starting and stopping Redis, and overall should provide more hints about what to configure and where.
To try it, just run monk init myapp, then cd myapp and monk to check the available options.
If you never [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://monkrb.com'>Monk</a>&#8217;s default skeleton now ships with <a href='http://www.sinatrarb.com/one-oh-faq'>Sinatra 1.0</a> and the latest versions of <a href='http://github.com/brynary/webrat'>Webrat</a> and <a href='http://ohm.keyvalue.org'>Ohm</a>.</p>
<p>It also includes tasks for starting and stopping <a href='http://code.google.com/p/redis'>Redis</a>, and overall should provide more hints about what to configure and where.</p>
<p>To try it, just run <code>monk init myapp</code>, then <code>cd myapp</code> and <code>monk</code> to check the available options.</p>
<p>If you never installed Monk, run <code>sudo gem install monk</code>. If you already have it, there&#8217;s no need to update the gem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/04/13/monk-updated-to-use-sinatra-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mixing Ohm with ActiveRecord, DataMapper and Sequel</title>
		<link>http://blog.citrusbyte.com/2010/04/12/mixing-ohm-with-activerecord-datamapper-and-sequel/</link>
		<comments>http://blog.citrusbyte.com/2010/04/12/mixing-ohm-with-activerecord-datamapper-and-sequel/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 16:08:48 +0000</pubDate>
		<dc:creator>Michel Martens</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=301</guid>
		<description><![CDATA[There&#8217;s one nice side effect in the way Ohm and Sequel find records: they use [](id), which is also a way to call procs in Ruby.
So, how would you declare a reference to a DataMapper model or a set of ActiveRecord instances within Ohm?
class User &#60; ActiveRecord::Base
  def posts
    Post.find(user: self)
 [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s one nice side effect in the way <a href='http://ohm.keyvalue.org'>Ohm</a> and <a href='http://sequel.rubyforge.org/rdoc/classes/Sequel/Model/ClassMethods.html#M000238'>Sequel</a> find records: they use <code>[](id)</code>, which is also a way to call procs in Ruby.</p>
<p>So, how would you declare a reference to a DataMapper model or a set of ActiveRecord instances within Ohm?</p>
<pre><code>class User &lt; ActiveRecord::Base
  def posts
    Post.find(user: self)
  end
end

class Comment
  include DataMapper::Resource

  property :id,          Serial
  property :body,        String
end

class Post &lt; Ohm::Model
  attribute :body
  reference :user, lambda { |id| User.find(id) }
  list      :comments, lambda { |id| Comment.get(id) }
end</code></pre>
<p>Each time Ohm needs to refer to User, it will call the lambda the way it calls other Ohm models.</p>
<pre><code>&gt;&gt; user = User.create :name =&gt; &quot;foo&quot;
&gt;&gt; post = Post.create :user =&gt; user, :body =&gt; &quot;bar&quot;

&gt;&gt; post.user.name
=&gt; &quot;foo&quot;

&gt;&gt; comment = Comment.new
&gt;&gt; comment.attributes = { :body =&gt; &quot;baz&quot; }
&gt;&gt; comment.save
=&gt; true

&gt;&gt; post.comments &lt;&lt; comment
&gt;&gt; post.comments.first.body
&gt;&gt; &quot;baz&quot;</code></pre>
<p>And what about Sequel? Because Sequel behaves exactly like Ohm, there&#8217;s no need for a lambda. You can mix them directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/04/12/mixing-ohm-with-activerecord-datamapper-and-sequel/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Guide to porting Facebook games and apps to the MySpace platform</title>
		<link>http://blog.citrusbyte.com/2010/03/15/porting_facebook_games_apps_myspace/</link>
		<comments>http://blog.citrusbyte.com/2010/03/15/porting_facebook_games_apps_myspace/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 19:58:18 +0000</pubDate>
		<dc:creator>PaulAllen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[myspace]]></category>

		<category><![CDATA[tools]]></category>

		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://blog.citrusbyte.com/?p=295</guid>
		<description><![CDATA[You didn’t have to attend the GDC last week in San Francisco to know that social games like Farmville are revolutionizing the gaming industry.  But what does this mean for developers who rely upon Facebook as the sole social network platform for their businesses?  It means its time to diversify.
In a recent Forbes [...]]]></description>
			<content:encoded><![CDATA[<p>You didn’t have to attend the GDC last week in San Francisco to know that social games like Farmville are revolutionizing the gaming industry.  But what does this mean for developers who rely upon Facebook as the sole social network platform for their businesses?  It means its time to diversify.</p>
<p>In <a href="http://blogs.forbes.com/velocity/2010/03/10/social-games-look-to-outgrow-facebook/">a recent Forbes article</a> Brian Reynolds, chief designer of Zynga, said his company was &#8220;platform agnostic,” stating Zynga “just [wants] to be on whatever platforms enable good experiences.  We&#8217;re also on MySpace, and we&#8217;ve done iPhone stuff. It&#8217;s all about which platform allows it to be most social.&#8221;</p>
<p>Today, Citrusbyte announces <a href="http://developer.myspace.com/wordpress/wp-content/themes/myspace/FB_TO_MS_convertion/guide.html">tools</a> to help your Facebook game be just a bit more platform agnostic with only a few minor code tweaks.</p>
<p>Commissioned by MySpace, Citrusbyte developed <a href="http://developer.myspace.com/wordpress/wp-content/themes/myspace/FB_TO_MS_convertion/guide.html">a reference toolkit for porting any Facebook app to the MySpace platform</a>. The document goes through Facebook’s Authentication and RESTful APIs, noting their MySpace equivilent or providing code snippets whenever necessary.   The document concludes with a step-by-step example of how to port one Facebook app to the MySpace platform, including before and after code.</p>
<p>Following this guide, Facebook game developers can quickly and easily bring their apps to the MySpace platform, accessing over 100 million additional active users.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.citrusbyte.com/2010/03/15/porting_facebook_games_apps_myspace/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

