XCode cannot compare SVN directories

I am missing one feature in XCode: it can’t compare whole directories under version control. Only single files can be compared. For example, I have a directory named “Classes”. It’s info dialog does not show the version control tab:
However, if I choose some source file, I get the SCM tab and can compare my local version with the head version in the repository:

OpenCL on OS X

I have just tried to run an official OpenCL sample program by Apple on a MBP 10.6.3 machine. Result: a crash. Why? I do not know yet, but it seems that OpenCL somehow crashlanded the nvidia OpenGL driver. This is what I get:
08.04.10 17:04:50 kernel NVDA(OpenGL): Channel exception! exception type = 0xd = GR: SW Notify Error
08.04.10 17:04:50 kernel 0000006e
08.04.10 17:04:50 kernel 00200000 00008397 00000474 00000040
08.04.10 17:04:50 kernel 0000047e 00001408 00000001 00000008
08.04.10 17:04:50 kernel 00000000 00000000 01dfdc03
08.04.10 17:05:04 kernel NVDA(OpenGL): Channel exception! exception type = 0x8 = Fifo: Watchdog Timeout Error
08.04.10 17:05:04 kernel 0000006e
08.04.10 17:05:04 kernel 00000010 00008397 00000474 00000000
08.04.10 17:05:04 kernel 0000047e 00001528 00000000 00000008
08.04.10 17:05:04 kernel 00000000 00000000 019fdc03
As soon as I know something more and especially how to fix it, I will share it here.
Update: It does not crash, if I don’t touch any keys when the kernel runs. So I guess the OpenCL drivers are a bit buggy still…

Bug in ff-find-other-file of Emacs 22?

I am working on a C++ project which is organized such that source files (*.cc) are in some subdir called, let’s say, project/dir1/, and header files (*.h) in a directory called project/include/. Now Emacs has a function called ff-find-other-file, which is able to switch between header and implementation of C/C++ files. If you take a look at the source of this function, you will find another function called ff-get-file-name, which tries the following: first, it looks for already visited buffers, if they contain the appropriate file. Then it will search a certain set of directories, if they contain the file. Last, it will ask to find or create the file in a user specified directory. However, in my case, although both files are already being visited by buffers, the first test (finding the file in already loaded buffers) fails. Actually the offending piece of code looks like this:


(if (bufferp (get-file-buffer filename))
(setq found (buffer-file-name (get-file-buffer filename))))

The problem is that this always fails, and found will always be nil. The filename constructed is not being expanded, as get-file-buffer demands. However, expanding it is useless, since the exact expansion (absolute path) of the searched file is not exactly known! However, you can rework these lines to just look for a buffer whose name matches the file you are looking for:


(let ((b (find-if (lambda(x) (string= (buffer-name x) filename)) (buffer-list))))
(if b
(setq found (buffer-file-name b))))

Note that this will only do a simple string matching. It might happen that for a certain file foo.cc you have to buffers visiting some foo.h. The function will only find the first one. But in my opinion, there is not simple solution to find the semantically correct header file, anyway. So this is still better than the broken solution in Emacs.

Recursive Makefile for LaTeX

I wanted to make a Makefile for a seminar report. This report contains all the sub-reports of the students. So the Makefile needs to recurse into subdirectories to compile all the contained LaTeX files there. So, given a file reports.tex which will include some PDFs in subdirectories 00/ to 10/, we get a Makefile that looks like this:


#####################################################
# A small LaTeX Makefile
#####################################################

PREFIX=reports

CHAPTERS=00 01 02 03 04 05 06 07 08 09 10

all: subdirs $(PREFIX).pdf

#####################################################

.PHONY: subdirs simple

subdirs:
@for i in $(CHAPTERS); do
(cd $$i; $(MAKE)); done

#####################################################

$(PREFIX).aux: $(PREFIX).tex
pdflatex $(PREFIX).tex

$(PREFIX).pdf: $(PREFIX).aux
pdflatex $(PREFIX).tex

#####################################################

simple:
pdflatex $(PREFIX).tex

#####################################################

clean:
@for i in $(CHAPTERS); do
(cd $$i; $(MAKE) clean); done
rm -f $(PREFIX).aux $(PREFIX).bbl $(PREFIX).blg
$(PREFIX).idx $(PREFIX).log $(PREFIX).out $(PREFIX).tcp
$(PREFIX).toc $(PREFIX).tps $(PREFIX).prf $(PREFIX).lbl
rm -f $(PDFFILES) *.aux