Austinheap is a champ – iran proxy servers

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.

Leave a Comment

Reaching fer me squid

one proxy server coming up let’s hope the good guys get to it…

Leave a Comment

Peter Costello to put the knife into the Liberal Party

Could it happen?

Leave a Comment

Kingdom of Loathing Literacy Test

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.

Leave a Comment

Getting Cython to work on OSX10.5 with Python 2.5

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.

Leave a Comment

Conspiracy theory? Probably.

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?

Leave a Comment

Numpy, atlas et al on Mac with python 2.6

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

Leave a Comment

Update macpython

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

Leave a Comment

‘June 4 Incident’ (Tiananmen Square Massacre)

Seems worth noting that today is the anniversary of this major event, still barely acknowledged by the Chinese government.

Not sure how accurate this piece about China blocking twitter in the leadup to the anniversary is but it’s plausible.

Leave a Comment

Resurrecting the pyticles development blog

Pyticles is my messy googlecode project: http://code.google.com/p/pyticles/

OK, first problem is that the design of the force classes is ugly. Overwhelmingly forces will be one body or pair forces within the system itself so why make the two system approach, for which the only application at the moment is system boundaries, the default case for which it is designed.

The motivation for this was to be able to use generic force calculation functions – better I think to write the functions (e.g. gmm/r2) seperately and bind them in the class defintions for one-system and two-system forces.

Leave a Comment

« Newer Posts · Older Posts »