Ary Borenszweig

Ary Borenszweig

Ary is a software craftsman, he is our guru in all code-related problems. Always teaching how to develop the best code with simplicity in mind, he makes everything seem easy no matter how difficult, to the point that nothing seems impossible with him on the team. Very optimistic (sometimes too much), he has the ability to put any idea into code in almost no time.

Nuntium: exponential backoff and new xmpp library

This week we’ve updated nuntium to version 2.8, yay!

Aside from some minor bug fixes, nuntium now implements an exponential backoff strategy when a message delivery fails. Previously, it worked like this:

  1. A message failed to be delivered.
  2. If the cause was the message itself (for example it contains invalid data), it was discarded.
  3. If the cause was an authentication problem, for example an SMTP server’s password changed, the channel responsible for delivering the message was disabled and an alert was sent to the administrator.
  4. Otherwise, the cause was a temporary one, maybe a connection timeout. In that case, delivery through that channel was suspended for five minutes with an alert being sent to the administrator.

In this last point, sometimes the cause was in fact an invalid message for which the other side expecting to get the message wasn’t correctly prepared to handle. This caused all subsequent valid messages to be suspended for five minutes.

We changed this behavior to just suspend this message for some time (using an exponential backoff strategy) but allowing next messages to be sent. The message is marked as “delayed” an you can see it in the UI. We think this is a much more resilient solution.

The other big thing is that we changed the library we used to receive and send XMPP messages. Previously we used xmpp4r, which works quite well but sometimes it would raise unexpected exceptions which we couldn’t understand. Also, it wasn’t based on event machine. We switched to the excelent blather library and so far it didn’t let us down.

What’s next? Having implemented delayed messages on failure cases we are only a small step away from implementing delayed messages just for the sake of it. Imagine sending a message to nuntium and telling it to send it on a specific date. With this you could implement things as simple as birthday reminders to pregnancy checks reminders or messages sent today or tomorrow afternoon of a given time zone.

New office, ruby cake

Two weeks ago, Friday, was the last day in our old office. The mood was pretty nice since the new office has direct sun light and is much more comfortable, and also because every Friday, in a round-robin fashion, each one of us brings some delicious for dessert. It was my turn.

I’m not much of a cook. I checked some online recipes and finally settled on a Chocotorta, a somewhat famous pie here in Argentina that you can prepare with chocolate cookies, coffee, dulce de leche and white cheese. I wanted it to be special for this last day so I thought about decorating it with powder chocolate that would read either “Friday” or “Manas”. But those words were too long and they wouldn’t fit. So the closest thing that meant happiness to me but was shorter was “Ruby”. :-P

Here’s a picture of it. The “R” is not very clear…

The rubycake

The rubycake

So here’s the recipe I used:

Ingredients:

  • 3 packs of Chocolinas
  • 500 grams of dulce de leche
  • 300 grams of white cheese
  • 1 cup of hot chocolate milk (can also be coffee)
  • Chocolate powder
  • 1 pionono (can be replaced with chocolinas)
  • 1 peach

Mix the dulce the leche and the white cheese. I also added some chocolate powder to it. We’ll call this the stuffing.

Wet some chocolinas in the hot chocolate milk and with them form a rectangle, like a platform. Then put some of the stuffing on it. Then put either another platform of chocolinas or pionono. Continue until your formed three or four platforms. On top of the final platform put more sutffing. Sprinkle the chocolate powder to form the word “Ruby”. Chop the peach in tiny sliced and put them around. Don’t forget to put one slice in the “R”‘s hole and two on the “B”‘s circle. Put on the fridge. You are done!

rgviz-rails updated to Rails 3

I just updated the rgviz-rails gem to work with Rails 3. It was pretty easy, following the instructions of this site.

I also moved the code from Google Code to github, so i can have all my projects under a single tree, and to start using git more frequently.

Here are the new URLs:

http://github.com/asterite/rgviz
http://github.com/asterite/rgviz-rails

Introducing cukecooker: writing cucumber scenarios with aid

In our development team we want our testers to start writing cucumber features. I know, BDD, the features should be written before the code, but a tester could later add scenarios which we haven’t previously thought or regression features for bugs.

For writing the scenarios she could learn the steps from other features or just browse the step definition files, but I felt it was a little uncomfortable, specially having to deal with regular expressions. So we thought about writing a script that lists all step definitions in a project: then she could browse the list, copy what she needed and fill in the parameters.

I went a step further: why not generating a page that allows her to browse steps, select one, fill in the parameters and then write it to a scenario? After doing this for many steps he could copy and paste the resulting scenario to the feature file. Autocompletion, no need to deal with regular expressions, just one copy and paste, nice colors (well, this last point might not be true).

And so cukecooker was born. You can think of it as a Cucumber IDE. To install it:

gem install cukecooker

To run it:

cukecooker

or

cukecooker path/to/your/project

This will generate an HTML file. Open it and start writing cucumber scenarios. Here are some screenshots.

This is the step selection part, where typing in the input above filters the steps, you can navigate them using the arrow keys and choose one pressing enter (or using the mouse):

cukecooker filter steps

Once you select a step you can fill in the parameters:
cukecooker complete parameters

For steps which require a table or a multiline string I just put a big “TODO: complete this”… maybe in a future I’ll include an editor for that.

Enjoy!