Well, I guess XP will be ok for another 5 years…
I have long since ditched MySQL 4, and about a year ago I stopped installing the plain MySQL libraries with PHP. (Mostly, they are a pain to install when you are custom building MySQL 5 and PHP 5 on 64 bit architecture, but I digress…)
However, not having access to the plain
mysql_* functions makes Wordpress very sad. In WP2.3 there was a work around that was pretty painful, involving some core editing. However, between then and WP2.5, the meek sobbing of folk like myself have been heard!
Simply download this updated db.php and place it in at
You’re done. No really. That’s it! From what I can tell this should even work for fresh installs, not just current installs. If you find anything broken with it, let me know and I’ll give it an update.
Update! I’ve updated to work with Wordpress 2.8.4. You can get the new db.php file here: http://jrm.cc/extras/wp-mysqli-2.8-db.txt
I was doing my regularly schedule Vanity Search and this came up:
Made. My. Day. :D :D :D
Kim was browsing the Banana Republic site looking at buttons on jackets ( her’s keep falling out :( ) and she showed me this neat rollover zoom image feature:
This is a very neat effect — simple, useful, intuitive, and easy to degrade (click would enlarge). Love it! I plan on keeping this little gem in my back pocket. :)
I took a few hours today to review some of my old code and update it. The Color Palette Generator is an old project of mine — probably 3 years old now — which takes images and, as it says on the tin, creates a color palette from it.
The algorithm introduced originally was fairly simple:
In this method, you would choose a “grid” (in the above, 3×3). The image would have 9 lines drawn through it and where those lines meet, the color of the underlying pixel would be used as the “palette”. While this wasn’t “wrong”, it wasn’t perfect. Many times the pixel under it would not be incorrect, per se, but it wasn’t very accurate.
Since writing the code, a few other methods have surfaced, one of my favorite, however, is the resize-and-sample. This process is very straight forward, and tends to deliver reliable results despite appearing to “wash out” some of the more vibrant portions of the image.
In this method, the image is resized down to the grid size (so, 3px by 3px) and the resizing causes a “blurring” of the image and all the colors get averaged down to 9 total pixels. These remaining pixels are now the average colors of the image.
Both methods are valid, and sometimes one is better than the other, however now they are both available. Pick a favorite and enjoy :)
Additionally, the updated source code is now freely available for download. Please note! I will not provide support for this code.
Me and Kim went to visit the Tekniska Museet (National Technical Museum) which happens to be a short walk from our apartment. (Like, really short — just across a huge park down the street).
Anyway, some photos!
Kim in the park
I head the top of this tower is a restaurant
The place had a really cool light up “Where is something” navigation piece
Another label, this time on a turbine
A Steam Engine Plate
Driver in the back, two passengers in the front
I got a new plant — cats got new plant. :|
Lucy goes for the kill
Lucy nom noms …
… and naps
Sam sat it out till later, when he found a way to SIT in the plant :(