Note: If you’re looking for information on Houdini or Toggle, you’re in the right spot. After changing the project name from Toggle to Houdini (for SEO reasons), we’ve switched again (there was another Houdini already). If you know of another language called “Presto” please let us know, we’ve got more names.
Over the years we’ve noticed that it seems like every day, all day, all our fancy code boils down one basic thing: showing and hiding DIVs. That’s it. Send a bunch of DOM to the browser, then toggle those DIVs on and off. Logged in? Show a DIV. Logged out? Hide a DIV. Click a tab? Yup, another DIV.
So, we’ve gone and done it. We wrote our own language, Presto. And Presto is all about showing and hiding DIVs. Fast. How? Read on. It’s like magic.
Continue reading …
Hopefully by now everyone has heard about the Bash remote execution vulnerability, and is sufficiently terrified. We here at Carbon Five all use Macs, and so we are all by default vulnerable. Here are the steps we took to secure our computers. Maybe they can help you too.
Continue reading …
A couple of weeks ago I gave a presentation entitled Agile for Startups to the companies in Startup UCLA, a startup accelerator program run by UCLA. I actually gave this talk a week after my colleague Lane Halley presented her talk to the same group.
The talk went well, and I think it was well received. The content is targeted at folks, both hackers and hustlers, who don’t have any experience with Agile techniques. I tried to focus on techniques that can have immediate value to startups.
Here is a summary of the eight techniques I described:
Continue reading …
This post is a follow up to my colleague Ben’s excellent post from three weeks ago describing how he got node.js up and running on Amazon EC2. He asked me if I could automate his deploy in order to help him provision his production environment. I decided it was a good opportunity to learn Chef.
Continue reading …
I have been getting more and more interested in high-performance Ruby apps, and in EventMachine in particular. First of all, super props to Aman Gupta for EM, and to some other Ruby devs out there who have been writing libraries and drivers on top if it, such as Ilya Grigorik, and Carbon Five’s own Mike Perham.
However one area that has not gotten a lot of attention within the EventMachine world is that of testing and tools support. It would be ideal for evented codebases if all tests and all rakes were automatically run inside an EventMachine reactor. I realize that many of the EM-enabled libraries out there, like mysql2, work whether they are in a reactor or not, so this may seem unnecessary. But this means that your tests are exercising a different code path than your production app, which is a bad idea.
So how can we get our tools running within EventMachine?
Continue reading …
We at Carbon Five are pleased to announce the release of ActiveColumn – an object mapping framework for Apache Cassandra. Currently at version 0.1.1, this gem is young but functional with its first major feature of data migration support.
Prior to Cassandra 0.7, keyspaces and column families had to be maintained by hand in a configuration file. But starting with version 0.7, these are managed through Cassandra’s Thrift API. ActiveColumn uses this new functionality to deliver data migrations similar to ActiveRecord.
ActiveColumn gives you several tools to help you with your Cassandra data migrations:
- A Rails generator for creating migration files
rails g active_column:migration CreateUsersColumnFamily
- Several rake tasks for creating and migrating keyspaces
- Some useful data management functions to use within migrations
class CreateUsersColumnFamily < ActiveColumn::Migration
The gem is pretty well documented on github, so take a look there for further details.
We hope that you find ActiveColumn useful in your Cassandra project. We are dedicated to keeping it under active development, so check back for further updates, give your feedback below, or jump on the project on github and help drive it forward.
Next up: timeline-based data mapping and querying!
Last week, Mike Wynholds presented at the inaugural Los Angeles No SQL meetup. The movement to these non-traditional data storage systems has exploded in the last year, and we had a chance to use Cassandra in one of our client’s projects. Cassandra is a column based datastore developed within Facebook, and open-sourced as a top-level Apache project. It is being used by its creators as well as Digg, Twitter, Reddit, Rackspace, and many others. For the meetup, our presentation covered what is Cassandra’s structure, how we used it, the challenges we faced, and the lessons learned. You can watch the presentation below, or you can grab the presentation with this PDF, and from its original Keynote file. And feel free to ask questions and leave comments below!
The Pre, an innovative next generation smartphone from Palm Inc., recently launched
with much fanfare. Access to the WebOS SDK was limited to a few select partners including Evernote, maker of a web, mobile and desktop applications for capturing and finding our memories, notes and inspirations.
The Pre and the app are getting a good amount press from tech heavyweights like lifehacker
I have been working on a web app for one of our clients that includes a pretty interactive AJAX / Web 2.0 component within it. This component is essentially a simplified drag-and-drop book publishing tool, which allows users to upload images and then to arrange them on predefined templates in order to create a book.
We chose to use the Dojo Toolkit (version 0.4.2) for both the AJAX (ie: remote calls to the server) and the Widegtry side of the Web 2.0 style. It’s been working fairly well. Dojo has a lot of functionality, but also has a few areas that still need some refinement. The most interesting / infuriating to me so far has to do with Dojo drag-and-drop functionality within IE.
Dojo’s facility for drag-and-drop is essentially composed of three components:
- Drag-and-Drop Manager
- Drag Sources
- Drop Targets
I developed and debugged the app in Firefox and Firebug, as we all do. But when it came time to check that everything works in IE, I ran in to one bug in particular that stumped me for two entire days, and frustrated me to no end. At a certain point in using the app, my ability to drop objects on their drop targets was broken. It only happened in IE (I was using IE 6 for Windows), and the error I got was the always helpful “Unexpected error”.
What I found was that the following code, which creates a drop target, also registers the drop target with the Drag and Drop Manager.
var imageTarget = new dojo.dnd.HtmlDropTarget(imageDiv, ['galleryImages']);
imageDiv.imageTarget = imageTarget;
As a matter of fact, the Drag and Drop Manager, which is a global singleton, keeps a registry of all drag sources and drop targets created. Later on in the flow of my application, some of these drop targets need to be re-rendered, and to do so I actually delete the DOM node and re-create it, using the following code:
And now everything works perfectly!
We have been using HSQL in-memory along with DBUnit for unit testing lately, and I found an issue using the most recent version of each. Basically, HSQL has added a new data type, BOOLEAN, which replaces BIT. But DBUnit is not updated to support this, and an error is throw when you attempt to insert some BOOLEAN data using DBUnit.
The error looks like this:
WARNING - TABLE.COLUMN data type (16, 'BOOLEAN') not recognized
and will be ignored. See FAQ for more information.
The solution outlined here is straightforward. You need to create a new data type factory that extends the DBUnit class DefaultDataTypeFactory. This new class just handles the SQL type Types.BOOLEAN as a special case. The code follows:
public class HsqlDataTypeFactory
private static final Log log = LogFactory.getLog(HsqlDataTypeFactory.class);
public DataType createDataType(int sqlType, String sqlTypeName)
if (sqlType == Types.BOOLEAN)
return super.createDataType(sqlType, sqlTypeName);
Then, in order to use this data type factory, just set a property on the IDatabaseConnection DBUnit object in your code (here is an example method):
protected IDatabaseConnection getConnection() throws Exception
IDatabaseConnection connection =
DatabaseConfig config = connection.getConfig();