2007-12-20

Do it, do it. do it well

Even such a small but very useful function saves a lot of time:

procedure assert_equal(expected varchar2, actual varchar2) is
begin
if expected is null and actual is not null then
raise_application_error(-20001,
'Expected is null'||' Actual '||actual);
elsif expected is not null and actual is null then
raise_application_error(-20001,
'Expected '||expected||' Actual is null');
elsif expected <> actual then
raise_application_error(-20001,
'Expected '||expected||' Actual '||actual);
end if;
end;

2007-12-17

Home <--> Work synchronization

What's a pity that major hosters do not offer free version control system. Google, sourceforge - that's all for programming projects.

I'd like to have some simple solution for the synchronization of small notes and todo lists at home and work computers.

I've come across OpenSVN project. The rules contain almost no restrictions on contents. It's slow, but it's quite enough for files <10ะบ. Well, I hope that it will be no more bugs with backups ).

At the work computer with constant connect to Internet I've set up a scheduler, now I'm sure that I Can download everything at the home one, if needed.

2007-12-11

Static vs Dynamic: Holywar in the rubbish chute

From a discussion at Not a kernel guy

The cafe trash bins are in groups of three pieces: for plastic, aluminum cans and the rest of the garbage. There are big icons on them so that no one would throw plastic can to the usual garbage bin. It would be nice but cleaners change bins places from time to time, which causes customer pain and frustration. Each person that has already raised arm to throw, hangs on for ten seconds, trying to understand what happened.

I laughed at the classification of the solutions offered in comments:

Static cast: You should have three bins of different shapes and make a stand with according slots then put them in a different order will be problematic.

Dynamic cast: You should stick the same icons opposite each bin then the cleaner would recognize these stickers and would think about the right order…

Duck typing: You should replace all bins of exactly the same without the icons, but put them on trays with icons (indicating the type of garbage) - ie indication of the type is external to the container =).

2007-12-09

Ubuntu + Pocket PC + Bluetooth = ?

I've learnt a lot of uninteresting stuff.

Now I can not only copy files on PocketPC via Bluetooth under Ubuntu, but also connect to Internet.

No visual configurators, just google and emacs.

The secret was in the magic phone number *99#.

2007-12-03

Unpleasant Jabber

Oh my.. because of the latest problems with icq protocol changes I had to change icq transport to jabber.snc.ru. Well, it works quite good... but I'm constantly getting into small fixes with it - and this is with my small contact list in fifty persons.

Boring stuff...

Contacts that were located on icq server loaded automatically so I had a heap of monstrosity records like XXXXXXXX@picq.jabber.snc.ru. Everything had to be renamed manually. Icq contacts that were located only in jabber just remained at @icq.jabber.snc.ru, I had to move them manually too. After all that I had to confirm authorization for each contact and got the response.

It's stupid.

Also I've found that if I'll want to jump down from the server it will be somewhat problematic. Quick contact list transfer service does not want to work either with my main account at jabber.snc.ru, nor with experimental one at xmpp.org.ru. It works only with abandoned jabber.ru.

2007-11-28

20,000 Lines Under the Sea

I wanted to write a small script for installing/changing pictures for folders containing photos in Nautilus.

I dug into sources, dug out the required Corba interfaces, understood how bonobo and its python wrapper work.

Under old Ubuntu with Gnome 2.16.1 this script works, under the new one with Gnome 2.20 Bonobo.GeneralError with an empty message is thrown.
#!/usr/bin/env python
import bonobo
import Bonobo

bonobo.activate()
obj = bonobo.get_object ('OAFIID:Nautilus_Metafile_Factory', 'Nautilus/MetafileFactory')
print dir(obj)
I do not like it, but I have no choice - I have to edit ~/.nautilus/metadata

Update 03.12.2007 - The presentation slides Guadec2003 - PyOrbit

Update 17.12.2007 - I got evidence that this is a bug. I'm curious, for how long it will remain unnoticed

2007-11-26

In Gates we trust

Sometimes it seems that authors that compile lists of esoteric programming languages underestimate bat files possibilities.

rem The current day of a month
for /f "tokens=2,*" %%i in ('date /T') do (
set dt=%%i
)
set dt=%dt:~0,2%