Archive for April, 2008|Monthly archive page

How to make Firefox faster / lower memory footprint for Firefox

Open Firefox and go to the Address Bar. Type in about:config and then press Enter.
Right Click in the page and select New -> Boolean.
In the box that pops up enter config.trim_on_minimize -> Press Enter.
Now select True and then press Enter.

As long as your are there, search and change the following variables:

browser.sessionhistory.max_entries 0
browser.sessionhistory.max_total_viewers 0

In the default setting, the first one is set to 50 entries and the second one to -1, which means it adepts automatically.

Type pipelining in the filter bar.
Double-click on network.http.pipelining to set its value to TRUE.
Double-click on network.http.pipelining.maxrequests and change its value to 12 or more if you have broadband.

Remember to restart Firefox.

Perl DBI Last Insert ID

Recently I was re-searching for an Perl DBI corenspondent for PHP’s last_insert_id(), so here’s what I’ve found:

$dbh->do('INSERT INTO some_table ...');
my $id = $dbh->last_insert_id(undef, undef, qw(some_table some_table_id)) or die "can not get it?";

Another way:

my $id = $dbh->{ q{mysql_insertid}};

The two undefs are for catalog and schema which don’t appear to be necessary. The DBI docs say they can be ignored for MySQL so you might not even need the table and field parameters.