Author Archive

Ruby Fools conference in Copenhagen

April 3, 2008

So we went to the Ruby Fools conference here in Copenhagen and this post kind of sums up my experience of the different speakers. The conference went over two days and had three tracks. I primarily focused on the Advanced Rails stuff. I’ll probably update this post once you can download the presentation slides (and video).

Tuesday:

Dave Thomas explained in his opening keynote why he is a Ruby Fool :). He’s gave a great performance about his passion for Ruby and went on to compare the sudden rush of developers coming to the platform with Rails to “golddiggers and prostitutes” (before Ruby was this nice little settlement, and suddenly everyone wanted to join). That of course hit pretty much 80% of the people sitting in on the keynote. Great stuff :D.

REST: A pragmatic introduction to the Web’s architecture by Stefan Tilkov. While REST is not that new to us, and the speak therefore didn’t provide much to us, Stefan was great to talk with and I threw a few ideas on him about some of our challenges with REST (like, what do you do when you’re implementing a dashboard with some functionality also found in other places of the system – expect a new blog post on this).

Tuning the Rails stack by James Cox. Since tuning involves turning alot of knobs al over, this is not an exact science, but he did give som nice pointers on e.g. MySQL tuning and also told a few scary stories on applications that didn’t scale. On a side note, he had the coolest presentation slides (well, not really slides, I think he said it was a flash movie :))

Advanced Ruby on Rails security by Heiko Webers. I’m having my doubts on what to write here. Let me first say that the content of the presentation was great and very “german”. It was “Do this/Don’t do this”. Great stuff. No room for interpretation and once the slides are downloadable I’ll probably run through every slide while looking on our own TBA application :). Unfortunately Heiko wasn’t the great presenter and while the slides was clear, he pretty much just read them out loud, but was in trouble whenever he had to explain something that wasn’t on them.

Meta-meta programming by Nic Williams – man I love this guy.

1) The presentation was close to useless when looking at the use cases where this can be applied.
2) The subject was VERY technical

And yet… This was perhaps one of the greatest presentations due to the amount of humor and general relaxed style of Nic. Basically everyone knows meta programming, so meta-meta programming was the meta programming of meta programming. The easiest explained example in rails terms is a generator that generates generators (as I said… Not the most common use case :))

Party keynote by Evan Phoenix. A couple of sponsors had provided food and beverages so of course there was a “party keynote” (Dave Thomas wanted to swap keynote with Evan :)). While I have a great respect for Evan, the keynote was close to “not relevant at all” to me. He basically explained how he does project management on the open source project Rubinius. I’ve haven’t been in a open source project before, but what he presented was pretty much “be nice and positive to people”. There was some debate about the policy on the project that once you committed your first patch you get full commit access to the project. While it certainly works for him, I’m still having my doubts.

Wednesday

Keynote: Ruby: Past, Present and Future by Yukihiro “Matz” Matsumoto. This whas great to here it from the creator himself. There weren’t many surprises about Ruby it self, but it was great to hear about what his thoughts was on other languages and why he then went on to create Ruby. The future part was a bit cutted off because he spent a little too long bitching about character encoding (UTF-8,16,32). It was clearly something that he’s spent a lot of time on with the 1.9 release.

Versioning your data model by Ole Friis Østergaard. The presentation explained 4-5 different plugins that had something to do with versioning (also an undo redo plugin that actually looks rather nice) – including his own new plugin Subversive. I kind of noted that this was actually one of the first presentations that actually showed “real live code”.

Adding full text search to your Rails application by Jørgen Erichsen. We’re currently also implementing the search enginge Solr into our own application so this presentation was a must see. While Jørgen went through the basics of the search engine and the acts_as_solr plugin (as well as Ferret and also briefly mentioned a couple of other solutions), he didn’t seem that knowledgeable about the subject when getting to stuff outside the basic behavior of the product.

The dark art of developing plugins by James Adam. This was great. James presentation was very pedagogical buildig a plugin step by step explaining every bit of the way. While plugin development aren’t that difficult to grap, it certainly put one or two thing in place for me. I’m looking forwards to his slides so I can wrap our authorization for our application up in a plugin.

After this I unfortunely had to leave because of another engangement. So I missed one speaker as well as the ending panel discussion.

Overall the conference was well planned and executed. You could perhaps argue that it is limited what you will learn in one hour presentations, but I could just have attended the workshops leading up to the conference. As a last note… The track introductions seemed a bit off = 30 minutes break – 15 minutes track introduction – 15 minutes break (though Glenn Vanderburg was quite good.

Shrink your Windows disk image on VMWare Fusion (Mac)

March 31, 2008

It is possible to free up quite a bit of hard disk space by compacting your virtual disks for VMWare.

Here is a easy (manual) way to shrink a Windows guest image hosted on VMWare Fusion for Mac OS. I have used the recipe below to successfully save about 50% of disk space for a Windows 2003 R2 guest image on Mac OS 10.5.2 running VMWare Fusion 1.1.1. Other Windows guest OS’s like Windows 95, 98, NT 4.0, Win2K, XP should work with this recipe as well, although this is untested at this time.

Warning: This recipe may/may not work for you. Beware of the risk! Remember to backup your disk image before messing with it. Finally, do not shrink a disk with snapshots as this is known NOT to work!! Update: See additional recipe at bottom of this post for how to deal with snapshots.

Shrink recipe:

  1. First backup your guest os disk image and other files (just in case something goes wrong) + make sure you have plenty of spare disk space on your harddrive.
  2. Start Windows guest OS in VMWare Fusion and login as administrator
  3. Clean up & defrag guest OS disk image from within guest OS
    * Delete all unused files, empty your trash can, delete your browser cache etc.
    * Defragment your guest OS (f.x. using “defrag c:” in the cmd prompt).
  4. Zero out unused disk space in guest OS disk image
    * Download Mark Russinovich’s disk erase tool SDelete v1.51+ and place it on the local guest drive (*1).
    * From a command prompt navigate to where you saved the above delete tool and write “sdelete -c c:”, which will clear all free disk space
  5. Close guest OS and VMWare
    * Shutdown your Windows guest OS.
    * Quit VMWare fusion
  6. Shrink disk image using VMWare’s diskTool
    * Navigate to the VMWare Fusion tools directory. E.g. type “cd /Applications/VMware Fusion.app/Contents/MacOS”
    * Run VMWare Fusion’s diskTool command with the shrink option “-k” to compact your virtual drive (*.vmdk). E.g. type “./diskTool -k 0 full-path-to-your-virtual-desk-image.vmdk”. (*2)
  7. Finished!

*1) Nb. this erase tool is not documented to be compatible with Windows 2003/XP, but it works just fine on on my Win2003 R2 (as far as I can tell).

*2) Do remember the “./” when running diskTool to avoid mis-executing the Mac OS disk tool with the same name instead.

UPDATE – QUICK SNAPSHOTS CONSOLIDATION TIP:

If your disk image has snapshots you need to consolidate those into one large disk before attempting the above recipe. You can create a single disk image by cloning (merging) your disks using VMWare’s diskCreate tool (located in same folder as diskTool). The procedure is:

  1. Again backup your stuff first in case things go wrong (and again make sure you have plenty of spare disk space).
  2. Create a new folder with the extesion .vmwarevm to hold the output files.
  3. Navigate to the VMWare Fusion tools directory. E.g. type “cd /Applications/VMware Fusion.app/Contents/MacOS”
  4. “./diskCreate -C path-to-latest-snapshort-vmdk-file.vmdk path-to-new-merged-disk-file.vmdk” (use output folder above for destination).
  5. Copy the .vmx , .vmdk and .vmxf files into the output folder. Use a texteditor to edit the .vmx (and .vmxf) files to reflect the new disk file name.
  6. Test that the new consolidated image works in VMWare fusion.
  7. You can now proceed to the recipe for shrinking your disk.

Using ExtJS tree on rails with the prototype adapter

February 22, 2008

UPDATE: Notice that the new version of ExtJS is now on Prototype 1.6, yeah…

So I’m doing a folder tree using the ExtJS javascript with the prototype library adapter. I’m pretty much doing this.

This was somewhat working. Every third or forth browser refresh the tree didn’t load any nodes. Very odd indeed. I debugged my way through using Firebug, but when this was on, it worked everytime. Since Firebug slows down the entire javascript environment I concluded that the error occured when something (or loading) happened too fast.

In the ext-all-debug.js (version 2.0.1) I tracked the error down to line 23754. The json result being evaluated is undefined (notice that this only happens some of the time). So… after hours of head scratching and putting alerts in both the prototype library and ExtJS library to see what was wrong, it hit me…

The version ExtJS I have, come bundled with prototype 1.5.0 while rails 2.0.2 comes with prototype 1.6.0.1. In my layout I simply included <%= javascript_include_tag :defaults %>, but after I changed this to:

<%= javascript_include_tag “application.js” %>
<%= javascript_include_tag “ext/adapter/prototype/prototype.js” %>
<%= javascript_include_tag “ext/adapter/prototype/effects.js” %>

Everything seemed to work. Now my only problem is that I now use Rails 2.0.2 with an old version of prototype. So can I use all the rails helpers?!?

Best of Ruby/Rails in 2007

January 1, 2008

Thanks to the great work of the Ruby & Rails communities, the year of 2007 saw many exciting new software releases. I have listed a few releases that I would like to point out in particular and expressively thank the developers for:

* Rails 2.0 – A great open-source framework got better in December 2007 with the v2.0 release. In particular I like the improvements in security, test fixtures, http support, performance, debugger and the non-beta addition of ActiveResource by default.

* JRuby 1.0 – By mid 2007 the first proper open-source release of JRuby arrived and it was able to run (most) Rails applications. Very impressive but a bit beta-like (many key API’s are still changing and there is little documentation in the download). Look out for an even better and faster JRuby 1.1 with JIT support in early 2008.

* Ruby 1.9 ( development release) – The proper development release of the next ruby programming language and implementation, version, 1.9, was released in open-source form on 25th December. Not suited for production but gives the community a chance to experiment with, and provide feedback for, many new Ruby features and implementation changes before Ruby 2.0 arrives. My favorite changes are string encodings (for f.x. unicode) and the new YARV virtual machine included in the Ruby 1.9 release.

* RubyGems 1.0.0 – First proper release of RubyGems in December 2007 as open-source. With RubyGems Ruby developers neatly avoids Java’s classpath-hell (*). Basic but cool stuff!

* Active Scaffold 1.1 (almost) – I was not sure if I was going to include this plugin on the list because it is not quite ready (it’s a release candidate last updated in December) and because the old version 1.0 had a bit too many limitations for my taste. However, this open-source Rails plugin is simply too great to leave out. It’s is basically a parallel to “ActiveRecord” but for the front end allowing the developer to implement visual, model-driven CRUD operations quite neatly. You should check it out.

* Commerical IDEs with real Ruby+Rails support arrives in plenty. Proper IDE releases in 2007 includes Netbeans, Aptana (RadRails), IntelliJ, 3rdRail, Ruby In Steel, Komodo IDE etc… At last some real competition to plain old emacs or textmate !

Nb) I use this term for a lack of a more neutral yet common description of the issues with installing jars and configuring classpaths in Java. Java is a great development platform – which I have used proficiently and happily for 10+ years – but classpath/package/module/jar/version management is not it’s strong point

Shooting yourself in the leg with a bazooka

July 13, 2007

The colorful title reflects that this posting is about common mistakes done by good but relatively inexperienced software developers. Big mistakes that a developer actually need quite some skills to make. Mistakes that we unfortunately see all too often and we would rather not see much of again (hopefully this blog entry can aid a bit towards that goal):

  1. Overly complicated design – Instead of a simple design for a simple project some developers insist on using a impracticable mix of all the newest, fanciest abstractions, design patterns, techniques and advanced language constructs that can possibly be combined in one software solution. All design elements have benefits and drawbacks. Great (experienced) developers know when a particular benefit of an abstraction, pattern, technique or feature outweighs the drawbacks. There is no silver bullet. No design element works well in all situations (just as no rules that you learned in “programming school” are in fact absolute). Developers that get way too eager ends up with one big unmaintainable design mess with the combined drawbacks of all decisions but few if any real benefits remaining…. Remember, a simple design is a beautiful design!
  2. Writing too much code – Writing lengthily code with a high maintenance cost by hand when writing such code can be avoided. Much code can be avoided by choosing a more suitable design/architecture, using standard framework/library features (xml serialization is a common example), using techniques such as dynamic reflection or specialized code generation and aspect oriented tools (be careful though).
  3. Reinventing the wheel – Some developers think they can write their own code much faster than learning to understand the underlying framework and available libraries. This might in some cases even be true, but when considering overall quality and maintainability (which developers seldom do) reinventing the wheel is almost always a bad idea.
  4. Incorrect use of advanced concepts such as multithreading – Some developers use multithreading without the discipline and deep understanding that writing correct, safe multi-threaded code requires. Multithreading can improve the user experience immensely. It is also the answer to scalability nowadays. However, before even considering to use multithreading in your design, make sure to know the theory and features in your environment well. A vague recollection of mutexes and semaphores from school is not good enough. You should also realize that by deciding to use multithreading, you generally need to upgrade on testing, documentation, reviews and quality insurance.

About 41 technologies

July 12, 2007

“.NET, C#, MS Visual Studio, MS Team Foundation Server and Team Systems, IIS, MS SharePoint, Microsoft Office, InfoPath, NAnt, NUnit, Log4net, NHibernate, NDoc, SourceControl & SourceSafe, .NET Web Services, Windows Communication Framework, SQL Server, Tridion Content Manager, Sitecore, Java SE/EE, JBoss Application Server, Tomcat, Jdbc, Jsp, Servlets, Taglibs, Portlets, EJB, Awt, Swing, Java-Corba, Java ByteCode, Rmi, Java-Corba , Jni, Web Services, Ant, JUnit, AspectJ, XStream, Spring, Hibernate, Antlr, Osgi, Eclipse-plugins, C/C++, Assembler, UML, SQL, MySql, Oracle, XML, XSD, XSLT, XPATH, HTML, CSS, Subversion, Ruby / Ruby On Rails” – are some of the many technologies that we in 41concepts have encountered when developing modern software.

Some of these technologies above work very well (mostly), some are best avoided. Some are easy to use, some are harder to work with and some are just too easy to misuse (requiring special expertise and discipline to use correctly). Some technologies have special computer performance benefits, some are slower but faster to implement for a human developer…. Lots of technologies…. Lots of choices and benefits/drawbacks.

How to select and use technologies such as these above correctly – or at least not incorrectly – will be a future subject of this blog. In conjunction we will also discuss appropriate software development processes, practices and management as well as our general on-the-job experience in software development consultancy and software product development… Stay tuned!

About 41concepts:
41concepts is a new Danish software development company offering premium consultancy services in software development using the Microsoft .NET and Java platforms etc. In addition we work with cutting-edge technologies like Ruby On Rails for innovative web 2.0 projects.

41concepts was founded in 2007 by Rasmus Lindgren og Morten Christensen from MortenCh Holding Aps. We work as senior software architects/developers for customers in Denmark (primarily greater Copenhagen area and Århus). In addition, we also work for international customers abroad.

You are welcome to contact us for more information, questions or input. See our homepage for more information about our company.


Design a site like this with WordPress.com
Get started