Posts

Showing posts from January, 2011

Ubuntu - Reduce the heat generated by yout laptop/netbook

Searching for ways to reduce the heat generated by my laptop i found a nice applet that helps to reduce the heat and save battery life.

Depending on the CPU/Processor you have it may have a capability to set its own the cock speed according to the processor load. Mime for instance, a AMD X2, has 1600Mhz and 800Mhz, for surf at internet 800 Mhz is more then enough and extents bouth battery life and reduces the temperature of your computer.
Right click on a free space on your taskbar or "panel".Select "Add to Panel..."Select the applet "CPU Frequency Scaling Monitor" This was tested in Ubuntu 9.10

Ubuntu - Save laptop/netbook battery life

Searching for ways to reduce the heat generated by my laptop i found a nice applet that helps to reduce the heat and save battery life.

Depending on the CPU/Processor you have it may have a capability to set its own the cock speed according to the processor load. Mime for instance, a AMD X2, has 1600Mhz and 800Mhz, for surf at internet 800 Mhz is more then enough and extents bouth battery life and reduces the heat.
Right click on a free space on your taskbar or "panel".Select "Add to Panel..."Select the applet "CPU Frequency Scaling Monitor" This was tested in Ubuntu 9.10

Improve blogger visual appearance

Image
The best way to improve blogger visual appearance is by changing its template. To do so visit one on many web sites with free templates and download one of your liking.

After you select and download your new template go to the "Desgn" folder and select "Edit HTML"

On the same page as before select "Download Full Template", this way you will have a backup of your old design if anything goes wrong.

Then, still on the same page, upload the new template. Its possible that this file will be inside the zip file you downloaded before, then unzip it to any folder and return to the page as before and select "Browse", once selected click "Upload".

Like me you may find receive the following result:


Once you decide if you want to keep or not the widgets you new template will be available. Please notice that there you may have to manually tweak some points like urls to blog logo, images and/or Twitter or Facebook id's

Ubuntu - Install KDE, the alternative to Gnome

Image
There are two major Desktop environments managers, Gnome and Kde, let's not start argue about which one is the best, try and install both and judge for yourself.

My ubuntu version came with Gnome for default, to install the Kde go to
SystemAdministrationSynaptic Package ManagerSearch for "Kubuntu desktop"And choose "Apply" To start using KDE, log out and in the login screen choose as Display Manager te Kde, instead of Gnome. Alternatively, after the download and installation, performed automatically by synaptic, you may be requested to configure the new display manager.


mySql - Get N Top rows

In mySql to return the first N rows execute the following:
select * from <table_name> limit N; Besides, mySql as a very useful feature, the "offset" in conjunction with "limit" may let define any interval that you desire, for instance to return rows 10 to 20:
select * from <table_name> limit 10 offset 10;

mySql - Recuperar el ultimo ID insertado

Dadoelescenario en elquehanlas tablas:
ClientesyClientes_DireccionesPara recuperarel identificadordelúltimo clienteinsertadoen la tabla Clientesquepuedenhacer:

select LAST_INSERT_ID() Mirando ala consulta vera que la misma no hace referencia a la tabla.Así queestasoluciónsólofuncionará sidesea recuperarel identificadorde laúltima filainsertadaentodas labase de datos,así deberá tener en cuenta posibles problemasde concurrencia.

Siestasoluciónnoencaja, otra solución es construir la tablademaneraqueel el identificador se generecon el AUTO_INCREMENTy luego simplemente ejecutar:
select max(cli_id)from Clientesyutilizarestevalorparaagregaren latablaClientes_Direcciones.

mySql - Get Last Inserted ID

Given the scenario where you have the tables:
Clients and Clients_Addresses In order to retrieve the id of the last client inserted in Clients you may do:
select LAST_INSERT_ID() This will then retrieve the last inserted id, but looking at the query you will notices that you don't have the table. So this solution will only work if you want to retrieve the id of the last inserted row in all your database, so be aware of concurrency problems.

If this solution does not fit, you may construct you table in a way that the id is generated with AUTO_INCREMENT flag, than simply issue a
select max(cli_id) from Clients and use this value to add in the Clients_Addresses table