Monday, February 18, 2008

upgrading to postgresql 8.3 in debian from 7.4

me:/home/me# pg_dropcluster 8.3 main --stop
me:/home/me# pg_upgradecluster 7.4 main
Checking for users and groups with the same name...
Creating new cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main)...
Moving configuration file /var/lib/postgresql/8.3/main/postgresql.conf to /etc/postgresql/8.3/main...
Moving configuration file /var/lib/postgresql/8.3/main/pg_hba.conf to /etc/postgresql/8.3/main...
Moving configuration file /var/lib/postgresql/8.3/main/pg_ident.conf to /etc/postgresql/8.3/main...
Configuring postgresql.conf to use port 5433...
Disabling connections to the old cluster during upgrade...
Disabling connections to the new cluster during upgrade...
Re-enabling connections to the old cluster...
Re-enabling connections to the new cluster...
Creating globals...
Fixing hardcoded library paths for stored procedures...
Upgrading database LTA_FIS...
Analyzing database LTA_FIS...
Fixing hardcoded library paths for stored procedures...
Upgrading database CTNControl...
Analyzing database CTNControl...
Fixing hardcoded library paths for stored procedures...
Upgrading database LTA_IDB...
Analyzing database LTA_IDB...
Fixing hardcoded library paths for stored procedures...
Upgrading database template1...
Analyzing database template1...
Copying old configuration files...
Copying old start.conf...
Stopping target cluster...
Stopping old cluster...
pg_ctl: postmaster does not shut down
Disabling automatic startup of old cluster...
Configuring old cluster to use a different port (5433)...
Starting target cluster on the original port...
WARNING: connection to the database failed, disabling startup checks:
psql: FATAL: the database system is shutting down

Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with

pg_dropcluster 7.4 main
wustl@me:~/perlscripts$ ./startctn.pl
both the archive_agent and archive_server processes have started yay!
wustl@me:~/perlscripts$ 170162 DB specific error (PostgreSQL:(null)) in PG_Open
140162 Could not allocate connection handle. dbinit()/dblogin() failed in PG_Open
40192 Bad Database/Table [LTA_IDB/PatientLevel] in IDB_Open
Fatal error during startup
170162 DB specific error (PostgreSQL:(null)) in PG_Open
140162 Could not allocate connection handle. dbinit()/dblogin() failed in PG_Open
40172 Failed to open table ApplicationEntity in function DMAN_Open
bfff4 APP Failed during startup: Could not open control database
120172 DMAN Illegal handle passed to function DMAN_Close
Exiting

Sunday, February 17, 2008

xorg.conf hebrew settings

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us,il"
# Option "XkbCompat" "group_led"
Option "XkbVariant" "lyx"
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
EndSection

Wednesday, February 13, 2008

GNU Emacs and UTF-8 locale

shamelessly copied from

http://linux.seindal.dk/2004/08/07/gnu-emacs-and-utf-8-locale/


GNU Emacs and UTF-8 locale

I recently wanted to shift to a UTF-8 locale, because I wanted to play with stuff like writing in Arabic, and because it seems to be the road forward.

So I switched and GNU Emacs starts to enter garbage in my buffers. I type “������ ��“, but Emacs gives me “æøå��� éí�“. Ever so slightly less useful, and less readable too.

I tried fiddling with “Options | Mule | Language Environments” and “Options | Mule | Set Coding System”, but to no avail.

Somewhat deluded I gave up and went back to Latin 1, mostly at least. Every once in a while I tried again, and one day I stumbled over a reference to the Emacs file etc/PROBLEMS, a section on problems with UTF-8 support in GNU Emacs. Unfortunately the section was gone from my copy, but I found it on the net.

The solution to all my problems: add the following lines to ~/.emacs:

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

The problem went away and haven’t been seen since.

BTW, I’m using GNU Emacs 21.3.1, installed from Debian testing and unstable (tried them both).

Tags:

Oviyam a new open source dicom web viewer

website
http://skshospital.net/oviyam/

downloads

http://skshospital.net/oviyam/oviyam_0.6-src.zip
binary

http://skshospital.net/oviyam/Oviyam-0.6-bin.zip

uses the
framework from

http://script.aculo.us/

and dcm4che which supports wado

Tuesday, February 12, 2008

precompiled headers .gch?

i dont know about this yet here is something from gtkmm july 2004

  • From: "Cristian Adam"
  • To: gtkmm-list gnome org
  • Subject: [gtkmm] precompiled headers [revisited]
  • Date: Wed, 21 Jul 2004 21:47:36 +0200 (MEST)

Take this small gtkmm application:

hello.cpp:
//--------------------------------------------------------
#ifdef USE_PCH
#include "precompiled.h"
#else
#include
#endif

int main(int argc, char* argv[])
{
Gtk::Main kit(argc, argv);

Gtk::Window window;

Gtk::Main::run(window);

return 0;
}

precompiled.h
//--------------------------------------------------------
#ifndef PRECOMPILED_H
#define PRECOMPILED_H

#include

#endif


The command to create the precompiled header was:
g++ -o precompiled.h.gch precompiled.h `pkg-config --cflags gtkmm-2.4`

The command to compile hello was:
time g++ -o hello hello.cpp `pkg-config --cflags --libs gtkmm-2.4` -DUSE_PCH

The results are below:

With PCH Normal
--------------------
0m1.172s 0m6.955s
0m1.168s 0m6.930s
0m1.173s 0m7.154s
-------- --------
0m1.171s 0m7.013s

The compilation was ~6 (six) times faster with precompiled headers!!!

Precompiled headers rulle!!!

Cheers,
Cristi.

  • From: Christer Palm
  • To: Cristian Adam
  • Cc: gtkmm-list gnome org
  • Subject: Re: [gtkmm] precompiled headers [revisited]
  • Date: Thu, 22 Jul 2004 01:49:39 +0200

Cristian Adam wrote:
The compilation was ~6 (six) times faster with precompiled headers!!!

Precompiled headers rulle!!!

OK - I'm seeing similar results now (even with more complex examples - about 4 times faster). I guess my problem was that the precompiled header should be named gtkmm.h.gch and not gtkmm.gch. However, I quickly stumbled across GCC bug 13675 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13675), which was rather easily worked around by using 2 include files like:
A.h:
#ifndef A_INCLUDED
#define A_INCLUDED
#include "B.h"
#endif

B.h:
#include

and then precompiling B.h, while including A.h in my source files. So it seems that it's not quite ready for prime time yet, but I still think it'd be rather interesting to have a build target for gtkmm.h.pch in the standard gtkmm makefile.
--
Christer Palm

and from
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-visual-studio-new-project.html



The next thing to alter is the stdafx.h precompiled
header file. At the time of this writing, many Windows programmers are
familiar with the concept of precompiled headers. However, many Unix
programmers are not, as precompiled header support was only recently added
to GCC (in version 3.4) and is still not used in most open source projects.
Unix programmers may be tempted to just disable precompiled headers
altogether, but think carefully before doing this. Proper use of precompiled
headers provides a much improved compile time when using gtkmm, and will
save you many hours over the course of a project.

Thursday, February 7, 2008

emacs read-only buffers

27.7 Read-Only Buffers

If a buffer is read-only, then you cannot change its contents, although you may change your view of the contents by scrolling and narrowing.

Read-only buffers are used in two kinds of situations:

  • A buffer visiting a write-protected file is normally read-only.

    Here, the purpose is to inform the user that editing the buffer with the aim of saving it in the file may be futile or undesirable. The user who wants to change the buffer text despite this can do so after clearing the read-only flag with C-x C-q.

variable: Buffer-read-onlyThis buffer-local variable specifies whether the buffer is read-only. The buffer is read-only if this variable is non-nil.


Tuesday, February 5, 2008

gtk-perl and focus; Gtk2::Gdk::Keysyms; asciidoc

you need to have the focus or even just focus capability for the keyboard entries
to have any affect on a widget.

thus drawingarea needs $drawing->can_focus to capture signals from key_press_event
events;

thus its not enough to do add_events

(also: I am not sure: perhaps if you do -> can focus, you may not even need set_events(["key-press-event]) in the flag .. )

*************************
use Gtk2::Gdk::Keysyms;

this gives you a LOT of flexibility in using keypress events

whereas the a valid flag for the $state= $event->state; flags does not include all of them
thus we have a Control_L or Control_R in Gtk2::Gdk::Keysyms;
as well as Alt_L and Alt_R, they don't exist in the this list of valid state flags....

Invalid flags GdkModifierType value control-l-mask, expecting: shift-mask / GDK_SHIFT_MASK, lock-mask / GDK_LOCK_MASK, control-mask / GDK_CONTROL_MASK, mod1-mask / GDK_MOD1_MASK, mod2-mask / GDK_MOD2_MASK, mod3-mask / GDK_MOD3_MASK, mod4-mask / GDK_MOD4_MASK, mod5-mask / GDK_MOD5_MASK, button1-mask / GDK_BUTTON1_MASK, button2-mask / GDK_BUTTON2_MASK, button3-mask / GDK_BUTTON3_MASK, button4-mask / GDK_BUTTON4_MASK, button5-mask / GDK_BUTTON5_MASK, super-mask / GDK_SUPER_MASK, hyper-mask / GDK_HYPER_MASK, meta-mask / GDK_META_MASK, release-mask / GDK_RELEASE_MASK, modifier-mask / GDK_MODIFIER_MASK a


see man Gtk2::Gdk::Keysyms for more information.



***************************
asciidoc

an interesting python program
it generates man/html/docbook/can generate pdf
from ascii format similar to that used by mjd in txt2slides

Thus is a python program similar to the
marc dominus perl program
txt2slides. tgz which itself uses
txt2html by seth golub which uses a
model of html.pl package of Oscar Nierstrasz
which is similar to CGI.pm module conversions to html.

general idea

this is a header
*************

Monday, February 4, 2008

mutt delete message moves off C-p or C-n moves back to it

mutt delete message
how to undelete? seems to skip the message with n or p

answer control key!
C-p or C-n moves back to it!