pmeerw's blog
Apr 2008
There is a Linux program, qtpfsgui, which allows to create high dynamic range (HDR)
image from a series of images with bracketed shutter speed. I'm using the CHDK firmware for my Canon IXUS 70.
Below is a series of shots of the Franziskanerkirche in Salzburg, in the middle is the tonemapped HDR image. Well, lacking a tripod, the result is poor.
A higher resolution image is here (1024x766, 78 KB).
posted at: 21:29 | path: /fun | permanent link
Had to try Google's App Engine, so here is my first project, imgal (imgal.zip).
It's just a guestbook thingie with image upload capability (stored as blobs in the database).
App Engine uses Python Paste's WebOb to provide objects for HTTP requests and responses.
posted at: 17:18 | path: /programming | permanent link
Some material on Google's BigTable
posted at: 15:30 | path: / | permanent link
Playing around with Karp-Rabin exact string search algorithm; did some assembler optimization -- the inner loop can be coded to use only registers. kr.c:
#define SHIFT 3
#define REHASH(a, b, h, m) ((((h) - ((a)<<(m))) << SHIFT) + (b))
#define OUTPUT(j) printf("%d\n", (j))
void KR(const char *pattern, int pattern_len, const char *text, int text_len) {
int i;
unsigned int hx, hy;
/* Preprocessing */
for (hy = hx = i = 0; i < pattern_len; ++i) {
hx = ((hx<
kr_opt.s (loop only):
mov edi, DWORD PTR [ebp+16] /* text[i] pointer */
lea esi, [edi+eax] /* load text[i+pattern_len] pointer */
mov edx, DWORD PTR [ebp-32] /* load hy */
jmp .L7
.L6:
mov ch, BYTE PTR [esi] /* get text[i+pattern_len] */
inc esi
movzx eax, BYTE PTR [edi] /* get text[i] */
inc edi
dec ebx /* i <= (text_len-pattern_len) */
jz .L8
sal eax, cl /* tmp = text[i] << shift */
sub edx, eax /* hy - tmp */
movzx eax, ch
lea edx, [eax+edx*8] /* hy = (hy << 3) + text[i+pattern_len]
.L7:
cmp DWORD PTR [ebp-36], edx /* hx == hy */
jne .L6
The results against gcc 4.3.0, can this be improved?
posted at: 17:16 | path: /programming | permanent link
Three things need fixes
comments.py, cmtExpr() breaks with None values
if entry['absolute_path'] == None or entry['fn'] == None:
return ''
session.py, is broken; if the file does not exist, an exception is thrown
def _lock(self):
# ???: does this work as expected?
try:
if self._use_lock:
self._dbmfile_lock = open(self._dbmfile, "r+")
tools.lock(self._dbmfile_lock, tools.LOCK_EX)
self._locked = 1
except:
pass
def _unlock(self):
# ???: does this work as expected?
try:
if self._use_lock and self._locked:
tools.unlock(self._dbmfile_lock)
self._dbmfile_lock.close()
self._locked = 0
except:
pass
complete_openid_auth() of comments_openid.py version 0.4:
# Ask the OpenID library to check the server's response
response = consumer.complete(query, return_to)
the second parameter, return_to, is required by python-openid version 2.1.1.
posted at: 23:56 | path: /projects/OpenID | permanent link
test stuff here
posted at: 15:35 | path: / | permanent link
A Universal Turing Machine in XSLT already exists, but... is CSS Turing-complete?
posted at: 18:54 | path: /fun | permanent link
Sadly, Mercurial is not in OpenWrt yet;
here is my lighttpd config (/etc/lighttpd.conf):
server.modules = (
"mod_rewrite",
"mod_alias",
"mod_auth",
"mod_cgi"
)
# OpenWrt has troubles with more advanced backends (#2401)
server.network-backend = "write"
# needed to store data of POST requests (#2224)
server.upload-dirs = ( "/tmp" )
static-file.exclude-extensions = ( ".cgi" )
cgi.assign = ( ".cgi" => "/usr/bin/python" )
# where hgwegdir.cgi resides
alias.url = ( "/cgi-bin/" => "/data/www-cgi/" )
# I have public and a private repositories
url.rewrite += ( "^/hg-priv([/?].*)?$" => "/cgi-bin/hgwebdir_priv.cgi$1" )
url.rewrite += ( "^/hg([/?].*)?$" => "/cgi-bin/hgwebdir.cgi$1" )
# require user/password for private repositories under /data/hg-priv
auth.debug = 0
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/data/hg-priv/.htdigest"
auth.require = ( "/cgi-bin/hgwebdir_priv.cgi" => (
"method" => "digest",
"realm" => "Private Mercurial repositories",
"require" => "valid-user"))
# only require require user/password for push requests to public
# repositories under /data/hg
$HTTP["url"] =~ "^/cgi-bin/hgwebdir.py" {
$HTTP["querystring"] =~ "cmd=unbundle" {
auth.debug = 0
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/data/hg/.htdigest"
auth.require = ( "/cgi-bin/hgwebdir.cgi" => (
"method" => "digest",
"realm" => "Mercurial repositories",
"require" => "valid-user"))
}
}
$SERVER["socket"] == "nslu2:80" {
}
$SERVER["socket"] == "nslu2:443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/ssl/server.pem"
}
And the hgweb.config configuration file (in /data/www-cgi/):
[collections] /data/hg/repos/ = /data/hg/repos/ [web] motd =Repositories maintained by me
baseurl = /hg push_ssl = true
posted at: 21:49 | path: /projects/OpenWrt | permanent link
The OpenID
setup for PyBlosxom is simple.
bjelli hat's schon immer gewusst
posted at: 16:20 | path: /projects/OpenID | permanent link
... created with South Park Studio.
posted at: 15:51 | path: /fun | permanent link
With the supplied Nokia micro-USB cable and a female-to-female USB-A adapter it is possible to attach USB devices to the N810. usbcontrol allows to switch the USB controller to host mode, however, the kernel needs also to be fixed (requiring a kernel recompile which is easy, see here and here).
Some devices, such as the MA-620 Infrared Adapter (0x0df7:0x0620) just seem to suck too much power and the N810 collapses (I had to remove the battery to get it working again).
posted at: 15:29 | path: /projects/N810 | permanent link
Setting up the toolchain (arm-elf) and compiling CHDK is rather straightforward. Then just put the binaries on the SD card and boot the new firmware!
The firmware sports a tiny basic interpreter, eg. for bracketing and raw file mode. I have yet to find software for linux to support HDR
posted at: 15:15 | path: /projects/CHDK | permanent link
I got a new camera: Canon IXUS 70; one of the reasons was the CHDK project; an open-source effort to extend the firmware of DiGIC II and III based cameras.
The new camera is really tiny but seems a bit fragile, at least compared to my previous Canon IXUS v2.
posted at: 15:07 | path: /projects/CHDK | permanent link
My paper Blind motion-compensated video watermarking got accepted at the 2008 IEEE International Conference on Multimedia & Expo, ICME '08.
posted at: 15:01 | path: /academic | permanent link