This is an unofficial blog.It's a sort of personal diary of my toughs (please consider them as private, and cannot be used or reference without prior consent from my part) Please remember that this blog is my personal diary ideas and I am the only person that should be able to decrypt those thoughts (and some case I am not able to decipher those thoughts, so if are good in riddle you might be able to understand something.).
Mar 31, 2012
Diamonds in a pile of shit vs shit warped with a fancy golden paper
Mar 22, 2012
Copy a pdf table into excel
In the last couple of weeks, I was searching for some evidence in the literature related to resource usage in telemonitoring. And part of this job consisted on copy pasting table from PDF(I recommend using Foxit reader instead of Adobe reader ) to word. And believe me it’s not that as easy as you might think. In some cases, MS word can do most the work by converting the text into a table ( option 1), but in some cases the formatting of the original data is so distorted that even word cannot sort it. That why, I have written the following VBA code (option 2) to be added to excel (It could be useful in certain circumstances, and easily tweaked according to the original data).
Function TestingRev(inputStr As String) As StringDim nbCol As IntegernbCol = 4Dim revInputStr As StringrevInputStr = StrReverse(inputStr)Dim ret As Stringret = Replace(revInputStr, " ", ";", 1, nbCol - 1)TestingRev = StrReverse(ret)End Function
Feb 25, 2012
Il faut vraiment changer les elections presidentielles
Depuis le premier plan de « sauvetage », la dette grecque est pourtant passée de 263 milliards en 2008 à 355 milliards en 2011. Le PIB s’est effondré de 233 milliards à 218 milliards. Le chômage a explosé de 8% à 18%. La récession est massive, et avec un taux d’intérêt officiel à 32%, il va de soi que la Grèce ne peut absolument plus se financer sur les marchés financiers. L’Euro tue la Grèce, mais la Grèce doit coûte que coûte demeurer dans l’Euro !puis ce que je crains que la même situation peut se reproduire dans d'autre pays notamment le notre si on continue a elire nos presidents, senateurs et deputes de la meme facont
Feb 3, 2012
Dynamic programing and the knapsack problem.
As I always forget the structure of a dynamic algorithm, this note is a reminder of the key idea behind the dynamic knapsack programming.
The knapsack problem is when we consider a large set of object having different size and value, knowing that the knapsack have a fixed size (S) the objective is to pack the subset that give the highest value ( to simplify the problem , lets say it Thief that have to choose which valuables to put in his bag)
Let vi be the value of the object i and si the size of the object i.
1- The first key idea is that the items are sorted by efficiency with is the price of an item divided by its size , in a decreasing order (most efficient to the worst efficient).
P1/s1 >= p2/s2 >= p3/s3 .......
2- The second key idea is related to space of solution, where the set of object to be considered is incremented gradually, following the order of the efficiency of objects. So N1={obj1} , N2={obj1 , obj2} .....
3- And the main idea to solve the sub knapsack problem of the size Z <= S and considering the sub space of solution Ni we need 2 values:
· The max benefit that we can get from the knapsack Z considering the for the subset Ni-1
· The max benefit that we can get from the knapsack (Z-si) considering the for the subset Ni-1
Therefore, if the max benefit from the knapsack Z-si added to the value pi is higher than knapsack Z for the solution space compose from the subset Ni-1, then the solution would be to add the item i to the set of object selection in the knapsack Z-si. If not the solution for the intermediate knapsack Z / Ni would be the solution knapsack Z / Ni-1.
......
Jan 16, 2012
Comments on TED videos
Wirless devices , patch to monitor , vitals signs , sleep, BR, .... He is part of the Wireless medical institue.
Jun 13, 2011
Configure Visual studio C++ 2008 express edition with IBM Ilog Cplex and Concert libraries
First you need to create an empty C++ application
1 - Then you go to your project Menu and choose properties.

2 - In the configuration manager, change the configuration from debug mode to Release ( If you are going to use concert ; you have to program without debugging as it uses macros incompatible with the debug flags that the compilor add to your code), that the price that you have to pay with concert it's a double eddged sword. You write less code, but if you have an error you have to start guessing and trust me you could loose a lot of your time guessing and trying to figure out what went wrong.

3- You need to change compiler flags ( aka C/C++ in the configuration settings)
In order to use any C++ library you need the library itself .lib and the Header files (*.h or *.hpp). The lib 's header files indicate the compiler to the content of the lib file( a sort of Table of content). So when you compile your code, the compiler only check if the function you are calling figures in the header files and that you are using the proper argument to make the call. After the compilation of your cpp files into object files , the assembler / linker will link your compiled code (*.o) with acttuel function in the lib and produce the executable.
In our case we need to tell the compiler the path to the header files for cplex and concert libs .So you will need to add the path in the Additional Include Directories. you can use the small button on the path line to choose via explorer the directories. ( there is two include folders that you need: the cplex include folder and another include folder in the concert folder )

4-Disable the debug information format ( It could be that it's not required any more)

5 -Add IL_STD to the preprocessor definition ; it's the equivilant of -D in gcc , you can a define IL_STD at begining of your main file; i didn't check the files in the cplex include directory to see exactly what is the effect of this option . And also It could be that its not used any more

6-I don't remmeber why, but I usually choose MT as a Runtime library and in the next section I choose the library in the in stat mta ( I could be wrong , may be you can check if there is any impact on the speed of the execution )

7 - After the compilation you need to assamble your code. The linker wil assemble all the .o files into an executable and will need the libraries that you are calling to make the final excutable. You need to add to the Additional Dependencies in Input section of the linker , the exact location of you cplex library and concert + winsoc32 lib
In my case I had to add the following line :
wsock32.lib
C:\ILOG\CPLEX_Studio_AcademicResearch122\cplex\lib\x86_windows_vs2008\stat_mta\cplex122.lib
C:\ILOG\CPLEX_Studio_AcademicResearch122\cplex\lib\x86_windows_vs2008\stat_mta\ilocplex.lib
C:\ILOG\CPLEX_Studio_AcademicResearch122\concert\lib\x86_windows_vs2008\stat_mta\concert.lib

Tip Use ( use the windows explorer aka my computer ) , browse to the folder in question then right click on folder hiearchy satuts bar and copy the path
Jun 12, 2011
Use the send mail to send the results from the server
I found this code this code on this post from ambikeh: http://www.unix.com/302072420-post2.html for more info on the send command http://linux.about.com/od/commands/l/blcmdl8_sendmai.htm
But i need to say that i didn t have time to test it
( cat << ! FROM : $FROM To : $TO Subject : ${SUB} Cc : ${CC} ! cat << ! HOPE THIS WORKS Test123 This sample E-mail message with the Unix sendmail utility. ! #uuencode ${1} ${1} ! ) | /usr/lib/sendmail -vt