Flu detector in the media

Our latest work, where we predict flu rates from the content of Twitter, has been featured in the media.

The primary article was published in MIT Technology Review:
"How Twitter Could Better Predict Disease Outbreaks" (July 14, 2010)
by Christopher Mims

It was also reproduced in or pointed by New York TimesCommunications of the ACMKurzweil Accelerating Intelligence  and Federal News Radio.

A departmental press release about it is also available:
"Predicting Flu from the content of Twitter" (July 1, 2010)
in the news of Computer Science Department, University of Bristol

Flu detector is available at http://geopatterns.enm.bris.ac.uk/epidemics/ and will be presented to the public in ECML PKDD 2010 (September 20-24).

A presentation using the LaTeX beamer class

LaTeX  presentation screenshot Do you think that a presentation in LaTeX looks better than what is produced by a WYSIWYG editor? Then start using the beamer class! Beamer is a LaTeX class which provides a lot of easy commands - tricks - libraries for producing presentations. Yes, the ones that you were used to author using Microsoft Powerpoint or similar WYSIWYG editors. I was searching the web for a proper and easy-to-follow example of the beamer class, but it took me some time, so when I finally compiled a LaTeX presentation, I thought it might be useful to make it publicly available. Therefore, the attached documents are only good for beginners!

If you are using MiKTeX in WinEdt, my source code should be considered as plug and play! There is no need to download the beamer class, WinEdt will do it for you automatically (at the compilation time). My sense is that in any modern LaTeX setup scenario the .tex LateX source code for the presentation should compile OK.

All the files (a .tex file and 2 figures) are included in this archive:
-- Presentation using beamer class in LaTeX

The final outcome is the pdf file:
-- LaTeX presentation pdf

Those files are a very good starting point (template). There is always a lot of information available online about everything. You can do magic, if you want to do more!

 

How to terminate the execution of a process after some time in Linux

Suppose that you have to execute a Java program which is fairly unstable and sometimes hangs on and never terminates. Is there a simple way to make it terminate (actually by killing the process) after some time? Yes, of course. There is always a way for such things. Ways for everything do not exist though.

So, let's say you have a program.jar to execute but you want to kill its process after 5 minutes in case it does not terminate. A very easy way to do this is the following:

#!/bin/bash

# here you set the time you want to wait before killing the process
time=5m

# then you run your program in the background
java -jar program.jar &

# you are waiting for the time you have set
sleep $time

# some printing - for fun
termination="\nTerminating the process...!!\n"
echo -e $termination

# and now you are about to kill it
kill %1

You can create a script.sh file, just copy paste the code above, and then run the script.sh file (by using the command > sh script.sh).

Hints on linux cron jobs - A quick tutorial

If you really do not know what a cron job is, then please have a look at the Wikipedia's article first.

Hint 1: Keep in mind that cron does not know where your home directory is OR does not see your directory structure. Be careful and specify the full path of the things you call (like /usr/java/bin/java etc.). This is not enough; in several occasions you have to add an extra line to your crontab file in order to define your HOME path. It might be something like that:

HOME=/
You have to write this inside the crontab file.


Hint 2
: How do I edit my cron jobs? You have to open a file called the "crontab" and simply edit it. To do that just type:

>> crontab -e
Beautiful vi editor will open; now you can edit your cron jobs.


Hint 3
: I hate vi. How do I open the crontab with an other editor?
You have to type three commands this time:

>> EDITOR=gedit (I pick gedit - you may pick another editor)
>> export EDITOR
>> alias editor=$EDITOR
Now run crontab -e again and the beautiful gedit will open (civilisation!).


Hint 4
: Hmm, what else should I write inside the crontab file? What about the actual syntax of the cron jobs? OK, it is nothing special. You just have to type a command to be executed. Right BEFORE the command you have to specify WHEN do you want to execute this command (or how often). You will use 5 space separated text fields for that. This is an example of a line in a crontab file:

* * * * * /usr/java1.6_02/bin/java -jar /home/programs/tetris/dist/tetris.jar
This creates a cron job that will open a tetris java based game. The 5 stars mean that this thing will be executed once per minute (and after a while your computer will have a problem because this .jar is not a very light or smart application). Actually the first star controls minutes, the second hours, the third days, the fourth months and the fifth years. It is really simple. Is it? How do I set a cron job to run every two minutes? This is how:
*/2 * * * * <your_command>
You just have to type a slash 2 right next to the first star!

 

How do I set a cron job to run every day at 21.00?

0 21 * * * <your_command>
That's it... -:)


Hint 5
: How do I avoid receiving this huge email with the cron job's output?

Implicit declaration of function abs

You are a beginner in C programming language (maybe 1st year student in a computer science department) and you want to meet a deadline for a programming assignment. The program specification is simple (because it is still the beginning) but there is something annoying happenning with your source code.

The course instructor has forced you to compile your C programs with all the appropriate flags enabled, e.g.

>> gcc program_name.c -ansi -pedantic -Wall -o program_name

Your program includes mathematical functions and as a result you have included math.h library and you have added -lm flag during compilation time:

>> gcc program_name.c -ansi -pedantic -Wall -lm -o program_name

Your final program should work (perfectly!) and after compilation NO warnings should appear. Otherwise, you lose points on your final mark! :-)

You have followed all the instructions, your program is working(!) BUT you still get an annoying warning, like:

implicit declaration of function abs

You try again and again, you 'google' this warning but there is no RESULT. Usually, the compiler is absolutely right and points to the right direction (in simple programs of course). So, there is an implicit declation of the 'abs' function (which returns the absolute value of a number). Something is missing. What? The following line (in most of the cases):

#include <stdlib.h>

You should include stdlib.h library as well. Don't forget that! That's it ... it should have helped you! -:)

Syndicate content