Broken Code Theory

I have recently come across Broken windows theory article. It is a criminological theory which addresses the problems of urban disorder, vandalism and anti-social behavior. The theory states that:

… maintaining and monitoring urban environments to prevent small crimes such as vandalism, public drinking, and toll-jumping helps to create an atmosphere of order and lawfulness, thereby preventing more serious crimes from happening.

The theory was introduced in a 1982 article by social scientists James Q. Wilson and George L. Kelling in an article titled Broken Windows, where they had an example:

Consider a building with a few broken windows. If the windows are not repaired, the tendency is for vandals to break a few more windows. Eventually, they may even break into the building, and if it’s unoccupied, perhaps become squatters or light fires inside.

Liquid Engine for PHP

I’ve just finished working on my fork of the Liquid template engine.

Liquid is a templating library which was originally developed for usage with Ruby on Rails in Shopify. It uses a combination of tags, objects, and filters to load dynamic content. They are used inside Liquid template files, which are a group of files that make up a theme.

Golang Channels Tutorial

Golang has built-in instruments for writing concurrent programs. Placing a go statement before a function call starts the execution of that function as an independent concurrent thread in the same address space as the calling code. Such thread is called goroutine in Golang. Here I should mention that concurrently doesn’t always mean in parallel. Goroutines are means of creating concurrent architecture of a program which could possibly execute in parallel in case the hardware allows it. There is a great talk on that topic Concurrency is not parallelism.

My First Hackathon (AngelHack, Moscow)

TL;DR It is inspiring and motivating. And the butler is a killer.

Last week I received an email with an invitation to a hackathon which was going to happen on weekend. I didn’t know much about these events so far — in my head there were only scrappy pieces of information gathered from different blogs and news sites pell-mell with photos of crowds of programmers sitting in comparatively small rooms and coding, and coding, and coding… Well, of course I’d like to be there.

Though there was a small problem: only 3 days left to the event and I had neither idea nor team. The chances of wining under such circumstances are slightly less than nothing. When I say “no idea” I don’t mean I did not have ideas at lot, on the contrary I had a whole bunch of ideas which (to be honest) I would never implement by myself.

Pinba — Statistic/monitoring Server for PHP on Mac OS X

When it comes to performance developers are limited with a choice of a suitable tool for measuring it. For PHP programmers there is a good one - Pinba, and since there is no much articles about it in English I decided to write one.

Introduction to WSGI

The Web Server Gateway Interface (WSGI) is a universal interface between web servers and web applications for Python. Universal means there is no more need to design your application for a specific API interface of a web server like CGI, FastCGI, mod_python, etc. - implementing WSGI support in your application gives you opportunity to use it with any web server which in it’s turn has WSGI support.

Thinking Is a Drug

“Thinking is the hardest work there is, which is the probable reason why so few engage in it.”

Henry Ford

When someone mentions addiction there is always something negative about it. But I think not every kind of addiction deserve to be censured, moreover possessing some particular psychological addiction is almost necessary for a programmer. I’m talking about thinking.

Abandoning VIM

Since I touched the keyboard for the first time when I was thirteen I never stop self-cultivating myself in the area. I even became a programmer and doomed myself on reading endless docs, tutorials and books. In one these books, called The Pragmatic Programmer, there was a chapter about tools used by programmers where the opinion was told that it is better to know one editor very well, and use it for all editing tasks.

I agreed and decided to follow this advice. The only difficulty was to pick up the right editor, but since I wanted to be super/mega cool programmer the variants were obvious: VIM or Emacs. I chose VIM, to be honest, for one reason: because of horrible (in my opinion) Emacs key bindings.

Playing Music with Python

Wand to play a sound in Python but don’t know how? It's your problem No problems. I’ll show you some ways. Here is the list of popular Python libraries used to make noise with short descriptions and usage examples.

Painting a Target with Canvas

After playing with canvas for some time I gave a birth to this small piece of… code. If you don’t have any idea what it is I’ll give you a hint. It’s a gradually appearing target created with the help of HTML5 canvas element. 5 elements actually.

The idea is simple: create several canvas elements with different radius values and absolutely position them at the same point. Step by step drawing is archived by repeatedly calling a drawCircle function with different values of radius property until it reaches Math.PI * 2.