Wednesday 29 August 2007

Pidgin more instances

Why would you have a need to use more instances of IM pidgin, when you can use in one instance more protocols, etc?

For me the reason was:
- to log only Buddies messages and not IRC chats (they grow fast)
- to flash the Pidgin window only when I receive the messages from Buddies and not from IRC chats

To achieve it create a small bat file that will run second, third, ... instance of the Pidgin
set PIDGIN_MULTI_INST=1
c:\programms\pidgin2.1\pidgin -c c:\.pidgin-alt

where you need to apply paths where you installed your pidgin (in my case in programms\pidgin2.1\) after -c parameter is the path to the directory that will hold all settings for the second, third, etc... instance if this directory does not exist, it will be created)

running that bat file will run in a seperate instance and there you can make independent settings.

happy instant messaging.
chris

Tuesday 28 August 2007

for my honey

    To make it clear
    there is only one
    and it is not beer,
    She smiles and cries
    but never lies
    as I hold that line
    I'm glad that she's mine.

    I code some stuff,
    I drink, have fun
    but she's the one working so hard.
    She waits for me,
    wiping her neck,
    Wait honey I'll be right back!!!

RMagick install from source in Debian Etch

Installing RMagick from sources (6.3.5)

1. Download the latest imagemagick from http://www.imagemagick.org/script/install-source.php#unix

- compile with follwoing options (assuming you don't need it for perl nor C++)


./configure --prefix=/opt/imagemagick --enable-shared --disable-static --without-perl --without-magick-plus-plus

of course you can change prefix or remove it when you want it to be isntalled by default

./make
sudo make install


Make sure /opt/imagemagick/includes/lib is in your LD_LIBRARY_PATH
and /opt/imagemagick/bin in your PATH

2. Download the latest RMagick from http://rubyforge.org/projects/rmagick/

./configure
./make


If at this stage you get errors like "unable to read font '(null)'":
- check first if your ImageMagick installation was successful running display command
- if running display you get "unable to find font .... helvetica ..." then you need to install fonts on your system
- if display runs fine but you still get the above error from one of ruby test scripts setting fonts options in ./configure of imagemagick might help
- try to configure again ImageMagick with following options:


./configure --prefix=/opt/imagemagick --enable-shared --disable-static --without-perl --without-magick-plus-plus  --with-gs_font-dir=/usr/share/fonts/type1/gsfonts --with-windows-font-dir=/home/chris/win_fonts

(applying appropriate paths)

./make
sudo make install

- compile again RMagick
- still not running? ...

I hope that helps
chris

Oracle - table changes how to notice

Couple of days ago I had a real problem how to provide always the most recent report with the products hierarchy. The first thought was to write a kind of a hash function to get just a hash stamp of the whole table and compare against the new one. The problem arose when it came to implementing the idea.
There is no built way to get a hash value of a whole table.

Suddenly I thought: "OK, let's check if the number of rows is different, then it would mean the content of the table changed".

I walked that way.
Replacing the table I always create first the new one with some different name and if everything goes fine, I replace the name to the right one at the end.

I have a production table called prods_hier and the new one in the background called prods_hier_bak

the following lines of code do the comparing:

changed:=false
select count(*) into no_of_rows_new from prods_hier;
select count(*) into no_of_rows_bak from prods_hier_bak;
if no_of_rows_new <> no_of_rows_bak then
changed := true;
else -- the same no_of_rows
select count(*) into no_of_changed_rows from
( select * from prods_hier
minus
select * from prods_hier_bak
);
if no_of_changed_rows <> 0 then
changed := true;
end if;
end if;