Archive for February, 2008

A Checkbox Group in PHP

Friday, February 29th, 2008
Und ich dachte, das ginge gar nicht... geht aber doch. Wenn die Checkboxen alle denselben Namen haben, überschreibt die zweite die erste etc. Aber in PHP gibts dafür ja Arrays. Und man glaubt es kaum, man kann den Namen der Checkbox als Array definier
[...more...]

WP > Static Page and latest Posts

Friday, February 29th, 2008
I wanted to have a static home page top area and the latest posts below. Somehow, Wordpress does not seem to have that by default. So here is my workaround: I created a new page template in my theme folder, mytemplate.php (see code below).
[...more...]

A small File Upload Checker

Friday, February 29th, 2008
<h2>Check file</h2>
<form name="checkfile" method="POST" action="<?=$PHP_SELF?>" enctype="multipart/form-data" >
<input type="hidden" name="max_file_size" value="8000000" />
<input type="file" name="file" id="c_f"
[...more...]

RegExp und PHP

Wednesday, February 27th, 2008
  • Finde einen Text, der mit font+4 und fett markiert ist und ersetze das ganze durch <h1>...</h1>
     $string2 =
     ereg_replace('<font size=.+4.>+ ?<b class=.bltxt.>(.*)</b> ?</font>'

[...more...]

RegExp für den emacs

Wednesday, February 27th, 2008
  • In einer Liste die führenden Zahlen plus Leerzeichen ersetzen:
     (query-replace-regexp "^[[:digit:]]* " "" nil nil nil)
  • Alle Zeichen bis zum ersten Punkt ersetzen:
     (query-replace
[...more...]

Find Files

Friday, February 22nd, 2008

Find files that contain a text string:

grep -lir "some text" *

The -l switch outputs only the names of files in which the text occurs (instead of each line containing the text), the -i switch ignores the case, and the -r des
[...more...]

Current Equipment

Wednesday, February 20th, 2008

Cameras

  • Nikon D70s, with Sigma 18-200mm Zoom (to be looked up ;-))
  • Canon Digital IXUS 60

Other

  • Nikon COOLSCAN V ED

Why my images seem to be yellow on the screen

Tuesday, February 19th, 2008
(but look fine in preview and as wallpaper) Great. New PC. Windows Vista. Installed Nikon's PictureProject and went to work. But then ... all my images that looked fine in the Overview pane, were
[...more...]