Thursday, 10 February 2011

Inserting Google visualizations in Wordpress blogs

I tried to insert a Google visualization into my (other) blog. I run into problems that Google itself solved.

The solution? Use the Custom fields shortcode plugin for Wordpress: first, install and activate it. Then, wherever your visualization goes, insert

[cf]this_is_my_tag_name[/cf]

If your plugin is properly inserted, at the bottom of the page you will see a form with title "Custom fields". Add a new custom field with name this_is_my_tag_name and paste the code for your visualization into the adjacent field.

The plugin will replace your tag with the code you inserted and your visualization will be properly shown in your entry.

Padding text with leading zeros in Teradata

In order to pad a number with leading zero Teradata you can do as follows:

create set table my_table ,no fallback ,
no before journal,
no after journal,
checksum = default
( a integer )
primary index ( a );

insert into my_table select 25;
insert into my_table select 12345;
insert into my_table select 0;

select substr(
'00000' || cast( a as varchar(5) ),
characters( cast( a as varchar(5) ) ),
5 )
from my_table;

The relevant part lies in the use of the functions substr and characters.

Friday, 21 January 2011

A open(er) web 2.0 chaintool

I am planning to migrate from my standard set of web 2.0 tools to something more open and collaborative. This will mean:

Wednesday, 12 January 2011

Table sizes and disk utilization in Teradata

The analysis of table sizes and disk utilization per AMP in Teradata is based on table dbc.tablesize.

Two typical queries are:

select
vproc,
databasename,
sum(currentperm) / 2**30 as cp,
sum( peakperm ) / 2**30 pp
from dbc.tablesize
group by 1,2
;

to find space utilization by AMP and

select
tablename,
databasename,
sum(currentperm) / 2**30 as cp,
sum( peakperm ) / 2**30 pp
from dbc.tablesize
group by 1,2
;

to find out the sizes of tables.

Sunday, 9 January 2011

More of git for remote server deployment of webpages

This is a brief tutorial on how to deploy your webpage to a remote server using git.

My (minimalistic) vi cheatsheet

:set (no)wrapscan
:set (no)nu
:set (no)ignorecase

\< \> to search for full words

set softtabstop=2
set shiftwidth=2
set tabstop=4
set expandtab

Saturday, 8 January 2011

Nice feature of OpenOffice's brush

I have just discovered a nice feature of OpenOffice's brush: unlike MS Word's, it does not copy formats but named styles.

If you want to use a given format in different places, why not creating a specific custom style? You can spread it over your document using the brush and later, if you need to change it, just edit the style and... voilá!