Where are the system icons in Ubuntu?


One can find the system icons in:

/usr/share/icons/

There are multiple directories underneath, where one can find many icons.

Calculating a value whether one column of several is not null in PL/SQL


I wanted to calculate in a SQL query whether one of three columns in a table was not null. I did not want to do it in the Java code to keep code clean.

First, I started to used DECODE and NVL2 to reproduce a kind of IF-THEN-ELSE to lazily compare my values:

IF <field one> IS NOT NULL THEN true ELSE IF <field two> IS NOT NULL THEN true ELSE IF <field three> IS NOT NULL THEN true ELSE FALSE

This was a bit convoluted and resulted in the following code:

SELECT DECODE(NVL2(remarks_f, 'true','false'), 'true', 'true','false',DECODE(NVL2(remarks_n, 'true','false'), 'true', 'true','false',DECODE(NVL2(remarks_d, 'true','false'), 'true', 'true','false','false'))) AS hasRemarks
FROM bulletin;

After discussion with a colleague of mine, he suggested that I concatenated the values of the three fields and check whether the outcome was null or not like:

IF <field one> + <field two> + <field three> IS NOT NULL THEN true ELSE FALSE

This resulted in the following code:

SELECT DECODE(NVL2(remarks_f || remarks_n || remarks_d, 'true','false'), 'true', 'true','false','false') AS hasRemarks
FROM bulletin;

Then, I realised that NVL2 was more than enough to achieve what I wanted and I ended up with the following code:

SELECT NVL2(remarks_f || remarks_n || remarks_d, 'true','false') AS hasRemarks
FROM bulletin;

Launching gnome-terminal with custom parameters


I wanted to create a custom launcher to launch gnome-terminal with a specific profile, set the working directory and maximise the window. Here’s the command to do it:

gnome-terminal --window-with-profile="Server Console"  --working-directory=/home/stephan/Development/servers --maximize

As the name of my profile contained white spaces, I had to use double quotes do delimit it.

%d bloggers like this: