This weekend was Father’s Day, which meant carting around town visiting family.

Saturday night we hung out at my parents’ condo and visited with them, my sisters, mom’s sisters, and mom’s dad. Not sure where my dad’s parents were.

Granddad got going on telling a story and had us rolling. Apparently his dog likes to sleep under the footrest of his recliner while Granddad watches TV. One time there was a power failure and Granddad got up to get a lantern so he could see, but when he came back, he couldn’t find his dog. He looked all over the house and came to the conclusion that, in his words, “The devil done shut off my lights and stole my dog!” (How hilarious is that? The best writers in Hollywood would never come up with “the devil done shut off my lights and stole my dog.” Too funny.) Turns out when he stood up, he pushed the dog under the recliner with the footrest and trapped the dog under the chair. Heh.

Sunday afternoon we had lunch with Jenn’s family at Marie Callender’s. Pretty tasty, and we all ended up with leftovers.

All in all, a good weekend hanging out with the family. Not particularly restful, but a good weekend nonetheless.

Went to Home Depot to check out paint colors for the bathrooms. Our entire house is the same color of white inside - trim, doors, walls, etc. - so we need a little color. Found some great stuff and will have to get on that as soon as we get money.

Spent a little at Bed, Bath, and Beyond, too, picking up some new bathroom rugs to replace the ones the cats have torn up and have seen better days. Plus, we had to get something that goes with the shower curtain we bought last weekend.

In other news, I think I have a little athlete’s foot - minor, but annoying - on my right foot. Not sure how I got it since I don’t go tromping around in public showers or really ever go around barefoot, but it’s there and it’s created a weird sort of dry spot that occasionally itches. At least, I think it’s athlete’s foot. I dunno. The point is, it’s resistant to the over-the-counter Lotrimin I’ve been using, so I figured I should go see a dermatologist to make sure I’m even dealing with it correctly. Made the appointment this morning for three weeks from now. That’s the soonest they could get me in! Seems dermatology’s in high demand around here. I’d say I should have been a dermatologist, but I’m sure you see some pretty disgusting shit in that line of work. I have issues picking up cat puke; no way am I dealing with skin diseases.

If you work with SharePoint Portal Server 2003, you’ve probably messed around a bit with creating web parts or maybe automating some of the routine administration tasks, but have you tried accessing the search web service?

There are articles out there telling how to integrate the search web service with the Office 2003 Research Pane, there’s documentation on the schemas for querying the search service, but if you look at the SDK documentation, there’s really no example for what the query itself should look like. I mean, I can figure out how SQL Server full-text queries work, but what’s the source I’m querying? When you put everything together, what are you really sending to the web service, and, more importantly, what’s coming back?

To answer this, you could use something like SOAPscope and start watching packets that way, but you’re still going to be putting things together in a sort of trial-and-error fashion, hoping your packet is formed right, etc.

Instead, I created a little app specifically for this: Give it the URL of your server’s search web service, enter your search terms (the keywords for a “keyword” search; the SQL full-text query SELECT statement for a “SQL Fulltext” search) and click “Execute Query” - the program goes out to your search service, registers to search, gets the list of available catalogs and search scopes, and executes your query. You can see the form the query packet takes and the results you received from that query. You also have the option of changing search settings to different limits - start at a particular record number in the results, retrieve a certain number of results, only retrieve certain types of results, etc.

SPS Search Test - Displaying the query

Note: While this is a very helpful tool to test out queries and see if they work, I still don’t have any real documentation about the form of full-text queries for SPS. I’m working on getting some information from Microsoft on this, to find out which fields I can query for/against and how to determine that for different servers, as well as figuring out what different errors mean. When I have more, I’ll update this entry. (The only queries I’ve gotten to work are variations on SELECT "DAV:href" FROM Non_Portal_Content..SCOPE() WHERE size > 0 so… I’ll keep you posted. It doesn’t seem to work like the SPS 2001 queries did, though.)

UPDATE: 6/18/04 11:00 AM - It turns out they embed the entire SQL query that gets run on the Advanced Search page right in the source.

Also, I’ll be updating the app as I learn more about the search functionality so I can offer more flexibility in the querying.

Download SPSSearchTest 1.1.0 (MSI)

Download SPSSearchTest Source 1.1.0 (ZIP)

Version History 1.1.0:

  • Added syntax highlighting for SQL queries using the ICSharpCode.TextEditor control.
  • Moved view and query options into menus.
  • Now showing the Registration Request packet. 1.0.1 - First public release. 1.0.0 - Internal/unreleased version (still needed more functionality for prime time).

media, movies comments edit

Jenn and I watched Punch-Drunk Love via On-Demand last night.

Boy, am I glad I didn’t pay for that one.

Adam Sandler plays this guy Barry who is sort of antisocial… but sort of not. Really, I couldn’t tell what was wrong with him. He had these random fits of rage, sometimes he was well adjusted and sometimes not… I dunno. Anyway, Barry calls this phone sex line and winds up being the victim of this ridiculous extortion scam. While he’s dealing with that, he meets this girl named Lena (played by Emily Watson) with whom he falls in love.

Sounds okay, right? Except for the fact that there are these weird non-sequiturs throughout the whole thing. For example, at the beginning Barry’s standing outside his business, drinking coffee, watching traffic. Out of nowhere, this SUV flips over onto its roof and slides down the street at the same time this taxi cab/van drives up and drops off a harmonium on the sidewalk.

Normally I’d be cool with this - an obvious, but potentially flawed metaphor for love: bang! something hits you and you end up with a little harmony. The thing is, this is actually happening in the movie; it’s not something in Barry’s mind. And he ignores it! All of these things happen, and we’re supposed to accept there’s basically no big deal.

Not only that, but there are these weird interstitials strewn throughout the movie with odd colors and lights on the screen and music playing… I have no idea what that was all about.

“No, it’s surrealism!” I hear you screaming. Maybe it’s me. It wasn’t consistently surreal, so I can’t give ‘em credit for the one-off attempt. I have to chalk it up as straight weirdness.

Maybe I just didn’t get it. Maybe I’m too “thick” for this kind of movie. I’d like to think it’s more because the movie missed its mark, but this is the avant-garde crap that critics seem to faun over. I can’t tell you how many reviews I’ve seen where the end is something like “this is the film to see!” or “a fresh breath from the norm!” Ugh. I’m all about art in films, but when the one overshadows the other, you lose me.

Pass on this one. Or see it when you’re smoking crack, because then the flashing lights and colors with the music might seem cool. It wasn’t for me, though.

sharepoint comments edit

It has come to my attention that at this time there are no real documents out there (at all - even internal to Microsoft) that discuss the ins and outs of querying SPS 2003 via the search web service and fulltext search queries. Nobody seems to have the magic answer as to how to formulate the query - what you can SELECT, what goes in the WHERE clause, etc.

I don’t have the answer, but I know how you can get a jumpstart on figuring out how it works.

On the SharePoint Portal Server 2003 “advanced search” page (the one that allows you to search over document metadata), do a search. Once you get the results you want, do a “View Source.” Scroll down near the bottom (or search for “SELECT” - match the upper case letters, too) and check this out: They embed the entire SQL full-text query right in the page.

Apparently that’s how the MS guys figure out how the thing works; if it works for them, it should work for you, too. Good luck!

gists, php, blog comments edit

I had a problem where I wanted to add a pMCode tag in pMachine to allow me to automatically link to other pages on my site. For example, normally you can use [url=]linktext[/url] to create links to other sites… but what if you want to link to pages in your own site? Adding hard references like that makes the site sort of inflexible if you change your URL or move to a different server (which is the problem I had). Wouldn’t it be nice if you could link to, say, your comments page by doing something like this: [commentlink=123]linktext[/commentlink]

So that’s what I drummed up. It seems to work for my site, which only hosts one blog, but it should work for multi-blog sites, too. To enable this change, you’ll need to edit your /pm/lib/pmcode.fns.php file.

At the top of the pmcode_decode function, add the following:

global $weblog;

Now add the following lines as shown, around line 305 in the file, with the rest of the substitutions:

// [commentlink=123]sometext[/commentlink]
$str = preg_replace("/\[commentlink=(.*?)\](.*?)\[\/commentlink\]/i", "<a href=\"" . get_comments_link('\\1', $weblog) . "\">\\2</a>", $str);

Then copy and paste the following function in that same file, somewhere toward the bottom:

function get_comments_link($postid, $weblog = ""){
 global $db_multiweblogs, $db_categories, $db_weblog;
 global $db_members, $db_upload_prefs, $db_nonmembers, $pingserver_path;
 global $db_comments, $profileviewpage, $auto_xhtml, $url_rewriting, $sfx;

 if ($weblog == "") $weblog = "weblog";

 $db = new DB();
 $blogid_array = array();
 $sql = "select id,weblog from $db_multiweblogs order by id";
 $query = new DB_query($db, $sql);

 while ($query->db_fetch_object())
  $blogid_array[$query->obj->weblog] = $query->obj->id;


 $catpage = (isset($blogid_array[$blog]))  ? $blogid_array[$blog] : "1";
 $pagespath = get_pref("pages_path_abs_$weblog","1");
 $comments_page = get_pref("comments_page_$weblog");

 $delim = '?id=';

 if ($url_rewriting == 1)
  $delim = '/';
  $comments_page = str_replace($sfx, '', $comments_page);

 $catrow     = 0;

 $comments_url = "$pagespath{$comments_page}$delim$prefix{$postid}_0_{$catpage}_{$catrow}_C";

 if ($url_rewriting == 1) $comments_url .= '/';

 return $comments_url;

That should do it. Now you can use the new “commentlink” pMCode tag. Just pass in the ID to the entry you want to link to, like this: [commentlink=123]linktext[/commentlink]

Good luck!