Category Archives: python programming

cmph Comparitive Graphs

I just enhanced cmph-bench/cmph-graph.py to allow graphing a single attribute across multiple minimal perfect hashing algorithms. The updated code is available in GitHub. For example, the following command generates a CSV of lookup times for four algorithms: ./cmph-graph.py -t chd … Continue reading

Posted in c programming, python programming | Tagged , , , | Leave a comment

CMPH Benchmark Bar Chart

I added a little more code to the cmph-bench project in GitHub. It’s described in the previous post, cmph-bench – A Benchmark for Minimal Perfect Hashing in C. The bench mark program now randomizes the order of the keys before … Continue reading

Posted in c programming, python programming | Tagged , , | Leave a comment

An Extension for Python re: regex

One thing I dislike about python is how painful it is to use regular expressions that capture matching groups of characters. For example, if I want to find words in quotes, I would write: quotedWordPattern = re.compile(r'”([^”]+)”(.*)’) match = quotedWordPattern(text) … Continue reading

Posted in python programming | Tagged , , , , , | Leave a comment