<?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>Stewdio Blog &#187; Ruby</title>
	<atom:link href="http://stewdio.org/blog/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://stewdio.org/blog</link>
	<description></description>
	<lastBuildDate>Wed, 25 Aug 2010 22:44:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Stewart interviewed by Creativity</title>
		<link>http://stewdio.org/blog/2010/03/25/stewart-interviewed-by-creativity/</link>
		<comments>http://stewdio.org/blog/2010/03/25/stewart-interviewed-by-creativity/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 11:00:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Press]]></category>
		<category><![CDATA[Browser Pong]]></category>
		<category><![CDATA[DS+R]]></category>
		<category><![CDATA[HistoFace]]></category>
		<category><![CDATA[iQuit]]></category>
		<category><![CDATA[Jed's Other Poem]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Terre Natale]]></category>
		<category><![CDATA[Warning Office]]></category>
		<category><![CDATA[Wieden+Kennedy]]></category>
		<category><![CDATA[WindMaker]]></category>
		<category><![CDATA[ZKM]]></category>

		<guid isPermaLink="false">http://stewdio.org/blog/?p=590</guid>
		<description><![CDATA[The design and advertising blog Creativity (formerly AdCritic) has just posted an interview with Stewdio&#8217;s Stewart Smith, conducted by Jamie Kim of Wieden+Kennedy Amsterdam. The two discuss the intersection of art and software, collaborators, personal projects, and the &#8220;fake it &#8217;till you make it&#8221; ethos. Read up here: Face to face with the brains behind [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/logo.png" alt="" title="Creativity Online" width="163" height="101" class="alignright size-full wp-image-593" /><br />
The design and advertising blog <a class="ext" href="http://creativity-online.com">Creativity</a> (formerly AdCritic) has just posted an interview with Stewdio&#8217;s Stewart Smith, conducted by Jamie Kim of <a class="ext" href="http://www.wk.com/work/from/amsterdam">Wieden+Kennedy Amsterdam</a>. The two discuss the intersection of art and software, collaborators, personal projects, and the &#8220;fake it &#8217;till you make it&#8221; ethos. Read up here: <strong><a class="ext" href="http://creativity-online.com/news/wk-amsterdams-jamie-kim-interviews-stewdios-smith/142910">Face to face with the brains behind iQuit, Browser Pong and other experiments in digital fun.</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://stewdio.org/blog/2010/03/25/stewart-interviewed-by-creativity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby-Processing</title>
		<link>http://stewdio.org/blog/2010/03/22/ruby-processing/</link>
		<comments>http://stewdio.org/blog/2010/03/22/ruby-processing/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 20:00:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby-Processing]]></category>

		<guid isPermaLink="false">http://stewdio.org/blog/?p=541</guid>
		<description><![CDATA[Are you on a Mac? Ten minutes from now you will be running your first Ruby-Processing animation, mesmerized by a color shifting 3D cube spinning in space. Interested? Then keep on reading this crash course in Ruby-Processing. If you&#8217;re really impatient scroll down to &#8220;Install Ruby-Processing.&#8221; What is Ruby? Ruby is a fairly young programming [...]]]></description>
			<content:encoded><![CDATA[<p>Are you on a Mac? Ten minutes from now you will be running your first <strong>Ruby-Processing</strong> animation, mesmerized by a color shifting 3D cube spinning in space. Interested? Then keep on reading this crash course in Ruby-Processing. If you&#8217;re really impatient scroll down to &#8220;Install Ruby-Processing.&#8221;</p>
<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/ruby_icon.jpg" alt="" title="ruby_icon" width="64" height="64" class="alignright size-full wp-image-565" /></p>
<h4 class="blog">What is Ruby?</h4>
<p><a class="ext" href="http://ruby-lang.org">Ruby</a> is a fairly young programming language, conceived in 1993 and first publicly released in 1995. It was created by Japanese programmer <a class="ext" href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto">Yukihiro &#8220;Matz&#8221; Matsumoto</a>. And if you&#8217;re running OS X you already have Ruby installed. Yup, it&#8217;s already there waiting for you. For more historical info see <a class="ext" href="http://en.wikipedia.org/wiki/Ruby_(programming_language">&#8220;Ruby (Programming Language)&#8221; on Wikipedia</a>. </p>
<p><span id="more-541"></span></p>
<p>Ruby gained significant popularity with the rise of <a class="ext" href="http://rubyonrails.org">Ruby on Rails</a>. (Rails is a web application framework written in Ruby.) In fact, web searches for things having to do with Ruby will usually land you on a page that&#8217;s specifically discussing the Rails framework. But Ruby is good for more than just building Web sites. We&#8217;re about to make a spinning cube with it, right there on your Desktop!</p>
<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/processing_icon.jpg" alt="" title="processing_icon" width="64" height="64" class="alignright size-full wp-image-566" /></p>
<h4 class="blog">What is Processing?</h4>
<p><a href="http://processing.org">Processing</a> is a <a class="ext" href="http://java.sun.com">Java</a>-based programming framework created by <a class="ext" href="http://benfry.com">Ben Fry</a> and <a class="ext" href="http://reas.com">Casey Reas</a> while they were studying under <a class="ext" href="http://maedastudio.com">John Maeda</a> at the <a class="ext" href="http://media.mit.edu">MIT Media Lab</a> back in 2001. It&#8217;s used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production.</em></p>
<p>Processing boasts a healthy development community with a wealth of helpful libraries and code examples, all available for free. Whether you&#8217;re a Processing novice or hardened &#8220;P5&#8243; warrior, the page you&#8217;ll find most useful is right here: <a class="ext" href="http://processing.org/reference">The Processing Language API</a>. It&#8217;s a list of all the available Processing commands with links to relevant code examples. </p>
<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/ruby-processing_icon.jpg" alt="" title="ruby-processing_icon" width="64" height="64" class="alignright size-full wp-image-567" /></p>
<h4 class="blog">Ok. So what&#8217;s Ruby-Processing?</h4>
<p><a class="ext" href="http://wiki.github.com/jashkenas/ruby-processing/getting-started">Ruby-Processing</a> is a plugin for Ruby created by <a class="ext" href="http://ashkenas.com/codework/ruby-processing.html">Jeremy Ashkenas</a> that allows you to use all the libraries and commands from Processing. Why would anyone want to do this? Because <a class="ext" href="http://en.wikipedia.org/wiki/Why's_(poignant)_Guide_to_Ruby">Ruby is a beautiful, conceptually elegant programming language</a>. And Processing is a simple yet powerful framework with a history and community already attached to it. This means you can immediately dive into building complex visualizations (Processing) while doing so in a programming language that will expand your mind (Ruby). And it&#8217;s easy to get started.<br />
&nbsp;</p>
<h4 class="blog">Install Ruby-Processing</h4>
<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/terminal_rp5.jpg" alt="" title="terminal_rp5" width="420" height="60" class="alignnone size-full wp-image-572" /></p>
<p>1. <strong>Open up Terminal</strong>. It&#8217;s a program that comes with OS X and is in your Applications &gt; Utilities folder. The quickest way to find it is to click the magnifying glass in the upper-right corner of your screen and type in &#8220;Terminal.&#8221; When it opens you&#8217;ll see a text window with a command-line prompt. In the mini screenshot above I&#8217;m using Terminal with the &#8220;Ocean&#8221; color theme. Because.</p>
<p>2. <strong>Paste this into Terminal and hit Enter</strong>:
<pre>sudo gem install ruby-processing</pre>
<p>3. <strong>Type in your admin password when Terminal asks for it</strong>. These programs aren&#8217;t allowed to just install themselves, so that&#8217;s why you need to enter your password. And don&#8217;t worry, you won&#8217;t be able to see your password as you&#8217;re entering it but Terminal knows what you&#8217;re typing. Wait for the download and install&#8230; should only be a minute. And that&#8217;s it. Done. You have Ruby-Processing.<br />
&nbsp;</p>
<h4 class="blog">Let&#8217;s spin some 3D cubes!</h4>
<p><img src="http://stewdio.org/blog/wp-content/uploads/2010/03/code_snapshot.jpg" alt="" title="code_snapshot" width="420" height="60" class="alignnone size-full wp-image-577" /></p>
<p> Now that you have Ruby-Processing installed (aka &#8220;RP5&#8243; for short) it&#8217;s time to write a program and run it. Or rather, why don&#8217;t you just copy the code below and past it into a text file. I recommend <a class="ext" href="http://macromates.com">TextMate</a> (it&#8217;s currently my favorite text editor) but if you can&#8217;t afford it there&#8217;s the free <a class="ext" href="http://www.barebones.com/products/TextWrangler/">TextWrangler</a> or you can just use OS X&#8217;s built-in <a class="ext" href="http://support.apple.com/kb/HT2523">TextEdit</a>. For TextMate I recommend the &#8220;Blackboard&#8221; theme. (To change visuals themes click on TextMate &gt; Preferences and go to the Fonts &#038; Color tab. Also, Menlo-Regular at 14pt is a respectable font choice. </p>
<p>Note: If you use TextEdit make sure you click Format &gt; Make Plain Text to remove text formatting (like font styles, sizes, colors, etc) before saving.</p>
<pre>
class ColorCube < Processing::App
  load_library :opengl

  def setup
    size 640, 360, OPENGL
    frame_rate 30
    @x_degree = 45
    @y_degree =  0
    @foreground_hue =   0
    @background_hue = 180
    color_mode HSB, 360
    no_stroke
  end

  def draw
    background @background_hue, 360, 360, 360
    lights
    push_matrix

      translate width / 2, height / 2, 0
      rotate_x radians( @x_degree )
      rotate_y radians( @y_degree )
      fill @foreground_hue, 360, 360, 320
      box 180

    pop_matrix
    @x_degree  = ( @x_degree + 1 ).modulo 360
    @y_degree  = ( @y_degree + 2 ).modulo 360
    @foreground_hue = ( @foreground_hue +   1 ).modulo 360
    @background_hue = ( @foreground_hue + 180 ).modulo 360
  end

end
ColorCube.new :title => "My COLORFUL Cube!"
</pre>
<p>&nbsp;<br />
<img src="http://stewdio.org/blog/wp-content/uploads/2010/03/frame-0191.jpg" alt="" title="frame-0191" width="640" height="360" class="alignnone size-full wp-image-570" /></p>
<h4 class="blog">Let&#8217;s do this</h4>
<p>1. <strong>Save this file to your Desktop as ColorCube.rb</strong>. That &#8220;.rb&#8221; file extension stands for Ruby. </p>
<p>2. <strong>Open up Terminal</strong>. Or perhaps you still have it open from installing Ruby-Processing? No Matter. Your Terminal&#8217;s command prompt is probably working out of your Home folder. But we want Terminal to work out of your Desktop folder because that&#8217;s where we just saved our file. Copy and paste this command into Terminal and hit Enter:
<pre>cd ~/Desktop</pre>
<p>3. <strong>Spin your cube</strong>. Again, copy and paste this command into Terminal and hit Enter:
<pre>rp5 run ColorCube.rb</pre>
<p>And there you go. You should be looking at a color-shifting, rotating cube on a color-shifting background. Just hit Command+Q to Quit. </p>
<h4 class="blog">Conclusions</h4>
<p>You have <a class="ext" href="http://wiki.github.com/jashkenas/ruby-processing/getting-started">Ruby-Processing</a> installed. You just ran your first &#8220;RP5&#8243; animation. You&#8217;re probably excited, but have a lot of questions. Try experimenting: How might I make the cube larger? Maybe it has to do with the number after that &#8220;box&#8221; command? What happens if I delete the line that says &#8220;lights&#8221;? Give it a shot. Don&#8217;t worry about breaking things. If you&#8217;ve made a mistake and can&#8217;t figure out how to fix it, just paste in this sample code again. No big deal.</p>
<p>Again, I would direct you to the <a class="ext" href="http://processing.org/reference">Processing Language API</a> which lists all of the Processing commands. You will need to &#8220;Ruby-ize&#8221; these commands: Java likes to use <strong>camelCase</strong> for function names but Ruby prefers <strong>under_scores</strong>. If you run into difficulties see the <a class="ext" href="http://wiki.github.com/jashkenas/ruby-processing/using-the-processing-api">RP5 Using the Processing API</a> page for more info.</p>
<p>And one last thing. Remember that Terminal command we used to switch from your Home folder to your Desktop? Wouldn&#8217;t it be nice to never have to type that again? What if your Ruby-Processing programs are in a folder within a folder within another folder somewhere else on your machine? Meet <a class="ext" href="http://etresoft.org/shellhere.html">ShellHere</a>, a free little Finder add-on to solve just such a problem. ShellHere adds a button to your Finder window that will open Terminal to whatever folder location you&#8217;re currently viewing.</p>
<p>Ok. Good luck and happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://stewdio.org/blog/2010/03/22/ruby-processing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails versus Django</title>
		<link>http://stewdio.org/blog/2008/12/09/rails-versus-django/</link>
		<comments>http://stewdio.org/blog/2008/12/09/rails-versus-django/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:00:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://stewdio.org/blog/?p=126</guid>
		<description><![CDATA[During the last two weeks Stewdio has invested a great deal of time and thought into the Ruby on Rails versus Python Django debate. We began using Rails roughly a year ago and this was our first exposure to Ruby. Conversely we dabbled in Python proper before investigating the Django framework. Our assessment? Ruby on Rails [...]]]></description>
			<content:encoded><![CDATA[<p>During the last two weeks Stewdio has invested a great deal of time and thought into the <a href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a> versus <a href="http://djangoproject.com/" target="_blank">Python Django</a> debate. We began using Rails roughly a year ago and this was our first exposure to Ruby. Conversely we dabbled in Python proper before investigating the Django framework. Our assessment? Ruby on Rails is currently a better solution for agile web development. </p>
<p>Python itself is a beautiful language and we are committed to using it in future projects (perhaps even via <a href="http://nodebox.net/" target="_blank">NodeBox</a>). Unfortunately Django just isn&#8217;t what we&#8217;re looking for. Rails has a stronger development community with a sharper visual sense and a predilection for code elegance. David Heinemeier Hansson describes creating Rails as a quest for <em>beauty</em>. Something about that struck a chord with us. It&#8217;s the same gut feeling that causes us to prefer <a href="http://jquery.com/" target="_blank">jQuery</a> to <a href="http://prototypejs.org/" target="_blank">Prototype</a>. And it&#8217;s a shame that Processing has become the new <em>lingua franca</em> because Java is just . . . <strong>Python</strong> is to <strong>Saul Bass</strong> as <strong>Java</strong> is to <strong>Michael Bay</strong>.</p>
<p>Finally, the Rails and Django communities are not enemies as some suggest. They are the two brightest stars; enabling us to slowly navigate away from the graveyards of <a href="http://php.net/" target="_blank">PHP</a>, <a href="http://asp.net/" target="_blank">ASP</a>, and <a href="http://adobe.com/products/coldfusion/" target="_blank">ColdFusion</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://stewdio.org/blog/2008/12/09/rails-versus-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
