God’s Word | our words
meaning, communication, & technology
following Jesus, the Word made flesh
February 8th, 2007

Vista and File Search for XML

I don’t intend to make a career out of grumbling about Vista, i just keep bumping my head. Today it was the search box. To their credit, Microsoft has attempted to make search ubiquitous (or cut off Google Desktop at the knees) by putting this feature right in Windows Explorer, and when it works (like in the Start Menu), it’s great. But here’s a place it doesn’t work, at least not as you’d expect.

At work, we have lots of XML data. So in a directory with 2000 XML files, i wanted to find the few files with some common content. But it appears that Vista only indexes the character data, not the XML markup, in the files. That means you can’t search on elements, attribute names, or even attribute values like priority="critical": even if you search in file contents for “critical”, Vista won’t find it. If you manually change the file type to something like txt, now that content becomes searchable (but of course i’m not about to do that for 2000 files). So Vista gets points for trying to be smart, but it’s not smart enough. Ironically, better support for XML (at least as an application format) is supposed to be one of the improvements of Vista.
I can already hear people telling me it’s a feature …

February 3rd, 2007

More about Vista and File Virtualization

There’s quite a bit of additional discussion on my Windows Vista post on this programming reddit thread. A sampling of opinions:

  • there are virtues to this feature (i can appreciate this): some would temper it with a warning or other notification (given how regularly Vista nags me about innocuous things like creating folders, it’s puzzling that creating a virtual file doesn’t merit a peep)
  • it’s bizarre to want to edit things in Program Files (in a perfect world, perhaps, but the reality is, developers sometimes need to change things)
  • Scott Hanselman has a post on the virtualization feature with a lot less whining :-) and a lot more technical detail that you may find helpful

One commenter pointed out that McAfee’s SiteAdvisor, which is supposed to warn you about bad sites, thinks SemanticBible is one of them! The basis for that assessment is a link i have somewhere to daml.org, a repository of OWL ontologies and data, which was originally set up as part of the government funded DAML research program by my former employer, BBN Technologies (DAML is the one of the progenitors of OWL, the semantic web language). SiteAdvisor’s claim is that daml.org was “found to be a distributor of downloads some people consider adware, spyware or other unwanted programs.” If you go to their assessment of daml.org, that’s based on a couple of downloadable zip files that are apparently infected with viruses. Given that the DAML site exists to share resources, i guess some of this is inevitable. Not that this excuses the problem: I remember pointing this out to one of the daml.org guys in the past, but apparently they haven’t fixed the problem (and SiteAdvisor doesn’t make it too easy). Anyway, i’m in the process of trying to get my black mark with McAfee removed, but let me assure you that SemanticBible does not knowingly distribute or encourage the distribution of malware.

February 2nd, 2007

Windows Vista: a Cautionary Tale

Since i’m the New Guy at work, along with my new box, i’ve had Windows Vista for several weeks now, ahead of all the eager crowds. So far, with the exception of a few nice features like searching from the start menu, i haven’t been too impressed.
My latest adventure started innocently enough, adding a little content to a file with my favorite XML editor so i could see how it got rendered in our app. Curiously, when i looked at the files in the folder, it didn’t look like the time stamp had changed. I figured i’d just modified the wrong one of several different versions, so i retraced my steps: nope, that was the right file. This is weird, i thought, so i re-opened the file from the folder, and all my content was there. I saved it again … no changes to the directory listing.

I fiddled with a few file and folder permissions (initially it had been read-only), but couldn’t get the directory listing to tell me the truth. Puzzled, i tried opening the file with Notepad, and fell headlong into some kind of parallel universe: the changed content was gone, and the file had reverted to its original content. What?!? I went back and opened it again with the original editor: my changes were there, just as i made them. I opened it with Notepad, then Wordpad: my changes were gone.

I’m chagrined to admit that i did this for at least 20 minutes, trying to prove to myself that i wasn’t seeing what i was seeing, and was just making some dumb mistake: what more basic service can an OS provide than showing the attributes of files and delivering their content to applications? I went to our sys admin and said “i think i’m losing my mind: do you want to watch?”. He did, and we tried several more tests. Looking at the file properties, it had a modification time of yesterday, but a creation time of … 10 minutes ago?!? Copying the file (which lived in Program Files with its application) to the desktop made it normal: every editor then told the truth. We opened the file with half a dozen different editors, which lined up neatly into two camps: MS apps (Notepad, Wordpad, MSWord, Visual Studio, even the DOS type command) that lied about the content, and every other editor that told the truth and showed me my changes. We pulled another colleague in to watch the spectacle.

At this point my readers are probably in two camps: some are utterly flummoxed (like i was), and others are chuckling at my naivete or knowingly tsk-tsk’ing, wondering how i could have missed hearing about this wonderful new thing in Vista. It took another half an hour and one of our savvy developers to explain that this was a feature, not a bug. You’re not supposed to edit things in Program Files, and Vista helps you with that by hiding such edits in a parallel universe called Compatability Files. He showed me the button Compatibility Files button from Windows Vista that had unobtrusively appeared on the window to alert me to the fact that i’d entered this weird place. Vista-aware apps were playing by the new rules, and non-aware ones (all the normal ones that i actually use every day) were blissfully opening the one i wasn’t supposed to have created in the first place. And by using a cool new Vista feature called symlinks (old Unix hands, it’s your turn to chuckle now), you just create a link to a folder outside Program Files, and then things behave like they’re supposed to.

Well, maybe: but it felt a little like taking a walk in the woods behind your new high-tech house, stepping off the path to pick up a walking stick, and getting attacked by a mechanical bear. After you wrestle the bear to the ground, you find out this bear is designed to keep you and your sticks secure (after all, you could poke your eye out), so the bear was for your own good, and if you use the Stick Supply House instead of just picking up random sticks, everything will be okay. But i’ve gotten used to picking up sticks in the woods, and they’re my woods, after all.

Anyway, you’ve been warned: there are bears in the woods.

|