-
Recent Posts
Recent Comments
- ubershmekel on Two bugs don’t make a right
- Ram Rachum on Optimizing Django ORM / Postgres queries using left join
- Dimensions in Mathematics on Beautiful Code
- Tomer Filiba on Collision: the story of the random bug
- Brendan Dolan-Gavitt on Collision: the story of the random bug
Archives
- August 2012
- July 2012
- June 2012
- June 2011
- February 2011
- January 2011
- December 2010
- April 2010
- March 2010
- February 2010
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- February 2007
Categories
- Algorithms
- Assembly
- C
- Challenges
- Compilation
- computer science
- Cryptography
- CSS
- Databases
- decompilation
- Design
- Fractals
- Game Development
- Geometry
- gotchas
- Graphics
- Group Theory
- Humour
- Javascript
- Linux
- Math
- Miscellaneous
- Optimization
- Optimization
- Optimization
- Optimization
- Origami
- Personal
- Programming
- Programming Philosophy
- Projects
- Protocols
- Python
- rants
- Research
- Security
- Sound
- startup
- Statistics
- Teaching Programming
- Testing
- Uncategorized
- Utility Functions
- web-design
Category Archives: Algorithms
Fast Peak Autocorrelation
So, I was at geekcon. It was a blast. There were many interesting projects, and I didn’t get to play with them all. I did get to work a bit on the Lunar Lander from last year, and this year … Continue reading
Posted in Algorithms, Math, Programming, Projects, Python, Utility Functions
Tagged autocorellation, automatic guitar improviser, geekcon, Math, pyimprov, signal processing
Leave a comment
Computing Large Determinants in Python
Story: For my seminar work, I had to calculate the determinant of a large integer matrix. In this case, large meant n>=500. You might say that this isn’t very large and I would agree. However, it is large enough to … Continue reading
Posted in Algorithms, computer science, Math, Programming, Python, Research
Tagged Float, Fractions, Matrix Determinants, Numerical Analysis, Programming, Python
2 Comments
Fractal Memory Usage and a Big Number
In a previous post I said I’d talk about 4**(4**(4**4)). First, about the number. I first saw it mentioned in a math lesson back in high-school, when the teacher wanted to demonstrate estimation abilities. He wrote it on the board, … Continue reading
Posted in Algorithms, computer science, Fractals, Math, Programming, Python
Tagged exponentiation, memory usage, Programming, Python
1 Comment
First Code Transformation: Removing Flag Computations
Short introduction to code transformations If you intend to write a decompiler, you’ll find yourself writing code transformations. In our context, code transformations are operations that take as input an expression tree, and return an equivalent but different expression tree. … Continue reading
Posted in Algorithms, Assembly, decompilation, Programming
Tagged code transformations, decompilation, Disassembly, Distorm, removing flag computations, vial, VM
1 Comment
Issues in Writing a VM – Part 2
Writing a VM capable of executing expression trees is different from writing a VM for executing assembly instructions. Here I’ll cover several issues stemming from this difference. The first group of issues involve generality. Supporting a specific instruction set is … Continue reading
Posted in Algorithms, Assembly, computer science, Programming, Projects, Python
Tagged delay slot, Disassembly, Distorm, Python generators, vial, VM
7 Comments
Two Mathematical Bugs
A few days ago, I discovered I had at least one, maybe two mathematical bugs. The first bug is in the line clipping algorithm. Here’s a quick reminder of what’s going on there: There are six points of interest: the … Continue reading
Posted in Algorithms, Geometry, Math, Programming, Python
Tagged Bugs, Line-Clipping, Programming, Python, random selection
2 Comments
Rhyme and Reason with Python
After reading xkcd’s blog, I went to LimerickDB.com. It looks and works just like bash.org, but for limericks. Quite amused with some of the limericks available, I wanted to try and compose my own. The first one came out fine, … Continue reading
Posted in Algorithms, Humour, Programming, Python
Tagged Algorithm, Natural Language Processing, NLTK, Python, rhymes, xkcd
Leave a comment
Small Python Challenge No. 2 – LRU Cache
Caching is easy. Consider the cache I used to optimize the recursive spring: class _NotInDict(object): pass _NotInDict = _NotInDict() def cached(func): cache = {} def wrapper_func(*args): prev_result = cache.get(args, _NotInDict) if prev_result is _NotInDict: result = func(*args) cache[args] = result … Continue reading
Posted in Algorithms, Challenges, computer science, Programming, Python, Utility Functions
Tagged challenge, LRU-cache, Python
2 Comments
Optimizing the recursive spring
Remember the recursive spring? Well, when I worked on it, it was quite slow. I mean very slow. Especially at the higher levels. The original reason was the recursion. Consider this – to ‘springify’ a track, you had to sample … Continue reading
Posted in Algorithms, Fractals, Programming, Python
Tagged Decorator pattern, Python
Leave a comment
Elegant Line Clipping Algorithm
I actually wrote about that a long time ago, in the wiki that once was algorithm.co.il. Since the wiki is long gone, and I figured this is a very elegant algorithm, I decided I should write about it. First, some … Continue reading
Posted in Algorithms, Geometry, Graphics, Math, Programming, Python
Tagged Algorithm, Graphics, Line-Clipping, Python
Leave a comment