free hit counter

Tuesday, November 29, 2005

subversion: traditional version control locks

So we want to disallow concurrent editing on binary files like word docs, PDFs, and powerpoint slides. To do this you need to add the following to the server's windows registry (can just cut/paste to a file named subversion.reg and double click to merge it in), then reboot your client machines (and for good measure restart apache on the server)

Windows Registry Editor Version 5.00





Monday, November 28, 2005

Subversion- adding a new repository

First create the repository and import in files to it (don't forget to add branches, tags, and trunks dir to the pre imported structure)

cd c:\svn
svnadmin create --fs-type fsfs newProject
cd c:\temp
svn import existingSrc file:///c:/svn/newProject -m "initial add"

Then make the repository live by editing subversion.conf

< Location /newProject\>
DAV svn
SVNPath C:/svn/newProject

AuthType Basic
AuthName "Subversion newProjectrepository"
AuthUserFile c:/bin/svn-auth-file

Require valid-user

AuthzSVNAccessFile c:/bin/svn-acl

Then make the repository visible by appending to the access control list - svn-acl

# newProject
# on all subdirectories
# specialUsers group has full access, all others have read access only
@specialUsers= rw
* = r

Finally, restart the Apache service


Wednesday, November 23, 2005

matrix inverse and determinant

Factiods about determinants:
* Switching two rows or columns changes the sign.
* Scalars can be factored out from rows and columns.
* Multiples of rows and columns can be added together without changing the determinant's value.
* Scalar multiplication of a row by a constant c multiplies the determinant by c.
* A determinant with a row or column of zeros has value 0.
* Any determinant with two rows or columns equal has value 0.

Factoid about the inverse:
* the inverse of A is only valid if the derterminant of A != 0

The uLAPACK templates, built on the bigger CLAPACK library, interface to the boost::ublas matrix type and have inverse and determinant functions.

It takes awhile to walk through all the steps to get CLAPACK to compile, but it all does work on MSVC8 Express.

Relevant qmake lines so the linker will acutally spit out an executable based on this stuff:

INCLUDEPATH += C:\ulapack
debug {
LIBPATH += C:\clapack\Debug
release {
LIBPATH += C:\clapack\release
LIBS += clapack.lib
LIBS += libF77.lib
LIBS += blas.lib


Tuesday, November 22, 2005

Color coding my subversion repository

Is it too much to ask? I just want webbrowsed files to have reasonable syntax highlighting. I don't even care if it matches the colors I use in XEmacs. I just want something better than plain black and white.

Here's a great comparisson someone else blogged about:

gnu enscript is what viewVC (formerly ViewCVS) uses
mod_highlight is an apache module that purportedly does highlighting

Subversion is up and running

Well it took me 2 hours and 10 minutes, rather than the 1 hour I was going to allow myself, but I now have Subversion up, a repository created, and a checkout on my local machine.

I have it integrated with Apache, and its running on a machine with Windows XP Media Center Edition. No small part of me doubted that I would be able to get it to work on this machine.

To start with I'm going with a single repository, stored in the native FS filesystem, with the recommended trunk, branch, and tags directories.

I used the excellent tutorial which I blogged about earlier. The only real exception was how I made the repository and imported files:

cd c:
mkdir svn
cd svn
mkdir tools
svnadmin create --fs-type fsfs tools
cd \temp\existingSrc
mkdir trunk
mv exisitingSrc/* trunk
mv trunk existingSrc
mkdir existingSrc/branches
mkdir existingSrc/tags
svn import existingSrc file:///c:/svn/tools


Monday, November 21, 2005

using MSVC 8 for free

Microsoft is providing free licences for Visual Studio 2005 (aka VS8) Express Editions. The marketroid speak makes them sound like they're not suitable for "professionals", but the feature comparisson link makes it look like it's great for somone doing QT + BOOST + STL

We'll see how it flies.

download MSVC Express Edition:
install the platform SDK:

calling up system properties directly


I would really like to bring up the Environment Vars dialog directly but this is close enough.


Tuesday, November 15, 2005

C++ stdlib reference

Monday, November 14, 2005

math madness

a floating point to hex calculator with code in javascript:

An easy to digest floating point represenation tutorial:

A floating point wikipedia artical:

A matrix math refresher:

Friday, November 11, 2005

Subversion Setup

The book:

The main page:

A great tutorial:

A good example of an andvanced config:


Thursday, November 10, 2005

line endings in XEmacs

So the MS Visual Studio 2003 compiler is picky about the lineendings in your files. It only wants dos cr/lf linefeeds, not unix cr, and definitly not a mix of the two.

In XEmacs the magic word realted to this is coding. C-h a coding RET will get you more than you ever wanted to know about character coding systems.

Thanks to I got this working. Here's the snippet I'm have in my init.el to use dos linefeeds by default:

(set-default-buffer-file-coding-system 'undecided-dos)
(setq coding-toggle nil)
(defun toggle-line-end-coding ()
"Switch from DOS line ends (\r\n) to Unix (\n) and back again"
(if coding-toggle
(set-buffer-file-coding-system `undecided-unix)
(setq coding-toggle nil)
(message "Use unix line endings." ())
(set-buffer-file-coding-system `undecided-dos)
(setq coding-toggle t)
(message "Use dos line endings." ())

Trying out SCons

I'm starting from scratch at a new job, and I just couldn't bring myself to write a makefile for a new project yesterday.

I've heard good things about SCons, so after perusing the user guidefor about 30 minutes I was ready to build my first SConstruct file and get going.

Looks great so far, but I ran into one issue right off the bad. Indendting is important. The SConstruct file is a Python script, so you can have any leading indents! No problem if you've written any Python before, but it took me a few minutes to come up with that one.

Tuesday, November 08, 2005

Calling C from java

Creating single file distributions for Java apps

The "which JVM is installed?" and "What's a JAR file, why don't I have an .exe file to run?" questions are the kinds of things that cause me uneasyness with Java. This is a good artical to help sort it out:


For $299 Advanced Installer looks to do a great job wrapping up your Java application and making it look like a regular windows app

Resistive Bridges for sensor interfacing

A good intro thanks to Maxim:

Bridge circuits are a time-honored way to make accurate measurement of resistance and other analog values. This article covers the basics of bridge circuits and shows how to use them to make accurate measurements in practical environments. It details the key concerns of bridge-circuit applications such as noise, offset voltages and offset voltage drift, common-mode voltage, and excitation voltage. It describes how to interface bridges to high-resolution, analog-to-digital converters (ADCs) and the techniques for maximizing ADC capabilities.


Monday, November 07, 2005

Parallel Ports and hardware access under WIN32

(image curtosey of

(image and text quoted from

Register DB-25 I/O
Signal Name Bit Pin Direction
=========== ======== ===== =========
-Strobe #C0 1 Output
+Data Bit 0 D0 2 Output
+Data Bit 1 D1 3 Output
+Data Bit 2 D2 4 Output
+Data Bit 3 D3 5 Output
+Data Bit 4 D4 6 Output
+Data Bit 5 D5 7 Output
+Data Bit 6 D6 8 Output
+Data Bit 7 D7 9 Output
-Acknowledge S6 10 Input
+Busy #S7 11 Input
+Paper End S5 12 Input
+Select In S4 13 Input
-Auto Feed #C1 14 Output
-Error S3 15 Input
-Initialize C2 16 Output
-Select #C3 17 Output
Ground - 18-25 -

(Note again that the S7, C0, C1 & C3 signals are inverted)

I could swear I've logged all these links before, but apparently not. The parallel port is a useful little bugger, about every year and a half I seem to look into it again...

Driverlinx - Free, parallel port only:
DriverX- $400ish, great if you're doing a PCI board, or your own USB board:
DeVaSys- free driver/app source code which interfaces to the parport.sys driver


Wednesday, November 02, 2005

Getting JDK 5.0 working with Ant and JUnit

I wanted to be able to do a command line build of the source. I got the main skeleton code to compile,as well as the test cases.

This is what I had to do to get it work:

* downloaded and unzipped Junit:
* dowloaded and installed the JDK 5.0 update:
* dowloaded and unzipped binary distribution of ant:
* set JAVA_HOME env var to "C:\Program Files\Java\jdk1.5.0_05"
* added JAVA_HOME\bin to my PATH env var
* added C:\apache-ant-1.6.5\lib to my CLASSPATH env var
* removed/renamed any exteraneous .java files in the tree (like "Copy of DBDeliverableBroker?.java")
* added C:\junit3.8.1;c:\junit3.8.1\junit.jar; to my class path (note the explicit addition of the junit.jar !!!!)

JUnit classpath problems

Can't get JUnit to work? The WhichJUnit utility/tutorial is great for solving class path issues:

also see Sun's take on how classes are found: