The Passionate Craftsman

Ruby, PHP, MySql, Software engineering and more.

Tuesday, 28 July 2009

Sun's JRuby team jumps ship to Engine Yard

"The JRuby Guys", Charles Nutter and Thomas Enebo, the main developers of the JRuby project are moving from Sun to Engine Yard. The reason seems to be the uncertainity created by the acqusition by Oracle of Sun. They said that they do not not if Oracle will support JRuby in the future, so they accepted the offer of Engine yard.

Engine yard offers Ruby on Rails hosting on a cloud computing platform. They are very popular in the Ruby world and probably JRuby will continue to be developed and sustained.


Saturday, 25 July 2009

 My VX220 when I went two week ago in the Cotwolds. Here is near Broadway, just in the end of the High St.
Posted by Picasa

Wednesday, 22 July 2009

The Merb Way

I am really happy to see that there is a new book to learn Merb. This book is published by Addison-Wesley, one of the best IT publishing company. The book covers most of the features, including routing, REST, DataMapper, ERB (Erubis) and HAML, Merb mailers, Behavior Driven Development and testing with RSpec. I think that there is more than enough to write an enterprise application with Ruby and Merb.

This is a list of the topics taken from InformIT web site:
  • Master Merb innovations that will be incorporated into Rails 3
  • Understand the fundamentals of Merb development, one step at a time
  • Use Merb’s sophisticated application router to guide incoming requests
  • Explore the Merb stack, master its configuration options, and dive into its internals
  • Use Merb controllers to integrate application code, handle responses, and manage sessions, filters, and exceptions
  • Build templates with both ERB (Erubis) and HAML
  • Use the DataMapper ORM to represent object properties and behaviors
  • Learn best practices for RESTful development with Merb
  • Leverage Helpers to simplify many common development tasks
  • Refactor code, encapsulate it in gems, and share it across multiple applications
  • Customize the responses your application sends to each user
  • Gain a deep, practical understanding of Merb plugins and extensibility
  • Authenticate users with Merb’s modular authentication plugin
  • Configure, generate, describe, and test Merb mailers
  • Use the merb-parts gem to create component-like regions on Web pages
  • Cache content to relieve stress on Web servers
  • Make the most of Behavior Driven Development and testing with RSpec


Friday, 17 July 2009

CMS for Ruby on Rails

I asked on Stackoverflow a suggestion for a CMS made in RoR. One sugggestion was BrowserCMS. The creators want to create an alternative to Drupal for RoR, well this is what I was looking for. There is an interesting video about BrowserCMS:


Wednesday, 8 July 2009

PHP 5.3

PHP 5.3 has been released the 30 of June. I made a post about the infamous GOTO statement, but there are some good news:

Clojures are available in many dynamic language, such as Groovy and Ruby. The problem is that we still have to use the function keywork - I hope that that unecessary keyword will disappear -. In few wors, a closure is a function with some code inside that can be assigned to a variable, then the code can be executed from the variable.

Namespaces are important to avoid name collisions and to create aliases. Any serious programming language should have namespaces, to organize the code and to use classes with the same name but in different packages. With namespaces, in the future, there will be less conflicts in libraries.

nWire for PHP

nWire will release very soon a stable version of nWire for PHP. nWire is an Eclipse and Zend Studio plug-in to explore PHP code with call hirearchy and diagrams.

Memcached + PHP + Win 32 + ZendServer CE

If you have the misfortune to develop PHP applications on a Windows box and you want to develop and learn mamcache, this is a quick recipe, but I assume that you have already installed ZendServer CE.

Download a port of memcache to Win32 platform: Then do the following:

1. Unzip the binaries in your desired directory (eg. c:\memcached)
2. Install the service using the command: 'c:\memcached\memcached.exe -d install' from either the command line
3. Start the server from the Microsoft Management Console or by running the following command: 'c:\memcached\memcached.exe -d start'

The the server, by default is listening on port 11211.

When you have started the memcache service you need to activate the PHP module. In ZendServer CE you already have the dll, so go to C:\Program Files\Zend\ZendServer\etc - I presume that you have your ZendServer CE installed in C:\Program Files\Zend\ZendServer\ - uncomment this line:


Restart the server (Apache ZendServer) and you should see that the module is active. Now you can test your installation with the following script:

connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();
echo "Server's version: ".$version."

$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;

$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)

$get_result = $memcache->get('key');
echo "Data from the cache:


Visit the PHP page for memcache:

Labels: , , ,