Teradata is a fine DBMS whose performance critically depends on whether the right table statistics are available to the query optimizer.
You can request it to hint you for the missing statistics that it would like to have on your tables running the code
diagnostic helpstats on for session;
before checking query plans. After running the command above, the query plan, at the end, will list those statistics that the end of the query plan.
Tuesday, 17 August 2010
Saturday, 14 August 2010
Completely eliminate packages marked as rc in Ubuntu or Debian
Removing a package is not the same as purging it. Simply removing leaves some cruft behind. If you remove packages from your Ubuntu or Debian system using
apt-get remove mypackage
you will still see it when you run a
dpkg -l
comand. And it is the case because configuration files are not erased. In order to completely remove (i.e., purge) a package you need to run
apt-get --purge remove mypackage
But what if you removed it but you did not purge it? It will always show up in your system.
If you want to get rid of all those rc-status (removed but not purged) packages in your system you can run something like:
sudo dpkg --purge `dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs`
apt-get remove mypackage
you will still see it when you run a
dpkg -l
comand. And it is the case because configuration files are not erased. In order to completely remove (i.e., purge) a package you need to run
apt-get --purge remove mypackage
But what if you removed it but you did not purge it? It will always show up in your system.
If you want to get rid of all those rc-status (removed but not purged) packages in your system you can run something like:
sudo dpkg --purge `dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs`
Tuesday, 13 July 2010
Calling Python from R
The new R package, rJython, permits calling Python from R. It is not on CRAN yet, but it will be soon. Details about the package (installation from r-forge, architectural details, etc.) can be found here.
Sunday, 4 July 2010
Passing arguments to Python functions
I found a good reference on how to pass arguments to Python functions using the star (or star-star) notation. You can find it here. Here goes a summary.
If you want to pass unnamed arguments, you can do as follows:
>>> a = (1,5)
>>> range( *a )
[1, 2, 3, 4]
If you want to pass named arguments, you need dictionaries:
>>> a = range( 1, 4 )
>>> b = range( 4, 8 )
>>> def concat( a, b ): return a + b
...
>>> concat( **dict( a = a, b = b ) )
[1, 2, 3, 4, 5, 6, 7]
You can mix named and unnamed arguments thus:
my_foo( *a, **b )
where a and b are a list and a dictionary. Caution needs to be taken to pass a single unnamed argument, though. Details can be found in the reference above.
If you want to pass unnamed arguments, you can do as follows:
>>> a = (1,5)
>>> range( *a )
[1, 2, 3, 4]
If you want to pass named arguments, you need dictionaries:
>>> a = range( 1, 4 )
>>> b = range( 4, 8 )
>>> def concat( a, b ): return a + b
...
>>> concat( **dict( a = a, b = b ) )
[1, 2, 3, 4, 5, 6, 7]
You can mix named and unnamed arguments thus:
my_foo( *a, **b )
where a and b are a list and a dictionary. Caution needs to be taken to pass a single unnamed argument, though. Details can be found in the reference above.
Passing arguments to Python functions
I found a good discussion on how to pass vectors and dictionaries as arguments to Python functions. It can be found here.
In summary, for unnamed arguments:
>>> a = (1,4)
>>> range( *a )
[1, 2, 3]
And for named arguments:
>>> def concat(a,b): return a + b
...
>>> a = [1,2,3]
>>> b = range( 4,7)
>>> b
[4, 5, 6]
>>> concat(**dict( a = a, b = b ) )
[1, 2, 3, 4, 5, 6]
Named and unnamed arguments can be mixed:
my_foo( *a, **b )
There is only one caveat with functions requiring a single, unnamed argument. See the link above for details.
Wednesday, 30 June 2010
Certificate problem trying to access Google Analytics
I upgraded my Firefox browser to version 3.6.6 yesterday. And I got errors when trying to access my Google Analtics account. A warning indicated me that I got something like a "ssl.gstatic.com:443 uses an invalid certificate".
Unwilling to learn about certificates by myself, I asked Google. And one hour later I found a page with a hint to solve the problem: download this
file (from the same server that issues the certificate) and just accept it.
From that point on, you will be able to navigate your Google Analytics account as usual.
Unwilling to learn about certificates by myself, I asked Google. And one hour later I found a page with a hint to solve the problem: download this
file (from the same server that issues the certificate) and just accept it.
From that point on, you will be able to navigate your Google Analytics account as usual.
Friday, 18 June 2010
SVG to PS using inkscape
If you want to change the format of your SVG file into PS format, you can use inkscape thus:
inkscape my_graphic.svg --export-eps=my_graphic.eps --export-text-to-path
inkscape my_graphic.svg --export-eps=my_graphic.eps --export-text-to-path
Subscribe to:
Posts (Atom)