February 10, 2006 Spout

My Favorite Wiki: pinvoke.net

I guess wikipedia is cool, but the wiki that provides a vital service in my life is pinvoke.net, which provides an enormous, user-contributed list of Win32 API mappings for .NET. I find it useful not just because folks are contributing tons of stuff I use, but also because I find it a wonderful place to drop code for my own later use, e.g.

This is the closest thing I’ve seen to a working code repository that is just as easy to contribute to as it is to use. Highly recommended.

P.S. I think this kind of functionality should be built into the SDK docs. I’ll ask ’em.

February 8, 2006 Tools

Network bandwidth usage monitor?

Sometimes, for no reason I can discern, the network bandwidth on various computers in my house goes south. What I'd love is a tool that shows me how much traffic is going across my network, where it's going and where it's from, i.e. from the internet, from a machine in my house, etc. Ideally, it'd also show me the ports and even the processes on each machine that are producing/consuming the data. Does such a tool exist?
February 3, 2006 Spout

PM Skill #7: Use That Meeting Time!

It’s very easy, as the PM, to not want to waste team time in a meeting, letting folks go when there’s still 30 minutes left. In fact, lots of folks will praise you for your short meetings. That’s fine if all of the work for that meeting has been done, e.g. everyone’s reported their status, all of the open questions have been decided, etc.

However, it’s often the case that in these meetings, other issues will come up to be discussed in future meetings to be scheduled at another time. Don’t let your concern for your team mates’ free time tempt you to let ’em go! It’s hard enough to get the folks you need together in a room. Once you’ve got ’em there, use ’em.

For example, if you’ve got the team together for weekly status that’s scheduled for 60 minutes, it often only takes 30 minutes. In that 30 minutes, you may decide that a subset of the team needs to get together for an hour design discussion on whether to spinning text boxes to your next software project. As a dutiful PM (aka “mom”), you’ll often find yourself saying, “Sure — I’ll set that up.” Then it’s your job to find an hour on everyone’s calendar while that issue remains open and the project drags on.

Don’t do it! Instead, peel off the folks in the status meeting that need to be in the “hour design discussion” and have the meeting right then and there. You’ve already scheduled the weekly status for 60 minutes, so you know those folks are free and just dying to get back to reading email in piece in their office — put ’em to work instead! Who the hell knows how long a design discussion is going to take anyway? It’s just as likely to go under an hour as over, so you might be able to wrap up the issue right then and there, skipping the need for another meeting altogether. Believe me, your team mates will thank you for that!

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. : )


← Newer Entries Older Entries →