2008-08-06

Sailing on Vltava river

Yesterday was nice weather and sun was shining like other days. But instead of other days I did not have to stay in my office all the time. I just finished one important project and I was allowed to leave for a while so I enjoyed the day even more.

I went with my friend on the Vltava bank where we rent pedal-powered ship. Then we sailed around the Strelecky island. We enjoyed very nice view of Prague Castle and Vysehrad church which we saw from our ship.

2008-07-31

Počítačový evergreen

Proti bolesti zad...

http://zdravi.idnes.cz/deset-prekvapivych-triku-proti-bolestem-zad-f33-/zdravi.asp?c=A080317_141512_zdravi_bad

http://slovnik.seznam.cz/?q=pra%C5%BE%C3%A1k&lang=cz_en

100 Prague towers

Interesting project shows Prague from perspective of famous Prague towers. You can turn around in 360 degrees or move to another tower just by clicking on the picture.

English version: http://stovezata.praha.eu/homepage.html
Czech version: http://stovezata.praha.eu/index.html

2008-07-29

Square dancing weekend

Last weekend was wonderful dancing event for people who enjoy Square dance. My friends David&Lenka precisely prepared dancing event which was the final part of their weding celebration.

It started in the Prague where we took boat trip throught center of the city and we saw some nice places including Charles' bridge and Vysehrad. Then we went by bus to the place where the dancing started.

It was situated in hotel near by Prague. Level of the even was high in all ways - it was very well organised, place was nice, hotel stuff took care of us all the time, dancing quality was very good and also square dance level - we danced C3A all the weekend. Even the weather was great so it was very nice relaxing weekend.

At the end of the weekend I went with my friend to the theatre to visit play. It was part of the summer student theatre fest. The evening contained one chorus sing, one drama and one pantomima. All the plays were wonderful.

2008-07-28

Playing Oracle and MySQL game

Sometimes we want to escape characters in Oracle SQL Plus console

Set the escape character
set escape \

Send command (in the same session)
INSERT INTO customer (url) VALUES('http://www.example.com/redir.php?id=1234\&log=true');

Select rows recursevely

SELECT LPAD(' ', 2 * (LEVEL - 1)) || TO_CHAR(child) s
FROM test_table
START WITH parent IS NULL
CONNECT BY PRIOR child = parent;

This has just one restriction: no joins allowed.
source: http://www.adp-gmbh.ch/ora/sql/connect_by.html

Insert-update with MySQL

INSERT INTO table_name (col_names)
VALUES (values)
ON DUPLICATE KEY UPDATE col=val, col2=val2;
source: http://devblog.billism.com/?p=12

2008-07-22

Riding back horses again

We were riding back horses again. Last weekend was very good weather for relaxing so we took another lesson of horse-driving. We ran for some times but very slowly and carefully, much slower than I wanted. But better to be careful than injured.

We went to the nature and if was time I enjoyed the surrounding view of woods, fields and wild in the sunshine.

Just at the end the horse stepped on my foot. It was not good but, fortunately, I did not need the doctor's help.
Even though, I am decided to take another lesson next time but I will take another horse.

2008-07-18

Starting with MySQL

All the beginning are terrible and slow... again and again looking into the manual for the same commands.

Install
apt-get install mysql-client mysql-server mysql-common php5-mysql

Set root password
mysqladmin password 'new_root_password'

Login to DB
mysql -u root -p

Create database
CREATE DATABASE db_name;

Create regular user and grant appropriate rights
SELECT PASSWORD('secret_password');
CREATE USER user_name IDENTIFIED BY 'secret_password';
GRANT ALL ON db_name.* TO 'user_name'@'host_name' IDENTIFIED BY 'secret_password';
^D

Login under the regular user
mysql -u user_name -p db_name

Create table
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
created_date DATETIME,
name VARCHAR(200),
phone VARCHAR(200)
);

Create index
CREATE INDEX index_users_name ON users (name);
details