31 Temmuz 2009 Cuma

CVS Client and Server installation on Ubuntu


Before installing the server, install the CVS Client:
   sudo apt-get install cvs

Then install the CVS server named "cvsd":
** If yo want to learn why we' ve chosen "cvsd", read this note,
   otherwise skip to the step 1 below:
      CVS was designed to use "xinetd" to startup service.
      But now most Linux distributions do not install xinetd by
      default, and configuration of CVS is somewhat complicated.
      "cvsd" is a wrapper program for CVS in pserver mode, it can
      startup CVS as a standalone daemon, under a special uid/gid
      in a chroot jail. It is relatively easy to use cvsd and its
      configuration file to setup CVS repositories.

       So, we' ve chosen "cvsd" instead of "xinetd"

1. Install the CVS Daemon named "cvsd" :

   sudo apt-get install cvsd

   When prompted for Repository, type in "/cvsrepo".


2. There is no need to add new group and new user !!!
   In the step1, the group 'cvsd' and the user
   'cvsd' have already been created.

3. If this is the last version of cvsd, skip this step.
   To update the cvsd:

   sudo cvsd-buildroot /var/lib/cvsd


4. If the folder /cvsrepo does not exist, then create it.

   sudo mkdir cvsrepo


5. Set the owner of /cvsrepo to cvsd:cvsd

   sudo chownn -R cvsd:cvsd /cvsrepo


6. Initialize the repository

   sudo cvs -d /var/lib/cvsd/cvsrepo init

30 Temmuz 2009 Perşembe

Installing Ubuntu & FreeBSD on the same computer

You can look at
http://forums.freebsd.org/archive/index.php/t-614.html

Briefly, you can choose one of 4 options :
1. (assuming Ubuntu is installed first) Use grub loader. Then add FreeBSD to menu.lst
2. use 3rd party boot managers such as GAG
3. use vmware or other virtual machine software
4. one says that lilo boot manager can easily be configured to support linux and FreeBSD. But grub is preffered by the most of users.

29 Temmuz 2009 Çarşamba

Using Oracle CREATE TABLE

I have prepared an example Oracle "create table" script with those characteristics:
  • compact, using "inline constraints", you can write
    more readable scripts. I preferred inline constraints instead
    of using "ALTER TABLE xxx ADD (PRIMARY KEY /
    CONSTRAINT...)" statements. Using GUI tools to create
    those scripts, we can easily miss more readable scripts.
  • several constraints such as "multiple column PRIMARY KEY",
    "REFERENCES (i.e. Foreign Key", "multiple column FOREIGN KEY", etc.
  • Options such as "ON DELETE SET NULL"
  • Several CHECK constraints
  • EXCEPTIONS INTO
  • and more...
DROP TABLE sa_dept CASCADE CONSTRAINTS;

CREATE TABLE sa_dept 
    employee_id     NUMBER(4)     PRIMARY KEY,

    last_name       VARCHAR2(10),

    email           VARCHAR2(100) NOT NULL UNIQUE,

    -- example for foreignkey const. with
    --   "different column names"
    --   (i.e, sa_dept.job_id = sa_jobs.id)
    -- of course, it is better to use the same
    --   column names if possible (sa_dept.job_id = sa_jobs.job_id)

    job_id          VARCHAR2(9)
                    CONSTRAINT fk_job
                    REFERENCES sa_jobs(id),

    -- ref. int. constr. with ON DELETE SET NULL
    manager_id      NUMBER(4)
                    CONSTRAINT fk_mgr
                    REFERENCES sa_employees ON DELETE SET NULL,

    -- composite foreignkey constr. + EXCEPTIONS INTO example
    hire_date       DATE
                    CONSTRAINT
                    FOREIGN KEY (employee_id, start_date)
                    REFERENCES sa_job_history(employee_id, start_date)
                    EXCEPTIONS INTO sa_wrong_emp,   -- sa_wrong_emp should exists!

    -- CHECK constr. Any boolean expression in
    -- parentheses after "CHECK" is valid

    salary          NUMBER(7,2)
                    CONSTRAINT check_sal
                    CHECK(salary * commission_pct <= 5000),

    -- CHECK constr. with BETWEEN. As stated above,
    -- any boolean expression in parentheses' after "CHECK" is valid.

    commission_pct  NUMBER(7,2)
                    CONSTRAINT check_divno
                    CHECK( BETWEEN10 AND 99)
                    DISABLE, -- if we use DISABLE, Oracle defines
                             -- the constr. but does not enable it.


    -- ref. int. constr. with ON DELETE CASCADE
    department_id   NUMBER(2)
                    CONSTRAINT fk_deptno
                    REFERENCES sa_departments(department_id) ON DELETE CASCADE

);

28 Temmuz 2009 Salı

Calling stored procedures from Lisp using CLSQL

I found a link describing how to call stored procedures from Lisp using CLSQL
http://www.rhinocerus.net/forum/lang-lisp/46000-clsql-stored-procedures.html

I have not tried the solution. When I try, I will explain it in details.

16 Temmuz 2009 Perşembe

Installing Emacs clisp and SLIME on Ubuntu

1. Install clisp and SLIME using Synaptic Package Manager.

2. According to SLIME User Manual some lines are required in .emacs file.
If you don't already have one, create a ".emacs" file in your HOME DIRECTORY. Add the following code to it, (the paths below are default for Ubuntu clisp and SLIME installations):
    (setq inferior-lisp-program "/usr/bin/clisp")
    (add-to-list 'load-path "/usr/share/emacs/site-lisp/slime")
    (require 'slime)
    (slime-setup)

Start up emacs, type "M-x slime" (i.e., Alt-x slime) and start hacking.

PS: With those instructions, I'd installed on Ubuntu 8.04 Hardy and Ubuntu 9.04 Jaunty Jackalope successfully.

14 Temmuz 2009 Salı

Let Over Lambda

Let Over Lambda by Doug Hoyte, (first 3 chapters and a good reference)