Thursday, November 15, 2012

Sprint and Shift

When resources are scarce the smartest thing to do is to share.

For so long, startup founders have been pitching about having a team of professionals who are one hundred percent dedicated to the job. For most of these enterprises in their infancy that was true. What was also true, and much less obvious, was that these dedicated teams were not 100% occupied in their work 100% of the time.

Much like in the military, start-up life is more in the sense of  hurrying up and waiting.

So you are Lean and Agile, Your team is sprinting, they are at their best, optimized, combined effort to get the feature out on time.

But then, they wait.

They wait for the new designs to come in, wait for the other guy to deliver his bit, wait for the analytics on the latest feature. Wait.
And while the team waits, you waste.

In a way, its like having a V12 engine, running full throttle without anything connected to it. burning money with no practical production.

So how does the sharing work?

The key for time efficiency is to always have a full stack of tasks to do for the development team. So, if one project is not enough, its time to share. combining efforts with more then one startup means that the developers, as any other expensive resource in the company can be pooled. while waiting on one task, a developer can shift to another. By the method of Sprint and Shift, resources are maximized.

Oh, this sounds so wonderful, but is this as good in practice as it is in theory?

For the past year I had the privilege of working with two teams, both independent companies but inter-dependent in resources.

By choosing to do so, we have been able to enjoy the best quality of manpower, without paying for lost time between sprints. This is "Sprint and Shift" in action.

Nothing can be leaner than this.

Friday, November 2, 2012

The Game Experience

Game mechanics (aka gamification) of sites has for some time become a necessity rather than a luxury. Everyone is talking about retention, engagement and acquisition, but are Points and Badges enough to give an answer?
Apparently it is not.

Gamification is all about manipulating the behavior of the on line users, in a way that would benefit both user and service provider. Effective behavioral influence requires subtlety and sophistication. Consumers need to be motivated and not lured. While trophies are nice to show, they need to represent a true achievement.

Game theories have long been addressing the issues of motivation and creating the economics of behavior.

The well-known prisoner’sdilemma addresses the economy of fidelity by imposing different rules of engagement; a reasonable player is bound to a particular behavior in order to climb up the ladder of success.

Equally celebrated, is the Nash Equilibrium used to analyze strategic interactions of a multitude of decision makers.

Both of the examples above assume the intelligence and reasonability of the players, and comprised of bona fide motivators.

Data services such as sites, telecommunication, enterprise applications etc. usually contain a range of challenges that flex and differ depending on the current situation of the participating user. In a way, much like board games, the rules of engagement differ in dependence of the state and history of the user.

To match such an elaborate engagement system, the Markov chain proves to be best accurate.

The Markov chain is a mathematical system that describes transitions between a finite (or countable) number of states. This implementation provides the robustness and flexibility of a multitude of challenges that are either with or without accumulation of memory.

Perhaps the best known implementation of the Markov chain is in google’s PageRank algorithm, although it can be manifested in as simple as a board game.

So can the Markov chain be used for site gamification?
Apparently it can. 

For more info: Tierx

Saturday, October 27, 2012

RMagic - image processing for RoR

I have a few projects that required basic image manipulation. Easy stuff like cropping and resizing images that users upload in the application.

Image Magic provides a nice solution for this both on Windows and Linux (the two environments i use) although they also provide libraries for MAC.

To install on windows first download and install the windows installer for Image Magic.
Note that you will need the installer to include the C libraries as well.

Then proceed to install the RMagick gem by this command (source):

gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'
And don't miss any character. just replace the [path to ImageMagic] with the location the installer put the image magic installation.

The installation for Ubuntu  is slightly easier:

apt-get update
sudo apt-get install imagemagick libmagickcore-dev
sudo apt-get install libmagickwand-dev
sudo gem install rmagick

Once you have the gem installed, add the following line to the gem file:
gem "rmagick", "~> 2.13.1"
And run the following command:

In the files you want to use this gem include:
require 'rubygems'
require 'RMagick'

You may find the instructions for the image manipulation facilities useful as well.

Sunday, October 14, 2012

Book Review: Sencha's ExtGWT Coockbook

The past few days I've been going through the ExtGWT Rich Internet Application Cookbook which is fresh out the the PacktPub press.

This Cookbook reviews the usage of the Sencha's ExtGWT GUI packages, A GWT application framework.

The book has been written by Odili Charles Opute and Oded Nissan, the latter is an old friend and an inspiring professional I hold dear.

Oded says: "GWT allows the use a single high level, object oriented and strongly typed language for developing web application. (this is the same concept behind the DART programming language that Google in involved with). Developers who are not JavaScript, HTML/CSS experts can then develop complex rich internet applications using Java.
With Java, developers can use OO design pattern in their client code, a capability that is missing when developing web applications using JavaScript and markup.
The main criticism against GWT is that it prevents developers from using JavaScript and HTML markup directly, thus preventing flexibility.
I would say that if you are shooting to develop a complex and revolutionary web site, GWT would probably not be your first choice (although there are plenty examples of unique application built using GWT) . However, GWT is a very good fit for developing form based web applications, probably covering most of the Enterprise and SMB applications.

Using GWT for web GUI implementation can work not only for Java Server side. As long as you are using RESTful interfaces, RoR can suite just fine.

For me, the aesthetics of coding is a major concern. Much like writing prose, code should be expressive and clear. After all, it is telling a story. Clarity of code helps developers create the right mental image of the mechanics and stream line of the moving parts.
Noisy and cluttered code on the other hand induces malfunction (AKA Bugs).

The first impression I got from the book was the clarity and simplicity of the examples and explanations. Being a ruby sort of person as I am, it actually made me miss coding in Java just a bit.

What I found in the book were 80 examples for GUI development and appendixes for event handling, Icon manipulation, RPC and file uploading.
In short, all the floaters you might need when jumping into the ocean of GWT GUI development.

The examples took me from the obvious to the advanced, and although I have years of Java development behind me, the explanations are structured in a way that could be easy for the novice and not tedious for the expert.

When Choosing GWT and the Sencha package, get a copy of this cookbook. I give it the thumbs up.

Friday, October 12, 2012

RoR Double Clutch

This is a pattern have implemented in three different projects of mine, so I'm writting it down once and for all the next times I wrap my head arround this until I remember I have already have done it.

In the Dezquare project, the users are offered a game that helps them in finding a sutable designer. The game varies accorging to all sorts of conditions. The sequence is broken down into a series of basic elements that can be manipulated and tweeked from an admin consule.

The aim is to have an implementor grabbed from the database and react to a particular context as part of a user flow sequance

The players:

  • A controller
  • A context object (as an ActiveRecord)
  • A referenced implementor descriptor (as an ActiveRecord)
  • An implementor

The sequence:

  1. The controller identifies the context object and passes the request params
  2. The context object finds its implementor descriptor and passes itself as an argument
  3. The implementor descriptor converts its implementor class name field into an entity (imp.camelize.constantize)
  4. The implementor descriptor invokes on the implementor method with the context object and its own agruments field (if applicable)

The code 

Note: this code will not work by itself. its only expressing the idea
The standard controller answering a play request
def play
    @results = @game.set(params)

The context object (Game), persistant and stateful, belongs to a "stage" and passes the request and context
def set(params)

The implementor descriptor (Stage), persisted common object, known here as the "stage" generated an entity and calls it.
def klass

def set(game,params)

The implementor (name derived from a data field), unpersisted, statless entity, acts upon the context it is given and returns the results
def self.set(game,params,arguments)
    #pay dirt

Thursday, August 30, 2012


This morning (GMT+2) we have successfully launched the new Wikibrains site into public beta. This is the elation of the 2 week development sprint we made, implementing a long list of an even longer list of suggestions comments and responses we got from the private beta launch a month ago.

Developing a project like Wikibrains is not easy mainly because its not trivial to step out of ones skin and try to get a fresh look at things. To see whats really needed and what is the pure fantasy, irrelevant for others.
This is where the early adopters come in and have a major impact on the decision making for the products features.
We got truck loads of awesome suggestions and I am grateful and thankful to all the people who took the time to write to us.

Ongoing road map:

Migrate to HTML5/Java-script

As discussed in a previous post, we are abandoning the Flex/Flash solution for a light HTML5/JS solution. we will start with a lean editor that will be available along side the robust Flash editor and gradually improve it until we can completely replace the old one.

Socialization and Gamification

We will enable users to follow other users and their contributions to Wikibrains. Contribtors ratings and an assortment of badges.

Public, Group and Private domains

In order to make idea sharing and collaboration even more easy and intuitive we will implement 3 different scopes of privacy. The public domain, where unregistered users can add their associations to any idea. The group domain, were users can collaborate and create mind maps together and restring the editing of the mind map to the group members only. Finally, private mind maps, that are only visible to the creator.

Brain API's and widgets

We are intending on opening the access to the data sources via RESTful API's so any one who would like to use and take advantage of the abundance of semantic information will be able to. After all, the Wikibrains site implements only one approach on what can be accomplished with an associative learning machine. We will start by publishing a set of widgets that enable basic interactions with the graph and open source them so developers may use it for their own benefits.

Bugs will be addressed continuously.

Tuesday, August 28, 2012

Wikibrains new look

During the past few weeks we were all too busy with a series of changes we have implemented into the Wikibrains web application. This is the first step in migrating Wikibrains to Javascript and away from flash. This phase is almost complete and expected to debut in a week.

We have implemented a new look, simple and clean, thus emphasizing the actual data results over the design quirks. Here are a few examples I snatched up from the new application:

Accessing the graph information is now available in two primary formats. The Brain Browser format accesses the word nodes on the graph and allows free browsing through the associations that are defined by users.

Each graph result is accompanies by an acknowledgement to the contributors and a list of top mind maps that include the main topic of the search.

Browsing the graph data has a mind map view. This is a read only view of a particular mind map and for the time being, is not browsable by clicking on the nodes on the graph. Since a mind map is the result of a single contributor, we zoom in on the owner and the other things he had created in Wikibrains.

When clicking on a contributor link a public profile is presented with more details and achievements (in the form of badges) that are credited to the particular person.

In sight of our goal to encouraging participation in teaching us new words and word association, we reward badges accordingly.
We created a set of badges that symbolizes each trait we admire, if its a person that creates allot of mind maps, or someone that is responsible for a great deal of associations.

So there.
I am exited and eager to hear how our users will like and react to this change we are making.

Good luck to us all.

Friday, August 24, 2012

Rails DOT Routing

The default rout match for rails considers the dot as a place holder for the format type that is expected in return.
When implementing a free text search over GET, its important to change this configuration.

Default configuration:
match ':controller(/:action(/:id))(.:format)'

This will not handle a query as following:
/site/search/I am looking for . in a sentence

A working configuration would look like the following:
match ':controller(/:action(/:id))',:id => /[^\/]*/

Found at the coding journal

Sunday, August 19, 2012

Wikibrains migration to a non-flash site

A few days ago, we had a long hard talk about the future UI technology of Wikibrains. We were debating two technologies for implementing the Wikibrains graph (mind map) editor.
On the one hand, we have invested countless hours in the Adobe Flex (AKA Flash) based editor, while on the other hand, thoughts about migrating to a much lighter and brisk implementation in HTML/Javascriupt.

The first step we took was to check out the feasibility and reaction of people to the new option, but implementing a read only version of the graph view in our social sharing landing page.

It took about a day and a half to convert a JavaScript tree view by Kenneth to a graph view and making it ready for the Wikibrains graph data injection.

Once published, the reaction to the sharing page was phenomenal, and its popularity almost matched the index page.

Faster to load and better UI performance made us decide to use this structure as the next step in our editors development. not to mention the fact that it works on mobile platforms without any extra effort.

JavaScript came a log way the past years in terms of rendering engines on browsers and the results is easily noticeable in the event management and motion  rendering. And I guess, that practically made the decision for us.

So long Flex.

Saturday, August 18, 2012

Why can't machines understand emotions?

This is a real error i got, because of permission restriction in running RoR. 

Thursday, August 2, 2012

Wednesday, August 1, 2012

Wikisrains moves to Public Beta phase

Months of hard work have finally resulted in airing the WikiBrains machine learning engine.
Having people using it is so exiting, since as more of them do, the smarted it gets.

Although one would need to register to actually use the brainstorm GUI tool, its easy to see the daily increase in vocabulary and context just by going into the search page and checking out 'Apple' (just an example).

Each time a user lines up a couple of words, may they be of his own design or using existing connections from the suggestion list, the brain is enriched by a new synapse.

The wiki engine uses a graph database to store the words as objective points and the subjective links between them are what people have to say about those words.

We still have several usability issues with the GUI, perhaps too cumbersome one may argue. but despite some snags on the way, it works (which makes me really happy). No performance issues so far, and the user base is steadily growing.

Thumbs up for the Wikibrains team!


Sunday, April 15, 2012

Titanium HTTPClient, Sending a complex object

If you need to send a complex object on a request through the Titanium HTTPClient, an object that has more then a single level of data, for example:
var data_to_send={
   user:{name:'Gilad', l_name:'Manor'}
Passing this object, as is, to the HTTPClient will result in the server getting the sub object as a string, instead of an object.
To have this properly sent, you will need to wrap the data with JSON.stringify

               'application/json; charset=utf-8');

Tuesday, April 10, 2012

Titanium for Android and RoR

Lately, I've been playing around with the Titanium IDE for mobile development.
Its pretty nice once you get a hang of it.
My first application (code name Moris) I made to communicate as a mobile front end for the Gizmo server.

It came out rather simple since my API on the server side are aleady set to spit out JSON structures.

I've found that the simplest way is as following:
First I created a generic send function with a global client object:

var SERVER = 'https://YOUR-DOMAIN/api/';

var send = function (action, data, resFunc){"POST", SERVER+action);
  if (resFunc!=null) {

var client = Ti.Network.createHTTPClient({
     onload : function(e) {
         alert('success '+this.responseText);
     onerror : function(e) {
     timeout : 5000  /* in milliseconds */

Then I add a specific function for each API I'd like to call on the server:

exports.login = function(user,pwd) {
send("login", {mail:user, password:pwd}, function(e) {
        Ti.App.fireEvent("gizmo_login_complete", JSON.parse(this.responseText));

exports.userInfo = function(resultFunction) {
send("user_info", {data:null}, resultFunction);

In these two examples, I've Pass a function that would handle the particular case of returned data.
For the login, I fire a Titanium event that is caught on the app.js while for the user info I inject the function each I do the call.

Tuesday, March 20, 2012

Ruby hash to_xml residue

When using the to_xml on a ruby hash object, it leaves a root.
The way to get rid of it is by explicitly specifying the root by the following:

my_hash_object = {:a=>"a", :b=>"b"}
result = my_hash_object.to_xml(:root=>"new_root")

And that's what its all about.

Wednesday, March 14, 2012

Pie Day

There aren't many special days for the non believers. But today is.
Its a day for celebrating irrationality at its best. Although not as interesting as e-day (Feb 7th at 6pm) and some what disproportionate compared to gold ratio day (Jan 6th at 6pm)
Still, its special.

Sunday, March 4, 2012

Morning comes as pure delight

After spending the night working, I went for a ride along the Tel Aviv shore line. The sky was a bit clearer after the heavy rain.

Rinsing rain, under skies so bright,
Sleep all day and work all night
Morning comes as pure delight

I hope I'll manage to do some testing before my head crashes into the keyboard.

Thursday, March 1, 2012

Installing RoR 3.x on Ubuntu 10.4 with MySQL

I'm writing this as a reminder for myself.
To install Rails (3.x) on Ubuntu 10.4 with a MySQL gem do the following:

sudo su
apt-get install build-essential
apt-get install ruby rdoc libopenssl-ruby
tar zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo apt-get install ruby1.8-dev
gem install rails

To install the MySQL gem: 

apt-get install ruby-dev libmysql-ruby libmysqlclient-dev
gem install mysql

After creating the application using
rails new myApplicationName -d mysql
Running the rake db:migrate will result in error, since it requires a JS engine.
To fix that, edit the Gemfile in the application directory and add the following lines:

gem 'execjs'
gem 'therubyracer'

and then run
bundle install

* Another option is to install NodeJS on the machine, as the javascript engine by following these steps:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm