Image “encryption”

Can images be encrypted? Well, of course — what kind of question is that? Any file –any bitstream— can be encrypted. But encrypting a file (image or otherwise) turns it into random-looking garbage. Therefore, in a sense, an encrypted image file would cease to be an image file at all (e.g. you wouldn’t be able…

Continue reading →

Beware table locking!

MySQL users have a few different storage engines to choose from for each of their tables, the most popular/well-known being MyISAM and InnoDB. Each has its own pros and cons, but there are several features that make InnoDB the best choice for most cases. One of these is row level locking, as opposed to MyISAM’s…

Continue reading →

A promising new PRNG (Pseudo Random Number Generator)

I’m no expert in the subject of PRNGs, but I find it quite interesting. Developers usually don’t give much thought to this and just use whatever rand(), random(), Math.random() function is available in their language of choice. And that’s fine for most purposes, but there are situations where (pseudo) randomness matters, and different algorithms may…

Continue reading →

Memcached extensions for PHP: some caveats

There are two PHP extensions to work with Memcached, which go by the somewhat unfortunate names of Memcache and Memcached (note the missing ending ‘d’ in the first one). In this post I’m going to share my experience of using them together, either to migrate from one to the other or use them simultaneously, and…

Continue reading →

Memcached and careless preloading

This is a short story about how I became aware of the dangers of “careless preloading”, while learning a bit about memcached internals along the way. A few years ago, while working on a high traffic app on the Facebook platform, I ran across a caching bug. All of a sudden, our memcached servers had…

Continue reading →