<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Musings of a Trained Monkey: Tag typo</title>
    <link>http://www.stevelongdo.com/articles/tag/typo</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>RubyGems memory reduction...</title>
      <description>I did gain some insight into the number of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; instances through my efforts.  They correspond nicely for each piece of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; that is loaded; ActionMailer, ActiveSupport, ActiveRecord, ActionPack, ActionWebService and Railties. Each of these has the &lt;code&gt;require 'rubygems'&lt;/code&gt; statement in it.  I believe this is why I was seeing multiple instances of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt;. &lt;br /&gt;
&lt;br /&gt;
As explained before instances of these take up an amount of memory proportional to the number of gems/gem versions in a repository.  Making &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; a Singleton of course, resolves more than one instance being loaded into memory.  This has been submitted as a patch to &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; &lt;a href="http://rubyforge.org/tracker/?func=detail&amp;atid=577&amp;aid=5394&amp;group_id=126"&gt;[ticket #5394]&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
Installing a patched version of &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; 0.9.0 on &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt; to demonstrate the fix with &lt;a href="http://ww.typosphere.org"&gt;Typo&lt;/a&gt; proved to be the most frustrating part.  I will write a follow up posting on exactly how to do this in the near future.  Hopefully they will release an updated &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; soon!
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.planetargon.com/"&gt;Shared&lt;/a&gt; &lt;a href="http://www.dreamhost.com"&gt;hosts&lt;/a&gt; will definitely want to patch their &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; installs to reduce their memory consumption across all of their &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; users.  &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt; in particular should buy me a present or something :-) 
&lt;br /&gt;
&lt;br /&gt;
I've learned a great deal about the &lt;a href="http://rubylang.org"&gt;Ruby&lt;/a&gt; memory ecosystem by digging into this issue with &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt;.  I got help from some folks on the &lt;a href="http://www.ruby-forum.com/forum/3"&gt;Rails mailing list&lt;/a&gt; but far and away I want to thank &lt;b&gt;Stef Telford&lt;/b&gt; for the help.  Mad props to you for putting up with all of my questions and ramblings!
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Finally some numbers:&lt;/b&gt;
&lt;br /&gt;
Gem::Dependency x330(57415)
&lt;br /&gt;
Gem::Version::Requirement x693(61939)
&lt;br /&gt;
Gem::SourceIndex x1(1632488)
&lt;br /&gt;&lt;b&gt;Gem::GemPathSearcher2&amp;nbsp;x1(1647806)&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;--&lt;/b&gt;&amp;nbsp;&lt;b&gt;Gem::GemPathSearcher&amp;nbsp;x5(7901012)&lt;/b&gt;&lt;br /&gt;
Hash x1219(1789928)
&lt;br /&gt;
Gem::Specification x362(1795089)
&lt;br /&gt;
String x113992(3876455)
&lt;br /&gt;
Array x7415(5080185)
&lt;br /&gt;
&lt;b&gt;TOTAL&amp;nbsp;==&amp;nbsp;16967273&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;--&lt;/b&gt;&amp;nbsp;&lt;b&gt;TOTAL&amp;nbsp;==&amp;nbsp;28496875&lt;/b&gt;
&lt;br /&gt;&lt;br /&gt;
Update:  These memory numbers are lower than actual process size.  They vary by number of Modules loaded as well as Objects counts.  Not all Objects and Modules can be evaluated for memory size.  The new routing code in the latest version of Rails may also account for some of the difference as well.  So grain of salt...</description>
      <pubDate>Sat, 12 Aug 2006 07:00:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:00dbf8e8-5fa9-43f2-9450-d3e6b7e52444</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/12/rubygems-memory-reduction</link>
      <category>typo</category>
      <category>rails</category>
      <category>memory</category>
      <category>rubygems</category>
      <category>profiling</category>
    </item>
    <item>
      <title>RubyGems: Single/Multi-tons and memorysize</title>
      <description>There is a line in the &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; source code, &lt;code&gt;@gempath_searcher ||= Gem::GemPathSearcher.new&lt;/code&gt;, from custom_require.rb that seeks to make &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; a Singleton class. For some reason this isn't sufficient as I have seen as many as five instances of it existing in the same thread during profiling of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;.  I am not sure why more than one gets generated. It may relate to &lt;a href="http://www.rubyonraiils.org"&gt;Rails&lt;/a&gt; aliasing the &lt;code&gt;Kernel.require&lt;/code&gt; method after &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; has in custom_require.rb.
&lt;br/&gt;&lt;br/&gt;
Review of the source makes me understand why a &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; instance can be so large, it holds the gem specifications for every gem and version on the load path.  Running locally this is not a big deal, as you probably don't have a lot of gems and their versions installed.  On a shared host though there are tons of gems and versions of gems installed (&lt;b&gt;350+&lt;/b&gt; on my TextDrive server!).
&lt;br/&gt;&lt;br/&gt;
A permanent solution to fix &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; to truly be a Singleton class would probably be something as simple as checking &lt;code&gt;Object.const_defined?(:GemPathSearcher)&lt;/code&gt; to see if the class is already in memory.
&lt;br/&gt;&lt;br/&gt;
A quick alternative would be restricting the gem library path to a gem repository other than the shared host's repository.  This can be done by exporting the &lt;b&gt;GEM_HOME&lt;/b&gt; variable in your shell.  There is also a &lt;b&gt;GEM_PATH&lt;/b&gt; variable that can be used to support multiple repositories.  Examples of how to work with these variables can be found on the &lt;a href="http://wiki.rubyonrails.org/rails/pages/HowToUseMultipleGemRepositories"&gt;Rails wiki&lt;/a&gt;.  It should be possible to make a repository containing just the gems your app needs and nothing else.  This will reduce the memory footprint of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; quite a bit, no matter how many instances of them there might be!
 &lt;br /&gt;&lt;br /&gt;
Obviously I am still learning the implications of &lt;a href="http://rubygems.org"&gt;RubyGems&lt;/a&gt; working together with &lt;a href="http://rubyonrails.org"&gt;Rails&lt;/a&gt; apps.  I apologize for you the reader being dragged along on my quest to learn.  Anyone wishing to bring this quest to a quick end just tell me how it ends.
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Update:&lt;/strong&gt; I will continue my research until we arrive at the truth.  I still have some other &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; optimizing techniques to apply.  My hope is using something like the gemconfigure file described &lt;a href="http://www.rubygems.org/read/chapter/4#page73"&gt;in the documentation&lt;/a&gt; will be the difference between the Whole Milk Memory and Skim Milk Memory.  Also I will reformat the code in the post to be pretty tomorrow.  need to add some stuff to scribbish to accomplish this and I want to go to bed now...</description>
      <pubDate>Wed, 09 Aug 2006 03:41:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3df63391-1cf6-4237-b987-aa0823be01ac</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/09/rubygems-single-multi-tons-and-memorysize</link>
      <category>rubygems</category>
      <category>rails</category>
      <category>typo</category>
      <category>memory</category>
      <category>profiling</category>
      <category>howto</category>
    </item>
    <item>
      <title>RubyGems dependency management and memory use...</title>
      <description>I've been looking into the nebulous matter of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; memory management &lt;a href="http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction"&gt;lately&lt;/a&gt;, using &lt;a href="http://typosphere.org"&gt;Typo4&lt;/a&gt; as my model app.  In my research thus far I have noticed that several of the highest memory using items are from the &lt;a href="http://www.rubygems.org/"&gt;RubyGems&lt;/a&gt; library.  Particularly the &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; object.  After running a few days I have picked up five instances of it taking up nearly 8MB of RAM which is odd because the first time I profiled it there were &lt;b&gt;only&lt;/b&gt; four of them.  I am not sure why &lt;a href="http://www.rubygems.org/"&gt;RubyGems&lt;/a&gt; needs to be in memory after the app initially loads, especially the ~1.5MB &lt;b&gt;SourceIndex&lt;/b&gt; and the 352 &lt;b&gt;Gem::Specification&lt;/b&gt; objects for another ~1.6MB.  Seems like wiring of any dependencies could be done once at start up.  I am not sure if this relates specifically to how &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; uses &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; or if all &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; apps incur the memory overhead penalty for &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt;. If any one with knoweldge of the internal functioning of &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; would take the time to educate me on this it would be much appreciated.  Also if someone could explain why &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; pops up at all since all &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; dependencies are deployed into the vendor folder.&lt;br /&gt;
&lt;br /&gt;Another one to watch is the slow accumulation of &lt;b&gt;ActiveRecord::ConnectionAdpaters::MysqlColumn&lt;/b&gt;, up to 217 instances in memory.  Not a particularly large memory hit, but they have steadily grown in number over the last few days.  i may swith over to my &lt;a href="http://www.postgresql.org/"&gt;Postgres&lt;/a&gt; database and see if the same thing happens with its connecton adapter.&lt;br /&gt;&lt;br /&gt;
Finally the allocation of &lt;b&gt;Array&lt;/b&gt; objects is interesting.  The number of instances in use has gone down by roughly -2000 instances but the memory use of the remaining &lt;b&gt;Arrays&lt;/b&gt; has gone up by about 2MB.  I need to explode these &lt;b&gt;Arrays&lt;/b&gt; and see what they hold and why they stick around so long.  Partial output of profiling included below:
&lt;br /&gt;
&lt;br /&gt;Class x852(21194)
&lt;br/ &gt;&lt;b&gt;Gem::Version x709(24981)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;ActiveRecord::ConnectionAdapters::MysqlColumn x217(35410)&lt;/b&gt;
&lt;br/ &gt;Regexp x1343(52312)
&lt;br/ &gt;&lt;b&gt;Gem::Dependency x309(53743)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::Version::Requirement x662(59168)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::SourceIndex x1(1563056)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::Specification x352(1714117)&lt;/b&gt;
&lt;br/ &gt;Hash x1257(1858255)
&lt;br/ &gt;String x117204(3869923)
&lt;br/ &gt;&lt;b&gt;Gem::GemPathSearcher x5(7901012)&lt;/b&gt;
&lt;br/ &gt;Array x6093(11102839)&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;TOTAL == 28496875&lt;/b&gt;
&lt;br /&gt;&lt;br /&gt;
Please do share your experiences with &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; or &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; memory use in the comments.</description>
      <pubDate>Tue, 08 Aug 2006 06:30:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e9ec453d-bde3-40e3-b93d-a56eee868d15</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/08/rubygems-dependency-management-and-memory-use</link>
      <category>rails</category>
      <category>rubygems</category>
      <category>typo</category>
      <category>memory</category>
      <category>stats</category>
    </item>
    <item>
      <title>Typo 4.0 and memory reduction...</title>
      <description>Have you upgraded to the latest &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; release only to find that it hits the per process memory limit on your host?  It happened to me. &lt;br /&gt;&lt;br /&gt;Here is how I went about reducing the memory footprint of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;:&lt;ul&gt;
&lt;li&gt;Removed sidbars that aren't used from the installation.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Amazon through XBox.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Removed unused requires from environment.rb&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;In particlular aggregation classes for the Sidebars that were removed.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Make sure to not load any unnecessary parts of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; (i.e. ActiveWebService)&lt;b&gt; That's right I use the admin screen to post!&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Most importantly deleted the sparklines_textfilter.&lt;/li&gt;
&lt;/ul&gt; 
That last one makes a huge difference in the memory use of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;.  It removes the need to load RMagick saving around ~8MB from your process size.  In fact these changes have brought &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; down to about 33MB in memory.  Since the average &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; app uses 30MB this isn't too bad, however memory consumption slowly creeps up over a period of days and hits the limit.  Seemingly a memory leak.  I will be digging into this issue as time allows, but work is keeping me busy.&lt;br /&gt;&lt;br /&gt;
I will eventually be using a diferent theme but I switched to this one while checking out memory use and haven't spent enough time on my new one yet.</description>
      <pubDate>Fri, 04 Aug 2006 22:56:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:14af913d-7393-419f-ad9f-bbcbcea81d4e</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction</link>
      <category>typo</category>
      <category>rails</category>
      <category>memory</category>
    </item>
    <item>
      <title>Mephisto...</title>
      <description>I've been learning the ins and outs of working with &lt;a href="http://weblog.techno-weenie.net/"&gt;Rick Olson's&lt;/a&gt; new Blogging/CMS Lite project, &lt;a href="http://svn.techno-weenie.net/projects/mephisto/trunk"&gt;Mephisto&lt;/a&gt;.  I've been impressed so far.  Feature wise it offers a lot for as small as the code base is.&lt;br /&gt;&lt;br /&gt;  Using &lt;a href="http://home.leetsoft.com/liquid"&gt;Liquid&lt;/a&gt; templates instead of rhtml is taking some getting used to.  I have a close port of this &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; blog running on my laptop.  I am still ironing out some kinks with interpretation of &amp;lt;pre&amp;gt; and &amp;lt;code&amp;gt; tags between &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; and &lt;a href="http://svn.techno-weenie.net/projects/mephisto/trunk"&gt;Mephisto&lt;/a&gt;. Mainly my older posts with code included have issues.  I do miss some of the sidebar functionality and I will be taking a look at adding a "feedparser section" to be able to recreate some of the sidebars in &lt;a href="http://svn.techno-weenie.net/projects/mephisto/trunk"&gt;Mephisto&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;Rick and company seem to have implemented caching the right way, everything just works and is fast!  I can definitely see why the &lt;a href="http://weblog.rubyonrails.org/2006/6/11/rails-system-back-on-track"&gt;Rails blog&lt;/a&gt; decided to make the switch.  </description>
      <pubDate>Tue, 20 Jun 2006 04:00:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:476a649c-b2e2-4278-beec-5533aed535dd</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/06/20/mephisto</link>
      <category>mephisto</category>
      <category>typo</category>
      <category>rails</category>
    </item>
    <item>
      <title>Lightbox V2 integration with Typo...</title>
      <description>It was brought to my attention that I didn't post a lot of detail about integrating &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; with Version 2 of &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;lightbox&lt;/a&gt;.
I'll attempt to correct that with a quick write up. &lt;br/&gt;&lt;br/&gt;Start by downloading the most recent &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;lightbox&lt;/a&gt; release.  From here we will want to copy the images that are distributed with it into our &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; installation's &lt;cite&gt;public/images&lt;/cite&gt; folder.&lt;br/&gt;&lt;br/&gt;
Next up is the javascript file and the stylesheet.  I have made some slight modifications to the originals to make the image paths non-relative and the additon of links that show in the caption portion of the light box.  Grab the following &lt;a href="http://www.stevelongdo.com/javascript/lightbox-modded.js "&gt;javascript file&lt;/a&gt; and put it in your &lt;cite&gt;public/javascripts&lt;/cite&gt; directory.  Then get the &lt;a href="http://www.stevelongdo.com/public/stylesheets/lightbox.css"&gt;css file&lt;/a&gt;  and put it in your &lt;cite&gt;public/stylesheets&lt;/cite&gt; directory.
&lt;br/&gt;&lt;br/&gt;Final step for usage is to place a couple of lines in your active theme's &lt;cite&gt;layout/default.rhtml&lt;/cite&gt;.  Under the &lt;%= page_header %&gt; line place the following two lines:&lt;pre&gt;&lt;code class="ruby2"&gt;&lt;%= javascript_include_tag "lightbox-modded"  %&gt;
&lt;%= stylesheet_link_tag "/stylesheets/lightbox" %&gt;&lt;/code&gt;&lt;/pre&gt;
This should get you up and running with lone imgs &lt;br&gt;&amp;lt;img src="..." rel="lightbox"/&gt;&lt;br/&gt; and/or groups of imgs &lt;br&gt;&amp;lt;img src="..." rel="lightbox[groupName]"/&gt;&lt;br&gt;&amp;lt;img src="..." rel="lightbox[groupName]"/&gt; </description>
      <pubDate>Tue, 23 May 2006 11:31:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:91619361-8306-4412-b318-37237859704f</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/05/23/lightbox-v2-integration-with-typo</link>
      <category>ruby</category>
      <category>typo</category>
      <category>javascript</category>
      <category>lightbox</category>
    </item>
    <item>
      <title>Lightbox V2 and the flickr sidebar...</title>
      <description>So to grant the flickr sidebar access to the powers of the lightbox script is a fairly simple trick, in your theme's &lt;cite&gt;views/plugins/sidebars/flickr/content.rhtml&lt;/cite&gt;
file (you can make this path and the file if it is not present in your particular theme.)
&lt;br&gt;
&lt;pre&gt;&lt;code class="ruby2"&gt;
&amp;lt;% &lt;span class="keyword"&gt;if&lt;/span&gt; @flickr -%&amp;gt;
&amp;lt;h3&amp;gt;&amp;lt;%= @flickr.title  %&amp;gt; &lt;span class="bracket"&gt;(&lt;/span&gt;&amp;lt;%= link_to &lt;span class="string"&gt;"flickr"&lt;/span&gt;, @flickr.link %&amp;gt;&lt;span class="bracket"&gt;)&lt;/span&gt;&amp;lt;/h3&amp;gt;

&amp;lt;div id=&lt;span class="string"&gt;"flickr"&lt;/span&gt;&amp;gt;
&amp;lt;% &lt;span class="keyword"&gt;for&lt;/span&gt; pic in @flickr.choose&lt;span class="bracket"&gt;(&lt;/span&gt;count.to_i&lt;span class="bracket"&gt;)&lt;/span&gt; -%&amp;gt;
  &amp;lt;div &lt;span class="keyword"&gt;class&lt;/span&gt;=&lt;span class="string"&gt;"flickr&amp;lt;%= format%&amp;gt;"&lt;/span&gt;&amp;gt;

&amp;lt;%= &lt;span class="keyword"&gt;case&lt;/span&gt; format
          &lt;span class="keyword"&gt;when&lt;/span&gt; &lt;span class="string"&gt;'square'&lt;/span&gt;:
            link_to image_tag&lt;span class="bracket"&gt;(&lt;/span&gt;pic.square, &lt;span class="symbol"&gt;:alt =&amp;gt; pic.title&lt;/span&gt;&lt;span class="bracket"&gt;)&lt;/span&gt;,
              pic.image.gsub!&lt;span class="bracket"&gt;(&lt;/span&gt;/_m/,&lt;span class="string"&gt;''&lt;/span&gt;&lt;span class="bracket"&gt;)&lt;/span&gt;,
              { &lt;span class="symbol"&gt;:rel =&amp;gt; 'lightbox[flickr]',:alt =&amp;gt; pic.title, :title =&amp;gt; pic.title&lt;/span&gt; }
          &lt;span class="keyword"&gt;when&lt;/span&gt; &lt;span class="string"&gt;'rectangle'&lt;/span&gt;:
            link_to image_tag&lt;span class="bracket"&gt;(&lt;/span&gt;pic.thumb, &lt;span class="symbol"&gt;:alt =&amp;gt; pic.title&lt;/span&gt;&lt;span class="bracket"&gt;)&lt;/span&gt;,
              pic.image.gsub!&lt;span class="bracket"&gt;(&lt;/span&gt;/_m/,&lt;span class="string"&gt;''&lt;/span&gt;&lt;span class="bracket"&gt;)&lt;/span&gt;,
              { &lt;span class="symbol"&gt;:rel =&amp;gt; 'lightbox[flickr]',:alt =&amp;gt; pic.title, :title =&amp;gt; pic.title&lt;/span&gt; }
          &lt;span class="keyword"&gt;end&lt;/span&gt;

 %&amp;gt;
&amp;lt;/div&amp;gt;
  &amp;lt;% &lt;span class="keyword"&gt;end&lt;/span&gt; -%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;% &lt;span class="keyword"&gt;end&lt;/span&gt; -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Tue, 23 May 2006 06:57:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:81c43cc7-42fb-41ac-b897-7dc52d701264</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/05/23/lightbox-v2-and-the-flickr-sidebar</link>
      <category>lightbox</category>
      <category>flickr</category>
      <category>typo</category>
      <category>rails</category>
    </item>
    <item>
      <title>When XML is binary you have a XMLHttpRequest problem...</title>
      <description>Lesson learned the hard way on this one.  I have been working with the &lt;a href="http://www.fckeditor.net"&gt;FCKEditor&lt;/a&gt; and getting a strange error specifically: &lt;pre&gt;&lt;code class="javascript2"&gt;Error: &lt;span class="keyword"&gt;this&lt;/span&gt;.DOMDocument has no properties
Source: /javascripts/fckeditor_gecko_2.js
Line: 22&lt;/code&gt;&lt;/pre&gt;  After pounding my head into my laptop for awhile and putting some whitespace into that file I figured out that I was getting a null response from the XMLHttpRequest for the fckstyles.xml file. &lt;br&gt;&lt;br&gt;I tried loading it directly from the browser and was promped to save the file to disk.  Normally it would open in the browser.  Why would it think the XML file is binary?  The xml mime-type mapping was removed from the &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; lighttpd.conf file.  File this one under "want to know how to keep an idiot busy for hours"... *sigh*&lt;br&gt;
Make sure that your lighttpd.conf has a mapping for XML if you are doing anything with XML.&lt;pre&gt;&lt;code class="ruby2"&gt;mimetype.assign = &lt;span class="bracket"&gt;(&lt;/span&gt;  
  ...
  &lt;span class="string"&gt;".txt"&lt;/span&gt;        =&amp;gt;  &lt;span class="string"&gt;"text/plain"&lt;/span&gt;,
  &lt;span class="string"&gt;".xml"&lt;/span&gt;        =&amp;gt;  &lt;span class="string"&gt;"text/xml"&lt;/span&gt;
&lt;span class="bracket"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 19 Apr 2006 23:55:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:616a0631-6455-4eaf-bcc8-d07a28ccb6d8</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/04/19/when-xml-is-binary-you-have-a-xmlhttprequest-problem</link>
      <category>xhr</category>
      <category>fckeditor</category>
      <category>typo</category>
      <category>mimetype</category>
      <category>lighttpd</category>
      <category>javascript</category>
      <category>xml</category>
    </item>
    <item>
      <title>Search nearly working...</title>
      <description>I nearly have the search working the way I want.  The word count it generates is based on words only.  HTML is stripped as is any content between &amp;lt;code&amp;gt; tags.  I notice that the current live search in &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; looks at the html content when making a match.  So if you see any articles coming back with an empty Snippet block("") it is because your search matched something in a generated URL and no actual words in the article.&lt;br /&gt;
I am working on the best way to handle this behaviour.  Maybe just list the links that appear in the article or provide a count of them. &lt;br /&gt;
Also I will be making hyperlinks in the balloons functional. I created new graphics for the balloon to see if IE will correctly display the new GIF (I knew PNG support in IE was bad, but this was my first personal encounter), I will know in a little bit when I get to work and can check it out in IE...&lt;br /&gt;
By the way the concept for this method of displaying search results is all &lt;a href="http://www.1976design.com/blog/"&gt;Dunstan Orchard&lt;/a&gt;.  I've just been making it work within Typo.
</description>
      <pubDate>Thu, 13 Apr 2006 23:39:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:d82ea43f-3717-4bd6-9619-10c51b33baee</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/04/13/search-nearly-working</link>
      <category>typo</category>
      <category>search</category>
      <category>theme</category>
      <category>design</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Site update...</title>
      <description>I updated my theme a bit, this one is either going to be called "Civil War" or "Feeling Blue".  It is still in progress, however, so you may observe some more changes over the next few days.  The Search is back and I modified the &lt;a href="http://www.huddletogether.com"&gt;lightbox javascript&lt;/a&gt; a little bit too.  I have a couple new sidebars in the works.  Now running &lt;a href="http://www.rubyonrails.org"&gt;Rails 1.1&lt;/a&gt; and a newer version of &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; modified to use less memory.  </description>
      <pubDate>Mon, 10 Apr 2006 16:40:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3146f830-869d-4fa5-8f36-3856ce1dc841</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/04/10/site-update</link>
      <category>rails</category>
      <category>typo</category>
      <category>css</category>
      <category>theme</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
