Interesting patterns: Proxy

Imagine a class which wraps an external API or read large files or parses huge XML files, fetches data from the Internet or something else. There are thousands of situations like that.


In many cases, you can want to not parse/download/load some resources every time, right?. A good option is to use a cache but, to be honest, it’s difficult. In this article I’ll show you a simple and flexible solution.

Interesting patterns: Marker interface

Some time ago I got my friend’s code to review. Nothing special. After a few minutes of reading, I noticed that he added an empty interface to the definition of some classes. I was ready to write a comment about it but I heard a voice in my head to ask Google first.


I’ve discovered something interesting. A long time ago, when Java 1.5 was not yet released and annotations were not available in the language it was common to use something called “marker interface”. What is marker interface?


An agony of trying to do the job

I’ll tell you a story of Igor. Igor is a web developer. He’s a young man with a girlfriend and some ambitious plan in the future. Igor sit at his desk because he has some work to do. In front of him is a PC. He turns it on and sees some system updates. 30 minutes have passed, and he can see his desktop with a beautiful wallpaper. Funny cats always make his day better. Some people are walking around his working desk, talking and drinking coffee. A typical day.


The IDE is on, but he cannot start working immediately because it’s indexing your project. It takes two extra minutes. Igor is okay with it – more time to finish the coffee is always a good idea.


History of WWW


The history of the WWW wasn’t simple and still isn’t easy. In the beginning, it was a complete mess. Every browser tried to meet developers halfway without any standards or cooperation with other web browser’s developers. Interested?

It all started with Memex – a theoretical machine created by Vannevar Bush with the ability to create links between documents and books and add comments to them. Until early 90’ Memex was derided and described as unreal because we had no tools to implement this idea. But then modern computers appeared…

Indexing in MySQL


Why do we use indexes? Searching through a row in a sorted file with N length takes O(log2N) comparisons and the same number of reads from a filesystem which is heavy itself. However, tables in databases are not sorted which complicates the operation, Especially, if you have a lot of reads, updates and deletions on them. Writing the sorted version of the file (table) would dramatically slow the database down. There is one more thing which makes it even more complicated: every table may be sorted in more than one order. That’s why we use indexes which hold only attributes used in sorting and a reference to the place where the data are kept.

Why Bitcoins may not be a good option


A few days ago, I heard the news that the value of 1 bitcoin is same as an ounce of gold. I thought it’s interesting. Why?

In the 17th Century, people LOVED tulips. They were very popular. The price of tulip bulb was rising so many people noticed it’s a good idea to become wealthy. Speculative bubble that was created mostly in 1636-1637 let some people earn a lot of money, but a lot of people lost everything because of it. Why did that happen? Because the bulbs were so expensive that nobody was interested in buying it only to plant them in his garden. They cost too much.

Let’s back to Bitcoins

Why do I write about tulips in an article about Bitcoins? In my opinion, the news that Bitcoins are becoming more and more expensive causes that less and fewer people may be able to buy it. So if there will be no buyers, then sellers will not be able to sell Bitcoins, and they will have to decrease the prices to get their money back.

I think it may be a problem with this virtual currency. People get money by buying and selling it, but one day they may lose everything like people in 17th Century. Imagine that in one day Bitcoin fails 75% of his value. Everyone who keeps a lot of money in the markets may lose 75% of their saving so even everything. Lots of markets may be closed after declines. In one word: chaos in virtual currency words.

3 ways to ignore files in GIT

Almost everyone heard about and used GIT. It is a good idea to know better tools we use so I found 3 ways to ignore file/folder you may not know. Interested?

.gitignore file

This is the most popular way to remove some items from your repository. Just add the .gitignore file to your project and it just works. You need to remember that if you add the file to ignoring list it will be applied to every collaborator.