Aspergers is soo 2005

| May. 29, 2009

Avoidant Personality Disorder

“Individuals with AvPD are “lonely loners.” They would like to be involved in relationships but cannot tolerate the feelings they get around other people. They feel unacceptable, incapable of being loved, and unable to change. Because they retreat from others in anticipation of rejection, they lead socially impoverished lives. They have immature and unrealistic expectations of relationships; they believe that they can have no imperfections if they are to be accepted and loved. Interpersonally, they are ill at ease, awkward and tense. They experience unremitting self-consciousness, self-contempt and anger toward others.”

“Kantor (1992, pp. 36-41) notes that individuals with AvPD, as with all of the personality disorders, have a tendency to live in the past or in fantasy — they receive too little input from the here and now. This diminished ability to pay attention results in mild memory disturbances and a characteristic immaturity.”

“Shame is one of the central AvPD affective experiences. Shame and self-exposure are intimately connected — which leads to withdrawal from interpersonal connection to avoid experiencing shame (Sutherland & Frances, Gabbard & Atkinson, eds, 1996, p. 993). These individuals are anguished. They describe their emotions as a constant and confusing undercurrent of tension, sadness, and anger…they must attempt to avoid pain, to need nothing, to depend on no one, and to deny desire.”

“They engage in wishful thinking, e.g. one day the perfect relationship or job will come along; one day they will be confident and have many friends. The patterns of cognitive, emotional, and behavioral avoidance are reinforced by a reduction in sadness and become ingrained and automatic.”

Customizing an RSS feed using Drupal and Views

Blog | May. 27, 2009

Note: This has only been tested with Drupal 6.x.

For some boneheaded reason, the latest version of Views for Drupal doesn’t let you customize the fields output in an RSS feed. If you create a new feed view, under the Fields block, you’ll get a message saying “The style selected does not utilize fields.” Well la de da. This means you’re stuck displaying the default content, despite which fields CCK says it is displaying or hiding.

Of course. Why would you want to customize your fields, anyway?

So here’s how I was able to customize the RSS fields output by including the entire node in the RSS feed results. If you want a tutorial on how to first setup an RSS feed, there’s a tutorial on creating a custom rss feed in Drupal.

Now that you have your feed setup, you’ll see there’s nothing you can do with it. But there is a Views function you can overwrite in template.php to add more data to the output rows.

/**
 * Default theme function for all RSS rows.
 */
function phptemplate_preprocess_views_view_row_rss(&$vars) {
  $view     = &$vars['view'];
  $options  = &$vars['options'];
  $item     = &$vars['row'];
 
  // Use the [id] of the returned results to determine the nid in [results]
  $result	= &$vars['view']->result;
  $id		= &$vars['id'];
  $node		= node_load( $result[$id-1]->nid );
 
  $vars['title'] = check_plain($item->title);
  $vars['link'] = check_url($item->link);
  $vars['description'] = check_plain($item->description);
  //$vars['description'] = check_plain($node->teaser);
  $vars['node'] = $node;
  $vars['item_elements'] = empty($item->elements) ? '' : format_xml_elements($item->elements);
}

I need to get a real code parser. This is just embarrassing.

What I’ve done above is use the 'result' array and 'id' value returned in the &$vars variable to determine the node ID of the returned results. The ID is just the position the node appears in the list of results (1,2,3,etc.). It’s one higher than the keys to the objects in the ‘results’ array (0,1,2,etc.) so just tell the function to get the nid in the object at position ID minus 1, and now you have the nid of the result. I load the nid into the &$vars array to be sent to the Views template, which I’ll get to now.

Views already has support for templates, but my complaint with its templates — like my complaint with much of Drupal — is that it gives you a half-finished template. It doesn’t give you the perfectly-rendered, nicely polished HTML to want, and it doesn’t give you an array to customize how you see fit: it gives you something in the middle, usually consisting of an array of preformatted elements. So thanks for that. I hope you like all your content wrapped in <p> tags! Well, most of the time, anyway!

Ahem, where was I? Ah, the template. Views recommends using a template called views-view-row-rss.tpl.php (you’ll notice it corresponds to the function name above). This is the most generic RSS template, but you can use a more specific one if you don’t want to use the same formatting on all your RSS feeds. Now that you have the $node variable at your fingertips, you can put any of the node content in the feed. Here’s what I did with it.

< ?php
// $Id: views-view-row-rss.tpl.php 3296 2009-05-27 23:08:21Z timtoon $
/**
 * @file views-view-row-rss.tpl.php
 * Default view template to display a item in an RSS feed.
 *
 * @ingroup views_templates
 */
?>
  <item>
	<title>< ?php print $title; ?></title>
	<link />< ?php print $link; ?>
	<description>![CDATA[< ?php 
		$desc = $node->field_teaser[0]['value'] ? $node->field_teaser[0]['value'] : $node->body;
		print nl2br(check_plain(trim($desc)));
	?>]]</description>
	< ?php print $item_elements; ?>
</item>

Christ how can anyone read that. Fixed! Anyway, nothing too fancy here. I don’t like Drupal’s auto-truncating teaser field, so I’m using my own in a custom field called field_teaser. But if there is no field_teaser value, use the whole node body. I hope this isn’t too many unrelated things to make a clear example.

Now that I have my node’s teaser/body, I trim the content, use Drupal’s check_plain function to do the same thing as PHP’s strip_tags method, and convert the new lines to line breaks using nl2br.

So your RSS reader won’t try to parse those <br /> tags as XML, I enclosed the content in <![CDATA[ ... ]]>, so now you won’t lose any formatting that wasn’t just stripped out by check_plain.

At last, I have a custom-formatted RSS feed showing only the field I want. I can use this to put whatever node content I want into my RSS feed, and if you have been able to follow my rambling example, so can you!

There is another method here: Control Title link and “read more” in RSS Feed of views

Home Theater Alchemy

| May. 19, 2009

Now that I have my home theater setup (…er, mostly), it’s time for me to find the right set of speakers. There is so much jargon in home audio I can’t pretend to understand it. But I went to How to choose the right speakers for your amplifier or AV receiver and feel like I was able to divine some truths. I think.

The optimal settings for matching speakers to a home theater receiver are:

Match Ohms and wattage from the receiver to the speakers, erring on the side of extra wattage from the receiver and higher Ohms on the speakers.

Ohms: speakers >= receiver (lower Ohms are better)
Watts: receiver = speakers + up to 10% (more watts are better)
Sensitivity: 87-93dB (higher dBs are better)

Home Theater Roundup

Blog | May. 17, 2009

I went through half a dozen home theater receivers last year, trying to find one that would work connected to my Mac Mini media PC. Here are the results:

Read more »

The Dark Age of genre movies

| May. 13, 2009

What set me off was the post And the He-Man Movie Is Back to Being F@#$ed about some nobody writer, egged on by Warner Bros., fucking up the script to a potential Masters of the Universe movie.

Warners sees the big-screen version as a gritty fantasy and reimagines Adam as a soldier who sets off to find his destiny, happening upon the magical world of Eternia. There, Skeletor has raised a technological army and is bent on eradicating magic.

A technological army? Robots? Why? Well, robots are natural cannon fodder, I concluded. No one cares when they get blown-up, cut in half or crushed (just ask HELPeR, a Battle Droid, or the Terminator). Having disposable baddies lets you get action in your movie without having to worry about killing off any beloved characters and risking tying your hands when it comes time for a sequel. But wouldn’t an action movie where no one dies be better described as a motion movie? Transformers: The Movie killed off characters in spades, and it still remains one of the most memorable movies from my childhood. It never had a sequel.

True, the reason so many G1 Transformers were killed off was to make room for new toys, but I would rather have old characters killed off and new ones brought in than to let a franchise wallow in its own ossified nostalgia. Must He-Man, Transformers, or GI Joe (whoa… all movies) be the exact same things from our childhood? We grew up, why couldn’t they? (OK, maybe some of us didn’t grow up so well, so I guess maybe toy franchises are no different.)

But with this eye-rolling example of a writer who just doesn’t get it writing the He-Man movie, plus the huge shit Michael Bay has taken on the Transformers franchise, not to mention the sound and fury signifying nothing that was Wolverine, I feel like comic book movies are suffering through the same Dark Age that comic books went through in the ’90s.

It took some time to digest, but soon the better draftsmen in the field began to interject their art with realism and reverence. … Artists who draw in the cartoon style of the Eighties or the hyper-thyroid style of the Nineties are out of fashion — perhaps forever.

This excerpt is taken from Our Gods Wear Spandex, how Alex Ross’ Kingdom Come broke the mold that had stifled comic books in their garish pre-bagged, chromium-covered trappings throughout the Nineties. It was a time when talentless hacks churned out mediocre characters and horrible art. Sound like something playing at a theater near you?

Firefox doesn’t understand anchor tags

| May. 12, 2009

No matter that anchor tags are some twenty years old, the Obama of web browsers, Firefox, managed to screw them up. If you want to jump to an <a name=”anchor_name”> tag, You need to wrap the stupid anchor in a stupid div because stupid Firefox only jumps to the top of the enclosing div, even if it’s the length of the entire stupid page, and not to the anchor tag itself.

This is how it should be:

<a name="anchor_name">

This is how clumsy Firefox needs it:

<div style="clear:both"><a name="anchor_name"></div>

Media center suggestions?

Blog | May. 12, 2009

I want a network-accessible drive and a way to comfortably play back movies on my TV.

The more I think about it, I’d like to get a dedicated Mac Mini to hook up to the TV and have that be my media center, since it plays YouTube and Netflix and iTunes and also works as a PC to boot (no pun intended). It doesn’t play Blu-Ray, but I can always get a drive that does when they come out. Sorry PS3. It was down to you and the Xbox as a gaming machine, and since the Mac beats both of you at media playback, and I already begrudgingly have an Xbox, I don’t feel a strong desire to buy a PS3 to collect dust along with it.

An IT friend suggested building a PC with ~six(!) RAIDed drives rather than buy an NAS, which would be ideal, except you can’t put six drives into a Mini and I’m not going to have a big grey tower with fans constantly buzzing as a viable replacement. The drawback to the Mini is that it doesn’t have much storage on its own, so I’m back to my original NAS problem; but if I’m always going to have a PC running, I may as well just get a couple of Firewire 800 drives and connect them into the Mac Mini.

That’s the best idea I came up with. I wonder what other people have done?

Mike & Ben Show.com is no more

| May. 4, 2009

The domain www.mikeandbenshow.com expires today, taking with it the all the online memories of “The Mike & Ben Show” — a college TV show that I haven’t been a part of for eight years. But please take a moment to browse old episode synopses and snarky email exchanges, not to mention the prominent button on the front page linking to the NEW site… which itself no longer exists.

I assure you, you’ll be the first non-googlebot visitor to the site in years.

Kill your little darlings

| May. 2, 2009

As a member of the Mac cult, I’m not supposed to criticize our beloved leader Steve Jobs, but AppleInsider’s story on his plan to level historic landmark Jackling mansion just comes across as a callous and artless act, making him no different from an unsentimental developer who sees uselessly beautiful rolling hills and imagines rows of cookie-cutter McMansions in their stead.

So I wondered how Jobs would feel if he was asked to demolish one of his creations, something equally historic and rare; say, an Apple I. But I instantly knew he wouldn’t hesitate to resign his and Woz’s first creation to the trash heap. I imagine he’s a firm believer that in the creative process, you must be prepared to kill your little darlings. It’s that lack of sentimentality that allows artists to refine their ideas, rather than grow attached to their nascent ones.

But when it comes to Jackling mansion, Steve should limit himself to killing his own darlings.