January 31, 2006 spout writing

Japanese version of Avalon book

I thought someone might be interested in the Japanese version of our WPF book. Personally, I love the cover.
January 31, 2006 spout writing

Pre-order “Windows Forms 2.0 Programming”

I just noticed that Windows Forms 2.0 Programming,” by Michael Weinhardt and Chris Sells, is available for pre-order. I've had a lot of requests for info on this book, so now folks can watch this space. Mike and I have finished the copy edit rounds, but we still haven't seen the final PDFs, so it's still going to be awhile (hopefully no later than early April).
January 31, 2006 spout

IE7 Beta 2 worth the download

I've been using IE7 for the last week or so and it’s definitely worth the download. Just Ctrl+/Ctrl- itself is worth the upgrade, imo...
January 29, 2006 fun

IT Crowd: Yesterday’s Jam

Why is British comedy so much funnier than ours? Check out Yesterday’s Jam.
January 26, 2006 tools

Calling a Remote Index Server from .NET

I was building some code to access Index Server’s results via .NET and I got this:

// Catalog specified in connection string
string query = select Path from Scope() where FREETEXT(‘foo’)”;
using( OleDbConnection conn = new OleDbConnection(“Provider=MSIDXS.1;Data Source=MyCatalog”) ) {
  conn.Open();
  OleDbDataAdapter cmd = new OleDbDataAdapter(query, conn);
  DataSet ds = new DataSet();
  cmd.Fill(ds, SearchResults”);
  DataTable table = ds.Tables[0];
  ds.Tables.Remove(table);
  return table;
}

This came from a combo of stuff I found on the net and my own experimenting. However, I had to get an MS employee who know IS (thanks Chad Ray!) to figure out how to access IS remotely, which I was finally able to get working thusly:

// Server and catalog specified in query string, not connection string
string query = select Path from MyServer.MyCatalog..Scope() where FREETEXT(‘foo’)”;
using( OleDbConnection conn = new OleDbConnection(“Provider=MSIDXS.1”) ) {
  conn.Open();
  OleDbDataAdapter cmd = new OleDbDataAdapter(query, conn);
  DataSet ds = new DataSet();
  cmd.Fill(ds, SearchResults”);
  DataTable table = ds.Tables[0];
  ds.Tables.Remove(table);
  return table;
}

Also, if the server or catalog name has anything weird” in it, e.g. those wacky dashes, you’re supposed to wrap it in double quotes. My experimenting showed that wrapping any server or catalog name in double quotes worked just fine, e.g.

string query = select Path from "MyServer".\“MyCatalog\”..Scope() where FREETEXT(‘foo’)”;

However, if the server name is localhost” or 127.0.0.1″, IS doesn’t like it, which meant that I had to check for those server names and drop the ones that used the loopback adapter (although using the machine name of the local machine worked just fine), e.g.

static bool IsLocalHost(string server) {
  return string.IsNullOrEmpty(server) || (string.Compare(server, localhost”, true) == 0) || (string.Compare(server, 127.0.0.1″) == 0);
}

string GetPlainTextQueryString(string text, string columns) {
  // IS doesn’t like localhost”
  if( IsLocalHost(_server) ) {
    return string.Format(“select {0} from "{1}"..Scope() where FREETEXT(‘{2}‘)”, columns, _catalog, text);&n
  }
  else {
    return string.Format(“select {0} from "{1}".\“{2}\”..Scope() where FREETEXT(‘{3}’)”, columns, _server, _catalog, text);&n
bsp; }}

I’m only posting this cuz I couldn’t find it on the net and I want to be able to find it again later. : )

January 25, 2006 spout

Imperative vs. Declarative

Savas showed me this great example from a book he’s reading. Consider this:

F = m * v

Using an imperative interpretation, this is a expression that, when evaluated, multiplies m and v, putting the result into F.

Using a declarative interpretation, this is an equation and is completely equivalent to the following:

m = F / v

The imperative interpretation allows me to execute. The declarative interpretation allows execution as well as addition reasoning.

January 22, 2006 spout

Netflix for Books?

I know, I know, "I hate books." Still, books are where most of the content I love is, so I live with 'em. However, it'd be nicer if there were a Netflix for books, like there is for DVDs and games. I think the public library should be become such a thing and I'd happily pay $15/month for mail delivery and return.
January 19, 2006 fun

Looking for an Xbox 360

I got my first hands on Xbox 360 demo today and I want one! Unfortunately, MS employees aren’t treated specially, i.e. there isn’t a big warehouse full of 360s for us at the MS Store. However, there is an internal mailing list filled with rapid pre and post-360 purchasers that showed me several resources to use to find 360s:

  • 360 Tracker, a WinForms app to find stores in my area with 360s in stock. Will alert me via email and my cell phone as well as on my computer screen. It’s running now.
  • NotifyWire.com, a web site that will filter for online sales in my price range and notify me via email and SMS. I’ve created my account.
  • xbox360tracker.com, a web site that shows online sales and their in-stock status. Available as an RSS feed, so that’s a reason to run one again! : )

I don’t want any fancy bundles and I don’t want to purchase online — I want the premium bundle and I want to walk out of the store with it. Is that so much to ask?


← Newer Entries Older Entries →