Skip to main content

Posts

Showing posts from December, 2010

A silent upgrade helps

I switched to compiling a C app on a Maverick Meerkat Kubuntu box instead of my Mandriva 2010.0 laptop, which resulted in a slightly newer version of gcc — the compiler. This resulted in discovering (via warning messages) several small ways in which certain segments of the application I’m working on are outright broken — would result in a SegFault sometimes & dubious results most other times. Some of it was simply bad habits (forex, original programmer had hard-coded fixed values instead of terminating a list of arguments with a NULL ), other of it were argument mismatches (forex, supplying an int argument for a %ld printf parameter, or occasionally more obscure things). It does make me wonder what similar blunders I committed in the early days which were never discovered. (-:

Burying antiquity in technology

Starting to see good results from converting an app from driving a specific breed of dot-matrix impact printer via a specific SCO Unix device node to a more generalised system which will print A4 pages on almost any printer. How? Feed the "printer" output into a (text) file; Set the init sequence to be <HTML><BODY><PRE> & the flush sequence to be </PRE></BODY></HTML> Redefine the escape sequences for bold/unbold into "<B>" & "</B>" likewise for italics into "<I>" & "</I>" etc, notably page break (^L/\f) into <!-- PAGE BREAK -->; Cram the text file into htlmdoc & order it to produce PDFs; lpr nameofPDFfile (or write it where it can be viewed in a file share for emailng purposes) The next stage is to get into cool stuff like doubled or dotted/dashed underscores, coloured text (or backgrounds), & jamming lists into <TABLE> structures, which would ...

So... you've got a string of video clips...

...but want to show them to [a] friend[s] when/where there’s no computer available? This script will turn a directory full of video files into a DVD: #!/bin/sh FILES="$(for x in *.flv *.mp4 *.mpg *.avi; do echo $x; done | grep -v '^\*' | sort)" for f in ${FILES}; do n=$(echo $f | sed -e 's/\.[a-zA-Z0-9]*$//' -e 's/_+/ /g' -e 's/^/"/' -e 's/$/"/') NAMES="${NAMES} \"$n\"" done NAME=$(basename $(pwd) | sed -e 's/_/ /g') mkdir -p DVD NEWFILES="" for f in ${FILES}; do n="$(basename $(basename $(basename $(basename $f .flv) .mp4) .mpg) .avi).mpg" NEWFILES="${NEWFILES} DVD/$n" nice -15 ffmpeg -i $f -target ntsc-dvd -aspect 4:3 -y DVD/$n done makemenu -noask -overwrite -ntsc -dvd -align northwest -menu-title "${NAME}" -menu-title-fontsize 32 -font "Helvetica" -fontsize 24 -textcolor "rgb(255,255,255)" -fontdeco '-stroke rgb(0,0,0) -strokewidth ...