Creating Excel files from PHP Lee AwesomeBytes en español!

I needed to make a little app to make some listings in Excel and the easiest and fastest way to do it accesible to everyone was to upload it to the web. So I’ve searched how to create Excel files from PHP.

To do this I found the class IAM_XLS. With it you can create a .XLS file and add data to it (from a msql query or generating the data) and give it out to the explorer to download. Here you have an example of code:


<?php
require("iam_xls.php");

//Create EXCEL file in memory
$mid_excel = new IAM_XLS('tickets');

$i = 0;
$fila = 0;
while($i <= 50) {
//Write on cells
$mid_excel->WriteCellNumber($fila, 0, $i);
$mid_excel->WriteCellText($fila, 1, "texto");
$fila++;
$i++;
}

//Spit out the file in the browser
$mid_excel->OutputFile();

?>

Pretty simple, I had never done anything like this and in a few minutes I had it working.
It comes with enough documentation, in web format.

Tags: , , ,

Solution to Outlook printing emails bad Lee AwesomeBytes en español!

The other day in the office there was a computer that started to print emails from Outlook 2003 and from the web-client of Outlook in a bad way. They were cut from the sides like if there was no margin. Trying other programs, they print well.

The solution was in going to Internet Explorer, and go to Archive / File > Configure page and give it margins. (Sorry about the menu items, I don’t have an english version of Windows to look for the correct words of the menu).

Tags: , , , , ,

Ducks – Dog mask Lee AwesomeBytes en español!


Hahahahahahaha incredibol!

Tags: , ,

How to configure environment variables in Windows Vista / 7 Lee AwesomeBytes en español!

I’ve had a little trouble installing strawberry perl and I’ve needed to configure my environment variables on my Windows 7. I needed to edit my %PATH% variable.
To do this we can go to:

Right Click on Computer > Properties
Advanced System Settings (left side)
(On Advanced Tab) Environment variables button

Tags: , , , , , , ,

How to identify the right earphone from the left one easy! Lee AwesomeBytes en español!

Via Microsiervos (spa) I found out an easy way to difference the right earphone from the left one of a headset, even in the dark: Just make a little knot in the right one!

Tags: , , , ,

Connecting to a network disk remembering credentials in Windows XP Home Lee AwesomeBytes en español!

I got tired of entering the password of the account I use to connect to a shared device (a folder) from Windows XP Home Edition (this version does not have enabled the “remember credentials” button in the connect to network drives window).
So I decided to search a way to get rid of that, and its pretty easy:

Net use L: "\\COMPUTER\Shared Folder" /user:USER PASSWORD

You only need to create a .bat file (a text file but changing the extension to .bat) with that linea (adapted to your case) and add it to the Start-on-boot stuff of the PC.

Tags: , , , , , ,

Remove blue background of Windows icons Lee AwesomeBytes en español!

Today at the job I’ve found a computer that had all the icons “like selected” with the blue background in the text.

To get rid of this effect I found the next solution (after many that didn’t work):

1. Right click on the Desktop
2. Properties
3. Desktop Tab
4. Personalize Desktop Tab
5. Web Tab
6. Unselect anything you don’t use

This was found out via nocturnar forums (spa).

Tags: , , , , ,

Using the Accelerometer in Android Lee AwesomeBytes en español!

To help a buddy (r4sh44t) I’ve compiled some code pieces of how using the orientation (accelerometer) in Android. Just in case someone finds it useful.

Global variables that will be useful:

//Justo despues de la declaracion del activity (public class MICLASE extends Activity{ ) podemos declarar estas variables globales
//Just after the declaration of the activity (public class MYCLASS extends Activity{ ) we can declare these global variables
private SensorManager myManager;
private List sensors;
private Sensor oriSensor;
private float oldA;
private float oldP;
private float oldR;

Capturing the sensor:

//Capturar sensor de orientacion (en el onCreate!)
//Capture orientation sensor (in the onCreate!)
myManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
sensors = myManager.getSensorList(Sensor.TYPE_ORIENTATION);
if(sensors.size() > 0)
{
oriSensor = sensors.get(0);
Toast.makeText(getApplicationContext(), "Sensor OK",
2).show();
}
else Toast.makeText(getApplicationContext(), "No Sensor", 2).show();
myManager.registerListener(mySensorListener, oriSensor,
SensorManager.SENSOR_DELAY_GAME);

Reading from the sensor:

//Leer del sensor
//Reading from the sensor
private final SensorEventListener mySensorListener = new SensorEventListener()
{
public void onSensorChanged(SensorEvent event)
{

//Aqui la funcion que usara los datos del sensor
//Here the function that will use the sensor data
yourFunctionThatUsesTheData(event.values[0],
event.values[1],
event.values[2]);;
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {}
};

Using the data:

//Ejemplo de una funcion que use los datos, solo teniendo en cuenta el cambio desde la ultima vez que se leyó
//Example of a function that uses the data only using the difference of movement from the last read
private void yourFunctionThatUsesTheData (float a, float p, float r){
float thisA = a - oldA * 10;
float thisP = p - oldP * 10;
float thisR = r - oldR * 10;
oldA = a;
oldP = p;
oldR = r;

//Hacer cosas con estas variables
//Do stuff with these variables
}

And to understand what a p & r mean here you have a graphic:

Tags: , , , , , , , , , ,

Recover Touchpad Ubuntu Lee AwesomeBytes en español!

Today I upgraded the ubuntu of my netbook and I found out that when I came back to the OS my Touchpad didnt work anymore. After trying to fix it with the man of xorg.conf and failing googling i found the solution:

You need to login as root (sudo does not work) and execute the following command.

echo options psmouse proto=exps > /etc/modprobe.d/psmouse.modprobe

And after that reboot.

PS: If you don’t have an external mouse to plug in, hitting control+alt+F2 you can find a console.

Via: danilogurovich

Tags: , , , , , ,

Sorry, but this post is not available in English Lee AwesomeBytes en español!

Sorry, but this post is not available in English

Tags: , ,