31/07/2011

GNOME 3 add applications taskbar/panel

GNOME 3 does not have, like GNOME 2, two taskbars: one for the applications and one for the system tray. It is possible to add the application taskbar (which includes a system tray panel too) manually with the project tint2. All instructions for installing under different distros are available directly on the developers website.

ITALIANO:


GNOME 3 enable right click on desktop and show icons

GNOME 3 by default doen’t show any icon on the desktop and does not allow right-clicking it. You could change this behaviour manually:
  • run yum install dconf-editor as root or install it via add/remove software and launch it when it’s ready
  • navigate the menus through org –> GNOME –> Desktop –> Background
  • search for the show-desktop-icons entry and chek its checkbox
ITALIANO:

GNOME 3 add minimize and restore buttons to windows

GNOME 3 by default shows only the “close” button on windows. You could add the other two (minimize and restore/maximize) manually:
  • run yum install gconf-editor as root or install it via add/remove software and launch it when it’s ready
  • navigate the menus through Desktop –> GNOME –> Shell –> Windows
  • search for the button_layout entry and edit its value to :minimize,maximize,close (colon included!)
  • restart nautilus or log out and in again to see the changes take effect

ITALIANO:

Realtek wireless on Fedora

This article applies to the 819x Realtek wireless cards series like models 8191SEvB, 8191SEvA2, 8192SE, …

Main reference site is Stanislaw Gruszka’s compact wireless website.

You can either try the -stable version or the –next. Both have different kernel requirements, the –next version, though more unstable, is compiled against the latest kernel version so you should run yum update kernel as root before installing the appropriate package for your system.

After installation you will have to reboot the system before being able to use and control your wireless card through NetworkManager.

 

ITALIANO:

 

Questo articolo si applica ai modelli di schede wireless Realtek serie 819x quali 8191SEvB, 8191SEvA2, 8192SE, …

Il sito di riferimento é compact wireless di Stanislaw Gruszka.

Potete provare sia la versione -stable che la –next. Entrambe hanno differenti requisiti di kernel, la versione –next, sebbene piú instabile, é compilata per l’ultima versione del kernel supportata dal sistema per cui é sufficiente lanciare yum update kernel da root prima di installare il pacchetto corretto per il proprio sistema.

Al termine dell’installazione sará necessario riavviare il sistema prima di poter usare e controllare la propria scheda wireless attraverso il NetworkManager.

20/07/2011

[MatLab] EM – Expectation Maximization reconstruction technique implementation

EM – Expectation Maximization is an iterative algorithm used in tomographic images (as in CT) reconstruction, very useful when the FBP – Filtered Back Projection technique is not applicable.

Basic formula is:

f_k+1 = (f_k / alpha) (At (g / (A f_k)))

where:

  • f_k is solution (the resulting reconstructed image) at k-th iteration, at first iteration it is our guess
  • g is image sinogram (what we get from the scanning)
  • A f_k is Radon transform of f_k
  • At is inverse Radon
  • alpha is inverse Radon of a sinogram with all values 1 which represents our scanning machine

Get the source code here.

[MatLab] SIRT - Simultaneous Iterative Reconstruction Technique implementation

SIRT – Simultaneous (algebraic) Reconstruction Technique is an iterative algorithm used in tomographic images (as in CT) reconstruction, very useful when the FBP – Filtered Back Projection technique is not applicable.

Basic formula is:

f_(k+1) = f_k + At (g - A f_K)

where:
  • f_k is solution (the resulting reconstructed image) at k-th iteration, at first iteration it is our guess
  • g is image sinogram (what we get from the scanning)
  • A f_k is Radon transform of f_k
  • At is inverse Radon

Get the source code here. Note: this sample code is to showcase the algorithm. It does not use FBP for the iradon, it adds noise, it normalizes the image values as per OUR needs. Given these difficult conditions, it still produces an amazing result.

Please check the comments carefully and tailor it to your use case!

[MatLab] Filter a tomographic image in Fourier’s space

MatLab has built-in functions to simulate acquisition and elaboration of tomographic (as in CT) images. When it comes to filtering the image prior to back-projecting it, it is possible to do it yourself without relying on the (good as in Shepp-Logan) filters MatLab has.

 

We will filter our image in Fourier’s space. For each column of the sinogram, we:

When we reconstruct our image WITHOUT having MatLab apply any filter, we’ll see the image, filtered with our filter, as a result. Get the source code here.

06/07/2011

[PHP] PageRank implementation




There are two possible PageRank implementations: the power method and the iterative method. We will describe both.

To check the results obtained we provide a scri'pt to generate a .gexf file to be opened with Gephi.

Test datasets are available at the Toronto university website.


Technologies used:
  • PHP
  • Gephi
  • XML
1.Power method
 

This method takes longer than the other one, however the result is equally right. Using a sparse matrix instead of the full one may help speed up the process.

Method description:

  1. Pick the NxN input matrix and make it stochastic, call it A
  2. Create the P" matrix as alpha*A+(1-alpha)*M with alpha a factor which describes the probability of a random jump and M an NxN matrix filled with values 1/N
  3. Create starting vector v_0 with length N filled with values 1/N
  4. Compute v_m = v_m-1*P" where the first time v_m-1 is exactly v_0
  5. Compute the difference v_m - v_m-1 which should converge to 0
  6. When the difference doesn't vary over a certain threshold or i iterations have been made, stop. v_m should contain the PageRank for every page
To run the program you must have the nodes and adj_matrix files from the chosen dataset. The implementation source code is found here here.

NOTE: Due to Apache and PHP limitations, you may have to modify the php.ini file to grant more memory to the scripts (if you don't want to store the matrix on filesystem like we did) by setting the memory_limit parameter to at least 768MB and raising the maximum script execution time to 5 minutes(300 seconds) with max_execution_time.

2. Iterative method - found on phpir

To use this method you must have the
nodes and adj_list files from the chosen dataset.




Method description:


Each page is given a starting PR of 1/N where N is the number of nodes in the graph. Each page then gives to every page it links a PR of current_page_PR/number_of_outbound_links.
It's introduced a dampening factor alpha (0,15) which represents the probability of making a random jump while visiting the graph or when reaching a cul de sac.

PR_new = alpha/n + (1-alpha)*PR_old




Every PR is then normalized between 0 and 1.

The process keeps going until it has reached i iterations or the difference between old and new PR doesn't vary over a certain threshold.

Our implementation is available here.


3. Gephi parser:

To use the
parser you you must have the nodes and adj_list files from the chosen dataset. The parser outputs a .gexf file to be opened with Gephi. Here is a sample .gexf file obtained by parsing the first dataset available on the site (the one about abortion).