http://andrewleigh.com/?p=2132
I like the one about coin flipping.
http://andrewleigh.com/?p=2132
I like the one about coin flipping.
Ok here’s the problem. I need to produce fast documents with images, and I want to control the layout of the images.
Word is a pain for this. So is Lyx. Obviously this is not a job for straight Latex. Neither is the restructured text I use for most of my day to day notes good for this either.
So, I’m giving Scribus a spin.
Macports compiles it just fine. Took about an hour or so, I think a fair chunk of that was compiling qt3. Hmm, qt3. Is the macports version an old one?
UPDATE: would you know, I gave up, and just used Powerpoint…
http://twitter.com/austinheap
So my proxy server doesn’t seem to be working. Looks like a lot of peeps are on the bandwagon now – this is good.
Austinheap has guides on his blog for setting up servers. Most recent advice is to use new ports as the usual ones (e.g. 3128) are blocked.
one proxy server coming up let’s hope the good guys get to it…
I am in the middle of the Kingdom of Loathing literacy test and I have to say that it is awesome. It can be found at http://www7.kingdomofloathing.com/main.html.
I’m trying out Cython to see if it the answer for making fast nbody systems with python. What follows is code for computing the covariance of two vectors. This is not optimised cython, it’s purely my first attempt at getting a cython program to compile and run. I recommend The Cython Numpy tutorial as a nice place to start.
Did I mention installation? Just download and then run setup.py, I didn’t need to do anything special.
#covar.pyx#
import numpy as np
def cov(a,b):
# Computes the covariance between the n element vectors a and b
# c is the output array indexed by x,y
if len(a.shape) != 1:
raise ValueError("Array must be one dimensional.")
if a.shape != b.shape:
raise ValueError("arrays must be the same shape")
n = a.shape[0]
c = 0
# Perform the calculation
for i in range(n):
c += (a[i]-np.mean(a[:]) ) * (b[i] - np.mean(b[:]) )/n
return c
#test_covar.py# """ Covariance with Cython. """ import numpy as np import covar n = 50 a = length*np.random.random((n)) b = length*np.random.random((n)) print "Covariance of two numpy random vectors",covar.cov(a,b) print "Covariance of a vector with itself.",covar.cov(a,a) print "Covariance of a vector with its sine.",covar.cov(a,np.sin(a))
And the build script. I got frustrated trying to figure out the compiler flags, and ended up using distutils to do it for me. I will post a cython nbody system soon which will use disutils to compile.
build_covar.sh #!/bin/ksh # TRANSLATE cython -a covar.pyx # COMPILE gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c covar.c -o covar.o gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup covar.o -o covar.so # TEST python test_covar.py
Enjoy.
The Rio Tinto deal collapsed because of the refusal of failure of the Chinese regime to apologise for the Tiananmen Square massacre known as the 4 of June incident in China?
Now that I have python 2.6 installed I figure it’s time to have a crack at a fully optimized numpy-scipy install.
Jarrod Milmans’ instructions are what I will be following. Problems, hitches, missing steps will go here.
First thing before I start is to get new version of ipython, and readline. And I find that ipython has not been tested with 2.6 yet. I will try again in another month..
So my current version is 2.5.2. I need version 2.6 for a simple UI kit I want to use with my python sph code. There also appears to be a python 3.0 there but I am not sure if the time is right yet. So for now I will be conservatively installing 2.6.
Step 1: Hit the python website and download the package.
Step 2. Run the installer and answer the prompts. By default it pops in the the Frameworks folder next to 2.5
Step 3. Run something. The something I ran used pyglet, numpy, scipy and probably a few other modules. Hey it worked!
Step 4. Have a poke about – of course there is nothing in the 2.6 site-packages directory. Of course my python path has the 2.5 directory in it. I suspect I will need to rebuild scipy et al for 2.6 eventually.
Step 5: It turns out that new packages will install by default into 2.6. You will find that some things still only run on 2.5, to install a package to 2.5 just use python2.5 setup.py etc