<?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>PullMonkey Blog</title>
	<atom:link href="http://pullmonkey.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pullmonkey.com</link>
	<description></description>
	<pubDate>Mon, 18 Jan 2010 19:51:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby PDF Reader Gem Tutorial</title>
		<link>http://pullmonkey.com/2010/01/18/ruby-pdf-reader-gem-tutorial/</link>
		<comments>http://pullmonkey.com/2010/01/18/ruby-pdf-reader-gem-tutorial/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 17:06:00 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[development]]></category>

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

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

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

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

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

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

		<category><![CDATA[pdf reader]]></category>

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

		<category><![CDATA[text matrix]]></category>

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57505</guid>
		<description><![CDATA[I've been doing a lot of work these days dealing with PDFs and for the most part I've been happy with using poppler-utils' pdftohtml.  And that is great if you don't care about positioning or formatting and just care about the content.  But for those of you who, like me, have run across [...]]]></description>
			<content:encoded><![CDATA[<p>I've been doing a lot of work these days dealing with PDFs and for the most part I've been happy with using poppler-utils' pdftohtml.  And that is great if you don't care about positioning or formatting and just care about the content.  But for those of you who, like me, have run across the need to know text positioning, font size, indentation, coloring, etc., then we will have to use something more.</p>
<p>I had given just about every other option a chance before I finally found <a href="http://github.com/yob/pdf-reader">the pdf reader gem</a>.  But when I found pdf reader, it didn't have much documentation and it wasn't entirely clear how to get started using it and if it would work.  Well, I can tell you that it will work and after playing with the examples a lot of it became much clearer.  I learned a lot that would probably be useful for a few other people out there, hence this post.<br />
Ok, well to get started, take a look at the <a href="http://github.com/yob/pdf-reader">github repository for pdf reader</a>.  You don't need to spend too much time, but just note a few places like <a href="http://github.com/yob/pdf-reader/tree/master/examples/">the examples directory</a> and the <a href="http://github.com/yob/pdf-reader/blob/master/lib/pdf/reader/content.rb">list of callbacks</a>.</p>
<p>You should probably familiarize yourself with <a href="http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf">this PDF specification</a> too - found <a href="http://www.adobe.com/devnet/pdf/pdf_reference.html">here</a>.  It really came in handly when trying to figure out what arguments are being passed around what they represent.</p>
<p>Let's get started -</p>
<h3>Step 1:  Install the gem</h3>
<p>Yah, this is a pretty easy step, but it is required <img src='http://pullmonkey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
sudo gem install pdf-reader</p>
<h3>Step 2:  Find a PDF (or PDFs) to use</h3>
<p>It would be best to have several PDFs for you to work with since the callbacks could vary depending on the PDF.<br />
NOTE: For these examples, I'm using a really simple PDF, pdf reader could take a while on some PDFs and seem as though it is hanging but it is not, it is just chugging away right <a href="http://github.com/yob/pdf-reader/blob/43f328a41f42a365a3582fad7df7cae374ef1d96/lib/pdf/reader/buffer.rb">around line 283 of this file</a>, reading each byte of your PDF.</p>
<h3>Step 3: List the possible callbacks and their args for one of your PDFs</h3>
<p>The point of this is to find out what methods we can write for pdf reader to call when it encounters the various parts of our PDF.<br />
The BIG One that you will most likely use is show_text() or some form of it like show_text_with_positioning().<br />
But, for now, THIS all depends on the PDF file you are using, so we need to find out what your PDF uses and go from there.</p>
<p>The easiest way to do this is to follow <a href="http://github.com/yob/pdf-reader/blob/master/examples/callbacks.rb">this example</a> and just substitute "somefile.pdf" with the path to your pdf file.</p>
<p>Run it and you will see a long list of possible callbacks and their arguments.  It is likely all squished together, so you can simply change the line of your code that says
<div class="codesnip-container" >puts cb</div>
<p> to
<div class="codesnip-container" >puts cb.inspect</div>
<p> and get a MUCH better look at everything.</p>
<p>We will start with show_text, so
<div class="codesnip-container" >grep</div>
<p> for show_text and see what you get.  For my PDF, I have mostly show_text_with_positioning.</p>
<h3>Step 4: Do some lookups</h3>
<p>What are the args they are showing me for my callbacks and how do we find out?<br />
You can do this two ways, try your luck at searching the pdf file for "show text" or "show text with positioning" and see what you get.  Or you can lookup the token used to represent show_text or show_text_with_positioning.<br />
The first way is pretty obvious, so on to the second - look in the <a href="http://github.com/yob/pdf-reader/blob/master/lib/pdf/reader/content.rb">list of callbacks</a> I had your familiarize yourself with earlier, starting on line 172.  Looking through we can find show_text and show_text_with_positioning, having Tj and TJ as their operators.  Alright, now we have something to look up - "TJ".  Well, I found it on page 251 of the PDF Specification from earlier.  Some of descriptions for the operators will require rereading but you will get the hang of it.</p>
<h3>Step 5: Use what we found</h3>
<p>Now that we know how the show_text_with_positioning works and what args it brings in, we can write our code.<br />
We need an instance of a receiver to pass to the PDF Reader.  This is just a class that has methods likes show_text() of show_text_with_positioning().  Our receiver could look something like this:</p>
<p><script src="http://gist.github.com/280305.js?file=test_it_receiver.rb"></script></p>
<p>Now we just need to create our receiver instance an pass our PDF file to pdf reader:<br />
<script src="http://gist.github.com/280307.js?file=gistfile1.rb"></script></p>
<p>Don't forget to require the pdf reader at the top of your script like this:</p>
<div class="codesnip-container" >require 'rubygems'<br />
require 'pdf/reader'</div>
<h3>Step 6: Check out the results</h3>
<p>If we run our script, we will see all the text that uses Tj or TJ print out.</p>
<p>This is just the beginning and you can pick and choose any of the callbacks from that list (list of operators) and implement just about anything.</p>
<p>At the beginning of this post, I mentioned that I was concerned about positioning.  This means I had to get very familiar with the text matrix operator (Tm), found on page 250 of the specification.  It takes six arguments (a-f) all representing one thing or another and it is not very well documented.  From what I can gather, the first four (a through d) are for things like scale and rotation, the last two e and f are for position on the page, where e is along the x axis and f along the y axis.</p>
<p>There is another text positioning operator that I saw quite often and that is move_text_position (Td operator, page 249 of the specification) that actually provides the x and y (unscaled) text space units coordinates.  So if y is -1, that just means go to the next line and if y is 0, stay on the same line, -2, move down two lines, 2, move up two lines, etc.  x is for indentation or horizontal spacing and represents the number of characters (spaces) to offset the text position by.</p>
<p>I hope this helps and a huge thanks goes to <a href="http://github.com/yob">James Healy</a> for his grand work on <a href="http://github.com/yob/pdf-reader">pdf reader</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2010/01/18/ruby-pdf-reader-gem-tutorial/feed/</wfw:commentRss>
		</item>
		<item>
		<title>POST OFC Graph as Image</title>
		<link>http://pullmonkey.com/2010/01/06/post_ofc_graph_as_image/</link>
		<comments>http://pullmonkey.com/2010/01/06/post_ofc_graph_as_image/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 21:17:57 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Open Flash Chart Graphs]]></category>

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

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

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

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

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

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

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

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

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

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

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

		<category><![CDATA[open flash chart]]></category>

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

		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://pullmonkey.com/?p=57469</guid>
		<description><![CDATA[I was asked recently (well sort of) to give an example of saving an image to the server.  If you look at teethgrinder's example for this, you will see that he has made available an external interface to do just that - POST your graph as png raw data to your server for storage. [...]]]></description>
			<content:encoded><![CDATA[<p>I was <a href="http://github.com/inbox/365812#reply">asked recently (well sort of) to give an example of saving an image to the server</a>.  If you look at <a href="http://teethgrinder.co.uk/open-flash-chart-2/adv-upload-image.php">teethgrinder's example for this</a>, you will see that he has made available an external interface to do just that - POST your graph as png raw data to your server for storage.  This has many benefits such as saving the image for use in a PDF report or for printing, since we know at times it is a bit troublesome to print the embedded flash object.<br/><br />
I think the main problem people are having with this is the receiving of the image data post - see the upload_image method below.  Also, teethgrinder's example never really says where to make the post_image() call.  So I touch on both in the code below.<br/><br />
Here is an example of the png that is saved when I did this for the chart in the previous example:<br/><br />
<img src="http://pullmonkey.com/wp-content/uploads/2010/01/tmp_image.png" alt="OFC Saved Image" title="OFC Saved Image" width="550" height="300" class="aligncenter size-full wp-image-57468" /><br/><br/><br />
Well, let's just get right in to the code.<br/><br />
The controller contains the same code as <a href="http://pullmonkey.com/2010/01/05/open-flash-chart-ii-x-axis-date-and-time/">my last post</a> with only a few minor changes to the index method and the addition of the upload_image method.<br />
In the <b>controller</b>, I have this:<br/></p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">TestItController</span> &lt; <span style="color:#036;font-weight:bold">ApplicationController</span><tt>
</tt>  <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">index</span><tt>
</tt>    <span style="color:#888"># note the user of open_flash_chart_object_from_hash instead of just open_flash_chart_object</span><tt>
</tt>    <span style="color:#888"># this allows you to pass in the id of the div you want the the chart to be in</span><tt>
</tt>    <span style="color:#888"># this is useful for when we need to findSWF by this id</span><tt>
</tt>    <span style="color:#33B">@graph</span> = open_flash_chart_object_from_hash(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">/test_it/chart</span><span style="color:#710">&quot;</span></span>, <span style="color:#A60">:div_name</span> =&gt; <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">my_chart</span><span style="color:#710">&quot;</span></span>)<tt>
</tt>  <span style="color:#080;font-weight:bold">end</span><tt>
</tt><tt>
</tt>  <span style="color:#888"># added to recieve the post data for the OFC png image of the OFC graph</span><tt>
</tt>  <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">upload_image</span><tt>
</tt>    name = <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">tmp_image.png</span><span style="color:#710">&quot;</span></span> || params[<span style="color:#A60">:name</span>]<tt>
</tt>    <span style="color:#888"># the save_image method that is provided by the OFC swf file sends raw post data, so get to it like this</span><tt>
</tt>    data = request.raw_post<tt>
</tt>    <span style="color:#036;font-weight:bold">File</span>.open(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="background:#ddd;color:black"><span style="background:#ddd;font-weight:bold;color:#666">#{</span><span style="color:#036;font-weight:bold">RAILS_ROOT</span><span style="background:#ddd;font-weight:bold;color:#666">}</span></span><span style="">/tmp/</span><span style="background:#ddd;color:black"><span style="background:#ddd;font-weight:bold;color:#666">#{</span>name<span style="background:#ddd;font-weight:bold;color:#666">}</span></span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">wb</span><span style="color:#710">&quot;</span></span>) { |f| f.write(data) } <span style="color:#080;font-weight:bold">if</span> data<tt>
</tt>    render <span style="color:#A60">:nothing</span> =&gt; <span style="color:#038;font-weight:bold">true</span><tt>
</tt>  <span style="color:#080;font-weight:bold">end</span><tt>
</tt><tt>
</tt>  <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">chart</span><tt>
</tt>    <span style="color:#888"># same code from here - http://pullmonkey.com/2010/01/05/open-flash-chart-ii-x-axis-date-and-time/ </span><tt>
</tt>    ...<tt>
</tt>  <span style="color:#080;font-weight:bold">end</span><tt>
</tt><span style="color:#080;font-weight:bold">end</span></pre>
</td>
</tr>
</table>
<p><br/><br/><br />
So just <b>note</b> the use of open_flash_chart_object_from_hash() in the index method, this way we can pass in the id of the div.<br/><br />
In the <b>view</b>, I have this:<br/></p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">&lt;<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">%=</span><span style=""> javascript_include_tag 'swfobject.js' %&gt;<tt>
</tt>&lt;%</span><span style="color:#710">=</span></span> <span style="color:#33B">@graph</span> %&gt;<tt>
</tt>&lt;<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">%=</span><span style=""> save_as_image(&quot;http://localhost:3000/test_it/upload_image?name</span><span style="color:#710">=</span></span>tmp.png<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">, :id =&gt; </span><span style="color:#710">&quot;</span></span>my_chart<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">) %&gt;<tt>
</tt>&lt;br/&gt;<tt>
</tt>&lt;%= button_to_function </span><span style="color:#710">&quot;</span></span><span style="color:#036;font-weight:bold">Save</span> <span style="color:#036;font-weight:bold">Image</span><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">, </span><span style="color:#710">&quot;</span></span>post_image()<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style=""> %&gt;</span></span></pre>
</td>
</tr>
</table>
<p><br/><br />
Really the only difference from what we would normally have in our view is that I am using the save image setup method that was added to the <a href="http://github.com/pullmonkey/open_flash_chart/commit/14ff9735c67e9b424caa129e8e06dc910e73681f">open flash chart ruby on rails plugin</a> in the last couple hours (as of this post).  The save_image method takes some arguments, mainly the url to post the image data to and the id of the chart we setup in the controller.<br/><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2010/01/06/post_ofc_graph_as_image/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open Flash Chart II - X Axis Date and Time</title>
		<link>http://pullmonkey.com/2010/01/05/open-flash-chart-ii-x-axis-date-and-time/</link>
		<comments>http://pullmonkey.com/2010/01/05/open-flash-chart-ii-x-axis-date-and-time/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:09:16 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pullmonkey.com/?p=57443</guid>
		<description><![CDATA[I was asked how to display date and time for the x axis as seen in this teethgrinder example - So here it goes.
Here is the graph we are after in this example:


    
      swfobject.embedSWF("/projects/open-flash-chart-lwc.swf", "flash_content_x_axis_date_and_time", "600", "300", "9.0.0", "expressInstall.swf",{"data-file":"/projects/open_flash_chart2/x_axis_date_and_time"});
    
More Open Flash Chart [...]]]></description>
			<content:encoded><![CDATA[<p>I was <a href="http://github.com/pullmonkey/open_flash_chart/issues#issue/3">asked how to display date and time for the x axis</a> as seen in <a href="http://teethgrinder.co.uk/open-flash-chart-2/x-axis-date.php">this teethgrinder example</a> - So here it goes.</p>
<p>Here is the graph we are after in this example:<br />
<script src="/projects/javascripts/swfobject.js" type="text/javascript"></script></p>
<div id="flash_content_x_axis_date_and_time"></div>
<p>    <script type="text/javascript">
      swfobject.embedSWF("/projects/open-flash-chart-lwc.swf", "flash_content_x_axis_date_and_time", "600", "300", "9.0.0", "expressInstall.swf",{"data-file":"/projects/open_flash_chart2/x_axis_date_and_time"});
    </script></p>
<p><a href="http://pullmonkey.com/projects/open_flash_chart2">More Open Flash Chart II examples.</a></p>
<p>And here is the code (the controller):</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt>23<tt>
</tt>24<tt>
</tt>25<tt>
</tt>26<tt>
</tt>27<tt>
</tt>28<tt>
</tt>29<tt>
</tt><strong>30</strong><tt>
</tt>31<tt>
</tt>32<tt>
</tt>33<tt>
</tt>34<tt>
</tt>35<tt>
</tt>36<tt>
</tt>37<tt>
</tt>38<tt>
</tt>39<tt>
</tt><strong>40</strong><tt>
</tt>41<tt>
</tt>42<tt>
</tt>43<tt>
</tt>44<tt>
</tt>45<tt>
</tt>46<tt>
</tt>47<tt>
</tt>48<tt>
</tt>49<tt>
</tt><strong>50</strong><tt>
</tt>51<tt>
</tt>52<tt>
</tt>53<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt><span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">TestItController</span> &lt; <span style="color:#036;font-weight:bold">ApplicationController</span><tt>
</tt>  <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">index</span><tt>
</tt>    <span style="color:#33B">@graph</span> = open_flash_chart_object(<span style="color:#00D;font-weight:bold">550</span>,<span style="color:#00D;font-weight:bold">300</span>,<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">/test_it/chart</span><span style="color:#710">&quot;</span></span>)<tt>
</tt>  <span style="color:#080;font-weight:bold">end</span><tt>
</tt>  <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">chart</span><tt>
</tt>    data1 = []<tt>
</tt>    data2 = []<tt>
</tt>    year = <span style="color:#036;font-weight:bold">Time</span>.now.year<tt>
</tt><tt>
</tt>    <span style="color:#00D;font-weight:bold">31</span>.times <span style="color:#080;font-weight:bold">do</span> |i|<tt>
</tt>      x = <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="background:#eee;color:black"><span style="font-weight:bold;color:#777">#{</span>year<span style="font-weight:bold;color:#777">}</span></span><span style="">-1-</span><span style="background:#eee;color:black"><span style="font-weight:bold;color:#777">#{</span>i+<span style="color:#00D;font-weight:bold">1</span><span style="font-weight:bold;color:#777">}</span></span><span style="color:#710">&quot;</span></span>.to_time.to_i<tt>
</tt>      y = (<span style="color:#036;font-weight:bold">Math</span>.sin(i+<span style="color:#00D;font-weight:bold">1</span>) * <span style="color:#60E;font-weight:bold">2.5</span>) + <span style="color:#00D;font-weight:bold">10</span><tt>
</tt><tt>
</tt>      data1 &lt;&lt; <span style="color:#036;font-weight:bold">ScatterValue</span>.new(x,y)<tt>
</tt>      data2 &lt;&lt; (<span style="color:#036;font-weight:bold">Math</span>.cos(i+<span style="color:#00D;font-weight:bold">1</span>) * <span style="color:#60E;font-weight:bold">1.9</span>) + <span style="color:#00D;font-weight:bold">4</span><tt>
</tt>    <span style="color:#080;font-weight:bold">end</span><tt>
</tt><tt>
</tt>    dot = <span style="color:#036;font-weight:bold">HollowDot</span>.new<tt>
</tt>    dot.size = <span style="color:#00D;font-weight:bold">3</span><tt>
</tt>    dot.halo_size = <span style="color:#00D;font-weight:bold">2</span><tt>
</tt>    dot.tooltip = <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">#date:d M y#&lt;br&gt;Value: #val#</span><span style="color:#710">&quot;</span></span><tt>
</tt><tt>
</tt>    line = <span style="color:#036;font-weight:bold">ScatterLine</span>.new(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">#DB1750</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">3</span>)<tt>
</tt>    line.values = data1<tt>
</tt>    line.default_dot_style = dot<tt>
</tt><tt>
</tt>    x = <span style="color:#036;font-weight:bold">XAxis</span>.new<tt>
</tt>    x.set_range(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="background:#eee;color:black"><span style="font-weight:bold;color:#777">#{</span>year<span style="font-weight:bold;color:#777">}</span></span><span style="">-1-1</span><span style="color:#710">&quot;</span></span>.to_time.to_i, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="background:#eee;color:black"><span style="font-weight:bold;color:#777">#{</span>year<span style="font-weight:bold;color:#777">}</span></span><span style="">-1-31</span><span style="color:#710">&quot;</span></span>.to_time.to_i)<tt>
</tt>    x.steps = <span style="color:#00D;font-weight:bold">86400</span><tt>
</tt><tt>
</tt>    labels = <span style="color:#036;font-weight:bold">XAxisLabels</span>.new<tt>
</tt>    labels.text = <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">#date: l jS, M Y#</span><span style="color:#710">&quot;</span></span><tt>
</tt>    labels.steps = <span style="color:#00D;font-weight:bold">86400</span><tt>
</tt>    labels.visible_steps = <span style="color:#00D;font-weight:bold">2</span><tt>
</tt>    labels.rotate = <span style="color:#00D;font-weight:bold">90</span><tt>
</tt><tt>
</tt>    x.labels = labels<tt>
</tt><tt>
</tt>    y = <span style="color:#036;font-weight:bold">YAxis</span>.new<tt>
</tt>    y.set_range(<span style="color:#00D;font-weight:bold">0</span>,<span style="color:#00D;font-weight:bold">15</span>,<span style="color:#00D;font-weight:bold">5</span>)<tt>
</tt><tt>
</tt>    chart = <span style="color:#036;font-weight:bold">OpenFlashChart</span>.new<tt>
</tt>    title = <span style="color:#036;font-weight:bold">Title</span>.new(data2.size)<tt>
</tt><tt>
</tt>    chart.title = title<tt>
</tt>    chart.add_element(line)<tt>
</tt>    chart.x_axis = x<tt>
</tt>    chart.y_axis = y<tt>
</tt><tt>
</tt>    render <span style="color:#A60">:text</span> =&gt; chart, <span style="color:#A60">:layout</span> =&gt; <span style="color:#038;font-weight:bold">false</span><tt>
</tt>  <span style="color:#080;font-weight:bold">end</span><tt>
</tt><span style="color:#080;font-weight:bold">end</span></pre>
</td>
</tr>
</table>
<p>And in your view (index.html.erb):</p>
<table class="CodeRay" border="0">
<tbody>
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt>&lt;script type=<span class="s"><span class="dl">"</span><span class="k">text/javascript</span><span class="dl">"</span></span> src=<span class="s"><span class="dl">"</span><span class="k">/javascripts/swfobject.js</span><span class="dl">"</span></span>&gt;&lt;<span class="rx"><span class="dl">/</span><span class="k">script&gt;<tt>
</tt>&lt;%= @graph %&gt;<tt>
</tt><tt>
</tt></span></span></pre>
</td>
</tr>
</tbody>
</table>
<p>Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2010/01/05/open-flash-chart-ii-x-axis-date-and-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open Flash Chart II for Ruby on Rails - Lug Wyrm Charmer</title>
		<link>http://pullmonkey.com/2010/01/04/open-flash-chart-ii-for-ruby-on-rails-lug-wyrm-charmer-version/</link>
		<comments>http://pullmonkey.com/2010/01/04/open-flash-chart-ii-for-ruby-on-rails-lug-wyrm-charmer-version/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 17:26:43 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Open Flash Chart Graphs]]></category>

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

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

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

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

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

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

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

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

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

		<category><![CDATA[open flash chart]]></category>

		<category><![CDATA[open flash chart II]]></category>

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

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57440</guid>
		<description><![CDATA[A long time overdue, but I've managed to get everything updated to the new version of Teethgrinder's open flash chart.
I've also started tagging everything, so if you notice any problems trying to do anything from Teethgrinder's examples, then first check that you are using the latest (as of now, that is Lug Wyrm Charmer) - [...]]]></description>
			<content:encoded><![CDATA[<p>A long time overdue, but I've managed to get everything updated to the new version of <a href="http://teethgrinder.co.uk/open-flash-chart-2/">Teethgrinder's open flash chart</a>.</p>
<p>I've also started tagging everything, so if you notice any problems trying to do anything from <a href="http://teethgrinder.co.uk/open-flash-chart-2/tutorial.php">Teethgrinder's examples</a>, then first check that you are using the latest (as of now, that is Lug Wyrm Charmer) - <a href="http://github.com/pullmonkey/open_flash_chart/tree/LugWyrmCharmer">http://github.com/pullmonkey/open_flash_chart/tree/LugWyrmCharmer</a>.</p>
<p>Make sure you are using the latest swf either from the plugin assets directory or from <a href="http://teethgrinder.co.uk/open-flash-chart-2/downloads.php">Teethgrinder's downloads</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2010/01/04/open-flash-chart-ii-for-ruby-on-rails-lug-wyrm-charmer-version/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Tumblr as a CMS</title>
		<link>http://pullmonkey.com/2009/12/30/using-tumblr-as-a-cms/</link>
		<comments>http://pullmonkey.com/2009/12/30/using-tumblr-as-a-cms/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:39:31 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[SimpleCMS]]></category>

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

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

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

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

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

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

		<category><![CDATA[data access]]></category>

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

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

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

		<category><![CDATA[tumblr as cms]]></category>

		<guid isPermaLink="false">http://pullmonkey.com/?p=57438</guid>
		<description><![CDATA[Thought you all might like this - http://blog.skizmo.com/post/308406755/use-tumblr-as-your-cms
It is something we sort of dreamed up and it works great as a partial CMS - very much like SimpleCMS where you can specify what exactly on the page needs to be managed by a CMS.  This allows you to mix your CMS static content with [...]]]></description>
			<content:encoded><![CDATA[<p>Thought you all might like this - <a href="http://blog.skizmo.com/post/308406755/use-tumblr-as-your-cms">http://blog.skizmo.com/post/308406755/use-tumblr-as-your-cms</a></p>
<p>It is something we sort of dreamed up and it works great as a partial CMS - very much like <a href="http://pullmonkey.com/tag/simplecms/">SimpleCMS</a> where you can specify what exactly on the page needs to be managed by a CMS.  This allows you to mix your CMS static content with your dynamic content.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/12/30/using-tumblr-as-a-cms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Got a road bike</title>
		<link>http://pullmonkey.com/2009/10/18/got-a-road-bike/</link>
		<comments>http://pullmonkey.com/2009/10/18/got-a-road-bike/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 14:08:30 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[biking]]></category>

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

		<category><![CDATA[928 ultegra]]></category>

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

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

		<category><![CDATA[first bike]]></category>

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

		<category><![CDATA[high desert bicycles]]></category>

		<category><![CDATA[new mexico]]></category>

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

		<category><![CDATA[road bike]]></category>

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

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

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

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57418</guid>
		<description><![CDATA[
Well, after months of riding my mountain bike everywhere, I decided it was time to buy a road bike.
There is way too much to know about purchasing a road bike, especially when I realized I was not going to get it for $30.00 like my mountain bike.  For the last couple weeks I started [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-57419" title="2010_tarmac_comp" src="http://pullmonkey.com/wp-content/uploads/2009/10/2010_tarmac_comp.jpg" alt="2010_tarmac_comp" width="500" height="300" /></p>
<p>Well, after months of <a href="http://pullmonkey.com/2009/09/05/biking_to_work/">riding my mountain bike</a> <a href="http://pullmonkey.com/2009/09/27/routes-i-did-over-the-weekend/">everywhere</a>, I decided it was time to buy a road bike.</p>
<p>There is way too much to know about purchasing a road bike, especially when I realized I was not going to get it for $30.00 like my mountain bike.  For the last couple weeks I started researching a few things about road bikes, starting with the best one to get.  That lead me down more and more bunny trails.  One thing I learned that wound up being very important was fit and the size of the bike.</p>
<p>The size of the bike is measured in centimeters, so based on a few charts, I found out that I should have a bike that is about 61 cm.  WOW!  My mountain bike is <em>tiny</em>.  It is 42 cm, smallest road bike I found was 48 cm, so maybe that isn't right, but again the mountain bike is too small for me and it was time to upgrade before I hurt myself.  Apparently if your knee does not extend far enough, you will get pain in the front of your knee and if your knee extends too far, you will get pain in the back of you knee.  Not only is my mountain bike too small it is a mountain bike and is a freaking tank weighing in at 40 lbs or so, far too heavy.</p>
<p>Anyway, back to buying the road bike.  After researching what I could, I went shop to shop to shop, about 10 shops in town, here are the ones I remember:</p>
<ul>
<li><a href="http://www.highdesertbicycles.com/">High Desert Bicycles</a><br />
Hands down the BEST bike shop in Albuquerque.  They are open EVERY day and are the friendliest group of people you will ever meet.  The owners are there every day too and they are very knowledgeable, I picked their brains for many hours and on multiple occasions.  It didn't stop at the shop, we actually exchanged a few emails about all kinds of things (more on this below).  This is where I wound up buying my bike.  You will read more about them below.</li>
<li><a href="http://www.fattirecycles.com/">Fat Tire Cycles</a><br />
Highly recommended around town and it was obvious why, I really liked it, but it didn't have as good of deals as some of the other places.  I would recommend them for service and tune ups though for sure.</li>
<li><a href="http://www.twowheeldrive.com/">Two Wheel Drive</a><br />
Not too bad, lots of Bianchis and for cheap too.  Nothing my size that I liked.</li>
<li><a href="http://www.thekickstand505.com/">Kickstand</a><br />
First place I went, they really pushed Giant.  But they have Bianchi too, I really liked the <a href="http://www.bianchiusa.com/09-bicycles/09-c2c/928-carbon-k-vid/09-c2c-928-ultegra-comp.html">C2C 928</a> that I tried, what a freaking awesome bike!</li>
<li><a href="http://albbicyclecenter.com/">Albuquerque Bicycle Center</a><br />
Treks galore.  I tried a few and despite their name didn't actually approve, sort of a rougher ride compared to the other bikes I was interested in.</li>
<li><a href="http://www.cyclecave.com/">Cycle Cave</a><br />
Mom and Pop shop, didn't have my size in anything I was interested in, but was still very informational.</li>
<li>Bike World<br />
They don't deserve a link.  It had to be a joke, this place was flat out awful!  Never go to a bike world if you want good service or any service really and I went to two of them in town just in case.</li>
<li>Performance Bikes<br />
They don't deserve a link either.  Walked in and waited for about 20 minutes, looking at bikes no one even spoke to me, so I left, wasn't what I was expecting at all.</li>
</ul>
<p>So after all of this, the question I have to ask myself is did I pick the shop or the bike?  I would like to think that it was coincidental that the <a href="http://www.highdesertbicycles.com/">BEST shop</a> with only two brands was where I ended up finding the <a href="http://www.specialized.com/us/en/bc/SBCBkModel.jsp?spid=45885&amp;eid=4350&amp;menuItemId=9256">BEST bike for me</a>.  Is that possible?</p>
<p>Yah, well obviously it is possible, I wouldn't get a bike that I didn't like.</p>
<p>So let's start from the beginning.  My shopping around started with Kickstand on Friday of last week with the Giant Defy for cheap.  I knew nothing about components, barely knew what shimano was and definitely didn't know if dura ace was better than sora.   I really thought - "Ah heck, I am going to go buy a bike real quick, buy a nice one for $500.00 and move on."  So it was a slow start.  For those that didn't know, there aren't any real road bikes for $500.00, well not in the retail stores anyway.  Real road bikes start at around $800.00 and go up with varieties of componentry and frames.   So the Giant Defy was Amazing compared to the mountain bike I was used to, but at $1,050.00, I found out that I had a lot to consider and learn.  Plus I only road the bike around their parking lot, not really a good test before spending over a thousand dollars.  This meant I had to go home without a road bike and with a ton of questions.</p>
<p>Ok, so Saturday rolls around and we hit all the shops in town - Kickstand (again), Two Wheel drive, Cycle Cave, Fat Tire Cycles, etc, the others aren't really worth mentioning again, luckily I got them out of the way early.  I tried a dozen different bikes, I really didn't want to stay at any one shop for too long.  I sort of had it in my mind that I would do the "Tour de Cookie" the next morning (Sunday) and I needed a road bike.  But Saturday came and went and still no road bike.  Ok, so instead of doing the "Tour de Cookie" I wound up at  <a href="http://www.highdesertbicycles.com/">High Desert Bikes</a>, the only bike shop open on Sunday, so I thought, "why not?".  </p>
<p>Ok, so why <a href="http://www.specialized.com/us/en/bc/SBCBkModel.jsp?spid=45885&amp;eid=4350&amp;menuItemId=9256">Specialized</a> and why <a href="http://www.highdesertbicycles.com/">High Desert Bikes</a>?</p>
<p>Well, from the first second I walked in to High Desert Bicycles I was greeted promptly and measured for size and fit almost immediately.  Ok, not too different from the other shops, everyone was all about "fit".  But, next when they found a bike in my size, they mounted it on a trainer and had me get on.  I sat on the bike and they measured the angles of my knees and placement of my hands, etc.  I felt like an athlete that was being studied.  Oh ... and my wife was with me and they fit her the same way they did me to a bike her size JUST so she could ride around with me.</p>
<p>The bike they put me on was the Specialized tarmac comp double (rival componentry).  After getting fit and measured, etc, I took it for a spin.  They positioned their bike shop along a bike path ... didn't see that much anywhere else.  I took the bike out for about 30-40 minutes, just riding up and down hills.  It was fun, it was effortless, I feel in love and as far as I was concerned at the time it was $$ expensive $$.  Too expensive I thought and took off.  I did research and found out that it wasn't all that expensive really; 2010, full carbon frame, high end components, perfect fit.  Well, never-the-less I continued my search, back to a few of the same bike shops throughout the week, but now with a higher price range in mind and better bikes to look at.  So I tried a whole new range of bikes and the close second was the 2009 Bianchi 928, full carbon, ultegra parts, from Kickstand.  I road the 928 one day then the tarmac the next, then the 928 again and then the tarmac again ... back and forth for the rest of the week.  I knew I was going to get one of them, just wasn't sure which one.</p>
<p>Well, it came down to the tarmac, and I'll tell you why.  First, the bike felt just a slight bit better, but what really did it for me was actually the shop.  I knew that if I had any problems the team at High Desert Bicycles would take care of it and make everything better.   So just yesterday (Friday, a week later from when the search started), I went in to High Desert Bicycles and found the guy I've been dealing with the whole time to make a deal, to see what my options were.  I left feeling like I got a great deal, they charged me for the bike and threw in everything else I could have asked for, for free, no additional cost.  I left with some winter biking gloves, bicycling shorts, water bottles, pedals, cup holders, etc.  </p>
<p>I took the bike out that night, road it until dark and everything was perfect.  I highly recommend the Specialized Tarmac and if you live in Albuquerque or near by, you have to check out High Desert Bicycles, they really did good by me.</p>
<p>By the way, some of the questions and concerns I had for getting a full carbon are as follows (and this may help some of you make your decision):</p>
<ol>
<li>Can I put a rack on it, like for commuting?<br />
Well, the answer is yes, but with some concerns.  High Desert Bicycles contacted Specialied to talk about <a href="http://www.treefortbikes.com/141_333222343031__Streamliner-Road-Rack-Black.html">a rack</a> I had found that connected to the rear hub and the rear brake - meaning most importantly that it did not clamp to the frame itself.  They suggested to get an aluminum seat post and connect there instead of the rear brake mount.</li>
<li>Can I use the current car bike rack that I have?  And I only have cars, so it is this bike rack that attaches with rubber hooks around the trunk, nothing special - it has two arms that come out with velcro straps.  Reading the forums, I found lots of scepticism and people claiming that it could damage the carbon frame when the car went over bumps.  Specialized and High Desert Bicycles both suggested a wheel or front fork mounting system but said that the bicycle rack I had wouldn't do much if any damage.  The only thing they were concerned about were scratches since there is a cable for rear components that goes along the bottom of the top tube.  So apparently it is no big deal, but for now I just take the front wheel off and lay the bike gently in my trunk.</li>
<li>Can I mount my cyclocomputer (uses zipties) to the frame? (yah, I was pretty naive) Anyway, they said that is not a problem at all, and so far, so good.</li>
</ol>
<p>Can't wait to get out and ride ...</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/10/18/got-a-road-bike/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Routes I did over the weekend</title>
		<link>http://pullmonkey.com/2009/09/27/routes-i-did-over-the-weekend/</link>
		<comments>http://pullmonkey.com/2009/09/27/routes-i-did-over-the-weekend/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:59:31 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[biking]]></category>

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

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

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

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57411</guid>
		<description><![CDATA[32 miles round trip from my friend's house to work.


Work from Chadwick's

Share your bike routes @ Bikely.com


25 miles to Los Lunas from downtown Albuquerque, and then we road the train back.


ABQ to LosLunas

Share your bike routes @ Bikely.com


]]></description>
			<content:encoded><![CDATA[<p>32 miles round trip from my friend's house to work.<br />
<!--     Bikely on-my-site code.      --></p>
<div id="routemapiframe1" style="width: 550px; border: 1px solid #d0d0d0; background: #755; overflow: hidden; white-space: nowrap;">
<span style="display: block; font: bold 11px verdana, arial; padding: 2px;"><a style="color: #fff; text-decoration: none" href="http://www.bikely.com/maps/bike-path/Work-from-Chadwick-s">Work from Chadwick's</a></span><br />
<iframe id="rmiframe1" style="height:450px;  background: #eee;" width="100%" frameborder="0" scrolling="no" src="http://www.bikely.com/maps/bike-path/Work-from-Chadwick-s/embed/1"></iframe><br />
<span style="display: block; font: normal 10px verdana, arial; text-align: right; padding: 1px;"><a style="color: #ddd; text-decoration: none" href="http://www.bikely.com/">Share your bike routes @ Bikely.com</a></span>
</div>
<p><!--     Bikely on-my-site code.  --></p>
<p>25 miles to Los Lunas from downtown Albuquerque, and then we road the train back.</p>
<p><!--     Bikely on-my-site code.      --></p>
<div id="routemapiframe2" style="width: 550px; border: 1px solid #d0d0d0; background: #755; overflow: hidden; white-space: nowrap;">
<span style="display: block; font: bold 11px verdana, arial; padding: 2px;"><a style="color: #fff; text-decoration: none" href="http://www.bikely.com/maps/bike-path/ABQ-to-LosLunas">ABQ to LosLunas</a></span><br />
<iframe id="rmiframe2" style="height:450px;  background: #eee;" width="100%" frameborder="0" scrolling="no" src="http://www.bikely.com/maps/bike-path/ABQ-to-LosLunas/embed/1"></iframe><br />
<span style="display: block; font: normal 10px verdana, arial; text-align: right; padding: 1px;"><a style="color: #ddd; text-decoration: none" href="http://www.bikely.com/">Share your bike routes @ Bikely.com</a></span>
</div>
<p><!--     Bikely on-my-site code.  --></p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/09/27/routes-i-did-over-the-weekend/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting pretty serious now</title>
		<link>http://pullmonkey.com/2009/09/19/getting-pretty-serious-now/</link>
		<comments>http://pullmonkey.com/2009/09/19/getting-pretty-serious-now/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 01:15:46 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[biking]]></category>

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

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

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

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

		<category><![CDATA[cateye v3]]></category>

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

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

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

		<category><![CDATA[garmin edge 705]]></category>

		<category><![CDATA[heart rate]]></category>

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

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57404</guid>
		<description><![CDATA[It has only been a few weeks of riding to and from work and I am obsessed.  I bought the Cateye v3.  It's a cyclocomputer that measures pretty much everything.  It measures the current, max and average for cadence (crank revolutions), speed, and heart rate.  Not to mention distance, time, and calories.  It took about [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">It has only been a few weeks of riding to and from work and I am obsessed.  I bought the Cateye v3.  It's a cyclocomputer that measures pretty much everything.  It measures the current, max and average for cadence (crank revolutions), speed, and heart rate.  Not to mention distance, time, and calories.  It took about 5 minutes to setup and getting everything securely fastened and operational.</p>
<p style="text-align: center;"><img class="alignnone" title="Cateye V3" src="http://www.cateye.com/sites/cateye/upload/products/460-og.jpg" alt="" width="205" height="305" /></p>
<p style="text-align: left;">So far it seems to work just fine.</p>
<p style="text-align: left;">If I could have justified it, I would have gone with a garmin cyclocomputer (probably the garmin edge 705).  But for $700 bucks it didn't make much sense knowing that my bike was $30 bucks.  I would have loved to ghost race myself, such that the cyclocomputer would have tracked/stored a previous lap or trip and then I would see a dot representation of both my current self and my previous self, kind of like mario kart.   That would have definitely kept me motivated.</p>
<p style="text-align: left;">For a little over $100.00, I couldn't beat the cateye, so I am going to give it a thorough test tomorrow, see what it can really do.  I hope it is a positive experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/09/19/getting-pretty-serious-now/feed/</wfw:commentRss>
		</item>
		<item>
		<title>THINning it out</title>
		<link>http://pullmonkey.com/2009/09/14/thinning-it-out/</link>
		<comments>http://pullmonkey.com/2009/09/14/thinning-it-out/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 21:02:13 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[development]]></category>

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

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

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

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

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

		<category><![CDATA[ruby on rails]]></category>

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57393</guid>
		<description><![CDATA[Been having problems with swap space and memory on my slicehost servers.  And it is all apache's and mongrel's fault.  That used to be the cool combination and now it is an ugly, sluggish beast.  Just recently, I switched to nginx (to replace apache) and thin (to replace mongrel).  So far so good, major speed [...]]]></description>
			<content:encoded><![CDATA[<p>Been having problems with swap space and memory on my slicehost servers.  And it is all apache's and mongrel's fault.  That used to be the cool combination and now it is an ugly, sluggish beast.  Just recently, I switched to nginx (to replace apache) and thin (to replace mongrel).  So far so good, major speed improvements and definitely memory consumption improvements.</p>
<p>I started out by switching everything over the nginx while keeping the mongrels alive, that was actually pretty easy.  Information was available everywhere.</p>
<p>Thinning everything via capistrano took a while, that wasn't as well documented.  Thin was documented, capistrano was documented, but easy solutions as to how to combine the two were difficult to find.</p>
<p>Here's the solution I was able to come up with -</p>
<h2>Capistrano</h2>
<p>My config for using mongrel used to look something like this -</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;">set <span class="re3">:stages</span>, <span class="sy0">%</span>w<span class="br0">&#40;</span>staging production<span class="br0">&#41;</span><br />
set <span class="re3">:default_stage</span>, <span class="st0">&quot;production&quot;</span></p>
<p><span class="kw3">require</span> <span class="st0">&quot;capistrano/ext/multistage&quot;</span><br />
<span class="kw3">require</span> <span class="st0">&quot;mongrel_cluster/recipes&quot;</span></p>
<p>set <span class="re3">:application</span>, <span class="st0">&quot;myapplication.com&quot;</span><br />
set <span class="re3">:user</span>, <span class="st0">&quot;appuser&quot;</span>set <span class="re3">:repository</span>,  <span class="st0">&quot;http://svn.myapplication.com/myapp/trunk&quot;</span><br />
set <span class="re3">:deploy_to</span>, <span class="st0">&quot;/var/www/#{application}&quot;</span></p>
<p>role <span class="re3">:app</span>, application<br />
role <span class="re3">:web</span>, application<br />
role <span class="re3">:db</span>,  application, <span class="re3">:primary</span> <span class="sy0">=&gt;</span> <span class="kw2">true</span></p>
<p>set <span class="re3">:runner</span>, user<br />
set <span class="re3">:keep_releases</span>, 3<br />
set<span class="br0">&#40;</span><span class="re3">:mongrel_conf</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="st0">&quot;#{current_path}/config/mongrel_cluster.yml&quot;</span> <span class="br0">&#125;</span></p>
<p>deploy.<span class="me1">task</span> <span class="re3">:after_update_code</span>, <span class="re3">:roles</span> <span class="sy0">=&gt;</span> <span class="br0">&#91;</span><span class="re3">:web</span><span class="br0">&#93;</span> <span class="kw1">do</span><br />
desc <span class="st0">&quot;Copying the right mongrel cluster config for the current stage environment.&quot;</span><br />
run <span class="st0">&quot;cp -f #{release_path}/config/mongrel_#{stage}.yml #{release_path}/config/mongrel_cluster.yml&quot;</span><br />
<span class="kw1">end</span></p>
<p>... <span class="sy0">&lt;</span>other things like symlinks<span class="sy0">&gt;</span></div>
</div>
<p>Now that we are moving from mongrel to thin, no need for two lines in particular, one being the line that requires mongrel_cluster recipes and the other that sets the mongrel_cluster yaml config path.  A third line changes from mongrel_cluster.yml to thin_cluster.yml.  You get something like this:</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;">set <span class="re3">:stages</span>, <span class="sy0">%</span>w<span class="br0">&#40;</span>staging production<span class="br0">&#41;</span><br />
set <span class="re3">:default_stage</span>, <span class="st0">&quot;production&quot;</span></p>
<p><span class="kw3">require</span> <span class="st0">&quot;capistrano/ext/multistage&quot;</span></p>
<p>set <span class="re3">:application</span>, <span class="st0">&quot;myapplication.com&quot;</span><br />
set <span class="re3">:user</span>, <span class="st0">&quot;appuser&quot;</span></p>
<p>set <span class="re3">:repository</span>,  <span class="st0">&quot;http://svn.myapplication.com/myapp/trunk&quot;</span><br />
set <span class="re3">:deploy_to</span>, <span class="st0">&quot;/var/www/#{application}&quot;</span></p>
<p>role <span class="re3">:app</span>, application<br />
role <span class="re3">:web</span>, application<br />
role <span class="re3">:db</span>,  application, <span class="re3">:primary</span> <span class="sy0">=&gt;</span> <span class="kw2">true</span></p>
<p>set <span class="re3">:runner</span>, user<br />
set <span class="re3">:keep_releases</span>, 3</p>
<p>deploy.<span class="me1">task</span> <span class="re3">:after_update_code</span>, <span class="re3">:roles</span> <span class="sy0">=&gt;</span> <span class="br0">&#91;</span><span class="re3">:web</span><span class="br0">&#93;</span> <span class="kw1">do</span><br />
desc <span class="st0">&quot;Copying the right mongrel cluster config for the current stage environment.&quot;</span><br />
run <span class="st0">&quot;cp -f #{release_path}/config/thin_#{stage}.yml #{release_path}/config/thin_cluster.yml&quot;</span><br />
<span class="kw1">end</span><br />
... <span class="sy0">&lt;</span>other things like symlinks<span class="sy0">&gt;</span></div>
</div>
<p>Now we need to implement what mongrel recipes was doing for us, start, stop and restart but in terms of thin (added this to the bottom of my deploy.rb):</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;">namespace <span class="re3">:deploy</span> <span class="kw1">do</span><br />
desc <span class="st0">&quot;Restart the Thin processes on the app server.&quot;</span><br />
task <span class="re3">:restart</span> <span class="kw1">do</span><br />
run <span class="st0">&quot;thin restart -C #{release_path}/config/thin_cluster.yml&quot;</span><br />
<span class="kw1">end</span><br />
desc <span class="st0">&quot;Start the Thin processes on the app server.&quot;</span><br />
task <span class="re3">:start</span> <span class="kw1">do</span><br />
run <span class="st0">&quot;thin start -C #{release_path}/config/thin_cluster.yml&quot;</span><br />
<span class="kw1">end</span><br />
desc <span class="st0">&quot;Stop the Thin processes on the app server.&quot;</span><br />
task <span class="re3">:stop</span> <span class="kw1">do</span><br />
run <span class="st0">&quot;thin stop -C #{release_path}/config/thin_cluster.yml&quot;</span><br />
<span class="kw1">end</span><br />
<span class="kw1">end</span></div>
</div>
<p>Here's what my thin_cluster.yml looks like:</p>
<div class="codesnip-container" >
<div class="ruby codesnip" style="font-family:monospace;"><span class="sy0">---</span><br />
log: log<span class="sy0">/</span>thin.<span class="me1">log</span><br />
address: 127.0.0.1<br />
port: <span class="nu0">9000</span><br />
chdir: <span class="sy0">/</span>var<span class="sy0">/</span>www<span class="sy0">/</span>myapp.<span class="me1">com</span><span class="sy0">/</span>current<br />
environment: production<br />
pid: tmp<span class="sy0">/</span>pids<span class="sy0">/</span>thin.<span class="me1">pid</span><br />
user: www<span class="sy0">-</span>user<br />
group: www<span class="sy0">-</span>data<br />
servers: <span class="nu0">3</span></div>
</div>
<p>That's it and it has worked out nicely so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/09/14/thinning-it-out/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Biking to work</title>
		<link>http://pullmonkey.com/2009/09/05/biking_to_work/</link>
		<comments>http://pullmonkey.com/2009/09/05/biking_to_work/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 05:10:35 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[biking]]></category>

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

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

		<guid isPermaLink="false">http://pullmonkey.com/?p=57376</guid>
		<description><![CDATA[
I started biking to work every day (approximately 6 miles one-way), and every morning it is a breeze, it takes about 15 - 20 minutes.  On the way back home, it is near impossible, and takes 45 - 60 minutes.  bikely's got this awesome tool that will show you the elevation for your route.  According [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-57383 aligncenter" title="elevation_ride_to_work" src="http://pullmonkey.com/wp-content/uploads/2009/09/elevation_ride_to_work.png" alt="elevation_ride_to_work" width="636" height="256" /></p>
<p style="text-align: left;">I started biking to work every day (approximately 6 miles one-way), and every morning it is a breeze, it takes about 15 - 20 minutes.  On the way back home, it is near impossible, and takes 45 - 60 minutes.  <a href="http://bikely.com">bikely</a>'s got this awesome tool that will show you the elevation for your route.  According to the graph I climb 134 ft on the way to work, and descend 594 ft, but on the way home it is reversed and boy do I feel it.</p>
<p style="text-align: left;">I bought my bike out of my work's classifieds for $30 USD and in the first 2 weeks of biking to and from work, I have had to do a number of things to my bike.   I didn't realize it for the longest time but my back tire had a slow leak and was sitting at about 20 psi, which was no big deal on the way to work, but made it pretty difficult to get home.  My tires are now both around 55 - 60 psi.   I also spent a good couple of hours learning about derailleurs, cogs, chainrings, sprockets, etc ....  My bike would jump gears, slip gears, fail to shift at all, it was a mess.  But I love it now - free exercise and I don't have to deal with too much traffic.</p>
<p style="text-align: left;">Here's my bike -</p>
<p style="text-align: center;"><a href="http://pullmonkey.com/wp-content/uploads/2009/09/hpim0453.jpg"><img class="size-medium wp-image-57377 aligncenter" title="gt timerline" src="http://pullmonkey.com/wp-content/uploads/2009/09/hpim0453-300x227.jpg" alt="gt_timerline" width="300" height="227" /></a></p>
<p style="text-align: left;">It is a GT Timberline (8-10 years old), all tuned up now and looking good, I have definitely gotten my money's worth.</p>
]]></content:encoded>
			<wfw:commentRss>http://pullmonkey.com/2009/09/05/biking_to_work/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
