Monthly Archives: February 2012

AjBase (1) Implementing an In-Memory Database

In mid 2009, I started to write an in-memory database, as a coding exercise in C#. These days, I resumed work on that project. Now the code resides in my GitHub repository:

Nice history image at Github:

The current solution:

As usual, it was developed using Test-Driven Development. All tests in green:

The key implemented elements are:

Engine: It has a list of created databases (in memory, there is no persistence).

Database: It is the container for tables.

Table: A table has rows, and a RowDefinition.

RowDefinition: it manages the list of columns in a table.

Row: it keeps the values of the table columns, in an object array.

I have a doubt: to keep the schema (RowDefinition) per table, or go for a schema-less (free columns) per row. Now, I will keep the schema approach.

This year, I started to parse SQL statements. SQL is not my preferred languages (too many quirks, etc…), but the project can parse the simplest commands:

I want to add an ADO.NET provider, see the Data namespace:

I have a simple ADO.NET DbConnection, with some very basic (incomplete) ExecuteQuery, ExecuteNonQuery support.

Next steps: complete ADO.NET provider, more SQL parse support, concurrency and transaction support (big challenges! :-).

Next posts: examples for creating a database, creating a table, inserting data, selecting data, by code and by SQL statements. Meanwhile, you can explore the tests code, to see how to code those examples.

Keep tuned!

Angel “Java” Lopez

Ruby On Rails (2): Links, News and resources

Previous Post

More links about this popular Ruby web framework (and some discussions):

Crazy, Heretical, and Awesome: The Way I Write Rails Apps

Rails Went Off The Rails: Why I’m Rebuilding Archaeopteryx In CoffeeScript

Frontend Code Doesn’t Have to Suck: 5 Tips for Rails Developers

Moving from Sinatra to Rails

ruby-debug in 30 seconds (we don’t need no stinkin’ GUI!)

What programming language is GitHub written in?

Rails: Presenter Pattern

Ruby/Sinatra/Rails failing at Start

Sinatra vs. Rails

Rails Caching Benchmarked: MongoDB, Redis, Memcached

Lately there has been a lot posts about how Ruby on Rails might not follow the best practices.

ActiveRecord (and Rails) Considered Harmful

Composition Of Responsibility vs Interface Implementation
ActiveRecord might truly be a horrible beast with far too many concerns in one given place. I haven’t dug into that source code very much. From what I remember of it, it’s huge and difficult for me to understand (but then, it does a metric-ton-squared of meta-programming, so I guess I’m not surprised that it’s hard for me to understand).

Rails Has Turned Me Into a Cannibalizing Idiot
Some interesting posts flying around about how ActiveRecord is rotting people’s brains and how Rails is "pants on head retarded". I figured I might as well respond.

spree / spree
Spree is a complete open source e-commerce solution for Ruby on Rails

Is it better to use routes or mod_rewrite to forward old URLs?

How to make Rails do not ignore trailing slashes in the routes?

SEO, Heroku, Ruby on Rails and removing those darn trailing slashes

El maldito libro de los descarrilados
Tutorial de Ruby on Rails en castellano

Using Redis with Ruby on Rails

To Redis or Not To Redis? (Key-Value Stores Part 4)

Delivering email with Amazon SES in a Rails 3 app

Activity Logs and Friend Feeds on Rails & pfeed

Ruby On Rails español

Entrenando con Ruby y RoR

Learning how to Learn Rails

nicksieger / refactoring-to-rails
Example of refactoring a Spring/Hibernate application to Rails

Configuration for Rails, the Right Way

Ruby clouds: Engine Yard vs. Heroku

Memcached Internals: Memory Allocation, Eviction Policy, Consistent Hashing

Heroku and Rails 3.1

Ruby on Rails 3.0 Release Notes

Instalar Ruby on Rails 3 en Windows

Rails QRCode Generator

How do I add a field in Ruby on Rails?

Why Bother With Cucumber Testing?

Mini reviews of 19 Ruby template engines

Ruby on Rails Tutorial

Rails Searchable API Doc

Bundler manages an application’s dependencies through its entire life across many machines systematically and repeatably.

Getting Started with Rails

Updating Ruby / Rails

My Links

More links about Ruby, Ruby web development, Sinatra, etc… are coming.

Keep tuned!

Angel “Java” Lopez

AjRools (1) Rule Engine in C#

Since last year, I was conducting a bit of research about rule engines, specially in Java:

I reviewed JBoss Drools Expert (see Past December, I assisted to Buenos Aires JBoss Meetup (see Spanish post)

In the old eighties, I met Rete Algorithm (see The Rete Matching Algorithm, Dr.Dobb’s). After all that, I decide to implement my own rule engine, in C#. You can check my progress at:

This is the current solution:

As usual, it was coded using TDD.

I have facts, that are asserted, like Temperature = 38. And rules, that based on the asserted facts, produce other asserted facts (I plan to add actions, too, beyond fact assertions). A rule example:

# Rules example
# Rule for Child Fever
		Temperature > 38
		Age <= 12
		HasFever is true
# Rule for Adult Fever
		Temperature > 37
		Age > 12
		HasFever is true

I have ideas to extend the rule engine to support objects with properties, not only variables:

	p is_a Patient
	p.Temperature is 39
	p.HasFever is true

but this feature is still in progress. I didn’t adopt the Rete algorithm, yet, or something similar. I want to have a running implementation, with tests. Then, changing internal algorithm is like an exercise on refactoring.

Pending work: more object+properties support, session (client use of the internal implementation), etc.

Keep tuned!

Angel “Java” Lopez

Node.Js: Links, News And Resources (6)

Previous Post
Next Post

More collected links about Node.js and its ecosystem, modules, critics, reviews, tutorial and samples.

The rise of Node.js: JavaScript graduates to the server
Microsoft and others have already adopted this technology to extend JavaScript beyond the browser — but it has limits developers must beware

tjanczuk / arrjs
HTTP and WebSocket application routing

Solving the upload progress bar problem–The History of Node.js
If you would have asked me how Node.js came to be I probably would have guessed something along the lines of a Stanford research lab. That is, until I stumbled across this youtube video ‘Ryan Dahl – History of Node.js’ from a Pheonix user group back in Oct 11. I intended to watch just a few minutes, but it was really interesting and I ended up watching the whole thing. If you are into Node I recommend you check it out too.

Node.js Cluster
A single instance of Node runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node processes to handle the load.
The cluster module allows you to easily create a network of processes that all share server ports.

If you’re using Node.js, you’re doing life wrong

Patio-query is a Sequel inspired query engine.

An Obvious MVC Framework for Node.js

New Electronic Check-in System
It uses Node.js

ShareJS – Live concurrent editing in your app.
ShareJS is an Operational Transform library for NodeJS & browsers. It lets you easily do live concurrent editing in your app.

Video Processing in node.js

Node.js Kansas City

Heroku, mongo, node.js – a problem

visionmedia / jade
Jade – robust, elegant, feature rich template engine for nodejs

The Reality of HTML5 Game Development and making money from it

Seriously.js: A Realtime, Node-Based Video Compositor for the Web

About restify
restify is a node.js module built specifically to enable you to build correct REST web services. It borrows heavily from express (intentionally) as that is more or less the de facto API for writing web applications on top of node.js.

marcello3d / node-mongolian
Mongo DB driver for node.js

benmills / robotskirt
A node wrapper for the C markdown parser, sundown.

bleakgadfly / node-irc
Node.js socket wrapper for the IRC protocol (client-side)

evantahler / actionHero
node.js API framework for both tcp sockets and http clients

Node.js Web Application with Storage on MongoDB
This tutorial describes how to use MongoDB to store and access data from a Windows Azure application written in Node.js.

Using the Windows Azure SDK for Node.js on Heroku

omerucel / node-restapi
node-restapi is a restful service creator

Benvie / Node.js-Ultra-REPL
Starting with Node’s built in REPL, add in a completely redone inspect formatter, actual functioning separate V8 contexts, keybindings to create, switch, and delete between them, combine it with a bunch of color. ULTRA REPL

xxoo / node-fsWin
windows fs extensions for nodejs

einaros / GitAzure
Git hook for node.js apps running in Azure

Node.js Selected by InfoWorld for 2012 Technology of the Year Award

Meet Diego Araos, the winner of sponsored Hackathon, Santiago, Chile (Dec 2011)
As an open source community contributor and fervient enthusiast in bleeding edge tech, in my inaugural post I decided to cover the story behind the team that won, and also, give them props for developing in Node.js.

Running on Windows Azure Web and Worker roles

WindowsAzure / azure-sdk-tools

Tools for developing applications for Windows Azure

Node.js Web Application using Express
Node.js includes a minimal set of functionality in the core runtime. Developers often use 3rd party modules to provide additional functionality when developing a Node.js application. In this tutorial you will extend the application created in the Node.js Web Application tutorial by using modules.

Node.js Web Application

My Links

More links about Node.js, server-side javascript, and general use of javascript are comint.

Keep tuned!

Angel “Java” Lopez

Clojure: Links, News And Resources (4)

Previous Post
Next Post

More links about Clojure programming languages:

Event-Driven Programming in Clojure

Beginning with Clojure

The Making of Typkov
Build a little webapp in Clojure/Noir from scratch

Clojure GUI Demo of Planetary Orbitals

Metaweblog API

Backlog: Ola Bini on Clojure/conj

Why Jark
Startup time of the Java Virtual Machine(JVM) is quite slow and thereby command-line applications on the JVM are sluggish and very painful to use. Jark is an attempt to run a persistent JVM daemon and provide a set of utilities to interact with it.

All Your HBase Are Belong to Clojure

Introducing ClojureScript One
Here at Relevance, we spent some time recently looking at the ClojureScript experience. We were specifically concerned with finding the pain points in ClojureScript development. To make the experience as real as possible, we chose to rewrite a client application which had been written in CoffeeScript.

ClojureScript One
ClojureScript One shows you how to use ClojureScript to build single-page, single-language applications in a productive, effective and fun way.

Object-oriented Clojure

Web application in Clojure: the starting poin

Some Thoughts on Classes After 18 Months of Clojure

Create a basic web application in clojure

fogus / fojure
a dumb little fp language written in Clojure

Immutant is an application server for Clojure built on top of JBoss AS7. It is a new project, but we already support Ring handlers and asynchronous messaging, and we are working on additional features.

My Clojure Adventure


Getting Started with Clojure-clr

roman / clj-stream
Oleg’s Iteratees in Clojure

Road-map – or n+1 steps to enlightenment (or loonybind)

geoffsalmon / bytebuffer
Clojure lib for packing and unpacking binary data using a java.util.ByteBuffer

Survey says: viability is number one

ClojureCLR has a new home


What is a multimethod?

4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving.

Testing Storm Topologies (in Clojure)

Maven Settings and Repositories

dmansen / boggle
A boggle solver, in clojure

Fractals in Clojure – Distributed Buddhabrot Fractal Using ClojureScript

marick / Midje
Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing

The Barbarians are at the Gates
By @unclebob

(take 6 carin-meier)
Carin Meier is a veteran of the Clojure Conj scene having attended both installments and a true asset to both the Ruby and Clojure communities.

Tips for using marginalia

Converting Command Line String Integers To Integers

bitsai / clojure-actors
Actors implemented on top of Clojure agents

Erlang style actors implemented using clojure agents

stathissideris / clarity
A wrapper for Swing aiming to provide more concise syntax and extra functionality. Still in heavy development, syntax may change radically.

Introducing Clarity: Swing application development for Clojure

A Refreshed View on Community : Clojure Conj 2011

Clojure: STMs vs Locks

Clojure for dummies: a kata

Introducing Avout: Distributed State in Clojure

The Clojure Community and Me

Clojure’s protocols influences?

Evangelizing Clojure

My Links

More links about Clojure, Lisp, Functional Programming and Languages are coming.

Keep tuned!

Angel “Java” Lopez

Scala: Links, News and Resources (1)

Next Post

These are my first Scala programming language links.

Scala (play /ˈskɑːlə/ skah-lə) is a multi-paradigm programming language designed to integrate features of object-oriented programming and functional programming.[3] The name Scala is aportmanteau of “scalable” and “language”, signifying that it is designed to grow with the demands of its users. James Strachan, the creator of Groovy, described Scala as a possible successor to Java.[4]

The design of Scala started in 2001 at the École Polytechnique Fédérale de Lausanne (EPFL) by Martin Odersky, following on from work on Funnel, a programming language combining ideas from functional programming and Petri nets.[5][not in citation given] Odersky had previously worked on Generic Java and javac, Sun’s Java compiler.[5]

Scala was released late 2003 / early 2004 on the Java platform, and on the .NET platform in June 2004.[3][5][6] A second version of the language, v2.0, was released in March 2006.[3]

On 17 January 2011 the Scala team won a 5 year research grant of over €2.3 million from the European Research Council.[7] On 12 May 2011, Odersky and collaborators launched Typesafe, a company to provide commercial support, training, and services for Scala. Typesafe received $3 million investment from Greylock Partners.[8][9][10][11]

Scala comes to .Net | The Scala Programming Language

Scala In 5 Years – My Prediction « GridGain – High Performance Cloud Computing

Why Java Folks Should Look Forward to Scala | Javalobby

Scala eXchange opening

Ruminations of a Programmer: Composing Heterogeneous DSLs in Scala

Scala Labs – Home

Spark Cluster Computing Framework
Spark is an open source cluster computing system that aims to make data analytics fast — both fast to run and fast to write.

Along Came Betty » Clojure and Akka: A match made in …

Scala: The Static Language that Feels Dynamic

Compiling Scala to LLVM

Why Java folks should look forward to Scala | /var/log/mind

Functional Languages will Rule (but not this year) – Good Stuff

Scala: A Better Java for Android

Ruminations of a Programmer: Combinators as the sublanguage of DSL syntax

Typesafe makes it easy to build web-scale software based on the open source Scala programming language and Akka middleware. From multicore to cloud computing, it’s purpose built for scale.

The Pragmatic Bookshelf | Programming Concurrency on the JVM

InfoQ: Actor Thinking

Clojure or Scala for bioinformatics/biostatistics/medical research – Stack Overflow

InfoQ: Switching from Java to Scala

Asynchronous Event Sourcing using Actors

Functional Scala: Expressions, Extensions and Extractors « brain driven development – JVM Languages

Scala Team Wins ERC Grant | The Scala Programming Language

Ruminations of a Programmer: Monads – Another way to abstract computations in Scala

Monads Are Not Metaphors – Code Commit

Algorithmically challenged: Sieve of Eratosthenes (the real one) Scala One-Liner

Code Monkeyism: Singletons without Singletons: Scala Type Classes

Erik Engbrecht’s Blog: Higher-Level versus Higher-Order Abstraction

Ruminations of a Programmer: Scala – To DI or not to DI

Real-World Scala: Introduction

Tom Morris’ wiki » Scala for Hackers

Scala Style Guide

Monads in Scala

Building Distributed Systems in Scala

James Carr » Blog Archive » Learning Scala: Factorials and foldRight

Scala Beauty – Fun with Logic « Thinkmeta

Beyond Mere Actors

My Links

More Scala links are coming.

Keep tuned!

Angel “Java” Lopez

Smalltalk: Links, News And Resources (3)

Previous Post
Next Post

10 reasons why I’m using Smalltalk for airflowing

10 razones por las cuales estoy usando Smalltalk para airflowing

S8 – Smalltalk on the “Invisible Machine”

Squeak VM: Compiling for Xcode

The complete and open-source solution to relational database access.

S8 Release Candidate – Smalltalk on JS

Some Resources for People Who Want to Learn Smalltalk

History of ObjectsAsMethods?

RE: U8 Release – Beta Testing

[squeak-dev] Clamato

Curso S8 – “Release Candidate”

NoSQL OODB with Smalltalk-based Ruby VM: MagLev 1.0 Released

Smalltalk Directions

the true power of pair programming

Smalltalk with Style

Kaliningrad: Developing with Amber, Seaside and Monticello

Smalltalks 2011

Coral: Pharo Smalltalk for scripting

Fuel is an open-source general purpose framework to serialize and deserialize objects based on a pickling algorithm.

Opal Compiler

Athens vector graphics API

Amber Smalltalk Documentation

Canvas and JTalk


Clamato is a Smalltalk dialect that is designed to operate within the JavaScript runtime. (For non-Canadians: “clamato” is what you get when you add clams to tomato juice. Some consider this an unholy mixture; others, a tasty treat.)

Implementing Smalltalk-80 on the ICL PERQ

The Blue Book VM

Lanzamiento de S8 en Smalltalking

ST2JS – Smalltalk to Javascript translator

The first time I met Steve Jobs
I was a reporter-researcher at Time magazine on a 12-month probationary writer’s trial. I’d heard that the Lisa had something to do with work done at Xerox’s (XRX) Palo Alto Research Center, and to prep for the meeting I had read and re-read the only substantive story I could find about Xerox PARC — a long article in Byte magazine on Smalltalk.

ESUG 2011, Edinburgh


User Interface Framework

The Pharo Roadmap

Lisp vs Smalltalk vs Ruby

Who looks at Smalltalk?

Can Smalltalk blocks be better than Lisp Macros?

Object Spaces for Safe Image Surgery

gnu smalltalk koans

Types are Anti-Modular

IM 31: Seaside and Rails (AAC)

Mariano Martinez Peck

My Links

More links and resources are coming.

Keep tuned!

Angel “Java” Lopez