Starting with concurrency and a “Hello world” using pthreads

December 31, 2013 No comments


Nowadays is very common to see dual-core or quad-core CPUs, but there are still systems with one single core.
In this post, I want to about the very basis of concurrency, a brief introduction to this world, so some descriptions …

MySQL loops and cursors with examples

December 16, 2013 No comments

First of all, you may not abuse of these techniques, and you must use them only when necessary. Most of the times you can find a faster solution.

Let’s see an easy loop, similar to a for loop, we will …

Regular expressions in C++ with Glib::Regex

November 30, 2013 No comments

In our programming life, there are some “before and after”s, and one of them is when we learn to use regular expressions… and they are like Twitter, you start with it, follow some famous people and a couple of friends, …

Call a variable whose name is contained by another one [BASH]

November 4, 2013 No comments

numbers

I’m sure this has happened to you. Imagine we have three variables (RED = “ff0000″ ; GREEN = “00ff00″ ; BLUE = “0000ff”) and a function which giving the name of the color, it gives us the code. Ok, we …

Prevent a delayed website because of a crashed server

November 1, 2013 No comments

When we are generating content for our website dinamically, sometimes information comes from outside, so the information we serve not only depends on our server, we have to retrieve it from another place, and this may not be controlled by …

Logging to debug MySQL

October 30, 2013 No comments

It’s common, when using more or less complex stored procedures, to make mistakes that make us waste much time, and sometimes we would like to see the value of a variable or the result of a query because it could …

Backup MySQL users

October 28, 2013 No comments

When we are dumping a MySQL database, is normal to ignore “mysql”, “test” and “information_schema” databases. We could have undesirable problems when restoring, for example if we change MySQL version.
But sometimes, when backing up the database we want to …

Know PHP methods visibility (public, protected, private)

October 24, 2013 No comments

When coding in Object Oriented PHP, sometimes we would like to know the visibility of certain methods. For example, we are using an instance of an unknown class in compile-time (or coding time) with its name in a variable just …

Get the HOME directory in C

October 23, 2013 No comments

In our programs, it’s usual to know where is the user home directory, to read/store configuration files, to search for something, or to know if the program is installed globally or locally.

There is a short function to get it:…

stermp.h, trying to port conio.h to Linux

October 22, 2013 No comments

This time I want to rescue an old project. I started it long ago. These days I’ve been reading some source codes in facebook using conio.h so I hope this could be interesting for anyone.

Of course there are some …

Top