Bill Gates letter to hobbyists

Hey guys, today I am here to share with you something very interesting about what happened in the 70’s when code was shared by hobbyists which used to develop software in the universities.

I just knew this after watching the movie Revolution OS (which is very nice indeed), and the purpose of this post is to show you who was the “enterprising” mind behind corporative software: Bill Gates — and I just don’t want to make the idea I am against him, of course not, since I believe he did a lot for computer science and Microsoft looks like is changing their minds to open source software since cloud computing took the scene.

There it follows the e-mail Bill Gates sent to the hobbyists encouraging them to make money with software and closing codes/patents — whatever:


ps:  A very interesting movie to watch is the Revolution OS — a movie about Linux, which tells a bit about Linux, GNU the all the Open Source Software and initiatives. You can find it on:

That is all for today, hope you like it. 😉

Deadlock from Multithreading


The objective of this small article is to give an introduction about threads, deadlocks and how a dead lock may occur illustrated with code using the Java programming language. At the end, I give my personal point of view about the subject.


A thread can be defined simply by “a separated computation process” that may be a children of other threads – or a main program (Savitch, 2010). Threads can also operate in a parallel manner, what means multiple computation processes sharing same resources, and running for a common goal.

In Java, this can be achieved by using the Thread class, which offers support for implementing single and multithread applications.

deadlockFigure 1 Illustration of a Thread Program in Java

The code figure above shows a simple thread program coded up with the Java language. Basically, this illustrates one thread instanced by the Thread class. The ThreadExample1 class is just an implementation of Runnable, one of the ways of implementing threads with the Java programming language.


Figure 2 Example of a Multithreading application in Java

When running the code above, will give the output of:



Is off


Is on

Is off

Is on

Is off

Is on

Is off


Table 1 Ouptut of the program


Deadlock is defined by, 2016 as A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function.

Figure 3 An illustration of a dead lock

The figure above illustrates a deadlock occurring on the traffic. What happens is that all the cars are trying to access the same resource at the same time, what locks the traffic to flow.


“When in doubt, synchronize.”

(Goetz, 2001)

The Java programming language offers synchronization resources in order to prevent dead locks. What happens is that at every variable that is overwritten using multiple threads, it is strictly recommended that you use synchronization.

Example of a potential synchronization deadlock:


Figure 4 Using the synchronization resource (Goetz, 2001)

Image a scenario while thread A calls oneMethod(), while thread B calls anotherMethod(). What happens is that thread A gets the lock on cacheLock and at the same time thread b gets the lock on tableLock. Now the threads are deadlocked.


According to the StackOverflow, 2016 forum, some good tips to avoid deadlocks are:

  • Always use lock free data-structures;

  • Release locks after a timeout period;

  • Always acquire the locks in the same order.


Deadlocks are a very sensible threat to every program which uses multithreading programs sharing the same resources. While debugging and simulating dead locks are difficult because it needs timing and also it may not occur because of environment and machine load. The Java programming language offers resources to deal with deadlock issues, however it is more of a programmers responsibility to avoid this problem.


Savitch, W, 2013. Absolute Java. 5th ed. USA: Pearson. 2016. What is deadlock? – Definition from [ONLINE] Available at: [Accessed 01 May 2016].

Blogspot. 2016. Figure of a deadlock. [ONLINE] Available at: [Accessed 1 May 2016].

Brian Goetz. 2001. Avoid synchronization deadlocks | JavaWorld. [ONLINE] Available at: [Accessed 01 May 2016].

Multithreading – Tips to prevent deadlocks in java. 2016. Stack Overflow. [ONLINE] Available at: [Accessed 01 May 2016].

Multiple Inheritance


The main objective of this small article is to provide an introduction about the multiple inheritance subject, give an overview how it is implemented with the Java programming language and my considerations to conclude.


The concept of inheritance is very close to what we have in genealogy. Fathers share common attributes with sons, whom all share common attributes from its parents, grandparents and so on. Yet, all of them have their own particularities, like eye color, hair color, etc…

xid-94316198_6Figure 1 Illustration of Genealogy


According to Sklenar, 1997, Simula is known and considered as the first object oriented programming language. This is based on the concept of the conceptualization of the real world brought up to the computing space.

The key aspect of objected oriented programming is to simulate the real world conceptualization of how things are designed, organized and oriented. One of these aspects is the inheritance concept, which is defined and illustrated by Oracle, 2016 as: object-oriented programming allows classes to inherit commonly used state and behavior from other classes. The figure below illustrates the inheritance in a bicycle illustrated analogy:



Figure 2 Illustration of inheritance


The concept of multiple inheritances can be illustrated with genealogy indeed. Father and mother share common aspects with their children the same way grandparents share commons aspects and particularities.

Although multiple inheritances to do not be implemented by some objected oriented programming languages, it is very common to happen in different manners.


It is widely known that Java does not support multiple inheritance, however Java 8 implements functional interfaces (a resource very similar and that can be compared pretty much the same) which are very similar to the concept of multiple inheritances. There is an example which illustrates its functionality below:


(, 2016)


In spite of being a powerful resource to the programmer, it is commonly criticized by its complication to debug and even to lead to unnecessary design complexity. The Java programming language does not support it directly; on the other hand it implements resources (such as function interfaces) which may lead in such manner to achieve the same functional result.


ISOGG Wiki. 2016. Mitochondrial DNA tests. [ONLINE] Available at: [Accessed 20 April 2016].

Sklenar J. 1997. INTRODUCTION TO OOP IN SIMULA. [ONLINE] Available at: [Accessed 20 April 2016].

What Is Inheritance?. 2016. What Is Inheritance? ONLINE] Available at: [Accessed 19 April 2016].

Default Methods in Java 8 and Multiple Inheritance. 2016. [ONLINE] Available at: [Accessed 19 April 2016].

Your next programming interview

This post is dedicated to all the ones which are looking to get prepared for the most difficult job interviews in software development. First of all, I want to make sure you know the fundamentals of computer science in the programming space, and I will recommend some courses which will make you a five star developer in a world-wide scale.

  1. Stanford’s Computer Algorithms Course:

Links and websites to practice and check your ability to deal with computer science and math related problems:

There are also other MOOC platforms such as:


Overloading Operations


The main objective of this small article is to provide an introduction about operators in Java, the possibility of overloading operators and method overloading.


Operators in programming languages are used to assign, and calculate a math expression, for instance. The usual Java operators are: + – * / for addition, subtraction, multiplication, and division. The Java language also offers also shortcuts like +=, for instance.

Actually Java does not support overloading with operators with objects. That means, you can’t use the following expression:


Figure 1 Operator overloading in Java

The most close to an operator overloading is the possibility of using the + operator to concatenate Strings.


Figure 2 String concatenation in Java


Method overloading is the possibility of two of more methods to have the same names in a class. In Java, you may specify the same name for methods, however using a different argument list, in terms of quantity of parameters or the type of the argument.

The method signature can be defined as The name of a method and the list of parameter types in the heading of the method definition is called the method signature.The signature of a method consists of the method name and the list of types for parameters that are listed in the heading of the method name”. (Savitch, 2013).The code below shows the overloading of the method setDate:


Figure 3 Illustration of method overloading written using the Java Programming Language


I personally believe the possibility of String concatenation using the Java language is something trivial for a programming language and it is implemented as expected, however in Java, I don’t think the operand of concatenating objects would be a good resource in terms of the search for being semantically clean. The overriding method possibility is such a good resource in terms of producing APIs and the extensibility is such a good resource to be pointed.


Savitch, W, 2013. Absolute Java. 5th ed. USA: Pearson.

Horstmann & Cornell, 2008. Core Java – Volume 1 fundamentals. 8th ed. California, USA: Sun Microsystems Press.

Continue reading “Overloading Operations”

Comparing Objects in Java


The Java programming language offer some operators to assign, compare and execute math operations. Considering the object of study in this paper, the operator ”==’ is used in the Java language in order to compare only primitive objects. For instance, if you execute the procedure ‘2 == 2’ or ‘2d == 2d’, the result will be simply TRUE, because both of the operations use primitive types in Java. In the case of using object comparisons, the operator ‘==’ will not be a good resource to use, except if you are trying to compare whether the object references in the memory are the aspect in the comparison subject.


To compare objects in Java, the $object.equal method is available in all the java object classes, including Strings, which in Java , String is a class, not a primitive type. The String class is part the JSE library, and it is accessible by any Java program.

One very interesting thing in Java s about Strings. A good illustration, according to Horstman & Cornell, 2008:

String greeting = "Hello"; //initialize greeting to a string
 if (greeting == "Hello") . . .
 // probably true
 if (greeting.substring(0, 3) == "Hel") . . .
 // probably false

“If the virtual machine would always arrange for equal strings to be shared, then you could use the == operator for testing equality. But only string constants are shared, not strings that are the result of operations like + or substring” (SANCHEZ & CANTON, 2002).


In spite of Java to have its particularities, I personally believe the way the Strings and comparison in Java are a good and extensible way of implementing it. Programmers are able to override the equals method, in order to define what really is equality for their own objects and the language offers many ways and possibilities in order to provide good performance when using comparison between primitives and objects.


Horstmann & Cornell, 2008. Core Java – Volume 1 fundamentals. 8th ed. California, USA: Sun Microsystems Press.

SANCHEZ & CANTON, 2002. Java programming for engineers. 1st ed. Florida, USA: CRC Press LLC.

Pointers in C++ vs References in Java


The objective of this small article is to give an introduction about the pointers subject considering the C/C++ programming language, give an introduction how it is implemented with the Java programming language and a conclusion of why pointers are not implemented in Java as it is in c++.


According to Hubbard, 2000, the computer memory can be imagined as an object formed by cells, which can be compared to a large array of bytes. A computer with 256mb of RAM (random access memory) for instance, may be represented as the image below:


The image on the left illustrate a computer memory starting from 0 to 268,435,455, which is commonly represented as 0x00000000 to 0x0fffffff.

Considering the declaration of the variable ‘n’ as:

int n;

And supposing it is stored at the address of 0x0064fdf0, this can be illustrated as:


The variable will occupy 4 bytes of memory, considering 0x0064fdf0, 0x0064fdf1, 0x0064fdf2, and 0x0064fdf3 (considering in C++ int types occupies 4 bytes of memory).

Considering the variable n = 44, the representation looks like:


According to Prinz & Crawford, 2006, “a pointer is a reference to a data object or a function. Pointers have many uses: defining “call-by-reference” functions, and implementing dynamic data structures such as chained lists and trees, to name just two examples.”

Basically in C++ you can declare a pointer using the following syntax:

int *iPointer; // this line declares iPointer as a pointer to int

In declarations, the asterisk (*) means “pointer to.” (Prinz & Crawford, 2006).

What happens with a pointer, is that you may reference the same area of the memory to the address, and so you are able to use the same area of the memory with a different variable, or even passing the reference, which will simply means you are working with the same area of the memory.

If you want a pointer to point to another area of the memory, you just need to use the &, which means “reference to”

iPointer = &iVariable;

The code above give the instruction of the variable iPointer to reference the area of memory of &iVariable.


Java is intended for writing programs that must be reliable in a variety of ways. According to Horstmann and Cornell, 2008, “Java puts a lot of emphasis on early checking for possible problems, later dynamic (runtime) checking, and eliminating situations that are error-prone”. One of the big differences between Java and C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data, taking off the power of the programmer in making mistakes what results in a more security and efficient programming language.

That means you cannot explicitly point to another area of the memory in Java, on the other hand there are ways which you can reference objects in Java, taking advantage of the same instance in memory, however by using the language standards.


Object instances in Java are stored in the memory of the Java Virtual Machine. For instance, when declaring the variable car below and making a new instance of the object, as seen below, a new reference in the memory will be allocated to store this object.

Car car = new Car();

In the case, of referencing the same object, as below:

Car car2 = car;

The reference to the car will be shared, and so, both car and car2 will point to the same area in the memory. This is the basically the way the Java programming language implements referencing.


Pointers are a powerful resource programmers may use to take advantage of many resources, however, the responsibility of dealing with the computer memory directly is not a resource a language which looks to be simple and security may implement. In my point of view, for languages such as C and C++, pointers and references are trivial. However, considering the kind of application Java looks to provide and implement, which are mostly Enterprise and final user applications, the resource of having direct access and control over the memory is not crucial and may lead to more secure and stable applications.


Hubbard, J. R., 2000. Programming with C++. 2nd ed. USA: McGraw-Hill.

Prinz & Crawford, 2006. C in a Nutshell. 1st ed. California, USA: O’Reilly Media.

Horstmann & Cornell, 2008. Core Java – Volume 1 fundamentals. 8th ed. California, USA: Sun Microsystems Press.