I’m sorry my last post was about three months ago. But, I have a good excuse: I’m just married!
(and I took a nice and fast honeymoon vacation)
Besides that, after three happy years, full time at Caelum, here is the shocking news: I’m now part of the Locaweb team!
This was (and is still being) a very hard decision. People close to me know, that I have a nice and strong relationship with Caelum. Man, I love the company!
I’m feeling very strange, because I’m sad I’m no more full time at Caelum and, at the same time, I’m extremely excited with the new challenges which are about to come. My decision to join Locaweb, which is a really good place to work, just proves I’m very anxious to make a good job there. Other than that, I’m going to sit near very known people as my friend Fabio Akita and Daniel Cukier, just to cite some.
I’m joining the talented Cloud Computing team and I hope I can help them to improve the Cloud Server product. An enormous responsibility!
Locaweb is a huge company and I must admit I’m a little bit scared with the size of things there. They have many teams working on a big diversity of challenging products. They even have their own Datacenter! Locaweb already embraced agile and people there are very open minded, because as a hosting provider, they have to deal with almost all kind of technology.
Because of my work prior to Locaweb, I know the expectations on me are quite high. I like being honest and just to be clear, I’m not better than anyone. I’m relatively new to this area, so I still have too much to learn. Fortunately, I already know many people at Locaweb and I really believe they will help me start being productive. Additionally, there are areas I know I can give something. I’m joining to help, not to prove anything to anyone.
It’s also important to say, that I couldn’t fully leave Caelum. I’m still part of the team, as an instructor, and I keep helping them in many areas, such as the book, courses, textbooks, internal discussions, events, talks and where else I can.
That’s it. Comments, questions and feature suggestions are, as always, welcome. As a cloud provider, I’m happy to hear what would you like to see in a cloud product and what can we do to help you scale and earn profit.
From now on, I stop referring to Locaweb as “they” and instead as “we at Locaweb …”.
Professionalism definition from Uncle Bob in his recent talk at RailsConf 2009:
“Discipline to wielding of power.”
– Robert Martin (aka Uncle Bob)
To me, it looks pretty much similar to the “Ruby” definition from Chad Fowler in the last Rails Summit Brasil:
“Ruby is a dangerous tool.”
– Chad Fowler
Wich makes me remember Uncle Ben’s advice to Spider Man:
“With great power comes great responsibility.”
– Uncle Ben
Would be Uncle Bob inspired by Uncle Ben? What if they are the same person?
With all the recent excitement about Google supporting Java for the App Engine platform, I’m proud to say that VRaptor2 just works, out-of-the-box!
All you have to do is copy the required jars that come in the vraptor distribution, configure the VRaptorServlet (or VRaptorFilter) in web.xml and enable session support in the appengine-web.xml:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>...</application> <version>1</version> <sessions-enabled>true</sessions-enabled> <!-- ... --> </appengine-web-app>
Being able to use my favorite Java Web MVC framework, to develop and deploy applications to Google’s cloud infrastructure, is really nice.
source = Account.first destination = Account.last transfer amount: 10, from: source, to: destination
tip: Ruby 1.9 new literal Hash syntax.
This shows Ruby improving even more, as a good host for internal DSLs.
I know we all love Ruby, and doesn’t care that much about not having auto completion/IntelliSense available.
I don’t care that much about auto completion, when coding in Ruby, myself. What I really like in Java IDEs is their refactoring support. Eclipse and IntelliJ IDEA are simply awesome in this space for Java. We still have ReSharper for Visual Studio and others, targeting other languages. Ruby has NetBeans, Aptana RadRails, RubyMine and TurboRuby/3rdRail doing a great job in this area.
But, I have this feeling that most of Ruby developers do not use IDEs (including myself). We are using good text editors, such as TextMate, Vim, Emacs and GEdit. They are good enough. Why would I need something else?
I have to admit. I really miss some refactorings while programming in Ruby. Particularly, the lack of “Extract Method” and “Extract Variable” bothers me. They aren’t even complicated, why hasn’t someone already implemented them?
So, I would like to introduce Rfactor. It is a Ruby gem, which aims to provide common and simple refactorings for Ruby code. RubyParser from Ryan Davis is being used to analyze and manipulate the source code AST, in the form of Sexps.
In theory, we should be able to use Rfactor to power any editor, adding refactoring capabilities to it. I’m targeting TextMate, but I would love to see contributions for others. The TextMate Bundle is hosted on github:
Rfactor TextMate Bundle, with installation instructions
This very first release has support only for basic “Extract Method”: inside methods and without trying to guess the method parameters and return.
Stay in touch, there is much more coming!
After the 1.0 official release, Merb is gaining more and more attention.
I’ve updated JettyRails to support Merb 1.0 applications, making it a good choice to run your rails and merb applications with JRuby, particularly in development time.
The release notes include:
* Merb 1.0 support!
* jruby-rack updated to the latest release (0.9.3)
* jetty server update to 6.1.14
* JSP and JSP Expression Language support
* some minor bugs
It is very simple to run any Merb 1.0.x and Rails 2.x applications. You just need to have JRuby properly installed, but JettyRails doesn’t work with jruby-1.1.4 (JRUBY-2959). First step is to install jetty-rails:
jruby -S gem install jetty-rails
Then, for Rails applications:
cd myrailsapp
jruby -S jetty_rails
And for Merb applications:
cd mymerbapp
jruby -S jetty_merb
Please note that you can’t use Merb with DataMapper in JRuby right now, but ActiveRecord does the job. Work is being done by Yehuda Katz (wycats) and Nick Sieger to port the native parts of DataObjects (used by DataMapper) in the do_jdbc project. Because of that, you can’t just install the merb gem. Wanted Merb modules should be installed separately:
jruby -S gem install merb-core # required
jruby -S gem install merb-more # extras
JMaglev is finally public available!
I’m releasing my experiments with JRuby and Terracotta, so you can play with JMaglev and contribute some code. The project is in Github.
I had to patch JRuby to make RubyObjects a little less dependent from the JRuby Runtime. It isn’t perfect yet, but is working. The patch against the current jruby trunk (rev. 8091) and the patched jruby-complete are included in the project.
The code in Github is just a TIM (Terracotta Integration Module) with a sample maven project and the JMaglev use-case included. Unfortunately, I haven’t any time yet to upload the TIM to Terracotta Forge. BTW, does anyone know how to do this?
For those who want to reproduce my JMaglev demo, here is a step-by-step. You must have GIT, Maven 2 and the JDK properly installed. It only works on Linux and OS X. Is anyone wanting to contribute support for Windows users?
git clone git://github.com/fabiokung/clustered-jruby.git- long time waiting, because terracotta-2.7.1 (vanilla) and jruby-complete (patched) are bundled.
cd clustered-jrubymvn install(althoughmvn packageis enough)cd jmaglev- start the terracotta server:
lib/terracotta-2.7.1/bin/start-tc-server.sh - open another two terminals
- run the simplified jirb inside them:
- Follow the demo. You will be able to share global variables among all jmaglevs:
require 'hat' $hat require 'rabbit' $hat.put(Rabbit.new)
- in the other terminal, try to see the magic hat contents:
$hat
cd clustered-jruby/jmaglev
./bin/jmaglev jmaglev.rb
I haven’t tested it with rails applications, but right now, it isn’t able to run IRB. I never thought that running IRB could be so hard.
More drawbacks and limitations are being discussed in the JRuby Users Mailing List.
I hope to see many contributions. Happy hacking!
Reading an article from Reza Rahman in TSS about what is new in EJB 3.1, I could predict the future. Here is a code snippet from the article:
EJBContainer container = EJBContainerFactory.createEJBContainer();
Context context = container.getContext();
PlaceBid placeBid = (PlaceBid) context.lookup("java:global/action-bazaar/PlaceBid");
placeBid.addBid(new Bid("rrahman", 10059, 200.50));
container.close();
Yes, PicoContainer will be standardized as EJB 4.0!
How long is going to take to people learn that less is more?
This is obviously a joke. It isn’t really true.
MagLev was a show from the last RailsConf (2008). Presentation and demos of the product are really impressive.
Recently, Brian Takita asked in the JRuby mailing list:
JRuby + TerraCotta == Maglev?
What an idea! In the last few days I’ve tried to make something useful and I’m happy to have something to show.
The first demo runs with Nailgun. The basic idea is to share a single Java VM across all clients, so they can share some objects. The second is much more complete, as its clients have their own Java VM. There are many true interpreters running, and they are sharing objects through Terracotta. Terracotta is responsible for sharing memory in Java VM clusters and, despite of its slow startup, has much more to offer. The shared objects (hats and rabbits) could be automatically persisted by Terracotta, as MagLev also does.
I’ve patched JRuby and configured Terracotta to make demos run. I’ll upload the patches and configuration somewhere, ASAP.
Working on JRuby to make it run multiple runtimes (VMs) at the same time is being really fun!



