My Contribution
to the Public Domain
Well, here is my humble contribution to the Public Domain, sorted
roughly in chronological order.
I hope you will find some of the following helpful ...
Batch Convert a Number of Movies with Quicktime
Here is a little applescript that
batch converts
a number of movies into the format that you have used last time when you
converted a movie using Quicktime.
Just unpack the
gzip file
(double-clicking should do it),
then drag a number of movies onto the icon.
A few Basic Shapes as OmniGraffle Stencil
I have imported a few shapes from Visio into OmniGraffle and created a
stencil of them.
It contains a curly brace, a number of cloud shapes,
and a number of block arrows.
Just download the zip file, unpack it, and move the .gstencil file into
~/Library/Application Support/OmniGraffle/Stencils.
Move Off-Screen Windows to the Main Screen
Here is a little applescript that
moves all windows
that are almost or completely off-screen
to a position on the screen (main display).
This can be very handy when you plug in your Mac laptop to different displays
(such as projector and flat panel). Then, it often happens (to me,
at least) that some windows get pushed to the very sides of the screen, so
that only a few pixels of the windows remain on-screen.
I should mention that this version is based on the script provided
by Jonathan Laliberte
Here is a little variation; the difference is:
all windows that are more or less off-screen (no matter how much) are moved back
so that they are completely on screen (if possible).
Counting Polygons in VRML / X3D
If you want to count the number of polygons in a VRML / X3D file
without a VRML loader / brwoser,
here is a little script.
Simplex Noise
Here is a port to GLUT
of Stefan Gustavson's
demo
of "simplex noise", which was invented by Ken Perlin.
My port compiles and runs fine under Mac OS X 10.4 on my Powerbook,
and it should also compile fine under Linux (please let me know).
Klausur-Auswertung
(The following text is in German, because the Excel sheet is in German, too.)
Mit diesem Excel Sheet
kann man Klausurergebnisse komfortabel auswerten, d.h., Noten erstellen und
kleine Statistiken erzeugen.
Hier sind 3 Beispiel-Snapshots:
Bsp 1,
Bsp 2,
Bsp 3 (verschiedene Ausschnitte desselben
Excel-Sheets).
Folgende Dinge berechnet das Sheet automatisch:
- Pro Student: Summe der Punkte und Note,
- Histogramm über die Gesamtpunkte,
- Histogramm über die Noten,
- Durchfallquote,
- Für jede Aufgabe ein Histogramm der erreichten Punkte,
- Farbkodierung der Noten,
- auf einem zweiten Sheet eine anonymisierte Tabelle der Noten, so
daß daraus sehr einfach eine HTML-Tabelle erzeugt werden kann;
Alle diese Dinge werden automatisch berechnet, sobald man eine der Eingaben
ändert (z.B. Punkte in einer Aufgabe, Schwellwerte, etc.).
Folgende Daten muß man eingeben:
- Pro Student: die erreichten Punkte in jeder Aufgabe;
- Je einen Schwellwert für die Note 1.0 und 4.0;
Eine kurze Anleitung und Erläuterungen sind im Excel-Sheet enthalten.
Bemerkung:
Beim Öffnen muß man "enable macros" anklicken (ansonsten funktioniert
die Aktualisierung der Farbcodes der Noten nicht; alles andere funktioniert aber
weiterhin).
Make Proceedings from many PDFs
This page
explains an easy method to produce a single PDF (such as a
proceedings) from a bunch of PDFs, such that the pages of the single PDF have
headings and consecutive page numbers.
Print Your Mac's IP
This little script prints your external
as well as your internal IP on the command line.
These two IPs might be different if you are behind a router or a NAT
device.
The script is written in Python (which is installed on your Mac).
Find Duplicate Files on the Mac
Here is a little command line tool for Mac OS
X (10.4, Tiger) that finds duplicate files in a directory tree. Just put the
binary somewhere in your PATH, e.g.,
~/bin.
Details:
Find files that are (byte-wise) identical,
but are (possibly) scattered among different directories.
This might happen, for instance, if you copy a large directory
tree and (accidentally) resolve symbolic links during the copying.
The output (on stdout) consists of two lists (mainly):
first a list of files that have been found to be equal, one file
per line, and the last file within each group of equal files
gets a period appended;
second, the list of duplicates sorted by complete pathname.
Special files, like .DS_Store, are not considered.
Also, special directories, like CVS, are skipped.
In addition, only regular files are considered,
no symbolic links or other special files.
The implementation uses a number of optimization tricks to speed up
the search. On my G4, scanning a directory tree consisting of 40,000 files
in total, containing 7,000 duplicates, took about 3 minutes.
And here is the source code as
XCode 2.4 project.
Screen Saver for the Mac
On my Mac (at last ;-) ) I wanted a screen saver like the one I had on my
Linux box. Since I couldn't find the one I wanted, I wrote it myself.
So, here is ArtSaver (version 1.7; see the
ChangeLog for the changes over the previous
version).
It is like the built-in Slide Show screensaver on Mac OS X, but with many more
options and features:
- Keeps a persistent database of all the images found in the
specified directory tree or iPhoto album. This allows the screen saver to
handle huge image databases, and still have the benefit of
- displaying images immediately when started, and,
- not "exercising" the disk every time it gets invoked.
(This was actually one of the main reasons why I developed this
screen saver.)
I've tested my screensaver with directory trees containing over
150,000 images (scattered among about 300,000 other files).
-
Can use all images in a directory tree (minus the ones that are
excluded by other options, see below), or all images in one of your
iPhoto albums.
- Options include:
- the speed of the gradual zoom-in and -out (Ken Burns effect);
- the duration for how long an image is displayed before the next
one;
- whether or not the path of the image currently being displayed
should be displayed, too.
(instead of the complete path, it can also display just the
filename.)
- whether or not to use Spotlight for finding all images in a given
directory tree (with Spotlight it is faster, but sometimes Spotlight
does not find all the images, or none at all, and then the other
options can be quite valuable);
- many more ...
You can specify constraints for excluding images from being
displayed:
- the minimal size in pixels (for instance, thumbnails);
- the minimal size in bytes;
- a list of file patterns; if the path of an image matches
one of the patterns, it gets excluded (for instance, index
"prints").
You can review the file names that ArtSaver has displayed after it was
run (just open 'System Profiler', Logs, system.log; or type
'syslog -k Sender ArtSaver' in a Terminal)
ArtSaver 1.7 works only under Mac OS 10.5 (Leopard);
version 1.6.3
should work on both 10.5 and 10.4 (Tiger), but I couldn't test it.
Installation: just open the disk image,
and copy ArtSaver.saver
to the directory /Library/Screen Savers
or ~/Library/Screen Savers (depending on write permissions and taste).
Then go to System Preferences -> Desktop & Screen Savers.
ArtSaver should work out-of-the box with its built-in defaults.
However, in ArtSaver's configuration you'll probably want to
specify the directory where ArtSaver
can find the images (default = ~/Pictures), and whether and how ArtSaver
should display the image name. All other options in the other two sections
probably work by default, but they are there if you need to change them.
When you close the configuration dialogue, the screensaver recursively
scans the directory tree containing the files, and saves the list of images
in a database (its plist file).
(While doing that, ArtSaver still continues to display images from the old
image list and a spinning bar).
After that, everytime ArtSaver gets invoked, it will just read this list, and never
has to go through the whole directory tree, which can be a huge time savings, if there
are many images.
Scanning a directory tree of 300,000 files (110,000 of which are
images) takes about 1 minute on my Intel-based Mac Book Pro
(both with or without using Spotlight).
|
If you enjoy this screen saver, I would really appreciate a donation.
(It would also keep me motivated for further enhancements ;-) )
|
|
|
If you prefer not to use PayPal, you may also buy me something from my
Amazon wishlist
|
|
Please notice that I put ArtSaver under
a copyright and license
that basically says it's free for personal use but not for commercial use.
And here is the source code as XCode 3.0 project.
If you have any comments or suggestions, please don't hesitate to send me an
email at
zach
in.tu-clausthal.de.
Acknowledgement: goes to Stéphane Sudre:
his code got me started, and he helped along the way by
answering lots of questions.
Also, i'd like to thank the kind people on
comp.sys.mac.programmer.help, in particular, Michael Ash, Doc
O'Leary, David Phillip Oster, Nick Hristov, Uli Kusterer, Patrick Machielse,
Matt Neuburg.
Convert CSV to Mail Aliases
I transfered all my contacts from my good old Revo to a Siemens CX65.
But I send my email under Linux using mutt.
So here is a little Perl script that converts a CSV file into
a file containing an email alias for each name.
Prerequisite: the Perl module Text::xSV
(see the man page perlmodinstall for installation instruction).
XScreensaver hack (on Linux)
Here is a little
hack
for
xscreensaver
that can run a
slideshow
on the background (root window) of your display.
(But see the next item!)
Special feature: it searches a complete directory tree for images.
Prerequisites: xv & perl.
Tested under RedHat 7.2 with xscreensaver 3.33.
Slide Show Screen Saver on Linux
I have added three options to
chbg
that can make it better at presenting a slide show.
The options can
- print the file name being displayed into the image,
- build, use, and store a cache of image file names,
- output the diagnostic messages to a log file
(I use it together with
xscreensaver
to have it show some of my 26,000+ fine art images.)
Since I was not able to contact the author, and I can't check it in on
sourceforge, I make the
source
available here.
Tested under RedHat 7.2 with xscreensaver 3.33.
Vim
vim 5.6
(1.5 MB) for SGI, IRIX 6.2 and higher.
Special feature: it has been configured so that you can type in Japanese
characters (and probably other Asian languages) via XIM.
In more details, this is how I configured it:
setenv CC cc; setenv CFLAGS "-O -n32 -xansi "
./configure \
--prefix=/igd/a4/software/vim \
--enable-cscope --enable-multibyte --enable-xim \
--enable-fontset --enable-perlinterp --enable-pythoninterp \
--disable-gtk-check
and this is the :version which this vim prints:
VIM - Vi IMproved 5.6 (2000 Jan 16, compiled Feb 2 2000 23:41:28)
Compiled by zach@xxx, with (+) or without (-):
+autocmd +browse +builtin_terms +byte_offset +cindent +cmdline_compl
+cmdline_info +comments +cryptv +cscope +dialog_con_gui +digraphs -emacs_tags
+eval +ex_extra +extra_search -farsi +file_in_path -osfiletype +find_in_path
+fork() +GUI_Motif -hangul_input +insert_expand -langmap +linebreak +lispindent
+menu +mksession +modify_fname +mouse -mouse_dec -mouse_gpm -mouse_netterm
+mouse_xterm +multi_byte -perl +quickfix +python +rightleft +scrollbind
+smartindent -sniff +statusline +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +textobjects +title +user_commands +visualextra
+viminfo +wildignore +wildmenu +writebackup +X11 +xfontset +xim +brokenlocale
+xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/igd/a4/software/vim/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DUSE_GUI_MOTIF -DFUNCPROTO=7
-D NARROWPROTO -I/usr/include/X11 -O -n32 -xansi -I/path/include/python1.5
Linking: cc -n32 -o vim -L. -lXext -lXm -lXt -lXt -lX11 -ltermlib
/path/lib/python1.5/config/libpython1.5.a -ldl -lm
Simplistic LaTeX to HTML Converter
yal2h
("Yet Another LaTeX to HTML converter")
A simple Perl script which takes a LaTeX file and spits out one HTML file.
It doesn't have all the fancy features other converters have, but it's
simple to use, and it works for me.
IGC (Go client)
igc v0.752 (500k)
The ASCII-based (text-based) Go client for
IGS (Internet Go Server).
It might even work for NNGS.
(Someone on rec.games.go seemd to recall that igc was the
first client ;-) )
See the ChangeLog
for more information about what I improved and changed since version 0.751.
Tool to produce Diff's in HTML format from CVS
cvshtmldiff (little Perl script)
For HTML files under CVS control,
this is a more comfortable diff utility than cvs diff or
xdiff.
It is not similar or comparable to
cvs2html or
cvsweb!
Usage: cvshtmldiff file.html.
This will produce another HTML file file_diff.html
with the differences of file.html and one revision earlier
highlighted by color.
Notice: this little script is not a HTML parser.
It can be arbitrarily complex to produce correct HTML from a diff!
Therefore, no attempt is being made to do that. ;-)
If the results are unacceptable, you might want to try tidy
on the resulting HTML file (can be obtained from
www.w3.org).
See the comments at the beginning of the script.
Gabriel Zachmann
Last modified:
Thu Jun 26 18:51:01 MDT 2008