October 20th, 2005
PDF::API2
Tutorial, dass die Basics von PDF::API2 ganz gut erklärt.
http://pdfapi2.sourceforge.net/twiki/
Perl and internet technology
Tutorial, dass die Basics von PDF::API2 ganz gut erklärt.
http://pdfapi2.sourceforge.net/twiki/
Bei der Ausgabe von Objekten ist Data::Dumper oft zu gesprächig, weil er die Strukturen bis ganz in die Tiefe ausgibt. So läßt sich die Tiefe begrenzen:
use Data::Dumper;
$Data::Dumper::Maxdepth = 2;
Meine Erfahrungen beim Konfigurieren eines externen Monitors an einem Dell Inspiron 9200 möchte ich hier kurz beschreiben. Ich habe dabei nur versucht den analogen Ausgang zu konfigurieren, nicht den DVI-Ausgang mangels geeignetem Endgerät.
Auf dem Rechner kommt XOrg in der Version 6.8.2-r1 mit den vorkompilierten ATI-Treibern media-video/ati-drivers 8.14.13-r2 und die media-video/ati-drivers-extra 8.14.13.
Mittels dem Tool fglrxconfig aus dem ati-drivers-extra habe ich mir eine Funktionierende Xorg.conf zusammengestellt, vorwiegend mit den Standard-Einstellungen. Danach habe ich die Einstellungen entsprechend den speziellen Bedürfnissen angepasst.
Zu beachten sind dabei folgende Punkte:
# Modeline
ModeLine "1440x900" 77 1400 1408 1416 1424 900 901 902 903
InputDevice "Touchpad" "CorePointer"
InputDevice "Mouse1" "SendCoreEvents"
Da das Touchpad immer angeschlossen ist, habe ich es als Core-Pointer eingestellt.Leider scheint nur die gespiegelte Ausgabe, bei der auf dem externen Monitor das gleiche zu sehen ist, wie auf dem eingebauten Display, zu funktionieren. Die anderen Einstellungen lassen den X-Server nicht mehr starten.
Noch ein Tipp: das X-Tool fireglcontrol kann zum einstellen des Displays benutzt werden, es kann die Ausgabe gesteuert werden wie nur internen Monitor, das gleiche auf internem wie externem Monitor ausgeben und extended-Desktop Einstellungen. Es verändert jedoch direkt die xorg.conf ohne ein Backup davon zu erstellen. Ein Backup vor Gebrauch des Tools von der /etc/X11/xorg.conf ist also dringend anzuraten.
Hier die komplette xorg.conf:
# File: xorg.conf
# File generated by fglrxconfig (C) ATI Research, a substitute for xf86config.
Section “dri”
Mode 0666
EndSection
Section “Module”
Load “dbe” # Double buffer extension
SubSection “extmod”
Option “omit xfree86-dga” # don’t initialise the DGA extension
EndSubSection
# This loads the Type1 and FreeType font modules
Load “type1″
Load “freetype”
# This loads the GLX module
Load “glx” # libglx.a
Load “dri” # libdri.a
EndSection
Section “Files”
RgbPath “/usr/X11R6/lib/X11/rgb”
FontPath “/usr/X11R6/lib/X11/fonts/local”
FontPath “/usr/X11R6/lib/X11/fonts/misc”
FontPath “/usr/X11R6/lib/X11/fonts/75dpi:unscaled”
FontPath “/usr/X11R6/lib/X11/fonts/100dpi:unscaled”
FontPath “/usr/X11R6/lib/X11/fonts/Type1″
FontPath “/usr/X11R6/lib/X11/fonts/Speedo”
FontPath “/usr/local/share/fonts”
EndSection
Section “ServerFlags”
EndSection
Section “InputDevice”
Identifier “Keyboard1″
Driver “kbd”
Option “AutoRepeat” “500 30″
Option “XkbRules” “xfree86″
Option “XkbModel” “pc105″
Option “XkbLayout” “de”
EndSection
Section “InputDevice”
Identifier “Mouse1″
Driver “mouse”
Option “Protocol” “ImPS/2″
Option “ZAxisMapping” “4 5″
Option “Device” “/dev/input/mice”
EndSection
# *********************
# Touchpad
# *********************
Section “InputDevice”
Driver “synaptics”
Identifier “Touchpad”
Option “Device” “/dev/input/mouse0″
Option “Protocol” “auto-dev”
Option “LeftEdge” “120″
Option “RightEdge” “830″
Option “TopEdge” “120″
Option “BottomEdge” “650″
Option “FingerLow” “14″
Option “FingerHigh” “15″
Option “MaxTapTime” “180″
Option “MaxTapMove” “110″
Option “EmulateMidButtonTime” “75″
Option “VertScrollDelta” “20″
Option “HorizScrollDelta” “20″
Option “MinSpeed” “0.3″
Option “MaxSpeed” “0.75″
Option “AccelFactor” “0.015″
Option “EdgeMotionMinSpeed” “200″
Option “EdgeMotionMaxSpeed” “200″
Option “UpDownScrolling” “1″
Option “CircularScrolling” “1″
Option “CircScrollDelta” “0.1″
Option “CircScrollTrigger” “2″
EndSection
Section “Monitor”
Identifier “Monitor0″
HorizSync 60
VertRefresh 50 - 70
Option “DPMS”
ModeLine “1440×900″ 77 1400 1408 1416 1424 900 901 902 903
EndSection
# === ATI device section ===
Section “Device”
Identifier “ATI Graphics Adapter”
Driver “fglrx”
# ### generic DRI settings ###
# === disable PnP Monitor ===
#Option “NoDDC”
# === disable/enable XAA/DRI ===
Option “no_accel” “no”
Option “no_dri” “no”
# === misc DRI settings ===
Option “mtrr” “off” # disable DRI mtrr mapper, driver has its own code for mtrr
# ### FireGL DDX driver module specific settings ###
# === Screen Management ===
Option “DesktopSetup” “0×00000100″
Option “MonitorLayout” “AUTO, AUTO”
Option “IgnoreEDID” “off”
Option “HSync2″ “31.5 - 60.0″
Option “VRefresh2″ “50 - 70″
Option “ScreenOverlap” “0″
# === TV-out Management ===
Option “NoTV” “yes”
Option “TVStandard” “NTSC-M”
Option “TVHSizeAdj” “0″
Option “TVVSizeAdj” “0″
Option “TVHPosAdj” “0″
Option “TVVPosAdj” “0″
Option “TVHStartAdj” “0″
Option “TVColorAdj” “0″
Option “GammaCorrectionI” “0×06419064″
Option “GammaCorrectionII” “0×06419064″
# === OpenGL specific profiles/settings ===
Option “Capabilities” “0×00000000″
# === Video Overlay for the Xv extension ===
Option “VideoOverlay” “on”
# === OpenGL Overlay ===
# Note: When OpenGL Overlay is enabled, Video Overlay
# will be disabled automatically
Option “OpenGLOverlay” “off”
# === Center Mode (Laptops only) ===
Option “CenterMode” “off”
# === Pseudo Color Visuals (8-bit visuals) ===
Option “PseudoColorVisuals” “off”
# === QBS Management ===
Option “Stereo” “off”
Option “StereoSyncEnable” “1″
# === FSAA Management ===
Option “FSAAEnable” “no”
Option “FSAAScale” “1″
Option “FSAADisableGamma” “no”
Option “FSAACustomizeMSPos” “no”
Option “FSAAMSPosX0″ “0.000000″
Option “FSAAMSPosY0″ “0.000000″
Option “FSAAMSPosX1″ “0.000000″
Option “FSAAMSPosY1″ “0.000000″
Option “FSAAMSPosX2″ “0.000000″
Option “FSAAMSPosY2″ “0.000000″
Option “FSAAMSPosX3″ “0.000000″
Option “FSAAMSPosY3″ “0.000000″
Option “FSAAMSPosX4″ “0.000000″
Option “FSAAMSPosY4″ “0.000000″
Option “FSAAMSPosX5″ “0.000000″
Option “FSAAMSPosY5″ “0.000000″
# === Misc Options ===
Option “UseFastTLS” “0″
Option “BlockSignalsOnLock” “on”
Option “UseInternalAGPGART” “yes”
Option “ForceGenericCPU” “no”
BusID “PCI:1:0:0″ # vendor=1002, device=4e50
Screen 0
EndSection
Section “Screen”
Identifier “Screen0″
Device “ATI Graphics Adapter”
Monitor “Monitor0″
DefaultDepth 24
Subsection “Display”
Depth 24
Modes “1440×900″ “1024×768″ “800×600″ “640×480″
ViewPort 0 0 # initial origin if mode is smaller than desktop
EndSubsection
EndSection
Section “ServerLayout”
Identifier “Server Layout”
Screen “Screen0″
InputDevice “Touchpad” “CorePointer”
InputDevice “Mouse1″ “SendCoreEvents”
InputDevice “Keyboard1″ “CoreKeyboard”
EndSection
### EOF ###
I wanted to create vcards out of userdata from an application. There is a module called Text::vCard and the first impression was that it would be an easy job. Finally it took much more time than I thought because the documentation is not easy to understand and does not describe the API completly.
For this reason i want to write a small howto for the next time
I wanted to get the textual output from the vcard. So I started creating an new Text::vCard, but could not find a method to output the content. After some reading I found out that the only way is to use am addressbook and create a vcard from this one:
my $addressbook = new Text::vCard::Addressbook();
my $vcard = $addressbook->add_vcard();
Next Step is to fill the base-data. Vcard knows base-data and “more complex” data. Note that $self is my user-object which contains the data.
# Basisdaten einfuegen
$vcard->fullname($self->get_fullname());
$vcard->email( $self->get('email') );
$vcard->uid($self->get('user'));
$vcard->title($self->get('title'));
Next Step is an Name-Node. This node belongs to the more complex ones and you can use. I do not know for what more than one of them can be used, but there must be any reason. The Method add_node is used to create a new node of a special type.
# namen setzen
my $name = $vcard->add_node({'node_type'=>'N'});
$name->family( $self->get('name') );
$name->given( $self->get('prename') );
Next i added an address-node. You can add multiple here i think. I did not try, but in other nodes you can do something like that: $add->add_types(’WORK’);
# Adresse einsetzen
my $ad = $vcard->add_node({'node_type'=>'ADR'});
$ad->add_types('work');
$ad->street( $self->get('street') );
$ad->city( $self->get('city') );
$ad->post_code($self->get('zip') );
Finally I added phone numbers. Please note the call add_types([’WORK’, ‘fax’]) to mark that the phone-number is a fax at work.
# Telefonnummern
my $p = $vcard->add_node({'node_type'=>'TEL'});
$p->add_types('WORK');
$p->value($self->get('phone'));
my $fax = $vcard->add_node({'node_type'=>'TEL'});
$fax->add_types(['WORK', 'fax']);
$fax->value($self->get('fax'));
my $mobil = $vcard->add_node({'node_type'=>'TEL'});
$mobil->add_types('cell');
$mobil->value($self->get('mobil'));
Finally you can get the output using the addressbook-object:
my $textonly = $addressbook->export()
If you want to print this to a browser, do not forget to send a proper content-type like text/v-card, so the browser knows what to to with it.
Ein kostenloses und sehr interessantes Bildverwaltungsprogramm gibt es seit kurzem von google: Google Picasa. Meine ersten Erfahrungen dazu sind überaus positiv. Das Programm war ca. 3 MB groß damit mit DSL schnell heruntergeladen.
Die Installation lief reibungslos (als Otto-Normal-Benutzer). Danach fragte das Programm sofort, ob die Festplatte nach Bildern untersucht werden sollte. Dieser Vorgang dauert einige Zeit. Das Programm ist allerdings auch während der Suchzeit benutzbar. Es werden alle Bilder gefunden, die irgendwo auf der Festplatte rumfliegen. Diese werden sehr übersichtlich dargestellt, im Hauptfenster werden sie nach Ordner sortiert dargestellt.
Es wird versucht, die Ordner auch zeitlich nach Jahren zu gliedern, was allerdings nicht so gut funktionierte. So sind die meißten Ordner von 2005 in 2003 gelandet, was nicht so richtig Sinn macht.
Die Dia-Show Funktion ist man von anderen Programmen gewohnt, man bekommt was man davon erwartet. Weitere Funktionen zum bearbeiten von Bildern haben sich als sehr nützlich erwiesen. Hat man ein Bild offen, hat man die Möglichkeit einige grundlegende und erweiterte Einstellungen vorzunehmen. So hat sich zum Beispiel die rote Augen-Funktion, die rote Augen zuverlässig entfernt, sowie die Aufhellfunktion für Dunkle Bilder sehr nützlich.
Wie sollte es anders sein, ist eine Suchfunktion in das Programm integriert, die wie man es von google erwartet, zuverlässig und äußerst schnell funktioniert. Ohne weiteres Handanlegen findet man natürlich nur Ordner oder Bildnamen. Nutzt man allerdings die Möglichkeit, Beschreibungen zu den Bildern zu vergeben, ist die Suche eine riesen Sache.
Fazit: nette, moderne, schnelle und intuitive Oberfläche, sehr nützliches und Tool zum verwalten von Bildern. Ich kann es sehr empfehlen.
Der Select-Zusatz sql_buffer_result weist mysql dazu an, eine temporäre Tabelle für das Ergebnis zu verwenden. Dies führt dazu dass das Table-Lock schnell wieder aufgelößt wird.
SELECT sql_buffer_result ID FROM table
Das sollte zum verhindern von Tabellenlocks ausprobiert werden.
Short Reference Guide to vi Commands
Moving Around
h, j, k, l - moves one space or line left, down, up, right.
^D, ^F, ^U, ^B - moves 1/2 or a full screen at a time.
0 - moves to the beginning of a line
$ - moves to the end of a line.
H, M, L - moves to top, middle or bottom of screen
G - moves to end of file
1G - moves to first line of file.
nG - moves to line n in file.
w - moves forward a word
b - moves backward a word
e - moves to end of current word
‘ (single-quote) - moves back to “previous” location.
(, ) - move to the beginning (end) of the current sentence.
{ , } - move to the beginning (end) of the current paragraph.
Getting rid of Things
d
dd - a line
dw - a word
d$ = D - from here to end of current line
d0 - from here to beginning of current line
x - one character
dG - delete from here to end of file.
Adding and Changing Text
i - enter insert mode to left of current cursor position
I - insert at beginning of current line
a - enter insert mode to right of current cursor position
A - insert at end of current line
r - replace a single character
R - enter overstrike mode.
c
u - undo the last text addition or deletion
:i,js/
y
Y - yank an entire line (or lines)
Saving Changes, Quitting, reading and writing files
ZZ - save the current file and exit.
:w - write using current file name
:w
:w! - write, even though a file exists with that name.
:q - quit without saving
:q! - really quit.
:wq - write and then quit
:x - exit while saving changes
:r
Marking lines and Finding Patterns
mx - mark the current position, and name it x (legal names are a-z, inclusive)
/
?
n - find the next instance of the pattern.
N - find the next instance of the pattern backwards.
Miscellaneous Commands
^Z - suspend execution of vi and return to the shell (see the jobs and fg commands to see how to return to vi)
^V
~ (tilde) - change the case of the current character.
n>> - move indentation n lines right shiftwidth spaces
n< < - move indentation n lines left shiftwidth spaces
>
<
. (period) - repeat the last insert or deletion command.
Hints and Tips
xp - swap two letters ddp - swap two lines
dwwp - swap two words dwbp - swap two words backwards.
There are 26 named buffers defined in vi; these buffers can be used to hold text in cut and paste operations and to hold boilerplate for memos, letters, etc.
“xy
Example: “ay9
“xp - will put the contents of the buffer “x at the current cursor position.
“Lohnt sich Wissensmanagement? - Oder der Preis von Wissen -”
von Dr. Bernhard von Guretzky
gefunden durch: Suche nach den Stichworten “bewertung von wissen” bei google.
Notizen:

Stolpersteine: