<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Tomas Varsavsky</title>
	<atom:link href="http://tomasvarsavsky.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tomasvarsavsky.com</link>
	<description>Ramblings about life, the universe and everything</description>
	<pubDate>Sat, 09 May 2009 07:41:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JAOO Sydney 2009 Review</title>
		<link>http://tomasvarsavsky.com/2009/05/09/jaoo-sydney-2009-review/</link>
		<comments>http://tomasvarsavsky.com/2009/05/09/jaoo-sydney-2009-review/#comments</comments>
		<pubDate>Sat, 09 May 2009 07:41:18 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Software]]></category>

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/?p=44</guid>
		<description><![CDATA[I was fortunate enough to go to the JAOO Sydney conference this week. I attended the first Australian JAOO in Brisbane last year which brought out a variety of international heavy hitters so my expectations were high. JAOO did not disappoint, it was a very well put together conference and I had a great time [...]]]></description>
			<content:encoded><![CDATA[<p>I was fortunate enough to go to the <a href="http://jaoo.com.au/sydney-2009/">JAOO Sydney</a> conference this week. I attended the first Australian JAOO in Brisbane last year which brought out a variety of international heavy hitters so my expectations were high. JAOO did not disappoint, it was a very well put together conference and I had a great time participating in a variety of technical and process related talks presented by local and international speakers. I came back energised and with a long run sheet of technologies and ideas to explore over the next few months.</p>
<p>The highlights for me were:</p>
<ul>
<li><a href="http://blogs.atlassian.com/rebelutionary/">Mike Cannon-Brookes</a>&#8216; talk on the great Aussie success story that is <a href="http://www.atlassian.com/">Atlassian</a>. It truly is great what a couple of smart young guys were able to achieve in such a short time. I liked the idea <a href="http://confluence.atlassian.com/display/DEV/What+is+FedEx">Fed Ex days</a>, a quarterly event where developers are encouraged to flex their creative muscle and &#8217;ship&#8217; working code within 24 hours. I also liked what they&#8217;ve done to measure productivity loops within their software development teams (e.g. code change to page refresh time, commit to build feedback time). As a consultant, I often struggle to explain to management the real cost of unproductive tools, technology and process. This sounds like a good way to go about it. On the downside, I disagree with what seems an overly formal code review process. Good teams with smart people that pair and rotate frequently should not need so much emphasis on code review.</li>
<li>Both <a href="http://www.avibryant.com/">Avi Bryant</a>&#8217;s talks. The first one was about how to improve the Ruby&#8217;s inherent performance. It was a deeply technical talk which mostly went over my head because I don&#8217;t operate in that world but it made me wish I did. His second talk followed the creative process they&#8217;ve been through to build their latest product. It really showed that a creative, iterative software development process does in the end produce a better product than careful specification.</li>
<li><a href="http://imagine-it.org/">Pamela Fox</a>&#8217;s talk on <a href="http://code.google.com/appengine/">Google App Engine</a>. She made what could have been a boring feature walkthrough presentation into a greatly entertaining experience by building the <a href="http://best-website-ever.appspot.com/">Best Website Ever</a> before our eyes, complete with frames, marquee tags, animated gifs, web ring, pumping techno and spam!</li>
<li><a href="http://www.jamesward.com/blog/">James Ward</a>&#8217;s walkthrough of <a href="http://www.adobe.com/products/flex/">Adobe Flex</a> was a surprising delighter. I have a suspicion that when building rich client applications we&#8217;re pushing html, css and javascript to extremes that they were never designed to go and we are feeling much development pain as a consequence. Could Flex or Silverlight be the answer? I don&#8217;t know. </li>
</ul>
<p>I didn&#8217;t go to see talks given by ThoughtWorkers (I&#8217;ve seen it all before) but by all accounts <a href="http://dannorth.net/">Dan North</a>&#8217;s Pimp &#8216;My Architecture&#8217; and <a href="http://erik.doernenburg.com/">Erik Doernenburg</a>&#8217;s &#8216;Builds: From Good to Great&#8217; were both excellent. </p>
<p>I understand that JAOO had some trouble with attendance this year due to many companies cutting back on discretionary spending. It&#8217;s a shame, conferences are the best bang-for-buck when it comes to career development. Hopefully the organisers won&#8217;t be discouraged by this and come back next year for another great round. Even better, maybe they&#8217;ll consider doing a tour of duty through Melbourne!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2009/05/09/jaoo-sydney-2009-review/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple Word document templating using Ruby and XML</title>
		<link>http://tomasvarsavsky.com/2009/04/04/simple-word-document-templating-using-ruby-and-xml/</link>
		<comments>http://tomasvarsavsky.com/2009/04/04/simple-word-document-templating-using-ruby-and-xml/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 07:24:00 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/?p=28</guid>
		<description><![CDATA[In my current project we have a requirement to merge simple data into Microsoft Word document templates. Ruby comes with the WIN32OLE library which can manipulate Office documents. WIN32OLE has a few major downsides &#8212; it only runs on Windows, it requires Microsoft Office to be installed and it works by sending commands to Word [...]]]></description>
			<content:encoded><![CDATA[<p>In my current project we have a requirement to merge simple data into Microsoft Word document templates. Ruby comes with the <a href="http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html">WIN32OLE</a> library which can manipulate Office documents. WIN32OLE has a few major downsides &#8212; it only runs on Windows, it requires Microsoft Office to be installed and it works by sending commands to Word itself to perform operations. Using Word as a back end system for a web application used by 50 people made us nervous so a different approach was needed. We came up with a combination of Ruby, <a href="http://en.wikipedia.org/wiki/Docx">Office Open XML</a> file format, XML processing with <a href="http://nokogiri.rubyforge.org/">Nokogiri</a> and native Zip libraries that works.</p>
<p><strong>Office Open XML file formats</strong></p>
<p>The new Office file formats (.docx, .xlsx, .pptx files) are basically a zipped collection of XML files. We focused on Word files (.docx) but this approach would work with any of the other types of files as well. The specification for the format weighs in at several thousand pages. Producing a file from scratch without a purpose built library that handles all the intricacies of the format would be quite a task. Instead, we drafted the templates in Word and placed markers to tell our templating engine where to insert values. We created document properties which reference data values and added these as fields into the document in the place where the values should be inserted. For example, we could have fields like:</p>
<ul>
<li>label_tag #{data[:user].name}</li>
<li>label_tag #{data[:user].address}</li>
<li>label_tag #{data[:booking].number}</li>
<li>label_tag #{data[:booking].items.collect{|i| i.name}.join(&#8217;,')}</li>
</ul>
<p>If it looks a bit like Ruby code, it&#8217;s because it is! The expressions get evaluated by our templating engine and the results are inserted into the document. Ruby in Word documents, a world first?</p>
<p><strong>Opening the documents</strong></p>
<p>To read and create documents we need to unzip and re-zip the document. We had trouble using Ruby&#8217;s standard RubyZip library. For some reason Word gave a nasty warning when opening files created with RubyZip. Our application has to run on Windows, Linux and Mac so we created an adapter that delegated to standard operating system zip executables based on the host platform. To keep it fast, we extract and re-added only the files that we need to work on. This is important because some documents can become very large when they contain embedded objects such as images. </p>
<p><strong>Processing the template</strong> </p>
<p>The document content can be found in the file <em>word/document.xml</em> inside the zip archive. The fields in the template come out as fldSimple tags that look like this:</p>
<textarea name="code" class="xml:nocontrols:nogutter" cols="60" rows="10">
  <w:fldSimple w:instr=" DOCPROPERTY  label_tag #{data[:user].name}  \* MERGEFORMAT ">
      <w:r>
          <w:t>Template Field: User Name</w:t>
      </w:r>
  </w:fldSimple>
</textarea>
<p>To process the <em>document.xml</em> we simply need to find all the fields that have the text <em>label_tag</em> in the <em>w:instr</em> attribute:</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
        xml.xpath("//w:fldSimple[contains(@w:instr, 'label_tag')]").each do |element|
          # process each element here
        end
</textarea>
<p>The rest is simple. We extract the expression in the element text using a regular expression, evaluate it and insert it back into the XML which ends up looking like this:</p>
<textarea name="code" class="xml:nocontrols:nogutter" cols="60" rows="10">
  <w:fldSimple w:instr=" DOCPROPERTY  label_tag #{data[:user].name}  \* MERGEFORMAT " w:fldLock="true">
      <w:r>
          <w:t>Tomas Varsasvky</w:t>
      </w:r>
  </w:fldSimple>
</textarea>
<p>We add the attribute <em>fldLock</em> with value <em>true</em> to make the field read-only so the user cannot change it when they open the document.</p>
<p>We also have tags to create lists, insert rows into tables and duplicate sections in the document. These are a bit more complicated in their XML manipulation. Beware, we had a few issues dealing with Word&#8217;s nasty XML which can vary a bit between versions and sometimes do unexpected things with formatting.</p>
<p><strong>Conclusion</strong></p>
<p>This approach worked really well for us and I would recommend it for simple field merging. </p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2009/04/04/simple-word-document-templating-using-ruby-and-xml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BarCampMelbourne2008</title>
		<link>http://tomasvarsavsky.com/2008/02/25/barcampmelbourne2008/</link>
		<comments>http://tomasvarsavsky.com/2008/02/25/barcampmelbourne2008/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 01:34:03 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://tomasvarsavsky.com/2008/02/25/barcampmelbourne2008/</guid>
		<description><![CDATA[Last weekend I had a blast attending my first BarCamp held at the ThoughtWorks office in Melbourne. The concept is powerfully simple: get a bunch of like minded people together and interesting conversations will ensue. The attendees represented a cross section of disciplines in the IT industry that you don&#8217;t usually find in technology specific [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I had a blast attending my first <a href="http://barcampmelbourne.org/">BarCamp</a> held at the <a href="http://www.thoughtworks.com">ThoughtWorks</a> office in Melbourne. The concept is powerfully simple: get a bunch of like minded people together and interesting conversations will ensue. The attendees represented a cross section of disciplines in the IT industry that you don&#8217;t usually find in technology specific user groups, producing a variety of interesting presentations. </p>
<p>Many thanks to <a href="http://benbalbo.com/">Ben</a> and the team for organising, I&#8217;ll be back next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2008/02/25/barcampmelbourne2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TODO: Learn stuff</title>
		<link>http://tomasvarsavsky.com/2008/02/25/todo-learn-stuff/</link>
		<comments>http://tomasvarsavsky.com/2008/02/25/todo-learn-stuff/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 01:08:00 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://tomasvarsavsky.com/2008/02/25/todo-learn-stuff/</guid>
		<description><![CDATA[I keep a list of &#8220;interesting things to look sometime maybe&#8221; which I add to when I come across something that I should learn more about. This list has grown over the last few months because I&#8217;ve been busy with client work, the birth of my daughter, landscaping my back yard and &#60;insert more excuses [...]]]></description>
			<content:encoded><![CDATA[<p>I keep a list of &#8220;interesting things to look sometime maybe&#8221; which I add to when I come across something that I should learn more about. This list has grown over the last few months because I&#8217;ve been busy with client work, the birth of my <a href="http://flickr.com/photos/tvars/collections/72157603926618551/">daughter</a>, landscaping my back yard and &lt;insert more excuses here&gt;. But today is my lucky day! I finished a client assignment last week and I have a few days up my sleeve before the next one starts. </p>
<p>Here are the high priority items on the list as it stands now. </p>
<ul>
<li><a href="http://www.scala-lang.org/">Scala</a></li>
<li><a href="http://www.erlang.org/">Erlang</a></li>
<li><a href="http://rmock.sourceforge.net/">RMock</a></li>
<li><a href="http://rspec.info/">RSpec Story Framework</a></li>
<li><a href="http://wicket.apache.org/">Wicket</a></li>
<li><a href="http://www.jboss.com/products/seam">Seam</a></li>
<li><a href="http://www.ruby-lang.org">Ruby 1.9</a> new features</li>
<li>Virtualisation with <a href="http://www.vmware.com/">VMware</a> and <a href="http://www.virtualbox.org/">VirtualBox</a></li>
<li><a href="http://git.or.cz/">Git</a> and <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a></li>
<li>Read some of the books collecting dust on my bookshelf (<a href="http://www.amazon.com/Lean-Thinking-Corporation-Revised-Updated/dp/0743249275/ref=pd_bbs_2?ie=UTF8&#038;s=books&#038;qid=1203901092&#038;sr=8-2">Lean Thinking</a>, <a href="http://www.amazon.com/User-Stories-Applied-Development-Addison-Wesley/dp/0321205685/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1203901168&#038;sr=1-1">User Stories Applied</a>, <a href="http://www.amazon.com/Agile-Estimating-Planning-Robert-Martin/dp/0131479415/ref=pd_bbs_2?ie=UTF8&#038;s=books&#038;qid=1203901168&#038;sr=1-2">Agile Estimating and Planning</a>, <a href="http://www.amazon.com/Blink-Power-Thinking-Without/dp/0316010669/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1203901214&#038;sr=1-1">Blink</a>, <a href="http://www.amazon.com/Tipping-Point-Little-Things-Difference/dp/0316346624/ref=pd_bbs_2?ie=UTF8&#038;s=books&#038;qid=1203901214&#038;sr=1-2">The Tipping Point</a>, <a href="http://www.amazon.com/Freakonomics-Revised-Expanded-Economist-Everything/dp/0061234001/ref=pd_bbs_3?ie=UTF8&#038;s=books&#038;qid=1203901214&#038;sr=1-3">Freakonomics</a>)</li>
</ul>
<p>Let&#8217;s see how many I can get through before consulting reality spoils the party.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2008/02/25/todo-learn-stuff/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Virtualised Ruby on Rails development environment for dummies</title>
		<link>http://tomasvarsavsky.com/2008/02/25/virtualised-ruby-on-rails-development-environment-for-dummies/</link>
		<comments>http://tomasvarsavsky.com/2008/02/25/virtualised-ruby-on-rails-development-environment-for-dummies/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 23:38:46 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

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

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/2008/02/25/virtualised-ruby-on-rails-development-environment-for-dummies/</guid>
		<description><![CDATA[Ruby development was always meant to be done on a *nix platform. For a while now I&#8217;ve been putting up with the Windows XP / Cygwin combination on my laptop to give me a pseudo-*nix environment. While this is a workable compromise, it is far from ideal. A lot of the Ruby tools don&#8217;t work [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby development was always meant to be done on a *nix platform. For a while now I&#8217;ve been putting up with the Windows XP / <a href="http://www.cygwin.com/">Cygwin</a> combination on my laptop to give me a pseudo-*nix environment. While this is a workable compromise, it is far from ideal. A lot of the Ruby tools don&#8217;t work well on Cygwin: crashes and mysterious hangings are common, execution times are slow and frustration is high.</p>
<p>The common solution to this problem is a walk to the closest Apple shop to get a shiny new Mac, but I&#8217;m not cool enough for a Mac so I decided to try something more befitting my coolness level: A Linux virtual machine running on my Dell laptop. </p>
<p>These are the steps you need to get a Ubuntu Virtual Machine running Rails over MySQL on your Windows machine.</p>
<p><strong>Step 1: Setup a Virtual Machine (VM)</strong></p>
<p>First we need to get a virtual machine configured and running with a *nix Operating System. I&#8217;ve chosen Ubuntu Server because all I need is shell access. You can use Ubuntu Desktop if you plan to use the VM as your development desktop.</p>
<ol>
<li>Download the latest version of <a href="http://www.vmware.com/download/server/">VMware Server</a> or <a href="http://www.vmware.com/download/player/">VMware Player</a>. VMware Player is a lighter download but can only operate VMs, VMware server can operate and create VMs. Either will work for our purposes, I used VMware Server.</li>
<li>Download and unzip the latest <a href="http://www.thoughtpolice.co.uk/vmware/">Ubuntu Server VMware image</a>. I used version 7.10 Gutsy Gibbon.</li>
<li>Start VMware Server, point it at the downloaded image and start it.</li>
<li>The virtual machine will start up and should come up with a login prompt. Hit Enter a couple of times on the console if it doesn&#8217;t.</li>
</ol>
<p><strong>Step 2: Get access</strong></p>
<p>In this step we create a user on the VM and configure it for external shell access through SSH.</p>
<ol>
<li>Login using the username &#8220;notroot&#8221; and the password &#8220;thoughtpolice&#8221;.</li>
<li>Install OpenSSH.</li>
<p><em>&gt; sudo apt-get install ssh</em></p>
<li>Create yourself a user.</li>
<p><em>&gt; sudo adduser &#8211;shell /bin/bash &lt;user_name&gt;</em></p>
<li>Add the user to the admin group (so they can do sudo, you can play around with sudoedit instead if you like).</li>
<p><em>&gt; sudo usermod -g admin &lt;user_name&gt;</em></p>
<li>Get the IP address of the virtual machine.</li>
<p><em>&gt; sudo ifconfig eth0</em></p>
<li>Fire up your favourite terminal program (I use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>) and SSH to the VM using the user you created above.</li>
</ol>
<p><strong>Step 3: Install Ruby, Ruby on Rails and MySQL</strong></p>
<p>Now we install some core development packages.</p>
<ol>
<li>Update the package index.</li>
<p><em>&gt; sudo apt-get update</em></p>
<li>Install Ruby and related tools.</li>
<p><em>&gt; sudo apt-get install ruby rubygems irb ri rdoc ruby1.8-dev build-essential</em></p>
<li>Install Ruby on Rails.</li>
<p><em>&gt; sudo apt-get install rails</em></p>
<li>Install MySQL.</li>
<p><em>&gt; sudo apt-get install mysql-server</em>
</ol>
<p><strong>Step 4: Create a Rails project and fire it up</strong></p>
<p>We have everything we need, let&#8217;s create a Rails project and access it from Windows.</p>
<ol>
<li>Create a Rails project in your home directory.</li>
<p><em>&gt; cd ~/projects<br />
&gt; rails killerapp<br />
&gt; cd killerapp</em></p>
<li>Create a database.</li>
<p><em>&gt; mysqladmin -u root -p create killerapp_development</em></p>
<li>Configure the database in your Rail application config/database.yml.</li>
<li>Start the WEBrick server. You have to bind it to the external IP address (not localhost) to make it available though windows.</li>
<p><em>&gt; ./scripts/server -b &lt;vm_ip_address&gt; &#038;</em></p>
<li>On your favourite Windows browser, navigate to: http://&lt;vm_ip_address&gt;:3000/.The default Rails landing page should come up! You can add this IP address to the Windows hosts file to avoid having to remember it.</li>
</ol>
<p><strong>Step 5: Set up Samba (optional)</strong></p>
<p>It&#8217;s useful to be able to share files between the VM and Windows, especially if you plan to use a Windows based IDE like Eclipse to craft your code. VMware has a &#8220;Shared Folders&#8221; feature but I gave up trying to get it to work after several hours of bashing my head against Google. I reverted back to Samba, which is trivial to configure.</p>
<ol>
<li>Install Samba.</li>
<p><em>&gt; sudo apt-get install samba</em></p>
<li>Add the user to the smbpasswd file.</li>
<p><em>&gt; sudo smbpasswd -a &lt;user_name&gt;</em></p>
<li>Open the Samba configuration file for editing.</li>
<p><em>&gt; sudo vi /etc/samba/smb.conf</em></p>
<li>Remove the &#8216;;&#8217; from the line that says &#8220;security = user,&#8221;.</li>
<li>Add the following to the end of the file.</li>
<p><em>[&lt;user_name&gt;]<br />
path = /home/&lt;user_name&gt;<br />
valid users = &lt;user_name&gt;<br />
read only = No<br />
create mask = 0777<br />
directory mask = 0777</em></p>
<li>Save and close the file.</li>
<li>Restart Samba.</li>
<p><em>&gt; sudo /etc/init.d/samba restart</em></p>
<li>On Windows Explorer, Map Network Drive \\&lt;vm_ip_address&gt;\&lt;user_name&gt;, login using &#8220;&lt;user_name&gt;&#8221;.</li>
</ol>
<p>That&#8217;s it! I haven&#8217;t used this environment in anger yet so there are bound to be some holes, let me know if you fall into any.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2008/02/25/virtualised-ruby-on-rails-development-environment-for-dummies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code complexity vs size</title>
		<link>http://tomasvarsavsky.com/2007/12/22/code-complexity-vs-size/</link>
		<comments>http://tomasvarsavsky.com/2007/12/22/code-complexity-vs-size/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 01:16:59 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Java]]></category>

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

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/2007/12/22/code-complexity-vs-size/</guid>
		<description><![CDATA[Steve Yegge (one of my favourite bloggers) recently posted about the maintenance problems exhibited by a large Java code base. I agree that software bloat is one of the biggest problems in our industry right now. 
His proposed solution is to re-implement the 500,000 lines of Java code into 150,000 lines of a more concise [...]]]></description>
			<content:encoded><![CDATA[<p>Steve Yegge (one of my favourite bloggers) <a href="http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html">recently posted</a> about the maintenance problems exhibited by a large Java code base. I agree that software bloat is one of the biggest problems in our industry right now. </p>
<p>His proposed solution is to re-implement the 500,000 lines of Java code into 150,000 lines of a more concise language such as Ruby or JavaScript (ES4). This approach seems misguided to me because software complexity is not directly proportional to number of lines of code. The fact that 5 lines of Java can sometimes be compressed into 1 line of Ruby does not make the logic less complex or easier to maintain if they are essentially doing the same thing. In fact, I would argue that often 1 line of clever Ruby is actually less maintainable that 5 lines of Java because it requires a deeper understanding of what&#8217;s going on underneath the covers. </p>
<p>A good case study is Perl where developers seem to be a mind set of &#8220;how clever can I be&#8221; and write one liners that become indecipherable even by the author within days. You might be able to get away with this if you&#8217;re a gun developer working on your own but not if you&#8217;re working in an average team of average developers. I think Ruby has actually struck a nice balance between readability and conciseness and this is one of the reasons why its popularity has surged. Still, the thought of a 150,000 line Ruby code base scares me and would keep me up at night if it was left in the hands of average developers.</p>
<p>A code base with 1000 Java classes is just a complex as a code base with 1000 equivalent Ruby classes even if the number of lines per class is less. Reducing complexity and therefore increasing maintainability is all about applying good software engineering principles and frequent doses of my favourite refactoring &#8212; <em>Delete</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2007/12/22/code-complexity-vs-size/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CruiseControl permanent link to latest successful build</title>
		<link>http://tomasvarsavsky.com/2007/11/13/cruisecontrol-permanent-link-to-latest-successful-build/</link>
		<comments>http://tomasvarsavsky.com/2007/11/13/cruisecontrol-permanent-link-to-latest-successful-build/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 10:27:46 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Build]]></category>

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

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/2007/11/13/cruisecontrol-permanent-link-to-latest-successful-build/</guid>
		<description><![CDATA[In my current project we have some deployment scripts written in Ant. We can deploy a new version of the application as built by CruiseControl by running the command &#8220;ant deploy-war -Dwarfile=http://cruise-box/artifacts/killer_app/BUILD_TIMESTAMP/killer_app.war&#8220;.

Most of the time we want to deploy the latest successful build. We manually get the timestamp of the build from the CruiseControl dashboard [...]]]></description>
			<content:encoded><![CDATA[<p>In my current project we have some deployment scripts written in <a href="http://ant.apache.org/">Ant</a>. We can deploy a new version of the application as built by <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> by running the command &#8220;<strong>ant deploy-war -Dwarfile=http://cruise-box/artifacts/killer_app/<strong>BUILD_TIMESTAMP</strong>/killer_app.war</strong>&#8220;.<br />
</code><br />
Most of the time we want to deploy the latest successful build. We manually get the timestamp of the build from the CruiseControl dashboard and substitute it into the command above. It would be nice to default the <em>warfile</em> property to the latest successful build. For that we need CruiseControl to give us a well known link to the latest successful build. </p>
<p>I solved this problem using symbolic links. We can do this because our CruiseControl server runs on Linux but we could have achieved a similar result with a file system copy or an artifact publisher under Windows. I created the following helper Ant script to create a symbolic link using the <a href="http://ant.apache.org/manual/OptionalTasks/symlink.html">Symlink</a> task.</p>
<textarea name="code" class="xml:nocontrols:nogutter" cols="60" rows="10">
<project name="symlink" default="symlink">
  <property environment="env" />
  <target name="symlink">
    <symlink 
      link="/cruise/artifacts/${projectname}/latest-successful"
      resource="/cruise/artifacts/${projectname}/${cctimestamp}"
      overwrite="true"/>
  </target> 
</project>
</textarea>
<p>I then added a call to the helper script in the CruiseControl <em>config.xml</em> as an Ant publisher executed after a successful build.</p>
<textarea name="code" class="xml:nocontrols:nogutter" cols="60" rows="10">
<publishers>
  <onsuccess>
    <antpublisher buildfile="symlink.xml"/>
  </onsuccess>
</publishers>
</textarea>
<p>I had to do it in an Ant script rather than calling the <em>ln</em> command directly with an execute publisher because I couldn&#8217;t work out how to access the build timestamp from within CruiseControl&#8217;s <em>config.xml</em>. </p>
<p>We can now access the latest successful build through the URL <em>http://cruise-box/artifacts/killer_app/latest-successful/killer_app.war</em>. The last step is to default the <em>warfile</em> property in our deployment scripts to this URL. We can now run &#8220;<strong>ant deploy-war</strong>&#8221; to deploy the latest successful build, or provide the property as before to deploy a different build.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2007/11/13/cruisecontrol-permanent-link-to-latest-successful-build/feed/</wfw:commentRss>
		</item>
		<item>
		<title>/me LOLZ @ LOLCODE</title>
		<link>http://tomasvarsavsky.com/2007/10/01/me-lolz-lolcode/</link>
		<comments>http://tomasvarsavsky.com/2007/10/01/me-lolz-lolcode/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 12:02:22 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Funny]]></category>

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/2007/10/01/me-lolz-lolcode/</guid>
		<description><![CDATA[LOLCODE - Finally, a Domain Specific Language for the masses! Here&#8217;s a couple of examples taken from the website:

BTW Hello world!
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE


BTW Count to 10
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
	UPZ VAR!!1
	VISIBLE VAR
	IZ VAR BIGR THAN 10? GTFO. KTHX
KTHX
KTHXBYE

There&#8217;s nothing like a joke that takes 15 years of education and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lolcode.com/">LOLCODE</a> - Finally, a Domain Specific Language for the masses! Here&#8217;s a couple of examples taken from the website:</p>
<textarea name="code" class="java:nocontrols:nogutter" cols="60" rows="10">
BTW Hello world!
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
</textarea>
<textarea name="code" class="java:nocontrols:nogutter" cols="60" rows="10">
BTW Count to 10
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
	UPZ VAR!!1
	VISIBLE VAR
	IZ VAR BIGR THAN 10? GTFO. KTHX
KTHX
KTHXBYE
</textarea>
<p>There&#8217;s nothing like a joke that takes 15 years of education and work experience to appreciate.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2007/10/01/me-lolz-lolcode/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Evaluating OpenCms, Alfresco and Liferay</title>
		<link>http://tomasvarsavsky.com/2007/09/21/evaluating-opencms-alfresco-and-liferay/</link>
		<comments>http://tomasvarsavsky.com/2007/09/21/evaluating-opencms-alfresco-and-liferay/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 06:30:21 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Java]]></category>

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

		<guid isPermaLink="false">http://tomasvarsavsky.com/2007/09/21/evaluating-opencms-alfresco-and-liferay/</guid>
		<description><![CDATA[I spent this week doing a proof of concept time-boxed to one week for a client that wants a new corporate intranet. The first step was to choose a technology stack.
I have experience with some heavy weight commercial Content Management and Portal products that play in this space but all of these are expensive and [...]]]></description>
			<content:encoded><![CDATA[<p>I spent this week doing a proof of concept time-boxed to one week for a client that wants a new corporate intranet. The first step was to choose a technology stack.</p>
<p>I have experience with some heavy weight commercial <a href="http://en.wikipedia.org/wiki/Content_management_system">Content Management</a> and <a href="http://en.wikipedia.org/wiki/Enterprise_portal">Portal</a> products that play in this space but all of these are expensive and probably an overkill for a intranet. The majority of the client&#8217;s requirements are to do with basic web content management so I went on the prowl for Java open source solutions to the problem. I spent around three to four hours installing and playing around with some open source products that have enterprise level support available through backing companies.</p>
<p><a href="http://www.opencms.org/">OpenCms 7</a> &#8212; OpenCms is a web content management system and nothing more. It was trivially simple to install and get going with MySql. It gives you a tree view of your web projects and you can go about managing content in the same way that you would in a file system. You do your work in an &#8220;offline project&#8221; and publish changes in batch when ready. I found changing the look and feel and layout non intuitive at first but it was ok once I worked out that my site was based on the &#8220;templateone&#8221; module and most of the styling and layout could be driven from properties in the document tree. OpenCms supports XML content that you can define and author through an automatically generated web form and then access from JSPs. The bundled documentation is good and finding help online is easy. </p>
<p><a href="http://www.alfresco.com/">Alfresco Community 2.1 + Web Content Management extension</a> &#8212; Alfresco is a lot more than web content management system. At it&#8217;s core it is a document management and collaboration tool that is trying to compete with products like <a href="http://www.microsoft.com/sharepoint">Microsoft Sharepoint</a>. It has team spaces where users can author, manage, version control and share documents as well as participate in discussion forums. Users can access the content repository through a sleek looking web interface or directly from Windows using various plugins. Content can also be accessed through a web service API. The Web Content Management extension adds the ability to create web projects and publish web content. A really cool feature is the ability to deploy dynamic web projects (i.e. WAR files) that are developed outside of Alfresco. I tried this out by creating a simple web application using <a href="http://opensymphony.com/sitemesh/">Sitemesh</a> to control the layout. As a Java developer I found this much more in tune to my way of developing software. In terms of support there&#8217;s a website, a wiki and forums but I found it very hard to get useful information. Even something basic like installation instructions are incomplete and all over the place. Alfresco is more feature rich than OpenCms and with that comes extra complexity which led to frustrating attempts at implementing more complex things like XML based web content. Overall I was quite impressed with Alfresco and can see the potential to do some really cool stuff in it. Unfortunately, due to the learning curve, lacklustre documentation and short amount of disposable time I abandoned Alfresco as an option. I will re-visit it when I have more time. </p>
<p><a href="http://www.liferay.com/">Liferay 4.3</a> &#8212; Liferay is an open source Portal product. I have a healthy dose of skepticism towards Portal products brought about by a few bad project experiences. Liferay was easy to install and get going, it comes bundled with Tomcat and runs on HSQLDB by default. Liferay comes with a lot of collaboration Portlets like wikis, forums, news, document sharing and calendars out of the box although I get the feeling that they are all quite basic. For example, the wiki Portlet is very simple and lacks a lot of the features that one would expect in a fully fledged wiki product like <a href="http://www.atlassian.com/software/confluence/">Confluence</a>. A core feature of any Portal product is the ability for each user to create their own mash-up of Portlets and Liferay supports that well. I found the administration Portlets to be slow and hard to navigate around. Overall I was impressed with the breadth of Liferay but not so much with the depth. I abandoned it as an option, mostly because it&#8217;s feature rich in all the wrong places and a general belief that Portals are evil.</p>
<p>In the end I chose OpenCms as &#8220;the simplest thing that works&#8221; and spent 2.5 days spiking an Intranet on it. In that time I was able build:</p>
<ul>
<li>A branded intranet</li>
<li>News page</li>
<li>Job board</li>
<li>General web content pages</li>
<li>Document attachments</li>
<li>A tree view of documents</li>
<li>Integration to a Java based forum through an iframe</li>
<li>Some rich ajaxy pages using <a href="http://extjs.com/">Ext JS</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2007/09/21/evaluating-opencms-alfresco-and-liferay/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My dog is on Facebook - Are you?</title>
		<link>http://tomasvarsavsky.com/2007/09/07/my-dog-is-on-facebook-are-you/</link>
		<comments>http://tomasvarsavsky.com/2007/09/07/my-dog-is-on-facebook-are-you/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 12:06:51 +0000</pubDate>
		<dc:creator>Tomas Varsavsky</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://tomasvarsavsky.com/2007/09/07/my-dog-is-on-facebook-are-you/</guid>
		<description><![CDATA[
A work colleague of mine and I constantly banter about his refusal to embrace Facebook. He cites the ridiculousness of it as his primary reason. I&#8217;m starting to see his point.
]]></description>
			<content:encoded><![CDATA[<p align="center"><img src='http://tomasvarsavsky.com/wp-content/uploads/2007/09/leo_on_facebook_small1.jpg' alt='Leo on Facebook' /></p>
<p>A work colleague of mine and I constantly banter about his refusal to embrace <a href="http://facebook.com">Facebook</a>. He cites the ridiculousness of it as his primary reason. I&#8217;m starting to see his point.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomasvarsavsky.com/2007/09/07/my-dog-is-on-facebook-are-you/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
