I am still waiting for 64 bit CUDA support for OS X 10.6. As this thread indicates, we might have to wait for a while so far. Maybe I will switch to OpenCL in the meantime? 🙂
Author: root42
Password generator
Neat link: An online password generator tool: https://www.grc.com/passwords.htm
How to add Google Analytics to Typo3
Someone else already solved it. I say thanks!
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
Angry Birds
I have to make some advertisement for a funny little iPhone game: Angry Birds. The idea: green pigs stole some eggs, now the birds are angry! Use those Kamikaze birds as ballistic missiles to destroy the pigs! Nice physics engine. Also available on the N900, and costs only 79 Eurocents. Here’s a shot:
How to duplicate Matlab functionality
Since I am a total Matlab-n00b, I rather write a convoluted Python script instead of using the appropriate Matlab function. And here it is. A small script to compute the standard deviation of two vectors. I guess this would have been one Matlab command.
import sys
import scipy.io
import math
def computeStdDev(file, vec1, vec2):
data = scipy.io.loadmat(file, struct_as_record=True)
vector1 = data[vec1]
vector2 = data[vec2]
if len(vector1) != len(vector2):
print "Error: Vectors do not have matching lengths."
return
diff = vector1
N = len(diff)
for i in range(N):
diff[i] = vector1[i] - vector2[i]
mu = 0
for val in diff:
mu = mu + val
mu = mu / float(N)
sigma = 0
for i in range(N):
sigma = sigma + (diff[i] - mu)**2
sigma = math.sqrt(sigma / float(N))
print "mu: %f" % mu
print "sigma: %f" % sigma
if len(sys.argv) != 4:
print "Usage: %s file vector1 vector2" % sys.argv[0]
sys.exit(0)
computeStdDev(sys.argv[1], sys.argv[2], sys.argv[3])
Matlab and Python
How to read Matlab files with Python and SciPy can be read here. Short:
import scipy.io
data = scipy.io.loadmat('test.mat')
This will create a dictionary called data containing all the variables of the Matlab file.
jabber.org is coughing
The guys over at jabber.org are moving servers, and upgrading their software. However, it does not seem to work well. They mention the need to adjust settings for iChat and Kopete. However my IM+ does not work anymore either, Licq’s pre-alpha jabber Plugin also crashes (however erijo seems to be working on a fix), and Adium also chokes, and will connect only every couple of hours. It seems they should have done a bit more testing before!
Mobile me, Mobile schmu
I am currently trying out Apple’s Mobile Me service, which is free in the first two months. It seems relatively nice, but has some drawbacks. On the plus side, you get 20 GB of storage space, or 40 GB for the family pack. Also you can track your iPhone if you lose it. The mail service is useful, but on the downside: It does not support server side filtering! That’s a great, great bummer. Also it does not seem to support Apple’s notion of filtering, called “intelligent mailboxes”. If that were supported on the server, I would ditch my GMX ProMail account, and switch to using Mobile Me for mail services.
Elegantly making a dictionary of lists
In Python I sometimes want to make a dictionary of lists. So usually I would write something like:
mydic = {}
for something in somethingelse:
mydic[somekey].append(something)
This however will not work, if somekey did not exist so far, because it will raise an exception. But there is help! You can use a collection:
import collections
mydic = collections.defaultdic(list)
for something in somethingelse:
mydic[somekey].append(something)