Prototyping Mobile Web Application

We decided to spend one evening prototyping very simple and small but unusual thing for our product.

I choose to build very basic mobile prototype. Actually our app is already responsive and can work on mobile devices, but it doesn't looks very good. I wanted it looks like a native application.

It took me about 4 hours to build this prototype (Backbone, Ratchet and CoffeeScript), you can see it live here code on GitHub.

Prototyping Mobile Web Application


Client-Side QA

Video (russian language) and slides.

Presentation was short and I didn't have a time to cover many interesting things like testing strategy, named scopes and matchers.

I'll try to add additional materials and code samples in next months, slides are below.


Countries with the best medicine

How can we decide if medicine is good or bad? About couple of years ago I found very interesting statistics, but only recently had time to investigate it in details.

Countries with people having the longest life

So, we can roughly guess that if lifespan is big, then the medicine should be probably good too. Also, as soon as lifespan is also affected by lots of other variables like - climate, food, ecology, lifestyle, income and so on - we can decide that they are probably good too.

But, the fact that lifespan is a sum of many variables has a drawbacks:


A little about CouchDB

I've read CouchDB Guide for the second time recently. Very interesting book, it's interesting to understand how CouchDB works internally, one of those rare books that creates a mind shift and expand it to the new territory. It's definitely worth the time spent even if I never will be using CouchDB.

So, what's good about CouchDB:

  • Reliable, can accept thousands of connections and behave elastically and predictably under high load (MongoDB is also pretty fast).
  • Has ability to efficiently (without blocking and copying) make snapshot of database state using MVCC (MongoDB can't to that).
  • High availability - thanks to MVCC it's never blocked (MongoDB block on write, although usually it's not a problem, unless you have write-heavy application).
  • Incremental Map/Reduce (MongoDB can do something similar).
  • Incremental, non-blocking, consistent replication (MongoDB also can do it).
  • Has notifications / change-log (MongoDB doesn't have it).
  • Has versioning, although pretty basic (MongoDB doesn't have it).

Now, about disadvantages:






Node.js not suitable for general web development

Had a quick look at Node.js usage in production.

In most cases Node.js isn't used as a web framework for the core web product. It's used for additional specialized API or real-time extensions.

From my subjective experience with Node.js web frameworks - it's about the level of Ruby Sinatra. None of node.js web frameworks even closely compared to Ruby on Rails. Nor in terms of functionality nor in development productivity.

So, it seems for me that Node.js isn't suitable for general web development. It's a good fit for API, but not for web site or web applications (online project management and so on.).

And that's sad news, because I believe it has all features needed to build rich and high productive web framework like Ruby on Rails (Fibers can be used to mitigate callbacks).

Still, even if productivity with Node.js is less than with Ruby on Rails it's better than with Java web frameworks.

UPDATE 2014/2/4

As I said before:

I believe Node.js has all features needed to build rich and high productive web framework like Ruby on Rails

So, here it is -


Quality of Product

In order to be able to sell the product it should do something useful and be in a working state. The only practically way to check if product works or not - is to check it according to the specification.

That's why product specification is important - it defines the goal, what the product should be and how to check if it works or not (it also helps to measure progress - how close current state to the goal).

Process of measuring how close the product to the specification and if it's working called testing, there are manual and automatic tests.

There's very huge difference between manual and automatic testing:

  • Manual tests require smaller amount of time - but it requires it every time you apply it.
  • Automatic tests require bigger amount of time - but it requires it only once, all next runs will be virtually free (some time will be spend on support, but it's very small).

That difference dictates when and how apply manual or automatic testing.


Open source games

Simple open source games that are nice and playable.

Monk Story

DotA, video, play, sources, JavaScript & CraftyJS.

Monk Story

Eat them all

Tower Defense / RTS, play (it's not available online, you need to download and run it locally), video, sources, JavaScript & CraftyJS.


Game Art

Liberated Pixel Cup

Free, video, download, documentation, demo, source of demo.

Lost Garden

Free, tutorial


SQL for Data Analyst

These days lots of data available in digital form, ability to analyze and get meaning from that data become more important. Usually such job is called Data Analysis or Data Mining and the person who does that is called Data Analyst.

Actually, I wrote that article for my brother (who's Analyst and ask me about SQL) and decided to publish it because it may be also useful for others.

Main skills of Analyst are Mathematics, Statistics and Domain expertise. But in order to apply those skills he should be able to get the data itself. Widely supported way to get access to data is called SQL, and Analyst can benefit greatly if it knows basics of it.

SQL is a declarative language for querying and transforming data stored in relational database.

  • Declarative - it means that you declare what you want without explicitly telling how to do that. And database figures it out by herself how to fulfill your request in the best way. It's a good thing, because describe what you want usually much simpler than to explain how to do that.
  • Relational database - special type of database (it's the most widely used type of database) that stores data as rows (also called records) in tables.


Prototyping 2D Game

Had one free evening and tried to create simple game prototype with plasticine.

Still don't know how to create ground tiles to allow easy combine it and quickly create diferend grounds. Square and random shapes looks bad.


Interesting 2D Open Source Games

Flare - RPG, clone of Diablo 1,


Functional Mixins in JavaScript

Functional Mixins is a flexible way to share functionality between objects.

From my experience it's more powerful than Class or Prototype based Inheritance, Mixins and even complex machinery like Ruby Object Model. But I believe the biggest advantage of it isn't the power but the simplicity, it's so simple that I wonder why it's so rarely used.

In this example we create Game Unit and add some basic functionality to it (source).

Creating simple Model

Defining Model that have only two methods - set to set attributes, and initialize - a constructor supporting setting attributes.


Rad SBS - simple store, site and organizer

My old abandoned project, allows to create simple site, store and be used as an organizer.

My biggest mistake was that I tried to finish two projects at once - Rad SBS and the Web Framework that powers it, it's called Rad (inspired by Ruby on Rails, but more modular and object oriented).

When I started it about year and half ago I'll planed to build simple solution that should be used as a Site and Collaboration for Small Businesses (mix of Alfresco, Jive ClearSpace, Backpack and WordPress).

I already had some experience with delivering such kind of projects (about 5 years of working in business consulting) and thought I can do something similar alone. But sadly it turns out that I'm not a genius, and can't do it alone in a reasonable amount of time.

So, when I recognized it, I was forced to throw out everything (about 60% of features) except the most fundamental features. A lots of them where already half-done, so it wasn't an easy decision.

Below are some of conclusions that may be useful if you would like to finish the project fast:

  • Lots of your code will be thrown out


Result of thinking in Java

I was recently involved in some discussion about Java and DSL and had an interesting observation how the language can impact the thinking. It was so explicit that I decided to discuss it in more details.

Please take a look at the code:

int labelsWidth=150;
    .item(new ComponentBox()
    .item(new ComponentBox()
    .item(new ComponentBox()
  this.add(layoutless, BorderLayout.CENTER);

This code builds simple dialog showed on the picture:


Rad Web Framework

In 2010 - 2011 years I was working on Web Framework called Rad, below are some site built with it.

Store / e-commerce.




I changed my opinion about Lisp and Clojure

There are two things I didn't like in Lisp - prefix notation and lots of parenthesis, but, recently I found that prefix notation has some advantages over infix notation, and that the reason for those parenthesis is - Lisp has no syntax (I believe this is very important, it gives you the freedom and power to create any syntax you wish).

Some more advantages of Clojure:

  • according to this benchmark Clojure is only 2 times slower than Java and ten times faster than Ruby.
  • multi-core processors are the future (UPDATE: yes, but not with the Transactional Memory - the Clojure way of doing it, also see this presentation).

Maybe I'll take some time to learn it in more details.



Hadoop The Definitive Guide


If there’s a common theme, it is about raising the level of abstraction—to create building blocks for programmers who just happen to have lots of data to store, or lots of data to analyze, or lots of machines to coordinate, and who don’t have the time, the skill, or the inclination to become distributed systems experts to build the infrastructure to handle it.

This, in a nutshell, is what Hadoop provides: a reliable shared storage and analysis system. The storage is provided by HDFS, and analysis by MapReduce. There are other parts to Hadoop, but these capabilities are its kernel.


Code Statistics and the Power Law

Last week I used Code statistics analyzer to examine my own and some other projects.

Complexity of Rails libraries

Ruby on Rails

Comparison of some Open Source projects


Interesting resources about AI

Find if domain name is generated by human or robot

Some learning resources, simple approach, lots of interesting examples

Podcast about AI


Collection of easy and practical approaches and there (in the body of that article) is also link to another interesting presentation from Google about it's machine translator, don't miss it.

Foundations of Intelligent Agents how to generate algorithms and judge if its right using Kolmogorov Complexity.

Pether Norvig about Google Algorithms:

Computing Like the Brain mathematical model of brain, sparse distributed representation, semantic (locality sensitive) hashing, sequential memory, prediction and anomaly detection and some practical applications






Learning statistics

Titanic Machine Learning

Quantitative Economics in Julia!/c-st101

Simpson's Paradox Explained Visually

Conditional Probability

Bayes' theorem

Chances of person age 65 has cancer

P(C|65) = P(65|C) * P(C) / P(65) = 0.5% * 1% / 0.2%

Bayes' theorem for hypothesis and evidence

So in this scenario, the hypothesis is having a cold and the evidence is having a runny nose.

List of courses