Popular Posts

Wednesday, June 13, 2012

Installing ROS Fuerte on Fedora 17 (Failed!)

I just installed a new Fedora 17 system to get familiar with it. Now I am trying to install the brand new ROS Fuerte on this Fedora system following the instructions here.

Everything went fine until the make & install step

make -j8
sudo make install

First, it is better to be cautious and just type 
without the
part. Parallel compilation can get you into trouble some times! Second, with the
sudo make install
step, I got an error complaining about the directory ~/ros-underlay/catkin/bin/em is not found. Seems like this directory have to be present as if in a Debian system. So, mkdir ~/ros-underlay/catkin/bin/em solved this problem (apparently!).

Following the instructions with the Desktop-Full install, I got another error at the step
rosdep install -a

ERROR: Rosdep experienced an internal error.
Please go to the rosdep page [1] and file a bug report with the message below.
[1] : http://www.ros.org/wiki/rosdep

Bad installer [yum]: global name 'pkgs' is not defined

Actually, it seems like there is a ticket filed already for this bug here. Following the bug assignee instructions, I downloaded the latest rosdep from github, and then extracted the archive ans installed it using
sudo python setup.py install

The error disappeared. But now I have other errors!

Executing script below with cwd=/tmp
export PREFIX=/usr/
if [ -f $PREFIX/include/assimp/assimp-version.installed ]; then
  [ 2ed0b9954bcb2572c0dade8f849b9260 = `cat $PREFIX/include/assimp/assimp-version.installed` ]


ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rxtools: No definition of [swig-wx] for OS [fedora]
python_qt_binding: No definition of [python-qt-bindings] for OS [fedora]
image_proc: No definition of [opencv2] for OS [fedora]
image_view: No definition of [opencv2] for OS [fedora]
cv_bridge: No definition of [opencv2] for OS [fedora]
image_rotate: No definition of [opencv2] for OS [fedora]
opencv2: No definition of [opencv2] for OS [fedora]
image_geometry: No definition of [opencv2] for OS [fedora]
cv_markers: No definition of [opencv2] for OS [fedora]
stereo_image_proc: No definition of [opencv2] for OS [fedora]
opencv_tests: No definition of [opencv2] for OS [fedora]
depth_image_proc: No definition of [opencv2] for OS [fedora]
camera_calibration: No definition of [opencv2] for OS [fedora]
pcl_ros: No definition of [pcl] for OS [fedora]

I tried installing the assimp-devel package. But this did not solve the problem. I also installed the opencv-devel and the pcl-devel packages.

At this point, I decided to abandon it altogether, since I need to make a custom YAML config file! Since Fedora was a fresh install anyway, and since ROS only supported Ubuntu officially, I decided to give it a try on Ubuntu 12.04.

Fix to garbled display on booting Ubuntu 12.04 on Dell Vostro 470

Trying to install Ubuntu 12.04 on Dell Vostro 470 gave me all kinds of trouble! At first, the graphical installer did NOT work, so I had to try the text-based installer (aka alternate installer). It was successful, but then I had to manually install the ubuntu-desktop package since I had no desktop installed! Not to mention that I was only able to log in to the system using the Recovery mode from GRUB menu. The default mode was giving me a garbled screen similar to this one, and I could never log into my system.

To fix the garbled display problem, I did what was advised on this page, by changing the kernel command line from 'quiet splash' to 'nomodeset':

1)Edit: /etc/default/grub

2) Update GRUB by:
sudo update-grub

Now I can log in to my system from the default entry on GRUB!

Saturday, March 10, 2012

Root Cause Analysis for library.nu

Indeed, this is one of the best articles I have read in a very long time! The author takes a deep look at the shutdown of the library.nu website (formerly GigaPedia) and analyzes the real causes for the flourishing of such a 'pirate' society in our modern times. Long live Open Access to Knowledge!

Saturday, January 7, 2012

Compiling and Installing WFDB version 10.5 on Debian Squeeze

Today I tried to compile and install the WFDB tools from the PhysioToolkit (PhysioNet) on my Debian Squeeze system. I am documenting this experience here!

  1. Download the source package from http://www.physionet.org/physiotools/wfdb.tar.gz
  2. Install the needed Debian packages first. I needed the following Debian packages
    • libcurl4-gnutls-dev (for NETFILES feature support in WFDB, which allows you to work on portions of the PhysioBank data records online, without having to download the entire record on your computer)
    • libexpat1-dev (for XML parsing, some files did not compile successfully while installig the WFDB library because this package was missing)
  3. Follow the steps under "if you download the sources (recommended):" in the official quick start guide. If you are on a 64-bit system (like me!) then do NOT install the WAVE application now
  4. If you installed the WFDB library in a non-standard path (as I did), then probably you will need to adjust the $PATH and $LD_LIBRARY_PATH environment variables. I added the following snippet to my ~/.bashrc, (this will be automatically executed every time you login into a shell -- run '. ~/.bashrc' ('DOT SPACE ~/.bashrc') to execute the profile script immediately!) -- I also needed to manually copy the 'man' folder from the "(path to WFDB installation)/share/man" to '/usr/share/man' for manual enteries to be installed into the system!
  5. # add WFDB binaries to PATH
    PATH="$PATH:(path to WFDB installation)/bin"

    # add WFDB libraries to LD_LIBRARY_PATH
    LD_LIBRARY_PATH="$LD_LIBRARY_PATH:(path to WFDB installation)/lib64"
  6. Now you are ready to install the optional WAVE application in case you are running a 64-bit system. For this, I followed the instructions in this post. (Note: package ia32-libs must be installed!) Finally, you will need to further modify your ~/.bashrc to append the following
# add WFDB-32 binaries to PATH
PATH="$PATH:(path to WFDB-32 installation)/bin"

# add WFDB-32 libraries to LD_LIBRARY_PATH
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:(path to WFDB-32 installation)/lib"
Update1: With WFDB version 10.5.13 on Ubuntu 12.04, I had to manually change two lines in each Makefile of the subdirectories (app,checkpkg,convert,examples,fortran,psd,xml) to compile with libcurl successfully
LC = `curl-config --cflags`
LL = `curl-config --libs`

Otherwise, I was getting errors such as
ann2rr.c: In function ‘help’:
ann2rr.c:370:6: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_global_cleanup'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_easy_perform'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_global_init'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_easy_init'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_version'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_easy_setopt'
/home/islam/wfdb/wfdb-10.5.13/build/lib64/libwfdb.so: undefined reference to `curl_easy_cleanup'
collect2: ld returned 1 exit status
make[2]: *** [ann2rr] Error 1

Update2: Check the solution posted by Murari Srinivasan and George Moody (the author of WFDB) in the comments below. The error above is temporary and should be resolved soon out-of-the-box.

Tuesday, October 4, 2011

Research by Dr. Moustafa Youssef

Today I had the opportunity to attend a session given by Dr. Moustafa Youssef on his research. The key point in his talk was about detecting the presence of humans inside a wireless network area by detecting variations in the wireless signal strength (Received Signal Strength Indicator, RSSI) at the receiver side. Dr. Moustafa introduced his Horus system based on this concept! Imagine the scenario in which your home wireless network acts as an intrusion detection system while you are sleeping at night. Dr. Moustafa and his group developed an all-software solution that provides this functionality by utilizing the hardware of the deployed wireless network and your laptop! If you are really interested, you can watch his Google Tech Talk here. The same concept is eventually being applied in hospital settings as well as discussed in this paper.

Monday, October 3, 2011

The Adaptive Noise Canceller as a High-Pass Filter

In 1975 Widrow et. al. introduced a scientific paper about Adaptive Noise Cancellers (ANCs). Since then, ANCs have been used extensively in different applications. This article is about the use of an ANC as a simple, yet powerful, high-pass filter.

As shown in the figure, a reference DC signal x(n)=1 is fed to a single-coefficient ANC. The noise estimate y(n) is the multiplication of the DC signal x(n) times the single coefficient, or weight, w(n). The noise estimate is then subtracted from the input signal d(n) to obtain a noise-free sample e(n) which can be considered the output of the ANC. e(n) is also fed back into the Least Mean Squares (LMS) Algorithm block, which calculates a new value for the weight w(n+1) based on the correlation between the reference signal x(n) and the error signal e(n) using the equation
w(n+1) = w(n) + mu * e(n) * x(n)
where mu is the adaptation step, usually a very small factor in the order of 0.01.

Widrow et. al. proved in their 1975 paper that this structure is equivalent to a high-pass filter with a corner frequency determined by mu.

The ANC is indeed a very simple, yet powerful, structure that has many applications in different disciplines. Recently, I've used the ANC as proposed by Widrow et. al. with some modifications for adaptive cancellation of power-line interference signals from the electrocardiogram (ECG), as shown in this paper.

Sunday, June 12, 2011

Physiological Signals Datasets

In this post I will be gathering some links about the physiological signals datasets that are publicly available on the web. This post will be updated from time to time!

One of the largest platforms that makes it easy to contribute physiological signals is the PhysioBank platform. Following are some of the interesting datasets available under PhysioBank. The easiest way to access these datasets is through the PhysioBank ATM web interface.

ANSI/AAMI EC13 Test Waveforms
The ANSI/AAMI EC13 standard for electrocardiographic monitors specifies those test signals for evaluating the performance of the electrocardiographic monitors.

Multi-Parameter Databases
Those databases include different physiological signals typical of a patient monitoring device, such as ECG, Respiration, Continuous Blood Pressure, Plethysmogram, ... etc.

An important subset of those databases are the Polysmnographic databases useful for sleep staging. Physionank contains the MIT-BIH Polysomnographic Database, the Sleep-EDF Database, the Sleep Heart Health Study Polysomnography Database, and St. Vincent's University Hospital / University College Dublin Sleep Apnea Database.

MIT-BIH Arrhythmia Database
The most famous ECG arrhythmia database!

Wednesday, May 11, 2011

Worker Threads!

Many times you need to call a function/method that does some really heavy work. However, you don't want this function call to block your main application. You want to maintain a responsive GUI, for example!

This famous problem has a solution using multi-threading. From my background in the C++ Qt framework, I know the basic principles involved. And there is a very famous Qt example that explains how this "Worker Thread" solution can be implemented: The Madelbrot Example

Today I wanted to solve the same problem but in the C# (.Net Framework) context. Fortunately, the MSDN had a similar example that illustrates the solution to this problem, making use of the BackgroundWorker class:

Reading and Writing .Net Applications Settings

Sometimes you have to deal with the .Net framework in a way or another. I was forced to use a .Net C# closed-source library. And that library was automatically reading file paths from ConfigurationManager.AppSettings[]. So, I needed a way to read and modify those settings. Fortunately, this post saved my life!

To read:
string value = ConfigurationManager.AppSettings["oldPlace"];

To modify/write:
System.Configuration.Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

config.AppSettings.Settings["oldPlace"].Value = "3";

More information can be retrieved from the MSDN:

Sunday, May 8, 2011

Precision and Recall

One of the most important metrics used in evaluating the performance of binary classifiers is the Precision-Recall curve.

From Wikipedia:

It is possible to interpret precision and recall not as ratios but as probabilities:
* Precision is the probability that a (randomly selected) retrieved document is relevant.
* Recall is the probability that a (randomly selected) relevant document is retrieved in a search.

This page contains some illustrations to better understand the definitions of Precision and Recall:

Also, this paper relates Precision-Recall curves to the Receiver Operator Characteristic curves:

Finally, this page is further explaining the concepts and elaborating on the F-measure metric that tries to combine Precision and Recall into one measure:

Thursday, May 5, 2011

Splitting a video into frames using ffmpeg

I needed a quick way to split a video sequence into its individual frames and save those frames as images. FFmpeg seemed like a good handy solution. And the short answer is to do this:

ffmpeg -i inputfile.avi -f image2 image-%07d.png

This was a solution proposed in this thread. And for more information you can refer to the detailed documentation of FFmpeg.

PS: FFmpeg is available on Windows and you can get the installers here. If you just need the executable then download one of the static builds.

Monday, June 15, 2009

Deadline Email Notifications using Bugzilla Whining Feature

Bugzilla is a great project. Yet, customizing it to your needs is an overwhelming task!

I was assigned a task that our Bugzilla server should automatically notify the task assignees upon the deadline. After a lot of search and reading, here is what I reached at...

First, since our ISP did block our Sendmail server, we needed another way to send emails from Bugzilla... and this post saved my life:


The perl module Email::Send::SMTP::TLS was installed using the CPAN command:

perl -MCPAN -e 'install Email::Send::SMTP::TLS'

Then, from the administration, the email service was set to SMTP::TLS as per the instructions in the previous link.

Finally, the bugzilla code was modified as per the instructions, as follows


if ($method eq "SMTP" || $method eq "SMTP::TLS") {

my $smtp_server;

my $smtp_port;

($smtp_server,$smtp_port) = split /:/,Bugzilla->params->{"smtpserver"};

push @args, Host => $smtp_server,

#username => Bugzilla->params->{"smtp_username"},

User => Bugzilla->params->{"smtp_username"},

#password => Bugzilla->params->{"smtp_password"},

Password => Bugzilla->params->{"smtp_password"},

Hello => $hostname,

Debug => Bugzilla->params->{'smtp_debug'};

push @args, Port => $smtp_port if($smtp_port);


Now I have a Bugzilla system that can send emails... well, what about automated notifications? The whining feature came into play...

The whining feature was used to automatically notify the users about deadlines. The was inspired by the instructions in the following links (instructions of Marc):



The whining feature relies on Saved Searches. A 'saved search' is to be created and the search should be done for every member of a group. To execute the saved search for everybody, a group should be created that contains all the users of Bugzilla. This could be done by using the user RegExp '.*'.

Then, the Save Search 'Tasks due soon' was created. It searches all the products for bugs that are open (NEW, ASSIGNED, REOPENED). Then the advanced search (boolean charts) was used to search for only the bugs for which the current user is assigned (Assignee 'is equal to' '%user%') or cc'ed (CC 'is equal to' '%user%'). This was done using the bugzilla Pronoun Substitution feature (http://www.bugzilla.org/docs/2.20/html/query.html). In addition, the bug should have its deadline due soon or overdue (Deadline 'is less than' '+3d'). The final saved search looks like this:

Finally, from the Whining feature in administration, all the pieces were put together as follows:

In sum, the saved search entitled 'Tasks due soon' should be run 'Each day' 'at 15:00' for every member of the group 'everybody' and the search results should be sent 'one message per bug' to the '%user%'.

One question may arise, since we are running the search for all the users, how did we guarantee that the email will be sent to the bug assignee only and not to everybody? This was done using the Pronoun Substitution feature of Bugzilla. Basically, '%user%' is being automatically substituted for by the current user for which the search is done. So, if the current user is not the assignee or on the CC of the bug, there will be no search results, and consequently, there will be no emails sent!

We are not done yet! One final thing needs to be done. Add the whine.pl to your hourly cron, so that cron would automatically run the whine.pl script and Bugzilla start whining. This was done by adding a script 'bugzilla3' under '/etc/cron.hourly/' on a Debian Lenny system. The script was adopted from the 'bugzilla3' script under '/etc/cron.daily/'. Its code is:


set -e

umask 022



if [ -f /usr/share/bugzilla3/lib/whine.pl ] ; then

su www-data -c /usr/share/bugzilla3/lib/whine.pl



# process the main configuration: /etc/bugzilla3


exit 0

That is all!

Wednesday, March 25, 2009

Sound in GNU Octave on Debian Lenny

I was very disappointed by the poor sound capabilities of the GNU Ocatve project compared to MATLAB. The playaudio() function was inconvenient with nasty '/dev/dsp device or resource busy' messages. This was until I installed the octave-audio package in Debian and had the powerful sound() and soundsc() functions working.

The nasty thing is that those functions didn't work out of the box. They needed to call a play command from the shell. Finally, I discovered that this command is part of the sox package on Debian. I apt-get install sox and now, sound() and soundsc() are working perfectly!

Thursday, March 19, 2009

Installing OpenOffice.org 3.0 on Debian Lenny (stable)

There is no OpenOffice.org 3.0 in lenny-backports till now and I need it! So, I grabbed it from sid (unstable). This discussion helped me a lot:

In short, you need to

  1. add to your repositories (/etc/apt/sources.list)
    deb http://www.backports.org/debian lenny-backports main contrib non-free
  2. Also add to your repositories
    deb http://http.us.debian.org/debian sid main
  3. To stay with the stable and not install packages from unstable by default, we need to add the following to /etc/apt/apt.conf APT::Default-Release "stable";

  4. Then do aptitude install openoffice.org/unstable

Voila! Hope it does not break your system!

UPDATE: OpenOffice.org is now available in Lenny-backports. Now you do not need step 2. So, instead type aptitude install openoffice.org/lenny-backports

Tuesday, March 3, 2009

The long-waited Qt 4.5 Released :)

Qt 4.5 is now officially released.

With the LGPL v2.1 licensing option added, I expect the widespread adoption of Qt into commercial applications!

Qt 4.5 is even better suited for the medical field, combining reliability, performance, flexibility, nice look-and-feel, among other advantages.

Qt 4.5 now has -graphicssystem command-line option to switch the graphics engine of Qt applications to raster or even OpenGL without any change to the code. Yes, your application can draw itself using OpenGL without requiring you to change a single line of code, check:

Moreover, you can have a custom widget plotting itself using OpenGL without requiring the rest of the application to use OpenGL, check:

The LGPL v2.1 has one drawback regarding the use of templates in C++, check:
However, it is stated on the Qt Labs Blogs that Nokia is working on an LGPL exception to overcome this problem. Let's wait and see :)

With a framework so powerful and flexible like Qt, one can ask: Are we watching the dawn of Qt and the sunset of Java and .Net??

Tuesday, February 17, 2009

Adding PDF headers, footers, and watermarks in GNU/Linux

Recently I needed to add a header/footer to an existing PDF file. With some help from this link, I figured it out:

First, use OpenOffice.org Writer (for example) to generate a single-page PDF file that has the needed header/footer/watermark.

Second, use pdftk's background option. Quoting from the man page of pdftk:

pdftk in.pdf background back.pdf output out.pdf

the back.pdf is the file you created that has the needed header/footer/watermark. The in.pdf is the file you need to apply header/footer/watermark to. The result, of course, is saved into out.pdf.

You can also use the dual option stamp instead of background. This will overlay the back.pdf on top of every page of in.pdf.

Sunday, February 15, 2009

Debian Lenny is out... at last!

Debian 5.0 (codenamed "Lenny") is out. Check:
It appears that Debian 5.0 (aka "Lenny") will soon take its big binocular eyes out into the wider world. The Debian project has completed the first release-candidate of Lenny's installer, which features much-improved support for ARM-based devices, along with much faster installation from "live" CDs

The next stable release of Debian is codenamed "Squeeze". Check:
Prepare yourself for Squeeze, that’s right the little green guy. Continuing with the Toy Story names the Debian project has decided to name the next release in the line up after the three eyed green alien who fears “the claw” at Pizza Planet in the movie Toy Story

Tuesday, February 10, 2009

Free Books on "Design Patterns in C++" and Qt

Today is my lucky day :)

I found two free books about Qt and Design Patterns.

The first book is
C++ GUI Programming with Qt 4

The first edition of this book could be downloaded _legally_ for free here:

The second book is a magnificent one. It is the first book I see to explain C++ and Design Patterns in a Qt-ish style!

The book is free as in freedom! It is released online under the Open Publication License (OPL) here:

This is NOT a book, it is a complete PROJECT that I think people should actively contribute to... The bugzilla server for this project and many useful materials could be found here:

For convenience, you can download the whole book compiled into chm format here:

Enjoy the cute Qt!