<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30098697</id><updated>2012-01-31T12:31:00.287+10:30</updated><title type='text'>adz</title><subtitle type='html'>killer ninja code monkeys DO exist</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30098697.post-4119168167963137705</id><published>2010-01-18T15:17:00.004+10:30</published><updated>2010-01-18T15:48:02.903+10:30</updated><title type='text'>Fiscal Dates in Spreadsheets</title><content type='html'>Australian fiscal year 2008-2009 is from 1st July 2008 - 30th June 2009.&lt;br /&gt;&lt;br /&gt;July is the 7th month.&lt;br /&gt;&lt;br /&gt;LET'S HAVE EXCEL FUN!  :(&lt;br /&gt;&lt;br /&gt;Assuming A1 is you're date column, calculate year by ADDING 1 to the year for month's of July or later:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;  EXCEL:&lt;br /&gt;  = ( YEAR(A1) + (IF(MONTH(A1) &gt;= 7, 1, 0) )&lt;br /&gt;&lt;br /&gt;  OPEN OFFICE CALC:&lt;br /&gt;  = ( YEAR(A1) + (IF(MONTH(A1) &gt;= 7; 1; 0) )&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The calculation for fiscal month:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;  # EXCEL&lt;br /&gt;  = INT( 1 + MOD( MONTH(A1) - 7, 12) )&lt;br /&gt;&lt;br /&gt;  # OPEN OFFICE CALC&lt;br /&gt;  = INT( 1 + MOD( MONTH(A1) - 7; 12) )&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Last is fiscal quarter... &lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;  # EXCEL&lt;br /&gt;  = INT( 1 + (MOD(MONTH(A1)-7, 12) / 3)  )&lt;br /&gt;&lt;br /&gt;  # OPEN OFFICE CALC&lt;br /&gt;  = INT( 1 + (MOD(MONTH(A1)-7; 12) / 3)  )&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NOTES: &lt;br /&gt;&lt;br /&gt;- For US fiscal years, just replace '7' with '10' -- since October is your first fiscal month.&lt;br /&gt;&lt;br /&gt;- The semicolon is used to separate function arguments because OpenOffice accepts numbers with commas as the decimal point when it is running in a location that uses that notation. If it used commas for lists as well, then something like =SUM(20,2,30,6) would be completely ambiguous.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-4119168167963137705?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/4119168167963137705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=4119168167963137705' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4119168167963137705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4119168167963137705'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2010/01/fiscal-dates-in-spreadsheets.html' title='Fiscal Dates in Spreadsheets'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-1621097231311522420</id><published>2009-05-23T00:53:00.005+09:30</published><updated>2009-05-23T12:23:19.212+09:30</updated><title type='text'>Loading smartclient in Rails...</title><content type='html'>How to load &lt;a href="http://smartclient.com/"&gt;smartclient&lt;/a&gt; (LGPL javascript framework) in rails:&lt;br /&gt;&lt;ol&gt;&lt;li&gt; Download smartclient LGPL version&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Copy smartclientRuntime/isomorphic/* --&gt; RAILS_ROOT/public/isomorphic/&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Load up the javasacripts in your template&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;To help further, here's a nice application helper method (load_smart_client) to generate the right stuff for that last step:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;module ApplicationHelper&lt;br /&gt;  # All the modules in smartclient&lt;br /&gt;  #  (actually there's a few more -- but less useful)&lt;br /&gt;  ISC_MODULES = [&lt;br /&gt;    [:core,         'ISC_Core.js'],&lt;br /&gt;    [:foundation,   'ISC_Foundation.js'],&lt;br /&gt;    [:containers,   'ISC_Containers.js'],&lt;br /&gt;    [:grids,        'ISC_Grids.js'],&lt;br /&gt;    [:forms,        'ISC_Forms.js'],&lt;br /&gt;    [:data_binding, 'ISC_DataBinding.js']&lt;br /&gt;  ]&lt;br /&gt;&lt;br /&gt;  # Helper to generate paths to static urls&lt;br /&gt;  #&lt;br /&gt;  # Useful when you deploy under a path prefix&lt;br /&gt;  # (for example, --prefix with mongrel)&lt;br /&gt;  def static_url_for(path)&lt;br /&gt;    "#{ActionController::Base.relative_url_root}#{path}"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # Load smartclient javascript framework (via script tags)&lt;br /&gt;  #&lt;br /&gt;  # Options are:&lt;br /&gt;  #  :modules =&gt; array of js modules to load&lt;br /&gt;  #  :skin    =&gt; skin name, as per subfolder in /isomorphic/skins&lt;br /&gt;  #&lt;br /&gt;  # Skins include:&lt;br /&gt;  # BlackOps, Cupertino, Enterprise, fleet, SilverWave,&lt;br /&gt;  # SmartClient, standard, ToolSkin or TreeFrog&lt;br /&gt;  #&lt;br /&gt;  # Loadable modules include:&lt;br /&gt;  # :core, :foundation, :containers, :grids, :forms, :data_binding&lt;br /&gt;  #&lt;br /&gt;  # By default loads ALL modules, with Enterprise skin&lt;br /&gt;  def load_smart_client(opts={})&lt;br /&gt;    skin = opts[:skin] || 'Enterprise'&lt;br /&gt;    modules_to_load = opts[:modules] || ISC_MODULES.map(&amp;:first)&lt;br /&gt;&lt;br /&gt;    # Set isomorphic dir&lt;br /&gt;    out = "&amp;lt;script&amp;gt;var isomorphicDir='#{static_url_for('/isomorphic')}/';&amp;lt;/script&amp;gt;"&lt;br /&gt;&lt;br /&gt;    # Load each module&lt;br /&gt;    ISC_MODULES.each do |key, js_file|&lt;br /&gt;      if modules_to_load.include?(key)&lt;br /&gt;        js_url = static_url_for("/isomorphic/system/modules/#{js_file}")&lt;br /&gt;        out += "&amp;lt;script src='#{js_url}'&amp;gt;&amp;lt;/script&amp;gt;\n"&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;    &lt;br /&gt;    # Load skin&lt;br /&gt;    js_url = static_url_for("/isomorphic/skins/#{skin}/load_skin.js")&lt;br /&gt;    out += "&amp;lt;script src='#{js_url}'&amp;gt;&amp;lt;/script&amp;gt;\n"&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-1621097231311522420?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/1621097231311522420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=1621097231311522420' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/1621097231311522420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/1621097231311522420'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2009/05/loading-smartclient-in-rails.html' title='Loading smartclient in Rails...'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-8495314555131760238</id><published>2009-01-03T22:06:00.002+10:30</published><updated>2009-01-03T22:39:15.181+10:30</updated><title type='text'>Languages to learn...</title><content type='html'>&lt;ul&gt;&lt;li&gt;Javascript (more deeply)&lt;/li&gt;&lt;li&gt;Lisp&lt;/li&gt;&lt;li&gt;Smalltalk&lt;/li&gt;&lt;li&gt;OCAML&lt;/li&gt;&lt;li&gt;Haskell&lt;/li&gt;&lt;li&gt;Erlang&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-8495314555131760238?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/8495314555131760238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=8495314555131760238' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/8495314555131760238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/8495314555131760238'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2009/01/languages-to-learn.html' title='Languages to learn...'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-5017641978483896904</id><published>2008-07-01T01:03:00.004+09:30</published><updated>2008-11-06T14:23:11.497+10:30</updated><title type='text'>Don't lose my Money.new, or why 1 / 3 = ?</title><content type='html'>If you're using the Money object in rails, you'll be storing your money as cent in your DB.  Then, you use composed_of to read this into a whole separate object (of type Money).&lt;br /&gt;&lt;br /&gt;This works great, but, I don't like losing Money.&lt;br /&gt;&lt;br /&gt;The problem is, Money objects can't go into fractions below a cent.  So when you divide 1 by 3, you can't have .33333 reoccurring...  you get .33.&lt;br /&gt;&lt;br /&gt;We tackled this issue by modifying division to round to the nearest cent, but auto-calculate the total error.  This only makes sense when you have a way of dealing with the rounding...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Money&lt;br /&gt;  alias_method :lossy_divide, :/&lt;br /&gt;  def /(*params)&lt;br /&gt;    raise "Do not divide - losing Money!"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def split_between(x)&lt;br /&gt;    result = self.lossy_divide(x)&lt;br /&gt;    rounding_error = self - (result * x)&lt;br /&gt;&lt;br /&gt;    result, rounding_error&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this way, you 'split' money rather than exactly divide.  &lt;br /&gt;&lt;br /&gt;Our use-case is that we want to split the money between x people, or amongst x days. So, we generally have to assign the split money out to different instances.&lt;br /&gt;&lt;br /&gt;This works beautifully if we return an array representing all the splits, and add the rounding error to the first entry:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Money&lt;br /&gt;  alias_method :lossy_divide, :/&lt;br /&gt;  def /(*params)&lt;br /&gt;    raise "Do not divide - losing Money!"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def split_between(x)&lt;br /&gt;    result = self.lossy_divide(x)&lt;br /&gt;    rounding_error = self - (result * x)&lt;br /&gt;&lt;br /&gt;    [result + rounding_error] + (2..x).map{result}&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-5017641978483896904?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/5017641978483896904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=5017641978483896904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/5017641978483896904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/5017641978483896904'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2008/07/dont-lose-my-moneynew-or-why-1-3.html' title='Don&apos;t lose my Money.new, or why 1 / 3 = ?'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-2429589272976705014</id><published>2008-07-01T00:23:00.006+09:30</published><updated>2008-07-01T01:00:36.278+09:30</updated><title type='text'>Graphing in Rails Roundup</title><content type='html'>We recently built a small rails app to act as a portal into a large list of reports.  Rails works great for this - we've added role-based authentication, integrated legacy reportss and, hmmm, why not add sexy graphs? &lt;br /&gt;&lt;br /&gt;The following is a quick list of the current graphing/charting choices - with the intention of adding charts into this intranet-accessed reporting app...  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Image Generating: GRUFF&lt;/h3&gt;&lt;br /&gt;The most often sited lib is 'gruff'.  It works by generating an image of your graph which you can serve up.  The API seemed very easy to use.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://nubyonrails.com/pages/gruff'&gt;http://nubyonrails.com/pages/gruff&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I had some issues when there were a lot of x-axis labels.  You specify which x-label points to display in a hash, and to avoid the overlap it looked as though we would have to manually calculate an interval.&lt;br /&gt;&lt;br /&gt;NOTE: there is also a library called scruff which generates SVG graphs.  It uses a similar API to gruff.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Open Flash Charts&lt;/h3&gt;&lt;br /&gt;We are currently using &lt;a href='http://teethgrinder.co.uk/open-flash-chart/'&gt;Open Flash Charts&lt;/a&gt;.  It's very easy to use, looks great, and provides a large number of styles.&lt;br /&gt;&lt;br /&gt;The way it works is you embed a flash object into your browser, and tell it an url from where it should fetch it's data.&lt;br /&gt;&lt;br /&gt;It puts your x-axis on an oblique which avoided our problem all together.&lt;br /&gt;&lt;br /&gt;To help out, there's a nice Rails plugin, generating all of the above.  See: &lt;a href='http://www.pullmonkey.com/projects/open_flash_chart/'&gt;http://www.pullmonkey.com/projects/open_flash_chart/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;AMCHARTS&lt;/h3&gt;&lt;br /&gt;&lt;a href='http://www.amcharts.com/'&gt;AM Charts&lt;/a&gt; make some really professional looking components.  It's pretty similar to Open Flash Charts, but the free version is not open source and contains a link back to amcharts.com.  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, it's not too expensive and there is a rails plugin for it: &lt;a href='http://ambling.rubyforge.org/'&gt;Ambling&lt;/a&gt;.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Ambling is a rails plugin makes it easy to generate XML needed by the wonderfully slick Amcharts.&lt;br /&gt;&lt;li&gt; Amcharts has two kinds of XML: the data xml and the settings xml. Ambling can help with both. &lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;OTHERS&lt;/h3&gt;&lt;br /&gt;Fusion Charts - v2 is free: &lt;a href='http://www.fusioncharts.com/free/'&gt;http://www.fusioncharts.com/free/&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.fusioncharts.com/'&gt;Fusion Charts - v3&lt;/a&gt; is commercial: http://www.fusioncharts.com/&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.maani.us/xml_charts/index.php?menu=Gallery'&gt;XML/SWF charts&lt;/a&gt;&lt;br /&gt;XML/SWF has a free version - which if used, generates graphs as a link - where clicking on a graph directs you to their site.  A commercial version is  $45 for a developer.&lt;br /&gt;&lt;br /&gt;XML/SWF plugin for rails: &lt;a href='http://ziya.liquidrail.com/'&gt;http://ziya.liquidrail.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One issue to be aware of -  Flash objects don't seem to print in Firefox.  I believe other browsers work fine - in particular, IE worked under test.  &lt;br /&gt;&lt;br /&gt;A work around (in most of the above libs) is to right click a particular graph and select "Print Chart".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;JAVASCRIPT BASED&lt;/h3&gt;&lt;br /&gt;This is a very cool idea - javascript draws the graph in a canvas object within the browser.  It works in IE too via an emulated canvas object.  &lt;br /&gt;http://en.wikipedia.org/wiki/Canvas_(HTML_element)&lt;br /&gt;&lt;br /&gt;A roundup of these are as follows:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; &lt;a href='http://www.liquidx.net/plotkit/'&gt;PLOTKIT&lt;/a&gt;, based on Mochikit javascript lib&lt;br /&gt;&lt;li&gt; &lt;a href='http://solutoire.co/plotr/'&gt;PLOTR&lt;/a&gt;, is PLOTKIT with parts rewritten to use prototype&lt;br /&gt;&lt;li&gt; &lt;a href='http://code.google.com/p/flot/'&gt;FLOT&lt;/a&gt;, is based off of jQuery&lt;br /&gt;&lt;li&gt; &lt;a href='http://solutoire.com/flotr/'&gt;FLOTR&lt;/a&gt;, is similar to FLOT but uses prototype&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;All of these are quite simple to use, and have varying levels of maturity, documentation and compatibility.  However, generally speaking they support browsers where the Canvas tag is supported:  Firefox 1.5+, Safari 2.0+, Opera 9.0+ and IE6+ (emulated).&lt;br /&gt;&lt;br /&gt;It's also worth mentioning that these integrate nicely with rails - all your app need do is embed JSON data (or return it via AJAX).  The javascript is trivial to use - and can be controlled dynamically on the fly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;GOOGLE CHARTS&lt;/h3&gt;&lt;br /&gt;The charts you see in google analytics are openly available via a public API. &lt;br /&gt;&lt;br /&gt;Lot's of info on &lt;a href='http://code.google.com/apis/chart/'&gt;their site&lt;/a&gt; (probably one of the best documented), and a rails plugin is available too: &lt;a href='http://code.google.com/p/google-charts-on-rails/'&gt;http://code.google.com/p/google-charts-on-rails/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is a very nice options if you have a public site, but not so good for intranet applications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;CSS GRAPHS HELPER&lt;/h3&gt;&lt;br /&gt;At the other end of the scale is this little plugin.  It uses nothing but HTML, CSS (and optionally some images) to generate simple bar graphs. &lt;br /&gt;&lt;br /&gt;I liked the simplicity of this one, but we did have some issues:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; it seemed to conflict with some of our existing CSS&lt;br /&gt;&lt;li&gt; you are limited to one graph per page&lt;br /&gt;&lt;li&gt; all values need to be normalised to 100&lt;br /&gt;&lt;li&gt; it seemed to go wonky when you used more than 5 data points for vertical bar graphs (you can do more with horizontal ones)&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;It may still work well for you if you can work around those limitations.  It's simplicity is also it's asset: no flash, no server-side processing, and works across browsers.&lt;br /&gt;&lt;a href='http://nubyonrails.com/pages/css_graphs'&gt;http://nubyonrails.com/pages/css_graphs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you've found another option please leave a note in a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-2429589272976705014?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/2429589272976705014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=2429589272976705014' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/2429589272976705014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/2429589272976705014'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2008/07/graphing-in-rails-roundup.html' title='Graphing in Rails Roundup'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-7485076201857328784</id><published>2008-02-07T15:05:00.000+10:30</published><updated>2008-02-08T09:01:53.780+10:30</updated><title type='text'>Array Subsets and Supersets</title><content type='html'>I often find myself looking to see if an array contains all elements in another array.  The code looks like this:-&lt;br /&gt;&lt;code&gt;!array.any? {|e| !other_array.include?(e)}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;A much nicer solution is to use the build-in Set#subset because it reads so much better:&lt;br /&gt;&lt;code&gt;set.subset?(other_set)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A Set is like an array, but stores each element only once in an unordered sequence.  You can't get at a particular index - but you can still use #each.  Arrays, on the other hand, can store the same thing multiple times, and in different orders.  Hence, it only makes sense to talk of 'subset' or 'superset' and not 'subarray'.&lt;br /&gt;&lt;br /&gt;Quite usefully, Enumberable defines #to_set - which is included into Array giving us:-&lt;br /&gt;&lt;code&gt;array.to_set.subset?(other_array.to_set)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;BTW - if you're outside rails, you'll need to &lt;quote&gt;require 'set'&lt;/quote&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-7485076201857328784?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/7485076201857328784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=7485076201857328784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/7485076201857328784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/7485076201857328784'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2008/02/array-subsets-and-supersets.html' title='Array Subsets and Supersets'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-4170137547819004718</id><published>2007-11-26T11:27:00.000+10:30</published><updated>2007-11-26T11:38:51.506+10:30</updated><title type='text'>Fowler on Viagra Infused Rabbit Organisations</title><content type='html'>Martin Fowler on &lt;a href="http://martinfowler.com/articles.html#ap"&gt;Organization Structures (Accountability)&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;If you are dealing with an organization with a single hierarchy, or even a couple, then Organization Hierarchy (7) is the simplest way to deal with things. However larger organizations grow beyond this. You often find a host of different relationships between parties, all of which carry their own meaning. If your hierarchies start breeding like viagra infused rabbits, it’s time to look to Accountability (17).&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Gotta love that description :)&lt;br /&gt;&lt;br /&gt;He's describing how you can structure organisations (including relationships between them).  &lt;br /&gt;&lt;br /&gt;I strongly recommend reading up on Fowler's work.  I really like his style - especially his method of demonstrating the simplest possible model first, then building up complexity to maximum flexibility.  &lt;br /&gt;&lt;br /&gt;It's important to recognize that while no-one likes needless complexity, it's extremely beneficial to know how to add just enough to cover your needs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-4170137547819004718?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/4170137547819004718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=4170137547819004718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4170137547819004718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4170137547819004718'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/11/fowler-on-viagra-infused-rabbit.html' title='Fowler on Viagra Infused Rabbit Organisations'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-4016125119368717591</id><published>2007-11-21T16:41:00.000+10:30</published><updated>2007-11-21T17:00:56.666+10:30</updated><title type='text'>Do NOT Override Rails :default DATE_FORMAT!</title><content type='html'>A subtle issue - I should've known better!  Beware!&lt;br /&gt;&lt;br /&gt;We &lt;a href="http://wiki.rubyonrails.org/rails/pages/HowToDefineYourOwnDateFormat"&gt;defining our own date formats&lt;/a&gt; in our rails environment.rb - in order to format dates consistently across our app with 'some_date.to_formatted_s(:my_format)'. This is done by opening up the existing ActiveSupport class, and merging in your formats:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(&lt;br /&gt;  :in_words =&gt; "%A, %d %B %Y",    # Add format - Monday, 01 January 2007&lt;br /&gt;  :short =&gt; '%d/%m/%Y'            # Override :short to ozzy style dates&lt;br /&gt; )&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However, do NOT go overriding the :default format!  &lt;br /&gt;This one ALSO seems to be used for converting dates into SQL string-formatted dates.&lt;br /&gt;&lt;br /&gt;MySql ended up receiving a blank string, and stored '0000-00-00' for all my dates... ...but no errors.&lt;br /&gt;&lt;br /&gt;Not nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-4016125119368717591?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/4016125119368717591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=4016125119368717591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4016125119368717591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/4016125119368717591'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/11/do-not-override-rails-default.html' title='Do NOT Override Rails :default DATE_FORMAT!'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-514669332630894852</id><published>2007-11-14T08:50:00.001+10:30</published><updated>2007-11-14T09:01:38.811+10:30</updated><title type='text'>Rails Coding Standard</title><content type='html'>The small team I'm part of work on a large Rails project (in complexity and scope).  We've all got quite contrasting backgrounds: PHP hackers, J2EE pattern junkies &amp;amp; legacy spaghetti coders.&lt;br /&gt;&lt;br /&gt;I've found some recurring issues that arise relating to code quality, so have set out to write a mini-code standard.&lt;br /&gt;&lt;br /&gt;&lt;OL&gt;&lt;br /&gt;  &lt;LI&gt;IN ESSENCE: &lt;EM&gt;ALL CODE SHOULD BE READABLE!&lt;/EM&gt;&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;DO &lt;EM&gt;NOT&lt;/EM&gt; OPTIMISE for performance - OPTIMISE FOR &lt;EM&gt;CLARITY OF CODE&lt;/EM&gt;&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;STYLE: use 2 spaces for indent (not tabs)&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;STYLE: Line up hash arrows for readability&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;STYLE: put spaces around =&gt; hash arrows&lt;/LI&gt; &lt;br /&gt;  &lt;LI&gt;STYLE: put spaces after ',' in method params - but none between method names and '('&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;VIEWS: use HAML for views&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;VIEWS: break up the structure with white space to help readability - VERTICALLY TOO!&lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;VIEWS STYLE: Rely on structure of page, without having to insert messages or new components...  &lt;br /&gt;    &lt;UL&gt;&lt;br /&gt;      &lt;LI&gt;Example: Effect to visually highlight then drop out an existing element rather than flash a message&lt;/LI&gt;&lt;br /&gt;      &lt;LI&gt;Example: Highlight newly added row rather than a message about it&lt;/LI&gt;&lt;br /&gt;    &lt;/UL&gt;&lt;br /&gt;  &lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;AVOID logic in views - they should be simple&lt;br /&gt;    &lt;UL&gt;&lt;br /&gt;      &lt;LI&gt;put html generating logic into helpers&lt;/LI&gt;&lt;br /&gt;      &lt;LI&gt;instead of inline ruby logic, add to models (filtering, checking)&lt;/LI&gt;&lt;br /&gt;    &lt;/UL&gt;&lt;br /&gt;  &lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;NEVER use ActiveRecord models in migrations unless you re-define them within the migration &lt;br /&gt;    &lt;UL&gt;&lt;br /&gt;      &lt;LI&gt;...otherwise the migration fails when you later remove/rename the AR class&lt;/LI&gt;&lt;br /&gt;      &lt;LI&gt;BETTER SOLUTION: use bootstrapping until deployed!!!&lt;/LI&gt;&lt;br /&gt;    &lt;/UL&gt;&lt;br /&gt;  &lt;/LI&gt;&lt;br /&gt;  &lt;LI&gt;AJAX only for sub-components of an object, and avoid over-use&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now the problem with code standards, is that they need to be adhered to, or they're totally useless.  That's why the above is very short and easy to comprehend in one quick sitting.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What would you add or remove?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-514669332630894852?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/514669332630894852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=514669332630894852' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/514669332630894852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/514669332630894852'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/11/rails-coding-standard.html' title='Rails Coding Standard'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-7040351187118804899</id><published>2007-11-14T08:36:00.000+10:30</published><updated>2007-11-14T08:47:55.498+10:30</updated><title type='text'>ActiveRecord Through ODBC Without Rails</title><content type='html'>&lt;ol&gt;&lt;li&gt;Install Ruby&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Install active-record (plus any adapters... such as ODBC) on command line&lt;br /&gt;&lt;code&gt;&lt;br /&gt;gem install active_record --include-dependencies&lt;br /&gt;gem install odbc-rails --include-dependencies&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Write some Ruby code...&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The simplest case looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# require AR&lt;br /&gt;require 'rubygems'       # require gems first since AR is installed via gems&lt;br /&gt;require 'active_record'&lt;br /&gt;&lt;br /&gt;# connect to the database (sqlite in this case)&lt;br /&gt;ActiveRecord::Base.establish_connection({&lt;br /&gt;  :adapter  =&gt; odbc,&lt;br /&gt;  :dsn      =&gt; your_pre-configured_odbc_datasource_name,&lt;br /&gt;  :username =&gt; user_name,&lt;br /&gt;  :password =&gt; secred_password,&lt;br /&gt;  :trace    =&gt; true,&lt;br /&gt;  :convert_numeric_literals =&gt; true})&lt;br /&gt;&lt;br /&gt;# define your models - this one looks for a table called 'tasks'&lt;br /&gt;class Task &lt; ActiveRecord::Base&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then you're good to go!  Go ahead and use all that Active Record stuff from a local script...&lt;br /&gt;&lt;br /&gt;See &lt;a href="http://odbc-rails.rubyforge.org/RailsAdapterWebHOWTOAdapter.html"&gt;here&lt;/a&gt; for futher info on using ODBC with rails:&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href='http://wiki.rubyonrails.com/rails/pages/HowToUseActiveRecordOutsideRails'&gt;rails wiki&lt;/a&gt; has more on active record outside rails.&lt;br /&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-7040351187118804899?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/7040351187118804899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=7040351187118804899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/7040351187118804899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/7040351187118804899'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/11/activerecord-without-rails.html' title='ActiveRecord Through ODBC Without Rails'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-3111357173810254969</id><published>2007-08-30T08:19:00.000+09:30</published><updated>2007-08-30T09:43:38.186+09:30</updated><title type='text'>Colours?</title><content type='html'>Ruby has helped me write beautiful code - more expressive and abstract - and hence more maintainable. I've become interested in enhancing my visual design skills to match!&lt;br /&gt;&lt;br /&gt;One area of visual design that seems particularly subjective is &lt;span style="color: rgb(255, 0, 0);"&gt;c&lt;/span&gt;&lt;span style="color: rgb(255, 153, 102);"&gt;o&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;l&lt;/span&gt;&lt;span style="color: rgb(102, 255, 153);"&gt;o&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;u&lt;/span&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;r&lt;/span&gt; (that's Australian for 'color').&lt;br /&gt;&lt;br /&gt;This post is a summary of basic colour ideas researched up from the wild web.&lt;br /&gt;&lt;h2&gt;Colour Matters!&lt;/h2&gt;On your website, use color to create the most functional user-interface design.&lt;br /&gt;&lt;blockquote&gt;For example, use color to direct the eye to the most important areas on the page. The web designer must identify what ideal and normal sequences might entail: what the viewer should see first, where the eye should move next, and how much time the viewer's attention should be held by each area.&lt;br /&gt;&lt;br /&gt;Keep colors to minimum. "Signal detection" theory means that the brain is able to understand and organize information when a minimum of colors and shapes exists within the visual field. Too many colors and shapes make it impossible to focus and find anything.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use colour to direct the eye to important areas&lt;/li&gt;&lt;li&gt;Identify the sequence of focal areas (ideal &amp; normal)&lt;/li&gt;&lt;li&gt;Keep Colours and shapes to a minimum&lt;/li&gt;&lt;/ul&gt;The main emphasis is on using colour as a means of focusing attention  ...but which colours?&lt;br /&gt;&lt;h2&gt;Which Colours?&lt;/h2&gt;This is where things get very subjective - the realm of psychology.  Color psychology is a field of psychology devoted to analyzing the effect of color on human behavior and feeling.&lt;br /&gt;&lt;br /&gt;This seems to be very culturally dependent - see &lt;a href="http://en.wikipedia.org/wiki/Color_psychology"&gt;Wikipaedia&lt;/a&gt; for a table of some common cultural (symbolic) connotations attached to colors in Western cultures.&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Realise that colours will evoke behaviour &amp;amp; feelings in humans!&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Keep in mind colour psychology when selecting your colours&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It's subjective!&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Using Colours For Focus&lt;/h2&gt;Let's move on to something less subjective - how to use colours to direct the eye.  In order to understand this, you need to understand how colours relate to one another.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The Colour Wheel&lt;/h3&gt;An indispensible tool for selecting colour - the color wheel (or circle) is a visual representation of colors arranged according to their chromatic relationship.  It essentially provides a method of selecting colours based on their relationship to one another.&lt;br /&gt;&lt;br /&gt;There's a number of useful colour wheels you can user directly on the web - google 'em.&lt;br /&gt;&lt;br /&gt;Here's a selection:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.worqx.com/color/palette.htm"&gt;Peter Piper's Pallete:&lt;/a&gt;&lt;br /&gt;Uses a 'cross' rather than wheel, but shows 7 colours at once - each in varying levels of proporition.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colorsontheweb.com/colorwizard.asp"&gt;The Color Wizard:&lt;/a&gt;&lt;br /&gt;Select a colour - then it will show you related colours.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.paintquality.com/color/index.html#"&gt;Digital Color Wheel:&lt;/a&gt;&lt;br /&gt;Similar to the color wizard, it helps see which colors go with what. You can choose your primary or reference color, then move the mouse over the different color schemes – analogous, split complementary etc.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colorsontheweb.com/colorwheel.asp"&gt;Random Color Generator:&lt;/a&gt;&lt;br /&gt;Generates three random colours with a text block preview.  Useful when you're totally stuck with designer's block!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Complimentary or analogous?&lt;/h3&gt;When complementary colours are used together, they seem to make each other brighter and more vivid.  They are located opposite from each other on the colour wheel.&lt;br /&gt;&lt;br /&gt;Analogous colours will tend to blend together, and provides a feeling of harmony.  They are located next to each other around the colour wheel.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Passive or active?&lt;/h3&gt;The color wheel can be further divided into ranges that are visually active or passive.&lt;br /&gt;&lt;br /&gt;Most often warm, saturated, light value hues are "active" and visually advance. Active colors will appear to advance when placed against passive hues.&lt;br /&gt;&lt;br /&gt;Cool, low saturated, dark value hues are "passive" and visually recede.  Passive colors appear to recede when positioned against active hues.&lt;br /&gt;&lt;h2&gt;Proportions&lt;/h2&gt;When using colours, realise that the proportions of each colour affect focal points, and can help draw the eye from one area to another&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The color with the largest proportional area is the dominant color (the ground).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Smaller areas are subdominant colors.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Accent colors are those with a small relative area, but offer a contrast because of a variation in hue, intensity, or saturation (the figure).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Placing small areas of light color on a dark background, or a small area of dark on a light background will create an accent.&lt;br /&gt;&lt;h2&gt;Summary of links:&lt;/h2&gt;Principles of design: &lt;a href="http://www.digital-web.com/articles/principles_of_design/"&gt;http://www.digital-web.com/articles/principles_of_design/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Colour tutorial: &lt;a href="http://www.worqx.com/color/index.htm"&gt;http://www.worqx.com/color/index.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Color and E-Commerce: &lt;a href="http://www.colormatters.com/des_ecom.html"&gt;http://www.colormatters.com/des_ecom.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Learning to Use Color on Your Website: &lt;a href="http://www.creativepro.com/story/feature/6858.html"&gt;http://www.creativepro.com/story/feature/6858.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Peter Piper's Pallete: &lt;a href="http://www.worqx.com/color/palette.htm"&gt;http://www.worqx.com/color/palette.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Random Color Generator: &lt;a href="http://www.colorsontheweb.com/colorwheel.asp"&gt;http://www.colorsontheweb.com/colorwheel.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Color Wizard: &lt;a href="http://www.colorsontheweb.com/colorwizard.asp"&gt;http://www.colorsontheweb.com/colorwizard.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Digital Color Wheel: &lt;a href="http://www.paintquality.com/color/index.html#"&gt;http://www.paintquality.com/color/index.html#&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-3111357173810254969?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/3111357173810254969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=3111357173810254969' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/3111357173810254969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/3111357173810254969'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/08/colours.html' title='Colours?'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-3393744532769718317</id><published>2007-07-01T20:15:00.000+09:30</published><updated>2007-07-01T21:12:21.475+09:30</updated><title type='text'>Gimmie an awesome main-menu</title><content type='html'>Gimmie is a neat organiser/launcher for all your stuff on Gnome.   You can add it to your gnome panel's as an applet, or as a stand alone dock.&lt;br /&gt;&lt;br /&gt;It's a big improvement over existing menu-based structures (although I've yet to learn any nice keyboard shortcuts).&lt;br /&gt;&lt;br /&gt;It splits things up into colour-coded tabs:&lt;br /&gt;&lt;br /&gt;linux | &lt;span style="color: rgb(51, 102, 255);"&gt;programs,&lt;/span&gt; | &lt;span style="color: rgb(51, 255, 51);"&gt;library&lt;/span&gt; | &lt;span style="color: rgb(255, 153, 255);"&gt;people&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You'll find synaptic, settings &amp; places under 'linux'; &lt;br/&gt;&lt;br /&gt;your usual apps under 'programs'; &lt;br/&gt;&lt;br /&gt;documents, tomboy notes, music &amp; media in 'library';&lt;br/&gt;&lt;br /&gt; and contacts from Gaim/Pidgin under 'people'.  &lt;br /&gt;&lt;br /&gt;There's plans to integrate google contacts, flickr and the like in too.&lt;br /&gt;&lt;br /&gt;What really makes it useful is that each has a set of buttons which act like filters - and one is &lt;em&gt;"Recently Used"&lt;/em&gt;.  I've found that after a few days it learns the apps I use, the people I chat with and the doc's I'm working on.  I just leave the Recently used button down and hardly ever have to go searching.&lt;br /&gt;&lt;br /&gt;You can find gimmie in universe of Feisty, but it's in heavy development.&lt;br/&gt;&lt;br /&gt;Get the latest &lt;a href="http://www.beatniksoftware.com/gimmie/Download"&gt;from source&lt;/a&gt;.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;./configure -prefix=/usr&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;br /&gt;The "-prefix=/usr" tells it to install in /usr - instead of /usr/local.  Without it, the applet won't show up when you "Add to panel" (seems only /usr/lib/bonobo/servers is searched for applets and not /usr/local/lib/bonobo/servers).&lt;br /&gt;&lt;br /&gt;Oh, and you'll need to &lt;code&gt;sudo apt-get install python-gtk2-dev&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;More info here: &lt;a href="http://www.beatniksoftware.com/blog/?p=53"&gt;http://www.beatniksoftware.com/blog/?p=53&lt;/a&gt;&lt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-3393744532769718317?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/3393744532769718317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=3393744532769718317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/3393744532769718317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/3393744532769718317'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/07/gimmie-or-awesome-gnome-main-menu.html' title='Gimmie an awesome main-menu'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-389413700403024870</id><published>2007-04-27T00:04:00.000+09:30</published><updated>2007-04-27T00:34:55.069+09:30</updated><title type='text'>Association extensions tidy up your Rails models</title><content type='html'>Don't underestimate the power of association extensions when building your rails models.  I totally glossed over them until recently.&lt;br /&gt;&lt;br /&gt;Consider this class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Project &amp;lt; ActiveRecord::Base&lt;br /&gt; has_many :stories do&lt;br /&gt;   def backlog&lt;br /&gt;     self.select { |s| s.iteration.nil? }&lt;br /&gt;   end&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;With this model you could say:&lt;br /&gt;&lt;code&gt;my_project.stories.backlog&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;As an alternative, you could put all the logic in the controller.  This would, of course, violate Jamis Buck's &lt;a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model"&gt;'Skinny Controller, Fat Model principle'&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Another alternative - use a more flat api style:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Project &amp;lt; ActiveRecord::Base&lt;br /&gt; has_many :stories&lt;br /&gt; def backlog&lt;br /&gt;   self.stories.select { |s| s.iteration.nil? }&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;...and then you'd call it thusly:&lt;br /&gt;&lt;code&gt;my_project.backlog&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The benefit of utilising association extensions is that methods will be grouped together more naturally, and tend to be shorter as a result of their context.  The larger your model the more this will benefit you.&lt;br /&gt;&lt;br /&gt;See more great examples of this in &lt;a href="http://explainpmt.com/"&gt;explainpmt&lt;/a&gt; - an open source web-based tool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-389413700403024870?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/389413700403024870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=389413700403024870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/389413700403024870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/389413700403024870'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/04/association-extensions-tidy-up-your.html' title='Association extensions tidy up your Rails models'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-5609488500967905646</id><published>2007-04-26T21:54:00.000+09:30</published><updated>2007-04-26T23:58:50.661+09:30</updated><title type='text'>What Don't I Like About Ruby?</title><content type='html'>Back in uni a friend told me you don't really understand a technology  unless you  see through the hype, and can enumerate what &lt;span style="font-style: italic;"&gt;doesn't&lt;/span&gt; work so well.  The benefit of doing so is a deeper and more practical level of knowledge   ...which was a new idea to me at the time.&lt;br /&gt;&lt;br /&gt;I've always been a bit like a human sponge.  I soak up knowledge and can do so fairly quickly - but I don't do it objectively.   It's not until I go and apply that knowledge that I see the more subtle effects.  I think it's really only then that I can appreciate the results of the trade-off's that every language or library must make.&lt;br /&gt;&lt;br /&gt;These days I &lt;span style="font-weight: bold;"&gt;*do*&lt;/span&gt; try and examine the negatives, and it's when I do so with Ruby that I find a most interesting situation.   &lt;span style="font-style: italic;"&gt;The negatives are a side-effect of the positives.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Look at 'Dynamic typing'... often seen as a big fat negative.   After all, it's static typing that makes a language more easily processed by the machine - compiler's can point out bugs &amp; IDE's can do funky refactoring.   However, without it ruby wouldn't be able to express ideas so succinctly.&lt;br /&gt;&lt;br /&gt;How about the 'Syntactic Sugar'?  It's inconsistent, right?  Cryptic?&lt;br /&gt;&lt;br /&gt;No, it let's you express what you mean in the way you think it.  It allows you to write code that is easier to &lt;span style="font-style: italic;"&gt;*read*.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;...and monkey patching.  The process of patching core libraries by overriding existing methods in existing classes.   When i first realised this was possible, alarm bells went off in my head - core classes don't have to be sub-classed - they're *wide open*.   What about the clashes?  Won't libraries  override each other??   How can you debug-trace that?&lt;br /&gt;&lt;br /&gt;Well, the danger is there but doesn't surface in practice.  It's generally not done unless it provides real value - and then it becomes prominent.  Case in point -&lt;span style="font-family:courier new;"&gt; 5.minutes.ago&lt;/span&gt; returns the time 5 minute ago - Rails cool bits like this wouldn't work without open classes.&lt;br /&gt;&lt;br /&gt;Fundamentally, Matz goal was to make a programming language that was easier for developers - not  machines.  Everything else took a back seat - including performance, cross-platform ideals, or even purity.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;&lt;a href="http://archive.gamespy.com/legacy/articles/devweek_b.shtm"&gt;"Language is the frame of thought."&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In other words, our language not only defines how we communicate with each other, it also defines how we think, what concepts we are able to ponder, and how we internalize the workings of the world in our minds.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;The moral of the story - constantly evaluate your language &amp;amp; tool-set.  It'll provide a feedback loop into your learning and hence effectiveness.&lt;br /&gt;&lt;br /&gt;:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-5609488500967905646?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/5609488500967905646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=5609488500967905646' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/5609488500967905646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/5609488500967905646'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/04/what-dont-i-like-about-ruby.html' title='What Don&apos;t I Like About Ruby?'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-2332468701401412481</id><published>2007-01-13T17:31:00.000+10:30</published><updated>2007-04-26T23:38:26.193+09:30</updated><title type='text'>wireless ubuntu edgy</title><content type='html'>No wireless! on my dell 6400... (with a Pro/Wireless 3945 ABG Network Connection).&lt;br /&gt;&lt;br /&gt;Googling showed I needed to install linux-restricted-modules-generic but that didn't seem to fix it.  I noticed ipw3945d was not in /sbin BUT /sbin/ipw3945d-2.6.17-10-generic *was*....&lt;br /&gt;&lt;br /&gt;Copying this file to /sbin/ipw3945d makes it detect the wireless, but it drops out every 5 mins....&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;*UPDATE* No probs at all on Feisty.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;I think it was most likely caused by messing with the ati video driver - and following HowTo's that installed a specific kernel.  Anyway, I've learnt somewhat about kernel modules, X &amp;amp; some details on package management with ubuntu.  That was half the point anyways...!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-2332468701401412481?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/2332468701401412481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/2332468701401412481'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2007/01/wireless-ubuntu-edgy.html' title='wireless ubuntu edgy'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-626320140367089880</id><published>2006-12-18T20:45:00.000+10:30</published><updated>2006-12-18T20:53:00.152+10:30</updated><title type='text'>Using ActiveRecord Models in Migrations With STI</title><content type='html'>It's cool to &lt;a href="http://toolmantim.com/article/2006/2/23/migrating_with_models"&gt;use ActiveRecord models in rails migrations&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However you might come across a problem i just had....&lt;br /&gt;&lt;br /&gt;If you have a model utilising STI, you may find (like I) that you get a big bad "superclass mismatch for class X".  ActiveRecord is instantiating your model class based on the 'type' column in your STI table - even if you use the parent class.&lt;br /&gt;&lt;br /&gt;I hacked a workaround by disabling STI in my migration:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  # Disable Single Table Inheritance...&lt;br /&gt;  ActiveRecord::Base.inheritance_column = 'something_to_disable_single_table_inheritance'&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This will mean it won't look for a column called 'type' but whatever else you say there - just make sure you don't have a column called 'something_to_disable_single_table_inheritance'&lt;br /&gt;&lt;br /&gt;:0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-626320140367089880?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/626320140367089880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=626320140367089880' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/626320140367089880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/626320140367089880'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/12/using-activerecord-models-in-migrations.html' title='Using ActiveRecord Models in Migrations With STI'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-116572063937916864</id><published>2006-12-10T13:43:00.000+10:30</published><updated>2006-12-10T13:47:19.393+10:30</updated><title type='text'>Find with :include ignores :order</title><content type='html'>A rails bug bit me today!  Ouch! &lt;br /&gt;&lt;br /&gt;Well, at least the bug report was clear and explained the workaround well:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.rubyonrails.org/ticket/6679"&gt;Ticket #6679 (new defect)&lt;/a&gt;&lt;br /&gt;find with :include ignores :order from has_many declaration&lt;br /&gt;&lt;br /&gt;Basically, when you eager load an association from a has_many relationship, :order is totally ignored.  To work-around, you have to specify :order again on the eager load.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-116572063937916864?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/116572063937916864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=116572063937916864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/116572063937916864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/116572063937916864'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/12/find-with-include-ignores-order.html' title='Find with :include ignores :order'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-115266830085800540</id><published>2006-07-12T11:08:00.000+09:30</published><updated>2006-07-12T11:38:27.996+09:30</updated><title type='text'>Vim 7.0 - Autocomplete With Rails</title><content type='html'>Just installed Vim 7.0 ...and had to check out this cool 'omnicomplete' thingy!  Like ctrl-space in eclipse to complete methods, etc...&lt;br /&gt;&lt;br /&gt;I tried a ruby file, and on first go it complained:&lt;br /&gt;&lt;code&gt;'load_buffer_class': uninitialized constant MyClassNameHere&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I wonder how I can tell vim where my rails code lives?&lt;br /&gt;&lt;br /&gt;Found this &lt;a href="http://undocumentedcode.com/?p=6"&gt;blog&lt;/a&gt; describing how to setup for c - the key for me was this comment:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;–run ctags on your C libraries (from VIM :help ft-c-omni)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I checked out :help ft-ruby-omni and it's all there:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Vim can detect and load the Rails environment for files within a rails project. The feature is disabled by default, to enable it add&lt;br /&gt;     &lt;code&gt;let g:rubycomplete_rails = 1&lt;/code&gt;&lt;br /&gt;to your vimrc&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;So I needed to add that line to my .vimrc file.... &lt;br /&gt;&lt;br /&gt;However, here I am on windows, and unsure where the .vimrc lives. It's supposed to go in your home directory - which on windows is typically 'C:\documents and settings\*user_name*\'.&lt;br /&gt;&lt;br /&gt;Turns out, you can use unix style shortcuts within vim and they work fine.  This is useful because I can edit the home .vimrc file using the following from within vim:&lt;br /&gt;&lt;code&gt;:e ~/.vimrc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then, when i save the file (:w) it saves it in C:\documents and settings\*user_name*\.vimrc - problem solved!&lt;br /&gt;&lt;br /&gt;BUT, then syntax and other defaults were turned off.... I had lost my 'default' settings.  &lt;br /&gt;&lt;br /&gt;What I needed was to source the defaults - which in my install was sitting in my VIM root, and named "_vimrc".&lt;br /&gt;&lt;br /&gt;My final ~/.vimrc file looks like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;source $VIM/_vimrc&lt;br /&gt;let g:rubycomplete_rails = 1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And now all is good!  Now I just need to spend some quality play-time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-115266830085800540?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/115266830085800540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=115266830085800540' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115266830085800540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115266830085800540'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/07/vim-70-autocomplete-with-rails.html' title='Vim 7.0 - Autocomplete With Rails'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-115266520798602074</id><published>2006-07-12T09:50:00.000+09:30</published><updated>2006-07-12T10:18:38.646+09:30</updated><title type='text'>Learning VIM</title><content type='html'>A colleague of mine re-introduced me to Vim about 6 or so months ago.  Like many people, I dismissed it originally as entirely too obscure and unnecessarily difficult to use.&lt;br /&gt;&lt;br /&gt;However, as a programmer I've come to appreciate the powerful UNIX command line well-over the windows one.  It only seemed logical to apply the same thing to my editor (command-line vs point-click)&lt;br /&gt;&lt;br /&gt;The h-j-k-l keys are used as left-up-down-right movement keys because they are on your 'home' row and hence quicker to get to (and come back to).  As a touch typer I can really appreciate that!&lt;br /&gt;&lt;br /&gt;One interesting thing I've noticed is that after 10+ years using the arrow-keys I sometimes unconsciously hit the 'p' key (which means put or paste) instead of up when using these keys.  :)&lt;br /&gt;&lt;br /&gt;This is weird because I'm using my little finger - even though I use the middle finger for up-down when on the standard arrow keys...&lt;br /&gt;&lt;br /&gt;It's something like 'spatial' body memory controlling my fingers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-115266520798602074?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/115266520798602074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=115266520798602074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115266520798602074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115266520798602074'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/07/learning-vim.html' title='Learning VIM'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-115260219554072203</id><published>2006-07-11T16:36:00.000+09:30</published><updated>2007-04-26T23:59:31.185+09:30</updated><title type='text'>Apache Tomcat Connector (JkMount) won't work for servlet base  - without a slash</title><content type='html'>We have a tomcat app-server running some java servlet apps which we pass through from apache using the tomcat &lt;a href="http://tomcat.apache.org/connectors-doc/index.html"&gt;JK connector&lt;/a&gt;.  It all worked fine - so long as you don't request the base servlet path.  As an example:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;# Mount worker1 to all urls starting with that base&lt;br /&gt;JkMount /jsp-examples/* worker1&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;The above won't work for http://localhost/jsp-examples (note there's no trailing slash!).  A simple solution - mount the path without the slash too:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;# Mount worker1 to all urls starting with that base&lt;br /&gt;JkMount /jsp-examples/* worker1&lt;br /&gt;JkMount /jsp-examples worker1&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-115260219554072203?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/115260219554072203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=115260219554072203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115260219554072203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115260219554072203'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/07/apache-tomcat-connector-jkmount-wont.html' title='Apache Tomcat Connector (JkMount) won&apos;t work for servlet base  - without a slash'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30098697.post-115099082929322395</id><published>2006-06-23T00:08:00.000+09:30</published><updated>2006-06-23T01:31:04.040+09:30</updated><title type='text'>Progress, Java, Ruby</title><content type='html'>I've spent &lt;span style="font-style: italic;"&gt;way &lt;/span&gt;too much time working with Progress 4Gl.   It's a language whose '4'ness is due to it's tight integration with the database.&lt;br /&gt;&lt;br /&gt;You can do stuff like this:&lt;br /&gt;&lt;code&gt;FIND FIRST Order EXCLUSIVE-LOCK&lt;br /&gt; WHERE Order.OrderDate = TODAY.&lt;br /&gt;DISPLAY Order.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;A procedural style database access (over SQL's set-based style) with in-place access to tables and fields.&lt;br /&gt;&lt;br /&gt;However, it can really suck.&lt;br /&gt;&lt;br /&gt;Why? Well, you are limited in your ability to code at a higher level of abstraction.  This has hit me again and again over the last 7 years while working with a large inherited code-base.  You have no object instances, or struct's or function pointers or custom data-types.  This limits the ability to have code be concise, or readable.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;Recently I've had the interesting task of writing the same system in Progress 4GL, then Java, then Ruby (don't ask how or why!).&lt;br /&gt;&lt;br /&gt;I loved some aspects of Java:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Objects and classes - using basic classes with collaborating objects drops a tonne of 'noise' you have to maintain with Progress because of it's primitive support for abstraction&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://springframework.org/"&gt;Spring&lt;/a&gt; - I just love flinging around singleton instances, setting this on that so loosely.  Loose coupling/tight cohesion city!&lt;/li&gt;&lt;li&gt;Massive number of quality open-source libraries out there&lt;/li&gt;&lt;li&gt;IDE support - i saw 'refactoring' happen in IntelliJ, but found almost as good support in &lt;a href="http://eclipse.org"&gt;Eclipse&lt;/a&gt;.  Refactoring rules.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; Then we got onto rails, and more importantly ruby.  I've settled on ruby, I think, because the underlying philosophy seems to be about making life easier for the developer.&lt;br /&gt;&lt;br /&gt;In my opinion, the 'noise' you drop in Progress -&gt; Java is similar in Java -&gt; Ruby.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;POLS - Principal Of Least Suprise&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.martinfowler.com/bliki/HumaneInterface.html"&gt;Humane interfaces &lt;/a&gt;(multiple methods doing very similar things).   How often do I think 'wonder if this'll work', and yep, it just does, then I lookup ri and find out it's an alias.  It also makes code more readable.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Extraneous syntax can be left out - Methods don't need (),  lines don't need a terminator.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Consistancy - everything is an object.  This helps in simplifying your view on things.  Java primitives suck.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Arrays and hashes are built in - and they are objects.  Iterators work on both, and simply rock. They make complicated code compact yet readable and concise.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Operators are overloaded to work in ways that make sense.&lt;br /&gt;Eg: array1 + array2,&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Of course, rails is great with it's principle of DRY (Do nor Repeat Yourself), which is a principle I've often strived for but with limited success.&lt;br /&gt;&lt;br /&gt;I think matz, the creator of ruby, &lt;a href="http://www.artima.com/intv/ruby3.html"&gt;sums it up best:&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Often people, especially computer engineers, focus on the  machines. They think, "By doing this, the machine will run faster. By doing this, the  machine will run more effectively. By doing this, the machine will something something  something." They are focusing on machines. But in fact we need to focus on humans, on  how humans care about doing programming or operating the application of the machines.  We are the masters. They are the slaves.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I couldn't agree more.  Thank's matz.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30098697-115099082929322395?l=adzdavies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adzdavies.blogspot.com/feeds/115099082929322395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30098697&amp;postID=115099082929322395' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115099082929322395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30098697/posts/default/115099082929322395'/><link rel='alternate' type='text/html' href='http://adzdavies.blogspot.com/2006/06/progress-java-ruby.html' title='Progress, Java, Ruby'/><author><name>Adz</name><uri>http://www.blogger.com/profile/17925612974456050575</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_fG8w62VhhfM/R4ADXx7M_pI/AAAAAAAAAAM/afTn0yyMz4I/S220/sand.png'/></author><thr:total>4</thr:total></entry></feed>
