It’s rare (never) that I blog about code, little alone blog anything. Today is not one of those days. I should have known it would be a special/different day when I woke up with ELO’s “Hold on tight to your dreams” stuck in my head.

One of my most recent project I have inherited is (regretfully) based half in phpCake, half in homerolled calls to mysql_query(). It makes for rather strange bedfellows.

This system partially utilized cake’s native Cache::Write/Cache::Read functions, but it only had primitive support, it was only compatible with cake’s engine type of ‘File’, which is rarely what you truly want.

I began implementing a single-host compatbile memcache which worked with PHPCake’s memcache daemon, but I really wanted it to be able to fail-through gracefully, rather than fall flat upon it’s face. I did some searching, and ran into SuperStack.

SuperStack is a simplistic attempt at doing precisely what I was looking for – with the added benefit of arbitrating cake’s own cache engines, so, he could get a list, call the functions, and be done with it – adding support for writing through to caches that are missing the data.

I took about 5 minutes (ok, about 2, it’s small) to read the code, and immediately made it part of the system, replacing the default Engine in cake. Now, I had both memcache, and a local file cache – just in case.

I wanted dumbCache to be able to support virtually every configuration available to cake, with minimal config differences. I wrote a wrapper to init() the Memcache servers given, rewrote the File support, and finally, added Redis. Then, I added basic error checking for testing upon init, and disabling them after the initial call, so no waste would take place on any subsequent read/writes after the init.

Here’s what the (ugly) config looks like:

$config = array(
        'Memcache' => array(
                'enabled' => TRUE,
                'host' => array(
                        "127.0.0.1:11211",
                        "127.0.0.1:11212",
                ),
        ),
        'Redis' => array(
                'enabled' => TRUE,
                'host' => array(
                        "127.0.0.1:6379",
                ),
        ),
        'File' => array(
                'enabled' => TRUE,
                'directory' => '../tmp/cache/',
        ),
);

As this is a simple write-through cache, it will attempt to populate all engines, and if it finds one missing a value, will attempt to write it, just to have it. Thanks, Richard, for the inspiration.

dumbCache weighs in at an amazing 7.2k, and has the following functions (to be compatible with the existing software):

cacheInit(), cacheRead(), cacheWrite(), and cacheDelete().

It prefers owlient’s phpredis (as that supports setTimeout so you can automatically expire data as with Memcache and the File subsystem), and was written for Memcache as is distributed via pecl.

[Update: Dec 15th, 2010:]

adam@adam.gs gets props for answering 20 questions related to his caching methods, none of which were actually applicable, or useful.

For some reason or other, about a year ago I was offered to provide feedback to Sirius/XM on their radio stations.

I’ve been annoyed since we lost ‘The System’. It was the reason I subscribed. Yeah, ‘that one’. I’ve since asked them to offer more variety on BPM, and Area could expand a bit.

I just saw this after hearing similar on the station:

SIRIUS|XM’s Area is re-launching as Electric Area and expanding its exclusive dance music content with A State of Sundays, a new show featuring 24 hours of music hosted and curated by DJ Armin van Buuren. The show premieres Sunday, September 12 with an exclusive six-hour set by van Buuren recorded live in Ibiza, Spain. “

Let’s hope they get this one right. “Bagatelle Brunch” is almost worth the time that it takes to turn it off.

[Edit: Update 09/13/2010: For every rainbow, you need to endure the rain. My favorite local radio station just changed their format to “New Country. Ugh.]

[Edit 2: Update 03/31/2011: 1400 KBDB-AM/Reno, Nevada, changed to Smooth Jazz late December – but AM Stereo will never exist; and with all of my electronic equipment, there’s no chance of ever listening to it when doing household chores and not wanting to stream. Oh well.]

After struggling working for the last two weeks on my new iPhone, I’ve decided that I absolutely hate it for it’s marketed primary purpose (which at one point, I believe, was placing and receiving calls).

For listening to music? Hey, it can do that, and it does that quite well, although the battery suffers about double that as it does in standby (god forbid it goes a day without being recharged, it’s almost guaranteed death – even without any applets in the background).
For browsing YouTube, it’s great, if not a little cumbersome.
For browsing the web? It’s a little hinky, but workable.
Placing phone calls? Forget it.

Unless you’re sitting in a stationary place where you can dedicate at least 80% of your attention span to the phone, and have absolutely no ambient noise, you might as well just be shouting into your wallet. The reception is nearly as good, as well as the user experience. If you truly want the iPhone experience, though, you’ll turn the wallet upside down and let the cash fall where it might. Don’t forget to wipe (front to back).

So, here are my top ten four uses for the iPhone, since it sucks at telephony:

  1. Playing Solitare City while on the toilet.
  2. Watching YouTube clips while on the toilet.
  3. Twatting (twittering) or updating your blog on the toilet.
  4. Browsing the web on the toilet.
  5. Listening to your music collection while at a public toilet as a distraction from your bizarre noises.

I’m sure there are six five other toilet-related activities, but I don’t think I need Trapster on the toilet.

Yeah… I know.

Trust me, I know.

I don’t update this site too much. I am well aware of that; it’s been over eight months. The truth is: Blogs are for people who have something worthwhile to share – or people who think they do. I have no such pretentions. Heck, if I didn’t have to listen to myself, I probably wouldn’t.

As I have ceased all open source software support, and prefer that my relatives (who want me to sign up for Facebook, currently) call me on the phone – this site has become widely disused. I have relatively little use for either Facebook, or at this point in my life, a blog.

Anyhow, I did a dist-upgrade on OpenSUSE from 11.2 to 11.3. It almost worked. Almost. Wireless crapped out before it rebuilt the drivers, and couldn’t insmod what was no longer there. It ended up becoming a mess of loading from the 11.2 CD (keyboard and mouse were broken in X11; minimal command line was basically impossible as I needed to backup to a USB HD, and most libraries were half-installed. I ended up archiving /home, and starting over.

..and it still doesn’t work right. NetworkManager craps itself if you try to sleep – and does not always come back with solid-network hacks. The OpenSUSE ndiswrapper of Adobe Flash 32 bit on 64 is worse than Adobe’s final (and now missing) Linux 64bit release. Otherwise, it’s much the same with slightly newer stuff.

To add to the prior post:

The 2000 is doing well, having rolled over to 172k miles recently, with an average of 30.0 MPG (Damn that hill).

I’ve also picked up a new-to-me toy:

It’s nearly a decade old, but the price was right, and it’s absolutely a thrill to drive. The resale value is well worth what I paid for it, but I don’t think I’ll be getting rid of it any time soon. It has a few very minor things (it’s a convertible, so it’s gonna be a little more creaky and squeaky, but it’s still no 9-5). It’s prior owner made me promise to take care of it, and I could tell she was having second thoughts. SAAB owners are a quirky bunch.