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

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\auto-props]
"*.doc"="svn:needs-lock=yes;svn:mime-type=application/msword"
"*.pdf"="svn:needs-lock=yes;svn:mime-type=application/pdf"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.vsd"="svn:needs-lock=true"
"*.ppt"="svn:needs-lock=true;svn:mime-type=application/mspowerpoint"


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\Miscellany]
"enable-auto-props"="yes"

Labels:

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
</Location>



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
#
[newProject:/]
@specialUsers= rw
* = r

Finally, restart the Apache service

Labels:

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
LIBPATH += C:\CLAPACK\F2CLIBS\Debug
LIBPATH += C:\CLAPACK\BLAS\Debug
}
release {
LIBPATH += C:\clapack\release
LIBPATH += C:\CLAPACK\F2CLIBS\Release
LIBPATH += C:\CLAPACK\BLAS\Release
}
LIBS += clapack.lib
LIBS += libF77.lib
LIBS += blas.lib


linkage:
http://mathworld.wolfram.com/Determinant.html
http://www.acfr.usyd.edu.au/homepages/academic/tbailey/software/software.html
http://www.netlib.org/clapack/
http://wims.unice.fr/wims/wims.cgi?session=BVDF4AB014.1%E2%8C%A9=en&module=tool%2Flinear%2Fmatrix.en

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:
http://geekswithblogs.net/flanakin/articles/CompareSubversionWebTools.aspx

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

Labels:

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.

linkage:
download MSVC Express Edition: http://msdn.microsoft.com/vstudio/express/visualc/download/
install the platform SDK: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

calling up system properties directly


Start->Run->sysdm.cpl


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

linkage:
http://vlaurie.com/computers2/Articles/control.htm
http://vlaurie.com/computers2/Articles/runline.htm

Tuesday, November 15, 2005

C++ stdlib reference

Monday, November 14, 2005

math madness

a floating point to hex calculator with code in javascript: http://babbage.cs.qc.edu/courses/cs341/IEEE-754hex32.html

An easy to digest floating point represenation tutorial: http://www.nuvisionmiami.com/books/asm/workbook/floating_tut.htm

A floating point wikipedia artical: http://en.wikipedia.org/wiki/Floating_point

A matrix math refresher: http://easyweb.easynet.co.uk/~mrmeanie/matrix/matrices.htm

Friday, November 11, 2005

Subversion Setup

The book: http://svnbook.red-bean.com/

The main page: http://subversion.tigris.org/

A great tutorial:http://svn.spears.at

A good example of an andvanced config: http://www.scons.org/cgi-bin/wiki/AdvancedBuildExample

Labels:

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 http://www.cs.odu.edu/~zeil/software/.emacs 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"
(interactive)
(if coding-toggle
(progn
(set-buffer-file-coding-system `undecided-unix)
(setq coding-toggle nil)
(message "Use unix line endings." ())
)
(progn
(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:


Link: http://www.excelsior-usa.com/articles/java-to-exe.html

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.



link: http://www.maxim-ic.com/appnotes.cfm/appnote_number/3426

Monday, November 07, 2005

Parallel Ports and hardware access under WIN32

(image curtosey of http://www.doc.ic.ac.uk/~ih/doc/par/)


(image and text quoted from http://www.doc.ic.ac.uk/~ih/doc/par/doc/regpins.html)



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...



Drivers:
Driverlinx - Free, parallel port only: http://www.driverlinx.com/ftp/unsupported/port95nt.exe
DriverX- $400ish, great if you're doing a PCI board, or your own USB board: http://www.tetradyne.com/driverx.htm
DeVaSys- free driver/app source code which interfaces to the parport.sys driver
http://www.beyondlogic.org/usb/usblptpd11.htm


Links:
http://www.lvr.com/parport.htm

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: http://prdownloads.sourceforge.net/junit/junit3.8.1.zip?download
* dowloaded and installed the JDK 5.0 update: http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jdk-1.5.0_05-oth-JPR&SiteId=JSC&TransactionId=noreg
* dowloaded and unzipped binary distribution of ant: http://ant.apache.org/bindownload.cgi
* 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:

http://junit.sourceforge.net/doc/faq/faq.htm#running_2

also see Sun's take on how classes are found: http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html