First drops of IronRuby available
July 23rd, 2007The first bits of IronRuby are available. I'm obviously going to have a look at this.
One very good news is that MSFT are going to accept source code contributions to the IronRuby libraries and host the project on RubyForge. They intend to fully open the whole project once the DLR will have reached version 1.0 and will be stable enough.
*Update:* Scott Guthrie offers a write-up you may want to have a look at (demoing the interactive interpreter and a wpf example).
Learn more about Ruby: Programming Ruby: The Pragmatic Programmers' Guide, Second Edition
Online data mapping with Dapper - sweet!
May 25th, 2007FiveRuns : some notes from my evaluation
May 9th, 2007I'm evaluating FiveRuns, a new player in the arena of system monitoring, which offers a 30 days trial. So far I find it's an effective way of monitoring my servers, hence this post.
How it works: just use the wizard to download the agent for your platform, and install it on each machine to monitor. The agent starts pushing data to the FiveRuns hosted server, where it is consolidated and monitored.
Things I liked so far:
- easy to setup, and no server required to handle the monitoring
- cross-platform (I'm currently monitoring 5 windows-based servers, a debian server and an imac)
- good default behaviour, "smart" groups of systems
- easy to configure global thresholds (like: warning and critical level for % CPU or memory or disk)
- history graph for all sensors
- simple but effective notification chain
- automatically detects subsystems to provide more accurate information (mysql and apache already included - I've heard that IIS / SqlServer 2005 support is planned)
- the agent can act as a proxy if some machines in a network do not have access to the internet
Quite often I find that setting up and taking care of a monitoring server can be a burden for small to middle-sized companies (even though you can download a Zenoss or Nagios appliance).
The FiveRuns approach is on a sweet spot here.
(I wasn't even paid to write all this - really)
Software Estimation : Demystifying the Black Art
April 30th, 2007Okay - we're not in 2006 anymore, but I've been willing to post this since last year. I've been kind of busy, working on various topics including SSIS/Rake/Ruby/ASP.Net for Villanao (holidays rentals aggregator) and a couple of RubyOnRails applications.
Now the book: my favorite book in 2006 is Software Estimation: Demystifying the Black Art by Steve McConnell.

The book is all about estimation, in a very pragmatic fashion. From a clear definition of the underlying concepts (including the key fact of separating estimates, planning, negociations and targets), to simple principles on how to avoid the easy or not-so-easy mistakes (like "never guesstimate"), to real-life methods to stay happy in a deadline world, Steve McConnell has gathered the best advices an estimator could read in one single book, and managed to keep complex things simple.
I warmly recommend it to any developer / project manager / architect.
Montastic: a nice web monitoring tool
October 3rd, 2006If you need a simple way to be warned when a web site goes offline, you may find Montastic sweet: a web-hosted and free monitoring service, very simple to setup.
It checks your sites at minimum every 10 minutes, provides RSS and email notification, and includes a totally-geeky widget you can install on your desktop:

I've been using it for one month and I'm very happy with it.
CruiseControl.Net 1.1 Final is released
October 3rd, 2006Here are the highlights:
* Log4Net is used with a rolling logfile appender for logging CCNet build server output.
* Users can use CCTray to volunteer to fix a broken build.
* <prebuild> section allows custom tasks to run prior to build. This allows clean up operations to run before the build starts.
* Caching is used in WebDashboard to reducing loading time of build reports.
* Build statistics are available through the CCWebDashboard.
* WebDashboard provides an interface for stopping and starting CCNet projects.
* Alienbrain source control provider is now supported.
Read the full release notes (thanks Owen). Grab the binaries here.
Watch out the cloud
September 4th, 2006(through John Lam's blog)
Jesse Andrews has a nice write-up about how to setup Fedora Core, MySql and a small application in EC2 (the distributed platform offered by Amazon).
Given the flexibility of the pricing (ie pay only for what you use), and given that it seems to play well with S3 (the online storage by Amazon), EC2 is something I'll watch closely.
UPDATE (07/09/2006) : InfoQ has an article ( http://www.infoq.com/news/amazon-changing-enterprise-ec2 ) which summarises the various options as well as the reaction of the blogosphere.
Worth reading - Cautious advice for accepting online payments by James Duncan Davidson
August 31st, 2006James Duncan Davisdson wrote an article you should read if you plan on adding online payment to a website - either yours, or your customer's.
There are plenty of technical ways to implement online payments, going from pure offsite (like CIC paiement, or the PayPal website payments standard, where credit card details are never known from your application) to more integrated solutions (where the details are entered through your application, then you proceed to a back-end call behind).
Are you using online payments ? What is your experience with payment gateways in France and/or Europe ? Which one did you experiment ?
TestDriven.NET update
August 25th, 2006Jamie is working hard to improve TestDriven.NET.
The latest build (2.0.1761 RC1) brings a couple of significant bug fixes and improvements, so I thought I'd post the highlights from Jamie below.
(as a reminder, TestDriven.NET is a VisualStudio.Net add-in dedicated to running and debugging unit tests - including NUnit/MbUnit/MS Team System - with convenience and speed)
1) When running under VS2005 you should find 'Test With... Debugger' a
*lot* faster. It now uses a cached test process is a similar way to
the default 'Run Test(s)' test runner. It will no longer do a full
solution build or touch your project files before starting. This means
is will play nicely with version control and doesn't need to create a
'*.Surrogate' project when used with MSTest projects.2) There is now a 'Repeat Test Run' option on the code context menu.
This will rebuild your tests and repeat the test run using the last
used test runner. If you prefer to use the keyboard you can associate
shortcuts with 'RerunTests', 'RerunWithDefault', 'RerunWithDebugger',
'RerunWithCoverage' or 'RerunWithMSBee'. The 'RerunTests' command
will use the last used test runner. The few people who have tried this
feature seem to end up using it a lot. :)3) You can now 'Test With... .NET 1.1' from VS2005. Your tests will
be built using MSBee/.NET 1.1 and executed inside a .NET 1.1
process. Any .NET 1.1 build errors will be merged into the VS2005
'Error List'. This is particularly useful when working on class library
code that must run on .NET 1.1 and .NET 2.0.4) You will find 'Go To Reflector' menu buttons on the 'Code',
'Disassembly' and 'Call Stack' context menus. This isn't strictly
speaking using testing related, but it can be very useful if you hit a
problem on some system or 3rd party code. For example when an
exception is thrown you can easily navigate down the call stack and
see exactly what caused it.5) Once in Reflector you can right click on *any* method and 'Toggle
Breakpoint'. This means you can set breakpoints on assemblies you
don't have the source for! If you're using this in VS2005 be sure to
disable the debugging option 'Enable Just My Code'. You can find this
on the VS2005 'Options...' dialog under 'Debugging\Enable Just My
Code'.
happy testing!
Measuring method call duration with Spring AOP
April 24th, 2006Here's one way of writing a reusable Spring advice which will measure and log the duration of all the calls to a given object (or to be more accurate, to the members of any interface it implements).
using System; using AopAlliance.Intercept; using log4net; using Spring.Aop.Framework;
public class ProfilingProxy : IMethodInterceptor { private static readonly ILog log = LogManager.GetLogger(typeof(ProfilingProxy));
public object Invoke(IMethodInvocation invocation) { DateTime startTime = DateTime.Now; try { return invocation.Proceed(); } finally { log.Info(string.Format("{0}.{1} call took {2}", invocation.Method.DeclaringType.Name, invocation.Method.Name, DateTime.Now - startTime)); } }
public static object GetProxy(object originalObject) { ProxyFactory factory = new ProxyFactory(originalObject); factory.AddAdvice(new ProfilingProxy()); return factory.GetProxy(); } }
Here in a real life use:
[Test, Explicit] public void BenchmarkLDAPCall() { BasicConfigurator.Configure(); ILDAPAuthenticationProvider provider = new DirectoryServicesAuthenticationProvider(); provider = (ILDAPAuthenticationProvider)BuildProfilingProxy(provider); Assert.IsTrue(provider.Authenticate("myldaphost", "cn=mylogin,o=mycompany"); }
As Bruno Baia pointed out, you may want to use a more accurate timer if the calls you want to measure have a short duration.
Why I like this approach: it's easy to reuse the profiling logic and you don't have to modify the profiled code (don't even need to have access to the code here). One drawback is that afaik, the profiled object has to implement an interface to let spring create the proxy.
That's all for today!
Third drop of RubyCLR available
March 17th, 2006I told I would keep you posted, so here are the news. John Lam has released the third version of its RubyCLR .Net/Ruby bridge. The project is soon planned to move to RubyForge.
Here is the summary:
- Reference .NET assemblies by assembly name or by filename
- Create and manipulate .NET reference and value types
- Automatically marshal .NET reference and value types to / from Ruby
- Dynamic generation of interop code using CIL instructions
- Create and manipulate generic .NET reference types
- Discover and consume .NET interfaces on a .NET object
- Implement .NET event handlers using Ruby blocks
- Map .NET member names to Ruby names (e.g. WordCount becomes word_count)
- Mix in Ruby Enumerable support for .NET IEnumerable types
- Dynamically access .NET XML documentation from irb (requires text/format. to make it work uncomment require in rubyclr.rb)
I'm anticipating that given the ease to learn the basics of ruby, this bridge will bring many possibilities like helping testers to write integration tests for .NET applications (more on that later!).
A Ruby proxy class for debugging
March 14th, 2006Have a look here to see how to code a generic proxy class in ruby.
It relies on the method interception abilities of ruby - the proxy is only 18 lines long!
(through SoftiesOnRails)
Learn more about Ruby: Programming Ruby: The Pragmatic Programmers' Guide, Second Edition
Some fun with Watir
March 9th, 2006I like Watir for web testing. Combined with the firefox web developer extension to determine the forms, areas, buttons names, it find it very efficient.
Although not the original intent, you can also use it to write small utilities relying on publicly available websites. For instance, let's translate something through reverse website:
require 'watir' include Watir
AVAILABLE_TRANSLATORS = { :fr_to_en => "65544", :en_to_fr => "524289" }
def translate(word,translation) ie = IE.start('http://elmundo.reverso.net/textonly/default.asp') ie.text_field(:name,'source').set(word) ie.radio(:value,AVAILABLE_TRANSLATORS[translation]).set ie.wait result = ie.text_field(:name,'target').value ie.close result end
puts translate('today is a sunny day!',:en_to_fr)
Well that's not exactly a SOAP call, but it works pretty well!
Learn more about Ruby: Programming Ruby: The Pragmatic Programmers' Guide, Second Edition
Exploring ActiveRecord + a .Net/Ruby bridge
March 8th, 2006Two quick notes today...
* John Lam is working on a bridge between .Net 2.0 and Ruby. It will only work on .Net 2.0 for the moment as it is based on a feature not available in the previous versions of the framework (DynamicMethods). I'll keep an eye on his releases, I'd love to write UI code with .Net and designer support, while using Ruby for the DSL / logic / database interaction in the background.
* Bruce Tate gives an overview of the Ruby ActiveRecord OR/M framework (ruby implementation of the ActiveRecord design pattern), and covers the migration part of ActiveRecord (the part which allows to describe how to handle evolutions of your database schema).
have a nice day!
C# and Ruby bits
March 7th, 2006
require 'rexml/document'
doc = REXML:: Document.new(File.new('MyProj.csproj'))
REXML::XPath.each(doc,"//References/Reference/@HintPath") { |n| puts n }
Took a couple of seconds to write a roughly equivalent C# code:
using System;
using System.Xml;
class Test
{
[STAThread]
private static void Main()
{
XmlDocument doc = new XmlDocument();
doc.Load("MyProj.csproj");
foreach (XmlNode node in doc.SelectNodes("//References/Reference/@HintPath"))
{
Console.WriteLine(node.Value);
}
}
}
I'm using ruby more and more for my daily tools (I tend to become faster at doing it, compared to using nant and/or c# code).
For the sake of learning something new and sharing it, I'll try to take some time to post more side-by-side comparisons here.
Learn more about Ruby: Programming Ruby: The Pragmatic Programmers' Guide, Second Edition