Monthly Archives: January 2009

Vista Networking Fix

I’ve been fighting with my new laptop for a couple weeks, trying to get the wireless networking to perform at anything resembling a reasonable speed. Wired networking has been fine the entire time. I’ve applied every fix I could think of, and that I could find on Google.

Today, while reading my livejournal friends page, I stumbled across mention that the Winsock still exists in Vista. I had assumed it was a thing of the past. So I immediately googled for instructions on resetting it in Vista, and found these instructions. I followed them, and rebooted, and lo and behold, my wireless network is performing at a reasonable speed, for the first time!

Thanks a lot, My Digital Life, for the instructions.

CakePHP: Paginate with Deep Associations

Got some CakePHP models with deep associations that you need to pull into the data that you display when you paginate them? This used to be a royal pain in the butt, and pretty much required custom pagination, but no more!

Behold:

$this->paginate = array(
    'Customer' => array(
        'contain' => array(
            'Order(id)',
            'Order.AccessCode(id)',
            'ShippingAddress(city,state)'
        )
    )
);
$this->set('customers', $this->paginate('Customer'));

All you need to do for this to work? Make sure you have your associations defined, and add the Containable behavior to each of the models in question. It works flawlessly, and can go as deep as you need, and retrieve just the fields you need. I haven’t tested sorting on deep relationships yet, but I don’t think that works, because of the way Cake does its queries. But still, this is better than nothing.

CakePHP Requests Blocking

I just finished tracking down a bug that I’ve been working on for nearly two days, and it turns out to have been something VERY simple.

The basic problem was that while a long running CakePHP request was running, the rest of the Cake app was non-responsive. This is because of a ‘feature’ of PHP. A given session can only be accessed by one apache thread at a time. Since CakePHP auto-starts sessions by default, my long running process was blocking all other requests to the UI, causing them to simply hang until the long process was complete. I solved it by turning off session autostart, and only activating sessions where I need them.

The critical clue came from this post: http://www.nabble.com/Cake-Stalling-(or-blocking)-td20769012.html

So, if you experience something similar, make sure to check your sessions.

Review: The World Turned Upside Down

This anthology consists of science fiction (and a few fantasy) short stories, that the editors read when they were young, that they felt left a strong impression on them. They stories selected are chosen more for the authors that wrote them in many cases, than for the specific story itself. But this is not necessarily a bad thing. As the editors state in their comments on several of the stories, the best known stories by the authors in question have been in so many anthologies that they really don’t need to be added to yet another one.

Read more »

Review: Death By Cliche (Podcast Novel)

I’ve been listening to Death By Cliche for a few weeks now, and greatly enjoying it. It’s a fun podcast novel by Bob Defendi, and you can listen to it yourself at PlayTesting.net for free.

Overall, it is a very amusing and engaging story, especially if you have ever played D&D, but is accessible enough that you should understand most of the humor even if you haven’t. A few scenes have literally had me laughing out loud, and many of them make me chuckle.

Read more »