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.

Read more...

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:

Read more...

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:

Read more...

Tovarkovo

Read more...

Sochi

Read more...

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 - http://monojs.org

Read more...

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.

Read more...

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.

Read more...

Game Art

Liberated Pixel Cup

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

Lost Garden

Free, tutorial

Read more...

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.

Read more...

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.

Read more...

Interesting 2D Open Source Games

Flare - RPG, clone of Diablo 1, http://flarerpg.org

Read more...

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.

Read more...

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

Read more...

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;
  layoutless
    .item(new ComponentBox()
      .component(jLabel1)
      .width(labelsWidth)
      .height(22)
      .x(0)
      .y(8+25*0)
      )
    .item(new ComponentBox()
      .component(jTextField1)
      .width(layoutless.width().minus(labelsWidth).minus(16).minus(50))
      .height(22)
      .x(labelsWidth+8)
      .y(8+25*0)
      )
    .item(new ComponentBox()
      .component(jButton2)
      .width(49)
      .height(21)
      .x(layoutless.width().minus(58))
      .y(8+25*0)
      )
    ...
    ;
  this.add(layoutless, BorderLayout.CENTER);

This code builds simple dialog showed on the picture:

Read more...

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.

Store

Site

Read more...

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.

Learning

Read more...

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.

Read more...

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

Read more...

Interesting resources about AI

Find if domain name is generated by human or robot http://nbviewer.ipython.org/github/ClickSecurity/data_hacking/blob/master/dga_detection/DGA_Domain_Detection.ipynb

Some learning resources, simple approach, lots of interesting examples https://github.com/hangtwenty/dive-into-machine-learning

Podcast about AI http://www.thetalkingmachines.com/blog/

Infographics http://www.randalolson.com/blog/page/4/

Collection of easy and practical approaches http://www.igvita.com/2011/04/20/intuition-data-driven-machine-learning 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:

http://www.youtube.com/watch?v=HT540VrCDwg http://www.youtube.com/watch?v=nU8DcBF-qo4

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

Read more...

Inspiration

Read more...

Melbourne

Read more...

Learning statistics

Titanic Machine Learning

Quantitative Economics in Julia

https://www.udacity.com/course/viewer#!/c-st101

Simpson's Paradox Explained Visually http://vudlab.com/simpsons

Conditional Probability http://setosa.io/conditional

Bayes' theorem

Chances of person age 65 has cancer http://en.wikipedia.org/wiki/Bayes%27_theorem

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 https://github.com/prakhar1989/awesome-courses#machine-learning

Read more...