UNIX & GNU/Linux - awk - Using the FILENAME variable

With the awk FILENAME builtin variable, we are able to retrieve the name of the file passed as argument during the execution.

It will avoid us to use a regex command line. Sometimes interesting.

Let's see this.

UNIX & GNU/Linux - awk - Using NR to display line numbers before each line from a file

We have a file with customers inside.

We would like to display all the file with line numbers before each line.

Let's see this in this awk tutorial.

C++ - Tips'n Tricks - Creating an object onto the stack and into the heap

Stack and heap enable data management inside the memory.

But some data are added onto the stack and the other into the heap.

For the stack, there is a stack pointer that enables to catch the last data added onto the stack.

Java - Tips'n Tricks - Printing four patterns using loops

In this Java tutorial we are going to see how to display four patterns using the while and for loops.

Notice that this example works in every language as well, just change the print() method depending on yours.

Perl - OOP - Creating classes with methods

As every language, OOP is a plus. And who says OOP, says classes and methods.

Perl is able to manage such of things. That's what we are going to see in this Perl tutorial.

Let's create classes and their methods.

Perl - Native functions - Using print()

The Perl print() function is used to display a string.

In our example, we are going to display the content of two variables previously declared and initialized.

So, let's go to our first Perl HelloWorld! tutorial!

Oracle - VirtualBox - Installation

VirtualBox is a virtualization manager that enables to add different OS on other OS.

Let's admit you have a PC with Windows 7 installed. In the past, if you wanted to have a Linux, you were obliged to install it like any OS with a DVD and boot on it.

And then, reboot each time you wanted to use one of them.

C++ - OpenGL - Using glRotatef() to animate shapes

Rotating a shape is fun, but rotating it with animation is really great.

That's what we are going to see in this glRotatef() tutorial for animating shapes on a window.

Our shape is made up of 3 squares with 3 different colours:

C++ - Errors / Warnings - Cannot declare member function ‘static void MyClass::myMethod()’ to have static linkage [-fpermissive]

In C++, we don't need to specify the static keyword in the declaration of the header and in the definition in the class.

It means that this keyword has to be added only in the header.

UNIX & GNU/Linux - bash - Setting the colour prompt with PS1

You like your shell but you think that some colours would be better.

Let's see how to set colours of the bash prompt with the PS1 variable.
Notice that this tutorial has been made with Ubuntu 12.
Some syntaxes may change depending on the operating system.

Pages

Subscribe to BadproG.com RSS