A Dash of Queueing Theory

Posted on by Tero Parviainen

I originally wrote this article in January 2015 for the Static Showdown. I'm republishing it here since Divshot has shut down.

The modern world is full of queues. There are queues everywhere from supermarkets and airports to web servers and databases. We organize ourselves in queues and we organize our work in queues. Therefore it is useful to understand a little bit about how these things called queues behave.

The problem is that the behavior of queues is actually pretty counterintuitive. Most queues that occur in the real world occur in situations with uncertainty and randomness. This brings us to the realm of statistical probabilities, which the human mind is not equipped to handle that well.

The field of queueing theory provides tools for getting around this: A quantitative approach combined with visualizations makes up for our lack of intuition. This article explores a few bits and pieces that I've found interesting when reading about queueing theory.

Read more →


Writing A Structural Directive in Angular 2

Or, how I wrote a customized version of ngFor

Posted on by Tero Parviainen

When building Angular 2 applications, we spend most of our time writing components. There are also other kinds of other kinds of directives we can define, but in my experience you end up needing to do that surprisingly rarely.

But recently I did end up in a situation where I needed a custom directive. I was using ngFor to render a collection of items, and I wanted to not keep track of items changing positions inside the collection. Instead I wanted a repeater directive that only adds and removes DOM elements but never actually moves them around to try to keep track of collection reorderings.

Read more →


Metabubbles: Making Generative Art with Angular 2

A tutorial using Angular 2, ES2015+, Babel, and Webpack

Posted on by Tero Parviainen

Most people talk about Angular 2 as a platform for writing business applications. But there's no rule that says this is the only thing it should be used for. If you're in the mood for something fun, how about making some generative visual art?

You see, the same characteristics that make Angular 2 a useful framework for business app development also make it a fun platform for pure experimentation and self-expression through code. In this tutorial we're going to do just that.

So let's have some fun with circles! While we're at it, we're also going to learn a whole lot about what Angular 2 development feels like and how it works with the popular Babel + Webpack tool stack.

Read more →