Alexander Guz avatar

From The age of average by Alex Murrell:

This article argues that from film to fashion and architecture to advertising, creative fields have become dominated and defined by convention and cliché. Distinctiveness has died. In every field we look at, we find that everything looks the same.

Welcome to the age of average.

People just want to have the same stuff.

GPS Art

I bet everybody knows this feeling when you get an interesting idea in your head, and you think – that is it! I need to do it! You start to dig into, but the first Google request shows that somebody has already implemented it. Bummer. I had one of those ideas the other day.

Since around a year or a bit more, I am into running. For tracking my running time and routes I am using an application, of course. It is nice to look at some statistics. After one of the runs, I looked at the route, and it reminded me of some figure or a drawing. And then a thought came to me – what if we draw something on a map while running using a GPS tracker?! Just imagine: a whole community running and sharing their routes!

My first deliberate attempt to draw during running was a letter “M“. It is supposed to be the first letter in either my wife’s name, or in the word “Metallica“. I’m not sure yet.

As it turned out, I am not the only one to come up with this idea. Drawing on a map with a GPS tracker is called GPS Art. It originated in 90s, and, of course, became more popular with a spread of mobile GPS devices. Check out hashtag #gpsart on Twitter for inspiration.

The community also has its heroes. For example, the largest drawings on Earth belong to Japanese artist Yasushi Takahashi. Here is a word “peace“… 60,794 km long.

A world map features yellow lines connecting various continents and countries across the oceans.

And here is “Marry Me“ over the whole Japan.

You can check out more of his work at http://gpsdrawing.info/.

But anyway, a journey of a thousand miles begins with a single step. So I guess I just go put my running shoes on and take a bunch of those single steps for now.

On Being a Backbone Software Developer

Pilots performing aerobatics maneuvers at air shows are exceptional professionals with incredible skills. I witnessed with my own eyes the Cobra maneuver at one of the performances in Moscow. It is indeed an incredible sight. Piloting at its best.

At the same time, a thought came to me: How often do pilots use these aerobatics maneuvers in real conditions? I doubt these skills are required during another planned flight. And my next thought was: Despite the skills, these pilots are not the backbone of a regular army. Regular pilots — work horses — serve as a basis for any unit. They do the job without frills. Perhaps, they are not that good at air shows, but it doesn’t make them less important.

We observe the same situation in software development. Ace pilots are programmers who solve whiteboard puzzles. But are they a good fit for a regular job? Anyone who was hiring at and conducting interviews knows that these whiteboard skills do not automatically mean good performance when working on a project in a team.

As it is with pilots, the backbone of any team or organization bases on ordinary programmers. They are not rockstar developers. They might not invert a binary tree in their head. But they solve specific tasks by googling and coping from StackOverflow.

Backbone developers deliver.

Being the backbone is not a shame. It is honorable.

Welcome to March 32nd

My wife and I both have watches with the date window - the one that shows the day of the month. At the end of March, nearly midnight, my watch’s date window switched to number “1”, which stands for April 1st. Though my wife’s watch started to show number “32” instead. I was curious why, and found out that it is because of so called outsize date mechanism.

The standard date mechanism is made of a single ring with numbers from 1 to 31 printed on it. The ring gradually rotates, and eventually switches to another number. My watch has this mechanism. The “problem” is that this way the window size, and thus the size of a number inside, is small, because the ring has to fit into the frame.

The feature that allows to have a larger “font size” in date windows goes under the name the oversize date complication. This feature utilizes two pieces for displaying the date: units disc and tens cross, which are nicely synchronized. Tens cross has numbers from 0 to 3, and unit disc - from 0 to 9. The final day of the month is then a combination of two digits from both pieces.

This video has a nice visual explanation of the outsize date mechanism.

So why does my wife’s watch show 32? Well, it actually goes up to 39! It seems that in some “cheap” implementations of the oversize date mechanism, the tens cross and the unit disc do not have proper synchronization. After the tens cross switched from 3 to 0, indicating the beginning of a new month, the unit disc just continues to rotate further to 2, 3, 4, etc.

Sometimes You Are No One without your Phone

We become more and more dependent on all sorts of technology and gadgets in our lives. Exactly for this reason, I try to minimize the amount of digital things I interact with daily.

All I have is my laptop and, of course, my smartphone. And it is my smartphone that made me recently feel completely helpless.

One day I decided to try a scooter sharing app.

I took a scooter and had a 10-5 min drive to a subway station, where I wanted to switch and go home. The ride was really great. But when I arrived I had to end my rent. Via the application.

For several minutes I was getting a Bluetooth connectivity error and could not stop the rent. And then my phone’s battery just died. One second I had ~20% of a battery, and another - the screen is black.

The scooter is still on me. It’s half past nine in the evening, and here in Berlin it means that almost everything is closed, and there is no place to charge a phone. And I also did not have a power bank.

I asked some guys to call the company’s hotline. They did, but the phone number on there site… did not work. Ha-ha. It turned out they had some problems with the line this day.

I was pressing all the buttons on the scooter in hope there was some hidden combination to manually stop the rent, when another guy approached me and asked if I had any problems.

It turned out that the guys was also a software engineer. Though, no surprise here: if you see a young guy with a backpack in Berlin, chances are really high he is a developer. Though, I guess not as high as in Bay Area, but we’re getting there. Especially in rent prices.

He also previously worked for the company which scooter I was using. Unfortunately, he did not know any special tricks, and we started to think logically together.

He suggested to install an app on his phone, so I could sign in and end the rent.

Very nice of him, but I did not know my password, because I am using 1Password.

He suggested to reset a password via e-mail.

Well, I know the password for my e-mail account, but I am using two factor authentication and get one-time passwords… from the app on my phone. I also did not have them printed out.

A bit later, he started to call his former colleagues in order find out what to do. While we were on the phone, the magic happened - the scooter flashed a few times with the light and turned itself off. Turns out if you do not touch the scooter for ~5 minutes, it automatically switches to a parking mode. I still had to write them an e-mail from home, that the scooter was on me, and blah-blah.

The company behaved well later: they charged me only the standard price and even gave me a free ride.

The result of the evening? Next day I bought a power bank and printed out my one-time passwords for e-mail account. I do not want to experience this helplessness anymore.

Bedtime Ideas

Bedtime ideas

Ah, bedtime. It’s time to close Reddit and have some rest. But not for your brain. Have you ever wondered why you’re so damn.. ehh.. creative before sleep? Why does your brain start to produce this stream of crazy ideas? I have, so I made a small research on the topic.

It turns out, that it has nothing to do with the time of day (well, a bit), but rather with your energy cycles. Let’s break it down.

So you have all these pieces of information and relations between them in your brain, which we may call knowledge. How do you produce a new idea? Well, it’s easy - you somehow have to construct a new connection in your head between already existing facts. But during the day, when you’re rested and focused (OK, let’s pretend it’s true) on performing some task, your smartass brain is able to reject to accept your shiny new connections, because they just seem awful. A phone without buttons? Are you fucking crazy?!

But when you’re tired it’s not longer the case. You lay down, try to relax, shut down most of incoming data, and your little grey friend, unable to concentrate anymore properly, starts to wonder in an unexplored land of unrelated things. What seemed insane - became kinda plausible. And bang! A new relation in your head has been born.

Why does it happen right before falling asleep? Just because our energy cycles are determined by our social life - we’re rested in the more morning and tired in evening. Normal people are at least.

Tie-breaking Rounding

So I was reading an article about differences between Python 2 and Python 3, and there was a statement:

Python 3 adopted the now standard way of rounding decimals when it results in a tie (.5) at the last significant digits. Now, in Python 3, decimals are rounded to the nearest even number.

At this point, I was like “WTF?!”. At school I was taught a simple rule: if x is exactly half-way between two integers - round to the largest absolute value, i.e. 13.5 becomes 14, and -13.5 becomes -14. No magic with even/odd numbers. It wasn’t even discussed, that there are might be different ways of rounding.

But, as it often happens with school program, they didn’t tell us all the truth.

There are actually six more or less normal ways and two not so normal, thus leaving us with eight (eight, Carl!) rules of rounding.

These are the normal rules:

  • Round half down (or towards negative infinity): 13.5 rounds to 13, -13.5 rounds to -14.
  • Round half up (or towards positive infinity): 13.5 rounds to 14, -13.5 rounds to -13.
  • Round half towards zero: 13.5 rounds to 13, -13.5 rounds to -13.
  • Round half away from zero: 13.5 rounds to 14, -13.5 rounds to -14. I believe, this is the rule I was taught at school.
  • Round half to even: 13.5 rounds to 14, -13.5 rounds to -14, but 14.5 also rounds to 14, and -14.5 rounds to -14.
  • Round half to odd: Opposite of the previous rule. 13.5 rounds to 13, -13.5 rounds to -13, 14.5 rounds to 15, -14.5 rounds to -15.

And these are some not so normal:

  • Stochastic rounding: the choice of the result is… random!.
  • Alternating tie-breaking: this just alternate round up and round down for.

Rounding in programming languages

Just out of curiosity I checked how rounding works in a few popular programming languages. It seems like most of them use Round half away from zero rule, the most logical for me, since I was taught it as school.

So, this is what you’ll get in C, PHP 7, Python 2, Ruby 2:

// C's printf
printf("%g -> %g, %g -> %g, %g -> %g, %g -> %g\n", 
    13.5, round(13.5), 14.5, round(14.5), -14.5, round(-14.5), -13.5, round(-13.5));

// output: 13.5 -> 14, 14.5 -> 15, -14.5 -> -15, -13.5 -> -14

But, as was already mentioned, Python3 uses Round half to even, and it will be:

>>> print('%.1f -> %d, %.1f -> %d, %.1f -> %d, %.1f -> %d' \
... % (13.5, round(13.5), 14.5, round(14.5), -14.5, round(-14.5), -13.5, round(-13.5)))

// output: 13.5 -> 14, 14.5 -> 14, -14.5 -> -14, -13.5 -> -14

What’s more surprising for me is that Java 8 also uses another rule - I guess it is Round half towards zero:

System.out.printf("%.1f -> %d, %.1f -> %d, %.1f -> %d, %.1f -> %d\n",
    13.5, Math.round(13.5), 14.5, Math.round(14.5), -14.5, Math.round(-14.5), -13.5, Math.round(-13.5));

// output: 13.5 -> 14, 14.5 -> 15, -14.5 -> -14, -13.5 -> -13

Go 1.8 doesn’t have built-in round function at all, you have to choose from math.Ceil or math.Floor yourself.

Conclusion

Well, beware of different rules in different programming languages!

One Way to Deal with Anxiety

Whenever it comes to some sort of a test or exam, I start to have this feeling of worry and anxiety. It doesn’t matter how well I’m prepared - I still have it. And, of course, it affects my performance not in the best way.

But there is one way, that helps me overcome this feeling. The key point, though it might sound strange, lies in our insignificance. When the stress begins before some important occasion, I do an exercise.

First, I concentrate on myself, like: this is me, I’m standing here and feeling anxiety. At this point I can describe myself a bit, e.g. the clothes I’m wearing, etc. It usually helps to relax by changing the topic in your head.

Then I expand the area of my perception a bit - up to the room, where I’m standing. I try to understand, what’s happening inside that room, who is inside, what they are doing, and how this people refer to me.

Next step, expand further - up to the building. I imaging all the people inside, they are sitting in different rooms, talking to each other or keeping silent; they have their own concerns (maybe another examination, huh?). Most of the people in the building don’t even know my existence.

And further - a district or a city. Tens of thousands, millions people. Cars are moving alone the roads. Everybody is busy. Somebody is having a date, somebody is yelling, because the taxi driver blocked the road. And again - they don’t care about you.

Continue expanding: country, planet, universe… Do you see the stars? The vast space of nothing? The suns, that have been exploding for billion of years? See that asteroid, which is going to hit the Mars in a billion years?

Now I start to quickly shrink the area of perception back to myself: universe, planet, country, city, building, room, myself. So, what was my anxiety about? That I couldn’t pass some test or score not well enough? Pff, who cares? The results of this test are so insignificant in comparison to what happens in the universe.

You’re so insignificant.

This feeling makes me feel free and peaceful. I calm down and just do the job.

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.

The authors suggested to prevent vandalism by addressing the problems when they are small and easy to manage with.

I think the same theory can be applied to software development - writing “bad” code may be observed as a vandalism. We often find ourselves in situations in which we can accomplish some task in two ways: either program a clean, robust solution (often meaning complex and long) or make a quick dirty hack. By that time the code may be in two states:

  1. The code is clean and there no dirty hack.
  2. There are dirty hacks.

Guess when will you be more tempted to add “just another small hack, that no one will notice”? Exactly. In the second case. After all, you have deadlines. But you’ll definitely feel uncomfortable, if you need to do that in the first case, just because there seem to be is an established norm of clean code, that you don’t want to break.

In ideal world, the code is always perfect, but in real world it tends to become over the time a collection of small (sometimes not so small) fixes. To prevent that, like with an ordinal vandalism, the hacks should be removed/replaces as soon as possible. By adding another small fix you not only making an obvious poor design decision, but also send the other the message “Go, add more of them!”.