<?xml version="1.0" encoding="UTF-8"?>




<rss version="2.0"> <channel> <title>Evernote Openbook: Code</title>
<link>http://www.evernote.com/pub/cdunn/code</link>
<description>Notes from cdunn&#039;s  Evernote Openbook: Code</description> 

  
  <lastBuildDate>Tue, 14 Jul 2009 18:08:39 GMT</lastBuildDate>
 
  
  <item> <title>can&#039;t activate rails (&lt;= 1.2.6, runtime), already activated rails-2.3.2</title> <link>http://www.evernote.com/pub/cdunn/code#5247c060-fff4-47cc-aeb5-8f43544a1608</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">rake aborted!<br clear="none"/>can't activate rails (&lt;= 1.2.6, runtime), already activated rails-2.3.2<br clear="none"/>/Library/Ruby/Site/1.8/rubygems.rb:149:in `activate'<br clear="none"/>/Library/Ruby/Site/1.8/rubygems.rb:49:in `gem'<br clear="none"/>/Users/cdunn/Projects/elc/profiles/vendor/gems/mbbx6spp-twitter4r-0.3.1/lib/twitter/ext/stdlib.rb:45:in `gem_present?'<br clear="none"/>/Users/cdunn/Projects/elc/profiles/vendor/gems/mbbx6spp-twitter4r-0.3.1/lib/twitter/rails.rb:4<div><br clear="none"/></div><div>FIX:</div><div>sudo mv /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/specifications/rails-1.2.6.gemspec ~/Desktop/rails-1.2.6.gemspec.bak<br clear="none"/></div></div>
    
    ]]></description> <pubDate>Tue, 14 Jul 2009 18:08:39 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#5247c060-fff4-47cc-aeb5-8f43544a1608</guid> 
  
  </item>

  
  <item> <title>How to Freeze Gems with Rails &gt;= 2.1</title> <link>http://www.evernote.com/pub/cdunn/code#37087acf-df98-4337-96c5-4cc3bfc8c9e1</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><p>I spent a couple of minutes trying to figure out how to ‘freeze’ gems with a recent Rails app (2.2.2) I’m developing. A bunch of git repositories have this vendor/gems folder a bit like in Merb, so I was pretty sure something had changed in Rails itself. I finally found this <a href="http://railscasts.com/episodes/110-gem-dependencies" shape="rect">screencast</a>. I’m sharing it again as I spent a bit of time already myself.
</p><p>Turns out it’s pretty well integrated. First edit your environment.rb to specify which gem you want to register as a dependency:
</p>
Rails::Initializer.run do |config|
  # ...
  # Specify gems that this application depends on. 
  # They can then be installed with &quot;rake gems:install&quot; on new installations.
  # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
  config.gem &quot;fastercsv&quot;, :version =&gt; '1.4.0'
  # ...
end
<p>If you want to freeze the registered gems automatically under vendor/gems, just do:
</p>
rake gems:unpack
<p>There is also the possibility to install them on any machine using this:
</p>
rake gems:install
<p>Generally, I prefer to keep things in my repository, as I don’t want my deployment to fail because of network or routing issues.
</p></div>
    
    ]]></description> <pubDate>Wed, 22 Apr 2009 21:17:35 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#37087acf-df98-4337-96c5-4cc3bfc8c9e1</guid> 
  
  </item>

  
  <item> <title>Daniel Morrison - A prettier truncate helper</title> <link>http://www.evernote.com/pub/cdunn/code#b6ca0d02-a5ea-4362-9b87-79b21e472153</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"># Awesome truncate # First regex truncates to the length, plus the rest of that word, if any. # Second regex removes any trailing whitespace or punctuation (except ;). # Unlike the regular truncate method, this avoids the problem with cutting # in the middle of an entity ex.: truncate(&quot;this &amp;amp; that&quot;,9) =&gt; &quot;this &amp;am...&quot; # though it will not be the exact length. def awesome_truncate(text, length = 30, truncate_string = &quot;...&quot;) return if text.nil? l = length - truncate_string.chars.length text.chars.length &gt; length ? text[/\A.{#{l}}\w*\;?/m][/.*[\w\;]/m] + truncate_string : text end</div>
    
    ]]></description> <pubDate>Fri, 17 Apr 2009 19:34:27 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#b6ca0d02-a5ea-4362-9b87-79b21e472153</guid> 
  
  </item>

  
  <item> <title>Big Spaceship Labs » Ensnaring mouseEnabled</title> <link>http://www.evernote.com/pub/cdunn/code#aab9e7b3-3e7a-491b-9f81-b6660f6d4f6a</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><a title="Permanent Link to Ensnaring mouseEnabled" rel="bookmark" href="http://labs.bigspaceship.com/2008/08/05/snaring-mouseenabled/" shape="rect" target="_blank">Ensnaring <b>mouseEnabled</b></a><p>A lot of what we do here at the Spaceship involves complex SWFs loaded in and layered on top of other SWFs. We wind up with a lot of buttons nested underneath of movieclips nested inside of SWFs.
</p><p>When we got to handling mouse interaction in AS2, this was fine so long as a button wasn’t layered on top of another button. But in AS3 it’s a different ball of wax — each DisplayObject has a <b>mouseEnabled</b> property, which is set to true by default. <b>mouseEnabled</b> means that the DisplayObject in question *can* react to mouse events.
</p><p>This can be lead to some tricky and irritating issues. Hit the jump for specifically what is happening and how to fix it.
</p><p><br clear="none"/>The rule of thumb is more or less this:
</p><p>When a mouse event happens, the DisplayObject underneath the mouse at the highest depth with <b>mouseEnabled</b> set to true will fire a MouseEvent, which will relay to it’s parent, and it will go all the way down to the stage.
</p><p>Consider this: MovieClip A is on the topmost layer. MovieClip B has a MouseEvent.CLICK listener. MovieClip A overlaps MovieClip B.
</p><p>Any time a user clicks on MovieClip A it will hear the MouseEvent and sending it down the chain… MovieClip B would never hear it. This effectively creates the “I’m listening for the mouse but nothing happens for no reason” bug. By setting MovieClip A to <b>mouseEnabled</b>=false, all is well. Note that if MovieClip A had anything nested inside of it, they too would have to be disabled. You can do this either with <b>mouseEnabled</b>=false on each of them painstakingly or by setting MovieClip A’s mouseChildren=false.
</p><p>So okay! We know what the problem is… a MovieClip can block the mouse from another movieclip. But most of what we’re building in Flash is far more complex than one MovieClip on top of another… is there an easy way to find the culprit of mouse blocking? Indeed there is! Sort of. Just drop this code on your main timeline (or your root class, if you prefer):
</p><p><br clear="none"/>stage.addEventListener(MouseEvent.CLICK,_checkMouseEventTrail,false,0,true);<br clear="none"/>function _checkMouseEventTrail($e:MouseEven...</p></div>
    
    ]]></description> <pubDate>Wed, 15 Apr 2009 16:25:37 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#aab9e7b3-3e7a-491b-9f81-b6660f6d4f6a</guid> 
  
  </item>

  
  <item> <title>Stored Procedures and Rails - Part 1 « class Nasir &lt; Jamal</title> <link>http://www.evernote.com/pub/cdunn/code#13321fd6-8155-4c63-a3cd-78e3b0261dfc</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><a title="Read Stored Procedures and Rails - Part 1" rel="bookmark" href="http://nasir.wordpress.com/2007/12/03/stored-procedures-and-rails/" shape="rect" target="_blank">Stored Procedures and Rails - Part 1</a>3 12 2007<div><div><p><br clear="none"/>There is no documentation in Rails about how to use stored procedures or atleast it is difficult to find where to look at. And according to <a target="_blank" href="http://web.archive.org/web/20060418215514/http://www.loudthinking.com/arc/000516.html" shape="rect">DHH</a> stored procedures is not the Rails Way to do things. DHH mentioned in his post
</p><p>I want a single layer of cleverness: My domain model. Object-orientation is all about encapsulating clever. Letting it sieve half ways through to the database is a terrible violation of those fine intentions. And I want no part of it.
</p><p>I somewhat agree to what DHH has to say. And that’s all fine but what if we don’t have any other option apart from using stored procedure and our stored procedure has some complex logic which we don’t want to put in our Ruby code then here is a little hack to it
</p>ActiveRecord::Base.connection.execute(&quot;execute procedure_name&quot;)
<p>But the above line will not return anything it will only execute your procedure, considering everything went OK.
</p><p>Moreover, it’s not DRY if everytime you have to write that line of code just to call a procedure.
</p><p>Here is a better way to do it:
</p><p>1) Create a class and let’s call it
</p>Class CallStoredProcedures
  your methods here .......
end
<p>2) Create a class method within it
</p>def self.fetch_db_records(proc_name_with_parameters)
  ActiveRecord::Base.connection.execute(proc_name_with_parameters)
end
<p>Then simply call it as
</p>CallStoredProcedures.fetch_db_records(&quot;exec procedure_name 'args1', 'args2', 'and so on' &quot;)
<p>Now you might say, that this will only execute a procedure (as I mentioned above) what if I want to return records or values from stored procedures. Then I will prefer class methods and this is how I would do it,
</p>class CallStoredProcedures &lt; ActiveRecord::Base

  def self.fetch_db_records(proc_name_with_parameters)
    connection.select_all(proc_name_with_parameters)
  end

  def self.insert_update_delete_calculate(proc_name_with_parameters)
    connection.execute(proc_name_with_parameters)
  end

  def self.fetch_val_from_sp(proc_name_with_parameters)
    connection.select_value(proc_name_with_param...</div></div></div>
    
    ]]></description> <pubDate>Fri, 10 Apr 2009 19:19:11 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#13321fd6-8155-4c63-a3cd-78e3b0261dfc</guid> 
  
  </item>

  
  <item> <title>Goondocks &gt; Zip Code Radius Search using MySQL</title> <link>http://www.evernote.com/pub/cdunn/code#3dd5df0f-3329-4107-b5d3-030151c61a0a</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">I had a project that required me to get a list of zip codes within a certain distance from a given zip code. <a href="http://www.zip-codes.com/zip-code-radius-finder.asp" shape="rect">Here is a web-based tool</a> that does what I'm describing.<br clear="none"/><br clear="none"/>I found a <a href="http://www.opensourcecf.com/1/2007/02/Determining-Zip-Code-Proximity.cfm" shape="rect">great post on how to do this using ColdFusion</a> . I converted the SQL found on this page to work with MySQL and have posted it on this page.<br clear="none"/><br clear="none"/>First, you are going to need to get a database that maps zip codes to longitude &amp; latitude. I personally purchased this data for $5 from the following web site: <a href="http://www.teamredline.com/zc/" shape="rect">http://www.teamredline.com/zc/</a><br clear="none"/><br clear="none"/>Update: <a href="http://www.stumbleupon.com/url/www.goondocks.com/blog/08-01-22/zip_code_radius_search_using_mysql.aspx" shape="rect">Heyrog posted on StumbleUpon</a> that you can get the zip code database for free from: <a href="http://www.populardata.com/downloads.html" shape="rect">http://www.populardata.com/downloads.html</a><br clear="none"/><br clear="none"/>Next, you need to create a MySQL function to calculate distances between two longitudes and latitudes:<br clear="none"/><br clear="none"/><div>DELIMITER $$    DROP   FUNCTION  IF EXISTS `GetDistance`$$  
  CREATE   FUNCTION  `GetDistance`(  
 lat1  numeric (9,6),  
 lon1  numeric (9,6),  
 lat2  numeric (9,6),  
 lon2  numeric (9,6)  
)  RETURNS   decimal (10,5)  
BEGIN  
  DECLARE  x  decimal (20,10);  
  DECLARE  pi  decimal (21,20);  
  SET  pi = 3.14159265358979323846;  
  SET  x = sin( lat1 * pi/180 ) * sin( lat2 * pi/180  ) + cos(  
 lat1 *pi/180 ) * cos( lat2 * pi/180 ) * cos(  abs ( (lon2 * pi/180) -  
 (lon1 *pi/180) ) );     SET  x = atan( ( sqrt( 1- power( x, 2 ) ) ) / x );  
  RETURN  ( 1.852 * 60.0 * ((x/pi)*180) ) / 1.609344;  
END $$  
  DELIMITER ;  </div><br clear="none"/>You will now need to create a MySQL stored procedure that accepts a zip code and a radius and returns a list of zip codes that fall within the given radius:<br clear="none"/><br clear="none"/><div>DELIMITER $$    DROP   PROCEDURE  IF EXISTS `GetNearbyZipCodes`$$  
  CREATE   PROCEDURE  `GetNearbyZipCodes`(  
    zipbase  varchar (6),  
    range  numeric (15)  
)   BEGIN  
DECLARE  lat1  decimal (5,2);  
DECLARE  long1  decimal (5,2);  
DECLARE  rangeFactor  decimal (7,6);  
SET  rangeFactor = 0.014457;  
SELECT  latitude,longitude  into  lat1,long1  FROM  tbl_zipcodes  WHERE  zipcode = zipbase;  
SELECT  B.zipcode  
FROM  tbl_zipcodes  AS  B   
WHERE    
 B.latitude  BETWEEN  lat1-(range*rangeFactor)  AND  la...</div></div>
    
    ]]></description> <pubDate>Thu, 09 Apr 2009 16:34:24 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#3dd5df0f-3329-4107-b5d3-030151c61a0a</guid> 
  
  </item>

  
  <item> <title>Rmagick Autorotation via EXIF</title> <link>http://www.evernote.com/pub/cdunn/code#3e4cf4e4-df90-4634-87e8-fbe9b918ff57</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><p>append to config/environment.rb):
</p>require 'RMagick' unless defined?(Magick)<br clear="none"/>Magick::Image.class_eval do<br clear="none"/>  class &lt;&lt; self<br clear="none"/>    def read_with_auto_upright(*args, &amp;block)<br clear="none"/>      self.read_without_auto_upright(*args, &amp;block).collect do |img|<br clear="none"/>        begin<br clear="none"/>          # if there's nothing to rotate, auto_orient! will return nil<br clear="none"/>          img.auto_orient! || img<br clear="none"/>        rescue NotImplementedError<br clear="none"/>          # Older versions of ImageMagick has no auto_orient!<br clear="none"/>          case img.get_exif_by_entry(&quot;Orientation&quot;) &amp;&amp; img[&quot;EXIF:Orientation&quot;]<br clear="none"/>          # img[&quot;EXIF:Orientation&quot;] might not be ready until get_exif_by_entry() is called<br clear="none"/>          when &quot;6&quot;<br clear="none"/>            # Magick::RightTopOrientation<br clear="none"/>            img.rotate!(90)<br clear="none"/>            img[&quot;EXIF:Orientation&quot;] = &quot;1&quot;<br clear="none"/>          when &quot;3&quot;<br clear="none"/>            # Magick::BottomRightOrientation<br clear="none"/>            img.rotate!(180)<br clear="none"/>            img[&quot;EXIF:Orientation&quot;] = &quot;1&quot;<br clear="none"/>          when &quot;8&quot;<br clear="none"/>            # Magick::LeftBottomOrientation<br clear="none"/>            img.rotate!(270)<br clear="none"/>            img[&quot;EXIF:Orientation&quot;] = &quot;1&quot;<br clear="none"/>          end<br clear="none"/>          img<br clear="none"/>        end<br clear="none"/>      end<br clear="none"/>    end<br clear="none"/><br clear="none"/>    # wrap around RMagick::Image#read method so that <br clear="none"/>    # any images loaded in memory are already upright<br clear="none"/>    alias :read_without_auto_upright :read<br clear="none"/>    alias :read :read_with_auto_upright<br clear="none"/>    # note: not using alias_method_chain so that this<br clear="none"/>    #       snippet can be used outside of Rails<br clear="none"/>  end<br clear="none"/>end

<p>  <a href="http://seattlerb.rubyforge.org/ImageScience.html" shape="rect">ImageScience</a> users, if you trust my C++ code, just place <a href="http://pastie.caboo.se/107610" shape="rect">this patched image_science.rb</a> in your vendor/ directory. Otherwise you can apply this patch manually:
</p>--- lib/image_science.rb      2007-10-16 12:11:08.000000000 +0800<br clear="none"/>+++ lib/image_science.rb.new       2007-10-16 12:11:01.000000000 +0800<br clear="none"/>@@ -150,6 +150,21 @@<br clear="none"/>           VALUE result = Qnil;<br clear="none"/>           int flags = fif == FIF_JPEG ? JPEG_ACCURATE : 0;<br clear="none"/>           if (bitmap = FreeImage_Load(fif, input, flags)) {<br clear="none"/>+            FITAG *tagValue = NULL;<br clear="none"/>+            FreeImage_GetMetadata(FIMD_EXIF_MAIN, bitmap, &quot;Orientation&quot;, &amp;tagValue); <br clear="none"/>+            switch (tagValue == NULL ? 0 : *((short *) FreeImage_GetTagValue(tagValue))) {<br clear="none"/>+              case&lt;/...</div>
    
    ]]></description> <pubDate>Tue, 07 Apr 2009 18:31:17 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#3e4cf4e4-df90-4634-87e8-fbe9b918ff57</guid> 
  
  </item>

  
  <item> <title>Ruby on Rails 2.3 Release Notes</title> <link>http://www.evernote.com/pub/cdunn/code#5fdde28c-8308-458d-8f31-cdd251fdf753</link>
  <description><![CDATA[
    
    
    
        <a href="http://www.evernote.com/pub/cdunn/code#5fdde28c-8308-458d-8f31-cdd251fdf753"><img align="right" src="http://www.evernote.com/shard/s1/thumb/5fdde28c-8308-458d-8f31-cdd251fdf753"/></a>
        <div class="ennote"><div><div>More at <a href="http://rubyonrails.org/" shape="rect">rubyonrails.org:</a> <a href="http://rubyonrails.org/" shape="rect">Overview</a> | <a href="http://rubyonrails.org/download" shape="rect">Download</a> | <a href="http://rubyonrails.org/deploy" shape="rect">Deploy</a> | <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/overview" shape="rect">Code</a> | <a href="http://rubyonrails.org/screencasts" shape="rect">Screencasts</a> | <a href="http://rubyonrails.org/documentation" shape="rect">Documentation</a> | <a href="http://rubyonrails.org/ecosystem" shape="rect">Ecosystem</a> | <a href="http://rubyonrails.org/community" shape="rect">Community</a> | <a href="http://weblog.rubyonrails.org/" shape="rect">Blog</a>
</div></div><div><div><a href="http://guides.rubyonrails.org/index.html" title="Return to home page" shape="rect">Guides.rubyonrails.org</a><p><a shape="rect">Skip navigation</a>.
</p><ul><li><a href="http://guides.rubyonrails.org/index.html" shape="rect">Home</a></li><li><a href="http://guides.rubyonrails.org/index.html" name="guidesMenu" shape="rect">Guides Index</a><div>Start Here
<a href="http://guides.rubyonrails.org/getting_started.html" shape="rect">Getting Started with Rails</a>Models
<a href="http://guides.rubyonrails.org/migrations.html" shape="rect">Rails Database Migrations</a><a href="http://guides.rubyonrails.org/activerecord_validations_callbacks.html" shape="rect">Active Record Validations and Callbacks</a><a href="http://guides.rubyonrails.org/association_basics.html" shape="rect">Active Record Associations</a><a href="http://guides.rubyonrails.org/active_record_querying.html" shape="rect">Active Record Query Interface</a>Views
<a href="http://guides.rubyonrails.org/layouts_and_rendering.html" shape="rect">Layouts and Rendering in Rails</a><a href="http://guides.rubyonrails.org/form_helpers.html" shape="rect">Action View Form Helpers</a>Controllers
<a href="http://guides.rubyonrails.org/action_controller_overview.html" shape="rect">Action Controller Overview</a><a href="http://guides.rubyonrails.org/routing.html" shape="rect">Rails Routing from the Outside In</a>Digging Deeper
<a href="http://guides.rubyonrails.org/i18n.html" shape="rect">Rails Internationalization API</a><a href="http://guides.rubyonrails.org/action_mailer_basics.html" shape="rect">Action Mailer Basics</a><a href="http://guides.rubyonrails.org/testing.html" shape="rect">Testing Rails Applications</a><a href="http://guides.rubyonrails.org/security.html" shape="rect">Securing Rails Applications</a><a href="http://guides.rubyonrails.org/debugging_rails_applications.html" shape="rect">Debugging Rails Applications</a><a href="http://guides.rubyonrails.org/performance_testing.html" shape="rect">Performance Testing Rails Applications</a><a href="http://guides.rubyonrails.org/plugins.html" shape="rect">The Basics of Creating Rails Plugins</a><a href="http://guides.rubyonrails.org/configuring.html" shape="rect">Configuring Rails Applications</a><a href="http://guides.rubyonrails.org/rails_on_rack.html" shape="rect">Rails on Rack</a><a href="http://guides.rubyonrails.org/command_line.html" shape="rect">Rails Command Line Tools and Rake Tasks</a><a href="http://guides.rubyonrails.org/caching_with_rails.html" shape="rect">Caching with Rails</a><a href="http://guides.rubyonrails.org/contributing_to_rails.html" shape="rect">Contributing to Rails</a></div></li><li><a href="http://guides.rubyonrails.org/contribute.html" shape="rect">Contribute</a></li><li><a href="http://guides.rubyonrails.org/credits.html" shape="rect">Credits</a></li></ul></div></div><div><div>Ruby on Rails 2.3 Release Notes
<p>Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn’t include every little bug fix and change. If you want to see everything, check out the <a href="http://github.com/rails/rails/commits/master" shape="rect">list of commits</a> in the main Rails repository on GitHub or review the CHANGELOG files for the individual Rails components.
</p><div>Chapters
<ol><li><a shape="rect">Application Architecture</a><ul><a shape="rect">Rack Integration</a><a shape="rect">Renewed Support for Rails Engines</a></ul></li><li><a shape="rect">Documentation</a></li><li><a shape="rect">Ruby 1.9.1 Support</a></li><li><a shape="rect">Active Record</a><ul><a shape="rect">Nested Attributes</a><a shape="rect">Nested Transactions</a><a shape="rect">Dynamic Scopes</a><a shape="rect">Default Scopes</a><a shape="rect">Batch Processing</a><a shape="rect">Multiple Conditions for Callbacks</a><a shape="rect">Find with having</a><a shape="rect">Reconnecting MySQL Connections</a><a shape="rect">Other Active Record Changes</a></ul></li><li><a shape="rect">Action Controller</a><ul><a shape="rect">Unified Rendering</a><a shape="rect">Application Controller Renamed</a><a shape="rect">HTTP Digest Authentication Support</a><a shape="rect">More Efficient Routing</a><a shape="rect">Rack-based Lazy-loaded Sessions</a><a shape="rect">MIME Type Handling Changes</a><a shape="rect">Optimization of respond_to</a><a shape="rect">Improved Caching Performance</a><a shape="rect">Localized Views</a><a shape="rect">Partial Scoping for Translations</a><a shape="rect">Other Action Controller Changes</a></ul></li><li><a shape="rect">Action View</a><ul><a shape="rect">Nested Ob...</a></ul></li></ol></div></div></div></div>
    
    ]]></description> <pubDate>Sun, 05 Apr 2009 18:34:16 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#5fdde28c-8308-458d-8f31-cdd251fdf753</guid> 
  
    <enclosure url="http://www.evernote.com/shard/s1/thumb/5fdde28c-8308-458d-8f31-cdd251fdf753"
               length="0" type="image/jpeg"/>
  
  </item>

  
  <item> <title>selfcontained » Blog Archive » Subscribing to an image loaded event</title> <link>http://www.evernote.com/pub/cdunn/code#0512b88f-fd00-42fd-8ed7-221089ce39cc</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Subscribing to an image loaded event
<p>I recently was working on something where I needed to swap the src of an image, but then perform some specific javascript AFTER the new image was loaded, namely resize the dimensions a little. This may seem pretty simple, but took me a little research, along with trial and error to get a working solution, so hopefully it helps someone else. I often use jQuery on my smaller projects, so I’ll show how I accomplished this with that toolkit.
</p><ol><li>First, I would need to listen to the load event of the image I was replacing the src of.</li><li>Next, in order to trigger the handler, we need to actually change the src of the image</li></ol><div>$('#my-image').load(function() {
    //Logic for w/e here, resizing, etc.
}).attr('src', myNewImageSrc);

</div><p>The code itself is really simple, but it took me a few to realize that jQuery solved the problem by simply letting us listen to the load event of the image, and count on it being fired when the src changes, and finishes loading.
</p></div>
    
    ]]></description> <pubDate>Fri, 03 Apr 2009 20:22:00 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#0512b88f-fd00-42fd-8ed7-221089ce39cc</guid> 
  
  </item>

  
  <item> <title>Alchemy:Documentation:Getting Started - Adobe Labs</title> <link>http://www.evernote.com/pub/cdunn/code#07b57033-8ffe-4f3e-a46e-fd89785ac651</link>
  <description><![CDATA[
    
    
    
        <a href="http://www.evernote.com/pub/cdunn/code#07b57033-8ffe-4f3e-a46e-fd89785ac651"><img align="right" src="http://www.evernote.com/shard/s1/thumb/07b57033-8ffe-4f3e-a46e-fd89785ac651"/></a>
        <div class="ennote"><a href="http://labs.adobe.com/" title="Main Page" shape="rect"></a><div>Search  
<ul><li><p>Navigation
</p><a href="http://labs.adobe.com/" shape="rect">Labs Home</a><a href="http://labs.adobe.com/wiki/index.php/Main_Page" shape="rect">Wiki Home</a></li><li><p>Technologies
</p><a href="http://labs.adobe.com/wiki/index.php/AIR_for_Linux" shape="rect">Adobe AIR for Linux</a><a href="http://labs.adobe.com/wiki/index.php/Adobe_AIR_Update_Framework" shape="rect">Adobe AIR Update Framework</a><a href="http://labs.adobe.com/wiki/index.php/Alchemy" shape="rect">Alchemy</a><a href="http://labs.adobe.com/wiki/index.php/Bolt" shape="rect">Bolt</a><a href="http://labs.adobe.com/wiki/index.php/DNG_Profiles" shape="rect">Camera Profiles and DNG Profile Editor</a><a href="http://labs.adobe.com/wiki/index.php/Centaur" shape="rect">Centaur</a><a href="http://labs.adobe.com/wiki/index.php/ColdFusion_Portlet_Toolkit" shape="rect">ColdFusion Portlet Toolkit</a><a href="http://labs.adobe.com/wiki/index.php/Data_Services_Stress_Testing_Framework" shape="rect">Data Services Stress Testing Framework</a><a href="http://labs.adobe.com/wiki/index.php/Dreamweaver_Widget_Packager" shape="rect">Dreamweaver Widget Packager</a><a href="http://labs.adobe.com/wiki/index.php/DNG_Codec" shape="rect">DNG Codec</a><a href="http://labs.adobe.com/wiki/index.php/Flash_Lite_for_BREW_Publisher_for_Flash_CS3_Pro" shape="rect">Flash Lite for BREW Publisher for Flash CS3 Professional</a><a href="http://labs.adobe.com/wiki/index.php/Flash-Ajax_Video_Component" shape="rect">Flash-Ajax Video Component</a><a href="http://labs.adobe.com/wiki/index.php/Genesis" shape="rect">Genesis</a><a href="http://labs.adobe.com/wiki/index.php/Gumbo" shape="rect">Gumbo</a><a href="http://labs.adobe.com/wiki/index.php/InContext_Editing" shape="rect">InContext Editing</a><a href="http://labs.adobe.com/wiki/index.php/InDesign_Plug-in_Editor" shape="rect">InDesign Plug-in Editor</a><a href="http://labs.adobe.com/wiki/index.php/Knowhow" shape="rect">knowhow</a><a href="http://labs.adobe.com/wiki/index.php/Mars" shape="rect">Mars</a><a href="http://labs.adobe.com/wiki/index.php/NoteTag" shape="rect">NoteTag</a><a href="http://labs.adobe.com/wiki/index.php/PatchPanel" shape="rect">PatchPanel</a><a href="http://labs.adobe.com/wiki/index.php/Photoshop_CS3_Extended_Plug-In_for_Google_3D_Warehouse" shape="rect">Photoshop CS3 Extended Plug-In for Google 3D Warehouse</a><a href="http://labs.adobe.com/wiki/index.php/Pixmantec_RawShooter_Migration_Tool" shape="rect">Pixmantec RawShooter Migration Tool</a><a href="http://labs.adobe.com/wiki/index.php/Adobe_Premiere_Pro_Update_for_Intel_SSE4.1" shape="rect">Adobe Premiere Pro Update for Intel SSE4.1</a><a href="http://labs.adobe.com/wiki/index.php/Spry" shape="rect">Spry framework for Ajax</a><a href="http://labs.adobe.com/wiki/index.php/Stratus" shape="rect">Stratus</a><a href="http://labs.adobe.com/wiki/index.php/SwitchBoard" shape="rect">SwitchBoard</a><a href="http://labs.adobe.com/wiki/index.php/Adobe_Wave" shape="rect">Adobe Wave</a></li><li><p><a href="http://labs.adobe.com/wiki/index.php/Showcase" shape="rect">Showcase Gallery</a></p></li><li><p><a href="http://labs.adobe.com/wiki/index.php/Special:Recentchanges" shape="rect">Recent Changes</a></p></li><li><p><a href="http://labs.adobe.com/wiki/index.php?title=Special:Recentchanges&amp;feed=rss" shape="rect">Recent Changes (RSS)</a></p></li><li><p><a href="http://labs.adobe.com/wiki/index.php/Help:Contents" shape="rect">Help</a></p></li><li><p><a href="http://labs.adobe.com/wiki/index.php/FAQ" shape="rect">FAQ</a></p></li><li><p>Toolbox
</p><a href="http://labs.adobe.com/wiki/index.php?title=Special:Whatlinkshere&amp;target=Alchemy:Documentation:Getting_Started" shape="rect">What Links Here</a><a href="http://labs.adobe.com/wiki/index.php?title=Special:Recentchangeslinked&amp;target=Alchemy:Documentation:Getting_Started" shape="rect">Related Changes</a><a href="http://labs.adobe.com/wiki/index.php/Special:Specialpages" shape="rect">Special Pages</a></li></ul></div><div>Personal tools
<ul><li><a href="http://labs.adobe.com/wiki/index.php?title=Special:Userlogin&amp;returnto=Alchemy:Documentation:Getting_Started" shape="rect">Create an account or log in</a></li></ul></div><br clear="none"/><div>Views
<ul><li><a href="http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started" shape="rect">Article</a></li><li><a href="http://labs.adobe.com/wiki/index.php/Talk:Alchemy:Documentation:Getting_Started" shape="rect">Discussion</a></li><li><a href="http://labs.adobe.com/wiki/index.php?title=Alchemy:Documentation:Getting_Started&amp;action=edit" shape="rect">View source</a></li><li><a href="http://labs.adobe.com/wiki/index.php?title=Alchemy:Documentation:Getting_Started&amp;action=history" shape="rect">History</a></li></ul></div><div><a name="top" shape="rect"></a>Alchemy:Documentation:Getting Started
From Adobe Labs
<div></div><p>This article will walk through the steps of getting the Alchemy tool-chain setup, show how to compile C / C++ code into a SWC, and then use that SWC within a simple ActionScript example.
</p><p>Alchemy (formerly referred to as FLACC) is a project from Adobe that allows users to compile C/C++ code that is targeted to run on the open source ActionScript virtual machine (AVM2). The C/C++ code is compiled to AS3 as a SWF or SWC that runs on Flash Player 10 or AIR 1.5. Alchemy is primarily intended to be used with C/C++ libraries that have few OS dependencies. The generated content is within the security constraints of the AVM2, and cannot bypass Flash Player security protections.
</p><b>Table of contents</b> [<a shape="rect">showhide</a>]
<div><a shape="rect">1 Macintosh</a><br clear="none"/></div><div><p><a shape="rect">1.1 Requirements</a><br clear="none"/><a shape="rect">1.2 Steps</a><br clear="none"/><a shape="rect">1.3 Troubleshooting</a><br clear="none"/></p></div><div><a shape="rect">2 Windows</a><br clear="none"/></div><div><p><a shape="rect">2.1 Requirements</a><br clear="none"/><a shape="rect">2.2 Steps</a><br clear="none"/><a shape="rect">2.3 Troubleshooting</a><br clear="none"/></p></div><a name="Macintosh" shape="rect"></a>Macintosh
<p>This section will show how to setup and use Alchemy on Mac OS X, although the general steps are also applicable on both Windows and Linux.
</p><a name="Requirements" shape="rect"></a>Requirements
<ul><li>Alchemy Toolkit Package for your operating system</li><li>XCode 2.4+</li><li>Flex 3.2 SDK</li><li>Flex Builder or Flex SDK setup to target compilation for Flash Player 10</li></ul><a name="Steps" shape="rect"></a>Steps
<p><b>Step 1</b> Download the Flex 3.2 SDK and make sure that the $FLEX_HOME/bin directory ...</p></div></div>
    
    ]]></description> <pubDate>Tue, 31 Mar 2009 15:57:38 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#07b57033-8ffe-4f3e-a46e-fd89785ac651</guid> 
  
    <enclosure url="http://www.evernote.com/shard/s1/thumb/07b57033-8ffe-4f3e-a46e-fd89785ac651"
               length="0" type="image/jpeg"/>
  
  </item>

  
  <item> <title>osx fzip</title> <link>http://www.evernote.com/pub/cdunn/code#40ea4256-2bdb-4c51-8c78-b9cddba32126</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">1. Setup: For the sake of this example, put a copy of the python fixer tool (included in FZip under tools) on your Desktop, along with a folder of files you want to zip up. Open Terminal. I’m not a command line guy myself so maybe there are better ways to do the next steps but they worked for me. (Terminal is in Applications/Utilities). Type in the word zip and hit return, this shows the list of options for zipping files. Finally, download and install Python, it’s a simple, normal installation with no catches.<br clear="none"/><br clear="none"/>2. In Terminal, navigate to your desktop, like: cd /Users/moses/Desktop<br clear="none"/><br clear="none"/>3. Create the zip directory, using this syntax but replace the names with whatever you want to call the zip and whatever the folder of files to zip is actually called: zip newZipFile.zip folderOfFiles/*<br clear="none"/><br clear="none"/>(For a plain folder of files this is fine. There’s also an option -j that lets you exclude folders, and some other options for including subfolders recursively. FZip doesn’t mind folders, foldernames are readable in your code via a file’s filename property.)<br clear="none"/><br clear="none"/>4. Check your Desktop to see if the zip is there, and try unzipping it to see if the files are in it. Last, apply the adler checksum fix which we copied to the desktop in step1, using the actual name of your zipfile of course: python <a href="http://fzip-prepare.py" shape="rect">fzip-prepare.py</a> newZipFile.zip<br clear="none"/><br clear="none"/>(You may see a warning about a deprecated something or other when you run the fix, which is okay.)<br clear="none"/><br clear="none"/>Hope that helps someone out.</div>
    
    ]]></description> <pubDate>Tue, 31 Mar 2009 05:02:19 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#40ea4256-2bdb-4c51-8c78-b9cddba32126</guid> 
  
  </item>

  
  <item> <title>Ruby/zlib version 0.3.0</title> <link>http://www.evernote.com/pub/cdunn/code#866036a1-dac8-4c7c-953e-157bf60a772c</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Ruby/zlib version 0.3.0
<p>The extension library to use zlib from Ruby. Ruby/zlib also provides the features for accessing gzipped files.
</p><p>You can modify or redistribute Ruby/zlib in the same manner of Ruby interpreter.
</p><ul><li><a shape="rect">Zlib</a><a shape="rect">Zlib::ZStream</a><a shape="rect">Deflate</a><a shape="rect">Inflate</a><a shape="rect">Zlib::Gzip</a><a shape="rect">GzipReader</a><a shape="rect">GzipWriter</a></li></ul><a name="Zlib" shape="rect">Zlib</a><p>Zlib is the module which provides the other features in zlib C library. See zlib.h for function details.
</p>Module Functions:
<a name="Zlib.version" shape="rect">version</a><p>Returns the string which represents the version of zlib library.
</p><a name="Zlib.adler32" shape="rect">adler32([string, [adler]])</a><p>Calculates Alder-32 checksum for string, and returns updated value of alder. If string is omitted, it returns the CRC initial value. If alder is omitted, it assumes that the initial value is given to alder.
</p><a name="Zlib.crc32" shape="rect">crc32([string, [crc]])</a><p>Calculates CRC checksum for string, and returns updated value of crc. If string is omitted, it returns the CRC initial value. If crc is omitted, it assumes that the initial value is given to crc.
</p><a name="Zlib.crc_table" shape="rect">crc_table</a><p>Returns the table for calculating CRC checksum.
</p>Exceptions:
<p>The following exceptions are defined in Zlib module. These exceptions are raised when zlib library functions returns with an error status.
</p><ul><li><a name="Zlib.Error" shape="rect">Zlib::Error</a>Zlib::StreamEndZlib::NeedDictZlib::DataErrorZlib::StreamErrorZlib::MemErrorZlib::BufErrorZlib::VersionError</li></ul><a name="Zlib.ZStream" shape="rect">Zlib::ZStream</a><p>The abstruct class for the stream which handles the compressed data. The operations are defined in the subclasses, <a shape="rect">Deflate</a> for compression, and <a shape="rect">Inflate</a> for decompression.
</p>SuperClass:
<p>Object</p>Methods:
<a name="ZStream.total_in" shape="rect">total_in</a><p>Returns the total bytes of the input data to the stream.
</p><a name="ZStream.total_out" shape="rect">total_out</a><p>Returns the total bytes of the output data from the stream.
</p><a name="ZStream.data_type" shape="rect">data_type</a><p>Guesses the type of the data which have been inputed into the stream. The returned value is Zlib::ZStream::BINARY, Zlib::ZStream::ASCII, or Zlib::ZStream::UNKNOWN.
</p><a name="ZStream.adler" shape="rect">adler</a><p>Returns the alder-32 checksum. See zlib.h for details.
</p><a name="ZStream.close" shape="rect">close</a><a name="ZStream.end" shape="rect">end</a><p>Closes the stream. All operations on the closed stream will raise an exception.
</p><a name="ZStream.closed_p" shape="rect">closed?</a><p>Returns true if the stream closed.
</p><a name="ZStream.reset" shape="rect">reset</a><p>Resets and initializes the stream. All buffered data in the stream are discarded.
...</p></div>
    
    ]]></description> <pubDate>Wed, 25 Mar 2009 23:13:06 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#866036a1-dac8-4c7c-953e-157bf60a772c</guid> 
  
  </item>

  
  <item> <title>Jacob Repp » Blog Archive » Build Huffman Compression in Ruby</title> <link>http://www.evernote.com/pub/cdunn/code#7bf8a56a-630c-432a-869f-54cabafa8d34</link>
  <description><![CDATA[
    
    
    
        <a href="http://www.evernote.com/pub/cdunn/code#7bf8a56a-630c-432a-869f-54cabafa8d34"><img align="right" src="http://www.evernote.com/shard/s1/thumb/7bf8a56a-630c-432a-869f-54cabafa8d34"/></a>
        <div class="ennote"><div><ul><li><a href="http://jrepp.com/" title="Home" shape="rect">Home</a></li><li><a href="http://jrepp.com/documents/" title="Documents" shape="rect">Documents</a></li><li><a href="http://jrepp.com/rubycube/" title="RubyCube" shape="rect">RubyCube</a></li><li><div></div></li></ul></div><div><div><a href="http://jrepp.com/" title="Jacob Repp" shape="rect">Jacob Repp</a>Game programming, music and life
</div><div><a shape="rect">Subscribe</a></div><div></div><div><div><div><div><a href="http://jrepp.com/2008/01/08/build-huffman-compression-in-ruby/" rel="bookmark" title="Permanent Link to Build Huffman Compression in Ruby" shape="rect">Build Huffman Compression in Ruby</a><p>January 8th, 2008 by <a href="http://jrepp.com/author/admin/" title="Posts by proj" shape="rect">proj</a>
</p></div><div><p>Many wonderful things can be done with binary trees. One brilliant usage of the binary tree was proposed by <a href="http://en.wikipedia.org/wiki/Huffman_coding" shape="rect">David Huffman in 1951 at MIT</a> which has since become the foundation for much of the compression technology available today. Huffman discovered a simple way to generate a provable minimal binary encoding given a set of input symbols. It’s a deep subject, and one which I’d eventually like to spend more time getting into. For now I’ll walk through how this simple idea can be used to implement some decent compression using pure Ruby.
</p><p>First of all you have your basic binary tree representation. I previously showed a <a href="http://jrepp.com/2008/01/07/build-a-binary-tree-in-ruby/" shape="rect">simple binary tree example</a> that demonstrates how binary trees are easily manipulated in ruby. Every binary tree node holds a value and links off to a right and left nodes that may also hold values. A leaf node is a node with dead links (left and right are both set to nil).
</p><p>In the Huffman tree the leaves contain a single symbol while interior nodes summarize their sub-tree. I have simplified the idea so that all nodes wrap what is called an association list (assoc list). This is an old lisp idiom of a list containing name value pairs in the form ((name value) (name value)). To find a value in an association list you just walk the list looking at the first element of each sub-list. A reverse association list (rassoc list) takes the same form as an assoc list with the name and value pair swapped. For very small sets of data the performance of assoc lists is better than deeper structures such as a hash or tree. Ruby provides a few array APIs to deal with assoc and rassoc lists. I always store a rassoc list with the (occurance count, symbol) in a leaf and a sum of all contained lists in interior nodes. None of this information is important in understanding how Huffman encoding works but I use this concept below so I thought I should at least call it out.
</p>class Node
    # binar...</div></div></div></div></div></div>
    
    ]]></description> <pubDate>Wed, 25 Mar 2009 23:12:42 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#7bf8a56a-630c-432a-869f-54cabafa8d34</guid> 
  
    <enclosure url="http://www.evernote.com/shard/s1/thumb/7bf8a56a-630c-432a-869f-54cabafa8d34"
               length="0" type="image/jpeg"/>
  
  </item>

  
  <item> <title>proxy_next_upstream -- nginx</title> <link>http://www.evernote.com/pub/cdunn/code#ed33b4fd-ee27-474a-974e-320732501b68</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">proxy_next_upstream<br clear="none"/><br clear="none"/>syntax: proxy_next_upstream [error|timeout|invalid_header|http_500|http_502|http_503|http_504|http_404|off]<br clear="none"/><br clear="none"/>default: proxy_next_upstream error timeout<br clear="none"/><br clear="none"/>context: http, server, location<br clear="none"/><br clear="none"/>Directive determines, in what cases the request will be transmitted to the next server:<br clear="none"/><br clear="none"/>    * error — an error has occurred while connecting to the server, sending a request to it, or reading its response;<br clear="none"/>    * timeout — occurred timeout during the connection with the server, transfer the requst or while reading response from the server;<br clear="none"/>    * invalid_header — server returned a empty or incorrect answer;<br clear="none"/>    * http_500 — server returned answer with code 500<br clear="none"/>    * http_502 — server returned answer with code 502<br clear="none"/>    * http_503 — server returned answer with code 503<br clear="none"/>    * http_504 — server returned answer with code 504<br clear="none"/>    * http_404 — server returned answer with code 404<br clear="none"/>    * off — it forbids the request transfer to the next server <br clear="none"/><br clear="none"/>Transferring the request to the next server is only possible when nothing has been transferred to the client -- that is, if an error or timeout arises in the middle of the transfer of the request, then it is not possible to retry the current request on a different server. </div>
    
    ]]></description> <pubDate>Mon, 16 Mar 2009 16:17:43 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#ed33b4fd-ee27-474a-974e-320732501b68</guid> 
  
  </item>

  
  <item> <title>sql between days</title> <link>http://www.evernote.com/pub/cdunn/code#3220bb74-1d31-425d-bbf7-c5131f49389f</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Posted by Isaac Shepard on October 11 2003 2:53pm        [Delete] [Edit]<br clear="none"/><br clear="none"/>If you're looking for generic SQL queries that will allow you to get the days, months, and years between any two given dates, you might consider using these. You just need to substitute date1 and date2 with your date expressions.<br clear="none"/><br clear="none"/>NOTE: Some of these formulas are complex because they account for all cases where date1 &lt; date2, date1 = date2, and date1 &gt; date2. Additionally, these formulas can be used in very generic queries where aliases and temporary variables are not allowed.<br clear="none"/><br clear="none"/><br clear="none"/>Number of days between date1 and date2:<br clear="none"/><br clear="none"/><br clear="none"/>TO_DAYS(date2) - TO_DAYS(date1)<br clear="none"/><br clear="none"/><br clear="none"/>Number of months between date1 and date2:<br clear="none"/><br clear="none"/><br clear="none"/>IF((((YEAR(date2) - 1) * 12 + MONTH(date2)) - ((YEAR(date1) - 1) * 12 + MONTH(date1))) &gt; 0, (((YEAR(date2) - 1) * 12 + MONTH(date2)) - ((YEAR(date1) - 1) * 12 + MONTH(date1))) - (MID(date2, 9, 2) &lt; MID(date1, 9, 2)), IF((((YEAR(date2) - 1) * 12 + MONTH(date2)) - ((YEAR(date1) - 1) * 12 + MONTH(date1))) &lt; 0, (((YEAR(date2) - 1) * 12 + MONTH(date2)) - ((YEAR(date1) - 1) * 12 + MONTH(date1))) + (MID(date1, 9, 2) &lt; MID(date2, 9, 2)), (((YEAR(date2) - 1) * 12 + MONTH(date2)) - ((YEAR(date1) - 1) * 12 + MONTH(date1)))))<br clear="none"/><br clear="none"/><br clear="none"/>Number of years between date1 and date2:<br clear="none"/><br clear="none"/><br clear="none"/>IF((YEAR(date2) - YEAR(date1)) &gt; 0, (YEAR(date2) - YEAR(date1)) - (MID(date2, 6, 5) &lt; MID(date1, 6, 5)), IF((YEAR(date2) - YEAR(date1)) &lt; 0, (YEAR(date2) - YEAR(date1)) + (MID(date1, 6, 5) &lt; MID(date2, 6, 5)), (YEAR(date2) - YEAR(date1))))<br clear="none"/><br clear="none"/><br clear="none"/>Now for some comments about these.<br clear="none"/><br clear="none"/><br clear="none"/>1. These results return integer number of years, months, and days. They are &quot;floored.&quot; Thus, 1.4 days would display as 1 day, and 13.9 years would display as 13 years. Likewise, -1.4 years would display as -1 year, and -13.9 months would display as -13 months.<br clear="none"/><br clear="none"/><br clear="none"/>2. Note that I use boolean expressions in many cases. Because boolean expressions evaluate to 0 or 1, I can use them to subtract or add 1 from the total based on a condition.<br clear="none"/><br clear="none"/><br clear="none"/>For example, to calculate the number of years between to dates, first simply subtract the years. The problem is that doi...</div>
    
    ]]></description> <pubDate>Sat, 14 Mar 2009 22:13:11 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#3220bb74-1d31-425d-bbf7-c5131f49389f</guid> 
  
  </item>

  
  <item> <title>Untitled Clipped Note</title> <link>http://www.evernote.com/pub/cdunn/code#b9437b1e-9063-4737-b0c0-5123743b1c78</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><br clear="none"/>CASE<br clear="none"/>WHEN modified_date between date_sub(now(), INTERVAL 60 minute) and now() THEN concat(minute(TIMEDIFF(now(), modified_date)), ' minutes ago')<br clear="none"/>WHEN datediff(now(), modified_date) = 1 THEN 'Yesterday'<br clear="none"/>WHEN modified_date between date_sub(now(), INTERVAL 24 hour) and now() THEN concat(hour(TIMEDIFF(NOW(), modified_date)), ' hours ago')<br clear="none"/>ELSE date_format(modified_date, '%a, %m/%d/%y')<br clear="none"/>END</div>
    
    ]]></description> <pubDate>Sat, 14 Mar 2009 21:42:00 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#b9437b1e-9063-4737-b0c0-5123743b1c78</guid> 
  
  </item>

  
  <item> <title>rotate logs</title> <link>http://www.evernote.com/pub/cdunn/code#cadd05bb-ff13-4e26-afd3-9f2695f5dea3</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">config.logger = Logger.new(&quot;#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log&quot;, 50, 1048576)</div>
    
    ]]></description> <pubDate>Sat, 14 Mar 2009 16:43:41 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#cadd05bb-ff13-4e26-afd3-9f2695f5dea3</guid> 
  
  </item>

  
  <item> <title>Date / Rational / Fixnum#gcd hack increased app performance by 15%</title> <link>http://www.evernote.com/pub/cdunn/code#23d6ab78-739a-412d-815d-23d6bfc59c6f</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Ruby: Date / Rational / Fixnum#gcd hack increased app performance by 15%<br clear="none"/>Kurt on Wed, 2007-03-28 22:23.<br clear="none"/>rails | ruby<br clear="none"/><br clear="none"/>Ruby Date uses Rational heavily, which calls Integer#gcd for every new Rational. The Integer#gcd method is generic to handle Bignums, but performs terribly for Fixnum#gcd(Fixnum), which is probably the most often case.<br clear="none"/><br clear="none"/>This RubyInline hack saved 15% execution time in a large Rails application:<br clear="none"/><br clear="none"/>require 'inline'<br clear="none"/><br clear="none"/>class Fixnum<br clear="none"/>  inline do | builder |<br clear="none"/>    builder.c_raw '<br clear="none"/>    static<br clear="none"/>    VALUE <br clear="none"/>    gcd(int argc, VALUE *argv, VALUE self) {<br clear="none"/>      if ( argc != 1 ) {<br clear="none"/>        rb_raise(rb_eArgError, &quot;wrong number of arguments (%d for %d)&quot;,<br clear="none"/>                 argc, 1);<br clear="none"/>      }<br clear="none"/>      /* Handle Fixnum#gcd(Fixnum) case directly. */<br clear="none"/>      if ( FIXNUM_P(argv[0]) ) {<br clear="none"/>        /* fprintf(stderr, &quot;Using Fixnum#gcd(Fixnum)\n&quot;); */<br clear="none"/>        long a = FIX2LONG(self);<br clear="none"/>        long b = FIX2LONG(argv[0]);<br clear="none"/>        long min = a &lt; 0 ? - a : a;<br clear="none"/>        long max = b &lt; 0 ? - b : b;<br clear="none"/>        while ( min &gt; 0 ) {<br clear="none"/>          int tmp = min;<br clear="none"/>          min = max % min;<br clear="none"/>          max = tmp;<br clear="none"/>        }<br clear="none"/>        return LONG2FIX(max);<br clear="none"/>      } else {<br clear="none"/>        /* fprintf(stderr, &quot;Using super#gcd\n&quot;); */<br clear="none"/>        return rb_call_super(1, argv);<br clear="none"/>      }<br clear="none"/>    }<br clear="none"/>    '<br clear="none"/>  end<br clear="none"/>end<br clear="none"/><br clear="none"/>Update:<br clear="none"/><br clear="none"/>Sorry for the late reply. If the code above does not work via cut-and-paste, download it from here.<br clear="none"/><br clear="none"/>This will be released soon as a gem dynamic library called speedfreaks,<br clear="none"/>with other performance-enhancing snippets.<br clear="none"/><br clear="none"/>Thanks for the feedback!</div>
    
    ]]></description> <pubDate>Thu, 12 Mar 2009 07:05:18 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#23d6ab78-739a-412d-815d-23d6bfc59c6f</guid> 
  
  </item>

  
  <item> <title>Use helpers in controllers or models</title> <link>http://www.evernote.com/pub/cdunn/code#454e0a5d-0d06-4819-8d86-0e0ede502e38</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><br clear="none"/>Use helpers in controllers or models<br clear="none"/><br clear="none"/>Published in: Ruby <br clear="none"/><br clear="none"/>URL: <a href="http://snippets.dzone.com/posts/show/1799" shape="rect">http://snippets.dzone.com/posts/show/1799</a><br clear="none"/><br clear="none"/>This is an easy to use any helpers that rails provides in any other place besides views and view helpers<br clear="none"/>Embed | Plain TextExpand<br clear="none"/><br clear="none"/>Copy this code and paste it in your HTML<br clear="none"/><br clear="none"/>   1.<br clear="none"/>      # create a new file inside lib/ and call it helpers.rb<br clear="none"/>   2.<br clear="none"/>      # paste the following:<br clear="none"/>   3.<br clear="none"/>       <br clear="none"/>   4.<br clear="none"/>      def help<br clear="none"/>   5.<br clear="none"/>      Helper.instance<br clear="none"/>   6.<br clear="none"/>      end<br clear="none"/>   7.<br clear="none"/>       <br clear="none"/>   8.<br clear="none"/>      class Helper<br clear="none"/>   9.<br clear="none"/>      include Singleton<br clear="none"/>  10.<br clear="none"/>      # look inside ActionView::Helpers to include any other helpers that you might need<br clear="none"/>  11.<br clear="none"/>      include ActionView::Helpers::DateHelper<br clear="none"/>  12.<br clear="none"/>      include ActionView::Helpers::TextHelper<br clear="none"/>  13.<br clear="none"/>      end<br clear="none"/>  14.<br clear="none"/>       <br clear="none"/>  15.<br clear="none"/>      # then in any model or controller:<br clear="none"/>  16.<br clear="none"/>      require 'lib/helpers'<br clear="none"/>  17.<br clear="none"/>       <br clear="none"/>  18.<br clear="none"/>      # to use:<br clear="none"/>  19.<br clear="none"/>      # help.name_of_helper<br clear="none"/>  20.<br clear="none"/>      # EX: help.pluralize 10, &quot;person&quot;<br clear="none"/><br clear="none"/></div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 16:13:01 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#454e0a5d-0d06-4819-8d86-0e0ede502e38</guid> 
  
  </item>

  
  <item> <title>HOWTO: Fix Aspect ratio of Divx,etc for DVD with ffmpeg</title> <link>http://www.evernote.com/pub/cdunn/code#b5e4a478-f484-4ec7-992c-8e90d21a11fa</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"> HOWTO: Fix Aspect ratio of Divx,etc for DVD with ffmpeg<br clear="none"/>I have created a simple bash script to calculate the aspect ratio when using ffmpeg for DivX-&gt;DVD-Video ready mpeg. So when watching the finished DVD on a stand alone DVDplayer, the image should not be squashed or squeezed.<br clear="none"/><br clear="none"/>Burning DVD Videos is described elsewhere.<br clear="none"/><br clear="none"/>The script calculates the correct amount of (top and bottom) padding required to maintain the AVi,etc Display Aspect Ratio. I exclusively use PAL so the resulting ratio will be 720X576. For NTSC (not tested) changing the variable dh=480 &quot;should&quot; work.<br clear="none"/><br clear="none"/>For details on the how the calculation is made go here<br clear="none"/><br clear="none"/>Copy the script to whatever name your want, chmod u+x script_name, to make it executable<br clear="none"/><br clear="none"/>First<br clear="none"/>Get the Display Aspect Ratio of the AVI,etc video file from the file properties, if for example AVI is 592x320,<br clear="none"/>usage: script_name 592 320<br clear="none"/>Some input error checking is included as well.<br clear="none"/>OUTPUT will be<br clear="none"/>#put the folowing into ffmpeg options assuming its a PAL dvd you want:<br clear="none"/>-target pal-dvd -s 720x554 -padtop 10 -padbottom 12<br clear="none"/><br clear="none"/>copy the above flags to the ffmpeg command line options, I would also use the flag -aspect 16:9 to be safe.<br clear="none"/>e.g.<br clear="none"/>ffmpeg -i &lt;input_file.avi&gt; -target pal-dvd -s 720x554 -padtop 10 -padbottom 12 -aspect 16:9 &lt;output.mpg&gt;<br clear="none"/><br clear="none"/>Code:<br clear="none"/><br clear="none"/>#!/bin/bash<br clear="none"/>#<br clear="none"/># A script to correct the resolution of an AVI file and<br clear="none"/># make a DVD without any stretching or squashing<br clear="none"/>#<br clear="none"/>if [ &quot;$1&quot; == help ]<br clear="none"/>then<br clear="none"/>  echo &quot;When encoding to a 16:9<br clear="none"/>Aspect MPEG (*see note below*)<br clear="none"/>Source Aspect   NTSC/PAL CVD    NTSC/PAL SVCD   NTSC/PAL DVD<br clear="none"/>1.33    1.33 Not Applicable: See above table for 1.33 resolutions<br clear="none"/><br clear="none"/>1.78    *352x480 / *352x576     *480x480 / *480x576     352x480 / 352x576 704x480 / 704x576 720x480 / 720x576<br clear="none"/><br clear="none"/>1.85    *352x460 / *352x552     *480x460 / *480x552     352x460 / 352x552 704x460 / 704x552 720x460 / 720x552<br clear="none"/><br clear="none"/>2.20    *352x388 / *352x432     *480x388 / *480x464     352x388 / 352x464 704x388 / 704x464 720x388 / 720x464<br clear="none"/><br clear="none"/>2.35    *352x360 / *352x432     *480x360 / *480x432     352x360 / 352x432 704x360 / 704x432 720x360 / 720x432<br clear="none"/>See <a href="http://www.transcoding.org/cgi-bin/transcode?Calculating_Frame_Size_And_Aspect_Ratio" shape="rect">http://www.transcoding.org...</a></div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 06:08:39 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#b5e4a478-f484-4ec7-992c-8e90d21a11fa</guid> 
  
  </item>

  
  <item> <title>HOWTO: Compiling the latest FFmpeg &amp; x264 on CentOS 4</title> <link>http://www.evernote.com/pub/cdunn/code#5395eb65-c557-4bef-9d87-d90b52d8c14d</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">HOWTO: Compiling the latest FFmpeg &amp; x264 on CentOS 4<br clear="none"/>Intoduction<br clear="none"/><br clear="none"/>FFmpeg is a superb video processing tool used to encode and transcode video files. In this particular project I needed to build “youtube” style video upload which would transcode into FLV, specifically catering for video files from the Nokia N95.<br clear="none"/><br clear="none"/>I spent quite a long time messing about with the stock version of ffmpeg on CentOS 4/Ubuntu trying to make it work, but it turned out not to be new enough/have all the right support compiled in.<br clear="none"/><br clear="none"/>This howto was written because I couldn’t find anything that fitted the bill for CentOS/RHEL (And being a Ubuntu man, found it a pain to get it compiled and working under CentOS). It’s based on the excellent tutorial by FakeOutdoorsman over on the Ubuntu forums. So big thanks to them.<br clear="none"/><br clear="none"/>These instructions have been tested on a fresh minimal install of CentOS 4.6 running in a VirtualBox VM.<br clear="none"/>Preparation<br clear="none"/><br clear="none"/>   1. Ensure that you have the rpmforge repo’s added to yum. See here for instructions.<br clear="none"/>   2. Update the install<br clear="none"/><br clear="none"/>      yum update<br clear="none"/><br clear="none"/>   3. (If you are not installing onto a fresh minimal install) Remove ffmpeg, x264 and faad2 to avoid confusion.<br clear="none"/><br clear="none"/>      yum remove ffmpeg x264 faad2 faad2-devel<br clear="none"/><br clear="none"/>   4. Install the necessary build tools<br clear="none"/><br clear="none"/>      yum install gcc gcc-c++ automake autoconf libtool yasm git subversion<br clear="none"/><br clear="none"/>   5. Install the necessary libraries<br clear="none"/><br clear="none"/>      yum install zlib-devel libmad-devel libvorbis-devel libtheora-devel lame-devel faac-devel a52dec-devel xvidcore-devel freetype-devel<br clear="none"/><br clear="none"/>Compile supporting libraries<br clear="none"/><br clear="none"/>   1. Compile &amp; Install faad2 (for some reason I couldn’t get it to compile against the standard rpm version)<br clear="none"/><br clear="none"/>      cd ~<br clear="none"/>      wget <a href="http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz" shape="rect">http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz</a><br clear="none"/>      tar xzvf faad2-2.6.1.tar.gz<br clear="none"/>      cd faad2<br clear="none"/>      autoreconf -vif<br clear="none"/>      ./configure<br clear="none"/>      make<br clear="none"/>      make install<br clear="none"/><br clear="none"/>   2. Compile &amp; Install GPAC<br clear="none"/><br clear="none"/>      cd ~<br clear="none"/>      wget <a href="http://downloads.sourceforge.net/gpac/gpac-0.4.4.tar.gz" shape="rect">http://downloads.sourceforge.net/gpac/gpac-0.4.4.tar.gz</a><br clear="none"/>      tar -xzvf gpac-0.4.4.tar.gz<br clear="none"/>      cd gpac<br clear="none"/>      ./configure<br clear="none"/>      make<br clear="none"/>      make install<br clear="none"/>      make install-lib<br clear="none"/><br clear="none"/>      Note: if the compile...</div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 03:01:17 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#5395eb65-c557-4bef-9d87-d90b52d8c14d</guid> 
  
  </item>

  
  <item> <title>error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory</title> <link>http://www.evernote.com/pub/cdunn/code#996d297e-a8cd-493b-be96-29e0c2026cf1</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory<br clear="none"/><br clear="none"/>error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory<br clear="none"/><br clear="none"/>right, this error usually comes when ldconfig does not know where to search for the libraries, so, in order to help it out,  on my fedora/centos systems, i did the following:<br clear="none"/><br clear="none"/>cd /etc/ld.so.conf.d<br clear="none"/><br clear="none"/>add another file:  custom-libs.conf<br clear="none"/><br clear="none"/>inside, put :<br clear="none"/><br clear="none"/>/usr/local/lib<br clear="none"/><br clear="none"/>save,<br clear="none"/><br clear="none"/>then do ldconfig, et voila.</div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 02:59:28 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#996d297e-a8cd-493b-be96-29e0c2026cf1</guid> 
  
  </item>

  
  <item> <title>Building Ffmpeg from source -- partial working</title> <link>http://www.evernote.com/pub/cdunn/code#3384f052-90e5-4ec8-8d8a-b10b58ca5c04</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Building Ffmpeg from source<br clear="none"/>Sooo...you've noticed that lovely rpm build of ffmpeg you've got doesn't include some key pieces, like h264 or aac encoding.<br clear="none"/><br clear="none"/>Here are some instructions on building ffmpeg from source. I used latest from subversion (on Sep 8, 06) and built on Fedora Core 5.<br clear="none"/><br clear="none"/>[1] Get ffmpeg source from svn:<br clear="none"/><br clear="none"/>svn checkout <a href="svn://svn.mplayerhq.hu/ffmpeg/trunk" shape="rect">svn://svn.mplayerhq.hu/ffmpeg/trunk</a> ffmpeg<br clear="none"/><br clear="none"/><br clear="none"/>[2a] Install faad<br clear="none"/>yum install faad2<br clear="none"/>yum install faad2-devel<br clear="none"/><br clear="none"/>[2b] Install faac and faac-devel rpms (yum may not help here)<br clear="none"/>try here: <a href="http://dries.ulyssis.org/rpm/packages" shape="rect">http://dries.ulyssis.org/rpm/packages</a><br clear="none"/><br clear="none"/>[3] Install lame<br clear="none"/>yum install lame<br clear="none"/>yum install lame-devel<br clear="none"/><br clear="none"/>[4] Install xvid<br clear="none"/>yum install libxvid<br clear="none"/>yum install xvidcore<br clear="none"/>yum install xvidcore-devel<br clear="none"/><br clear="none"/>[5] Install dc1394<br clear="none"/>yum install libdc1394<br clear="none"/>yum install libdc1394-devel<br clear="none"/><br clear="none"/>[5.5] Install vorbis<br clear="none"/>yum install libvorbis<br clear="none"/>yum install libvorbis-devel<br clear="none"/><br clear="none"/>[6] Build and install gpac multimedia library (needed by x264)<br clear="none"/><a href="http://gpac.sourceforge.net/" shape="rect">http://gpac.sourceforge.net/</a><br clear="none"/>download source,<br clear="none"/>configure --use-ffmpeg=no<br clear="none"/>make lib<br clear="none"/>make install-lib<br clear="none"/><br clear="none"/>[7] Build and install x264<br clear="none"/>svn co <a href="svn://svn.videolan.org/x264/trunk" shape="rect">svn://svn.videolan.org/x264/trunk</a> x264<br clear="none"/>./configure --enable-mp4-output --enable-shared<br clear="none"/>make<br clear="none"/>make install<br clear="none"/>cp /usr/local/lib/libx264.* /usr/lib<br clear="none"/><br clear="none"/>[8] Build ffmpeg<br clear="none"/>./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --enable-mp3lame --enable-faac<br clear="none"/>--enable-libogg --enable-vorbis --enable-faad --enable-xvid --enable-x264 --enable-a52<br clear="none"/>--enable-a52bin --enable-pp --enable-shared --enable-pthreads --enable-dc1394 --enable-gpl<br clear="none"/>--disable-strip<br clear="none"/>--extra-cflags=&quot;-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables&quot;<br clear="none"/><br clear="none"/>make<br clear="none"/>make install </div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 02:36:24 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#3384f052-90e5-4ec8-8d8a-b10b58ca5c04</guid> 
  
  </item>

  
  <item> <title>ffmpeg x264</title> <link>http://www.evernote.com/pub/cdunn/code#7e9e5ed7-8f38-497f-8ede-f5bff6df9331</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><div>sudo port install x264</div><div>sudo port install ffmpeg +lame +libogg +vorbis +faac +faad +xvid +x264 +a52</div><div>sudo port install AtomicParsley<br clear="none"/></div><div><br clear="none"/></div>ffmpeg -i wolverine-tlra_h720p.mov -f mp4 -acodec libfaac -ab 128k -ac 1 -vcodec libx264 -b 768k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -s 320x240 -y test.m4v<div><br clear="none"/></div><div>ffmpeg -i wolverine-tlra_h720p.mov -f mp4 -acodec libfaac -ab 128k -ac 1 -vcodec libx264 -b 768k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -s 704x400 -y test.m4v<br clear="none"/><br clear="none"/>ffmpeg -i wolverine-tlra_h720p.mov -acodec libfaac -ab 128k -ar 44100 -s 704x400 -r 20 -vcodec libx264 -b 256000 -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method umh -subq 5 -trellis 1 -refs 2 -bf 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 256000 -maxrate 4M -bufsize 4M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 21 test.mp4<br clear="none"/><br clear="none"/>ffmpeg -y -i wolverine-tlra_h720p.mov -acodec libfaac -ar 44100 -ab 96k -vcodec libx264 -level 41 -crf 20 -bufsize 20000k -maxrate 25000k -g 250 -r 20 -s 1280x544 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method umh -subq 7 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -bf 16 -b_strategy 1 -bidir_refine 1 -refs 6 -deblockalpha 0 -deblockbeta 0 output.mp4<br clear="none"/><br clear="none"/>ffmpeg -i wolverine-tlra_h720p.mov -an -pass 1 -vcodec libx264 -b 768k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method dia -subq 1 -trellis 0 -refs 1 -bf 16 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint...</div></div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 01:52:20 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#7e9e5ed7-8f38-497f-8ede-f5bff6df9331</guid> 
  
  </item>

  
  <item> <title>Untitled Clipped Note</title> <link>http://www.evernote.com/pub/cdunn/code#44a0400b-08be-494c-810f-a137c69c3376</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">yum install faac faac-devel faad2 faad2-devel a52dec a52dec-devel lame lame-devel libdca libdca-devel x264 x264-devel libogg libogg-devel libvorbis libvorbis-devel libtheora libtheora-devel xvidcore xvidcore-devel</div>
    
    ]]></description> <pubDate>Wed, 11 Mar 2009 01:20:29 GMT</pubDate> <guid>http://www.evernote.com/pub/cdunn/code#44a0400b-08be-494c-810f-a137c69c3376</guid> 
  
  </item>
 </channel> </rss>