Connelly - Technical

Public domain code.

Tuesday, July 07, 2009

Allegro 'libgif' animation library

›
From 2001, an Allegro library for loading GIF animations as a BITMAP pointer that automatically animates (due to an installed timer callback...
24 comments:
Wednesday, July 23, 2008

forkmap, threadmap

›
I have an 8 core machine, so vanilla Python increasingly annoys me by running roughly 200*8 times slower than optimized C code (I use OpenMP...
6 comments:
Saturday, March 15, 2008

C++ foreach

›
I can never remember the C++ for-each loop syntax. Thus, a helper macro I use: #define for_each(type, it, L) for (type::iterator (it) = (L)...
15 comments:
Sunday, November 04, 2007

RK45 in Python

›
Runge-Kutta 4th and 5th order adaptive ODE integrator. Generally the scipy integrators will be easier to use, unless you specifically need...
6 comments:
Wednesday, September 12, 2007

Filter numpy images with FFT, Python

›
Generic linear filter support is not currently built into the Python Imaging Library. This module lets you filter a numpy array against an ...
8 comments:
Monday, June 04, 2007

framecap - Capture camera input with Allegro, C++

›
Requires OpenCV, Allegro, and pthreads. Captures frames from a webcam. Usage: CAPTURE *cap = create_capture(); BITMAP *bmp = capture_frame...
13 comments:
Monday, April 30, 2007

pfm - Read/write 1 and 3 channel PFM files

›
PFM files are m x n x1 or m x n x3 arrays of floats. C++ code to read/write the format (public domain). ( Source )
7 comments:
Wednesday, April 04, 2007

OpenCV camera and AVI input

›
To convert a video to a format that OpenCV can read: $ mencoder in.avi -ovc raw -vf format=i420 -o out.avi This is necessary because OpenC...
7 comments:
Tuesday, April 03, 2007

Burrows-Wheeler transform in Python

›
def bwt(s): s = s + '\0' return ''.join([x[-1] for x in sorted([s[i:] + s[:i] for i in range(len(s))])]) def ib...
2 comments:
Sunday, April 01, 2007

How to put a video on the Web

›
Install FFMPEG [1] , use ffmpeg -i in.avi out.swf , then place <embed src="out.swf" width="400" height="300...
5 comments:
Saturday, February 17, 2007

Ubuntu Linux postinstall notes

›
After installing an operating system, there are always a zillion changes I have to make to get the operating system operational . I'm n...
1 comment:
Friday, February 09, 2007

Eigenvectors of 3x3 symmetric matrix

›
A C++ source and header file to compute eigenvectors/values of a 3x3 symmetric matrix. Potentially easier than installing EISPACK, LAPACK, ...
33 comments:
Sunday, October 15, 2006

Incremental flash backup tool

›
I recently decided that I would back up my documents to a high capacity flash disk. Thus I wrote a backup tool. Features: Dead simple. Som...
1 comment:
Sunday, August 06, 2006

Intelligent Minesweeper

›
A game of Minesweeper, with moves suggested by the entail module I posted earlier. The entail module contains a propositional logic infer...
4 comments:
Friday, June 16, 2006

Real-time hair animation

›
I used the Verlet integration and relaxation method described by Thomas Jakobsen in "Advanced Character Physics" [1] coupled with...
99 comments:
Saturday, June 10, 2006

Automatic Python imports with autoimp

›
I got sick of writing " import X " in Python. So, I created the public domain module autoimp , which imports all modules automati...
9 comments:
Thursday, May 18, 2006

Programming Language Productivity

›
Norvig [1] commented on two productivity studies by Prechelt [2] and Garret [3] . The results for the productivity of the languages isn...
7 comments:
Wednesday, May 10, 2006

Eight queens in Python

›
An elegant way to find all solutions to the 8-queens problem: generate all 8-castles solutions by a permutations() generator and filter the ...
4 comments:
Friday, April 28, 2006

Shedskin benchmarks

›
Shedskin [1] is an experimental Python to C++ compiler. I benchmarked it for some of the microbenchmarks in The Computer Language Shootout...
Monday, January 23, 2006

rencode -- Reduced length encodings

›
A space-efficient Python serialization module based on bencode, which can be used to decode strings from untrusted sources. Works well for ...
3 comments:
Saturday, December 17, 2005

Allegro Quick Reference in Japanese

›
The Allegro Quick Reference guide that I wrote in 2002 [1] has been translated into Japanese [2] by Ohsawa Hirotaka. Cool.
4 comments:
Friday, December 16, 2005

Search the Web in Python

›
Query 6 search engines in Python. ( Module website ).
1 comment:
Wednesday, December 07, 2005

MPI matrix multiplication and inversion

›
MPI matrix multiplication and inversion routines, written for a physics class that I took last year. The code is modular, and more flexible...
5 comments:
Sunday, November 13, 2005

Moore's law

›
For the past 5 years, CPU speeds have been increasing roughly linearly . That's right, for processor speeds, Moore's law does not c...
5 comments:
Saturday, November 12, 2005

FFT polynomial multiplication

›
It's easier than you might think: >>> def fft_mul(C1, C2): ... d = len(C1)+len(C2)-1 ... c1 = FFT.fft(list(C1) + [0] * (d-l...
7 comments:
Sunday, November 06, 2005

Trigonometry proved

›
Common trigonometric identities, proved in one page.
4 comments:

pysam -- Python I2P SAM library

›
A Python I2P SAM library, emulates the Python socket module. I haven't updated it in a while, but it works. ( Main Page ).

Hogwarts Security

›
Wow. I thought I'd seen it all. Then I find the world's most famous cryptographer talking about security in the sixth Harry Potte...
Saturday, October 29, 2005

Propositional logic in Python

›
Propositional logic inference via compressed truth tables. Module entail is presumably slower than your industrial-grade C inference algor...
7 comments:
Sunday, October 23, 2005

Ventiloquate

›
Hyperventilate + loquacious = ventiloquate, to freak out and speak too much, too fast, and use way more breath than is actually needed to ex...
1 comment:
Friday, October 14, 2005

Basic factorization algorithms

›
A paper which gives pseudocode and the reasoning behind some basic factorization algorithms: Fermat factorization, Pollard rho, Pollard p-1,...
10 comments:
Saturday, October 08, 2005

Memoization with cache clear on return of last function call

›
Memoization is nice, but in dynamic programming, it can eat up ever-increasing amounts of memory as your memoized function is called with va...
Thursday, October 06, 2005

mw2html -- Export Mediawiki to static, traditional website

›
mw2html is a Python program which exports a Mediawiki site to a traditional-looking HTML site. No indices are generated, and Wikipedia sid...
221 comments:
Tuesday, October 04, 2005

List of bits in Python

›
A memory compacted list of bits (uses 1 byte per every 8 elements). Instantiate from a list or string of bits. Otherwise behaves just like...
12 comments:
Sunday, October 02, 2005

Why books suck

›
An essay. Click comments for the text.
2 comments:

Timing a function (pytime)

›
Python's timing facilities are...unPythonic. Module timeit requires you to specify the number of iterations for the timing loop. But ...
1 comment:

Python htmldata module

›
Extract and modify URLs in an HTML/XHTML/CSS document. Translate HTML/XHTML documents to and from list data structures. Use cases: robots,...
12 comments:

List mixin for Python

›
You can use UserDict.DictMixin to create custom dictionary classes. Now you can use listmixin.ListMixin to create custom list classes. (...
10 comments:

Infinity in Python

›
Negative infinity: >>> None True Positive infinity: >>> () > 1e308 True
21 comments:

Modified Dijkstra's algorithm in Python

›
Algorithm: perform a breadth-first search, always expand the vertex with the smallest cost, and don't remove duplicate vertices in the c...
15 comments:

AI algorithms in Python

›
Uninformed search algorithms: breadth-first, depth-first, depth-limited, uniform cost, iterative deepening DFS, and bidirectional (in both t...
4 comments:
Tuesday, November 30, 2004

Literary warfare against the end of history

›
The author dpa has some thoughts on the end of literacy . I posted a lengthy response to his writing. See dpa's blog, or my mirrored ...
2 comments:
Thursday, November 25, 2004

Political commentary

›
I posted some commentary on 3rd political parties in the United States to 1 . Or see my mirrored copy .
1 comment:
Home
View web version

About Me

My photo
Connelly Barnes
I am a computer scientist working in the area of computer graphics. For more information see my website.
View my complete profile
Powered by Blogger.