BMI calculator

Dell XPS contrast issue

I been experiencing some issues with contrast of my XPS 15 screen while running the laptop on battery. After disabling almost everything that is related to power saving I found the blow solution.

Linux: Copy a directory and all of it content

In Linux, you can copy a whole directory, including all of it content by adding the -r flag to the copy function:

cp -r /path/to/original/folder/ /path/to/desired/copy/location

This will copy the original folder and all of it content.

Linux: delete/remove folder and all it content

You can delete a directory and all of it content by running the following command in the terminal:

rm -rf <FolderName>

Replace <FolderName> by the folder to be deleted; this will delete the desired directory and everything within it.

Blogger: Add a link to a blog comment

You can add a link to your blog or website in a blog comment by adding the blow line in your comment:

<a href="">World Geekz</a>

Replace '' by your blog or website address and 'World Geekz' by title of your site.

Java: Removing duplicate entries from a Vector or a List

Removing duplicates entries from a Java Vector( or List) is very simple. We can simply create a new set from the existing Vector( or List), cast it to a Vector( or List), and replace the current data structure.

  1. mVec = new Vector<String>(new LinkedHashSet<String>(mVec));

This occurs because, unlike a Vector or a List, a Set cannot contain duplicates. A full example can be seen below:

PATH variable in Scientific Linux

It is often needed to permanently add a new path to the global PATH in linux and this tutorial will demonstrate how to do this. This tutorial is specially designed for Scientific linux however the it can be applied to redhat and Fedora.

First, start the terminal and change the working directory to /ect/profile.d/ as follows:

C/C++ - Dynamic (run-time) memory allocation

Initialising an array in C/C++ can only be done with static number, they cannot be variable (At least that was true with older compilers). Basically, the initialization size has to be known at compile time and not run time.

Below we have a example of 2 array initialization, one that will work and a second one that will not always work.

C/C++ - Positive Modulo function

The modulo function is a standard function in C/C++. It allows the user to have a lower and upper limit on a number. This is very useful when one wants to ensure that a given number never exceeds a given limit.

An example of modulo can be seen below:

Android logo is a property of - Windows logo is a property of - Java logo is a property of