Science or fiction?

There is a thin line between what we call science and what we call fiction. If some imaginary story or event becomes true it becomes fact and even becomes common accepted in the science. For example, if you told someone who lived hundred years ago that we can construct microchips with a million transistors on it they would not believe you. Let alone the fact that the earth is not flat (actually the earth has become flat again but in a slightly different way [ref]http://www.youtube.com/watch?v=53vLQnuV9FY[/ref]).

So what we now call fiction can become faction and even science within a few year or few decades. Nature still has a lot of secrets that she will not share with us for a long time but once she will reveal it and we will learn something new about our existence. I can’t wait for the replicators and warp-drive 🙂

Bottom line is that we never can know anything for certain because we can’t oversee the present, future events and discoveries that has to be made. Scientists should always be open minded about the “truth”. Truth is very complex and in my opinion impossible to grasp. We never can be certain of anything. Einstein has a great quote that covers it in a very nice way:

“Whoever undertakes to set himself up as a judge of Truth and Knowledge is shipwrecked by the laughter of the gods.” – Albert Einstein

 

Singleton pattern in PHP 5.3

With the introduction of PHP 5.3 some nice object oriented features are available. One of them is the function get_called_class. Below a short example when this function comes in handy.

When we have an abstract CacheDriver as shown below and we extend this with a MemcachedDriver. We only want one instance of this driver available so we apply the singleton pattern. But before PHP 5.3 it was very difficult to put the getInstance method in the base class. There is a solution to use the factory pattern (eg. CacheDriver::getInstance('Memcached')) but the following solution is more elegant and possible from PHP 5.3

Because get_called_class() yields the name of the class we are using (MemcachedDriver) we get directly an instance of the MemcachedDriver without duplicating the getInstance method or using the factory pattern.

How big is Google?

What started in the late 90’s (1998 to be exact) is now a very large company that reaches probably the most amount of people worldwide. It started with their search algorithm and an interface to use the information they had stored and indexed. But now they have their own operating system (Android), a browser (Chrome) and a whole bunch of other products.

In this article I will give a short oversight of what they are doing and how all these products interconnect with each other. Also why some products are not creating money but are very important to sell their main product. While Google is really big and you can discuss if they aren’t too big they always claim to “Not do any evil”. Continue reading How big is Google?