21 de agosto de 2009

PCI Wireless Card Realtek 8185 weak signal

The default module to PCI Wireless Card Realtek 8185 has weak signal, something between 5% to 15%, on Ubuntu 9.04 kernel 2.6.28 .

On Mandriva this network device work very well, don't need to worry !

Nevertheless we can solve this problem installing the modeule from Realtek to this device.

The steps are easy:

  1. Download driver from Realtek .
  2. Unzip the file .
  3. Inside the file do make and make install, then reboot
  4. This is a very dirt step, you must install libssl-dev. Try a cable connection to Internet.
  5. unzip wpa_supplicant-0.5.5.zip
  6. cp defconfig .config
  7. make and cp wpa_cli wpa_supplicant /usr/local/bin
  8. reboot and let the job for the networkmanager




5 de agosto de 2009

Benchmark - cpus

Simple benchmark, just floating point calculations.
This can be use to evaluate the performance on Monte Carlo application and numerical recursions without memory use.
We calculate the time for 10^9 m=tanh(ran2(&seed)*m), m=sin(ran2(&seed)*m) and if(ran2(&seed)). (seed=234)
Used cpus in decreasing performance order :

Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
AMD Phenom(tm) II X4 945 Processor @ 3GHz
Intel(R) Xeon(R) CPU X5550 @ 2.67GHz
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+ @ 2.1GHz
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - Chipset ICH10
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - Chipset ICH7

Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz - Chipset ICH9
Mobile AMD Sempron(tm) Processor 3500+ @1.8 GHz
Intel(R) Core 2(TM) CPU T7200@ 2.0Ghz



Below graph (incomplete) shows time versus cpu for the if(ran2(&seed)) routine
Also the complete spreadsheet

16 de julho de 2009

The fast, the random

The fast and the random

Posted using ShareThis

This is very cool, look at how many bit per second they can resolve !
Put on a USB device and sell it!

9 de julho de 2009

Matrices Direct Product C GSL routine

This is my amateur routine of Matrices Direct Product or Kronecker Product using GSL. There is no advantage in doing this with GSL library, this is just a exercise.


#include <stdio.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_math.h>

double *produtodireto (int a,int b, double A[a*a],double B[b*b])
{
double *AxB;
AxB = malloc(a*a*b*b*(sizeof *AxB));
int i, j, k,l;
gsl_matrix *M = gsl_matrix_alloc (a,a);
gsl_matrix *L = gsl_matrix_alloc (b,b);
for (i = 0; i < a; i++)
{
for (j = 0; j < a; j++)
{
gsl_matrix_set (M, i, j, A[i+a*j]);
}
}
for (i = 0; i < b; i++)
{
for (j = 0; j < b; j++)
{
gsl_matrix_set (L, i, j, B[i+b*j]);
}
}
gsl_matrix *R = gsl_matrix_alloc (a*b,a*b);
for (i = 0; i < a; i++)
{
for (j = 0; j < a; j++)
{
for (k = 0; k < b; k++)
{
for (l = 0; l < b; l++)
{
gsl_matrix_set (R, b*i+k-b+2,b*j+l-b+2, gsl_matrix_get (M, i, j)*gsl_matrix_get (L, k, l));
}
}
}
}
for (i = 0; i < a*b; i++)
{/* OUT OF RANGE ERRORRRRR */
for (j = 0; j < a*b; j++)
{
AxB[i+a*b*j]=gsl_matrix_get (R, i, j);
}
}

gsl_matrix_free (M);
gsl_matrix_free (L);
gsl_matrix_free (R);
return AxB;
}


Using GSL to calculate Nonsymmetric matrices eigenvalues

Here is a example of using GSL - Gnu Scientific Library - to calculate the eigenvalues of a nonsymmetric matrix.
This is a simple example write in C. GSL uses BLAS and can be optimized with ATLAS, so can be used as a real tool for heavy calculations. To get know more about GSL visit http://www.gnu.org/software/gsl/ or the manual page.

Hint: Beware when using GSL or our own linear algebra routine, remember that greats matrices requires greats responsibilities, so keep track of precision errors. Find precision errors will be a great excuse to know more about multiple precision GMP .


#include <stdio.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_eigen.h>
int main (void)
{
int a=2; //matrix a x a
int i,j;
double cg[a][a];

// Defining matrix
cg[0][0] = 2.;
cg[0][1] = 3.;
cg[1][0] = -1.;
cg[1][1] = 1.;

gsl_matrix *TOTAL = gsl_matrix_alloc (a,a); //Alloc GSL matrix TOTAL

//Setting TOTAL
for (i = 0; i < a; i++)
{
for (j = 0; j < a; j++)
{
gsl_matrix_set (TOTAL, i, j, cg[i][j]);
}
}


gsl_vector_complex *eval = gsl_vector_complex_alloc (a); //Vector whose entries are the eigenvalues
gsl_eigen_nonsymm_workspace *K = gsl_eigen_nonsymm_alloc (a); //alloc work space for GSL nonsymmetric calculations
gsl_eigen_nonsymm (TOTAL,eval,K);
gsl_eigen_nonsymm_free (K);
gsl_matrix_free (TOTAL);


for (i = 0; i < a; i++) /* OUT OF RANGE ERROR */
{
gsl_complex eval_i = gsl_vector_complex_get (eval, i);
printf ("%g + %g*i\n",GSL_REAL(eval_i),GSL_IMAG(eval_i) );
}
return 0;
}

8 de julho de 2009

Testando a extenção do Firefox Firescribe

Gostei !!



26 de abril de 2009

casa de ferreiro, espeto de pau

A linux mall é tem muitos produtos interessantes, eu costumo comprar coisas lá, a entrega é muito boa etc.

Estou precisando de um novo router e um adaptador wireless e ao consultar a loja me deparei com um fato muito estranho.
O adaptador parece ter drivers disponíveis para linux (RTL8187B). Custa testar e aprovar ?
Vamos lá, a loja tem um nicho específico !