Have You Seen This Cache?
Code: C, cache, memcached, Python, referential transparency, Ruby
It looks like syntax highlighting, image thumbnails, and compiling object files.
Let me explain.
Sometimes Python’s roots in academia bug me. Lots of functions have a computer science feel instead of a software development feel. Here’s an example I just ran into: I wanted to fit as many sentences as possible from a long text into 255 characters. So I wrote:
ChiPy at Google
Code: BigTable, Chicago, ChiPy, Google Code, project hosting, Python, Selenium, Subversion
I had a great time last night at the ChiPy meeting last night that was held at Google’s Chicago office. I suspect a lot of people turned up just to see the venue: usually ChiPy gets 15-20 people but we got 51 last night.
I love shoving around large amounts of data. Unicode is an industry standard for encoding data in most every written script there’s ever been. It has over 97,000 characters. A while ago I read about a guy who made his own Unicode poster and I realized I had an opportunity for a fun project. I think Unicode is an invaluable and beautiful project, and this is my tribute to it.
Last night at the June 2006 ChiPy meeting I gave a presentation on how I wrote a few small Python scripts to take apart the Unicode PDF of all its glyphs and recombine them into giant ascii-art-like posters.
Question: Isn’t a domain-specific language just the same thing as a library?
Source: Pretty much everyone the first time they hear of DSLs.
Answer: No, a DSL is much more than a library, and I have an example that won’t make you say, “Well, sure, if you’re doing something that esoteric…”
Finally, several years after learning lambda expressions, I got a chance to use one at work a few days ago. As long as I’m putting a notch in my nerd belt, I’d like to write about what lambda is and how it can be useful.
When I wrote Equality for Python, my example didn’t mention how the Card objects could actually be a terrific waste of memory. A commenter named versimilidude (great handle!) beat me to this post, briefly describing the Flyweight Pattern. Luckily he didn’t provide example code, so I still get to publish this post.