Category: Programming

The devil made me do it.

Me: why(22.4367)
MATLAB: The devil made me do it.

Years ago, when I was taking my first programming course on MATLAB, I learned a cool function in MATLAB: why This tiny function basically gives you some random statements. Try typing “why” and enter. It gives you outputs like this:

Since it is a random sentence generator, you can also give a seed number to it (like why(100)) and...


oppa! – Optimization Performance Profiler Appliance

Often I need to compare algorithms or software. This comparison often involves solution time and/or number of nodes in the branch and bound tree. In their 2002 article Elizabeth D., and Jorge J. Moré proposed a performance profile to be used to compare optimization software. This is a particularly nice way to compare systems, that tells more than other similar methods. Generating...


Modulo of Multiplication of Big Numbers in C

Recently I had some difficulties to generate pseudo-random numbers in C by using Lehmer’s method. Lehmer random number generator is an easy-to-implement algorithm that provides random number stream. Basically you have a multiplier (a) and modulus (m) which you use in a basic arithmetic to get next number. Let we have the initial seed  $$s$$, than the following numbers can...


How to really clean the Putty terminal?

Almost for two years, I was suffering from using clear  command in Putty terminal screen. If you have used it before, you could recall that this command is not cleaning the terminal. It’s just shifting your code. So whenever I scroll up, I was welcomed by my ugly code. Damn! It is especially annoying when I’m running make  command to compile my...