CAB: Handling Focus In Workspace

Tuesday July 31st, 2007 @ 2:34 PM by Chris

Savij just blogged about a problem he had with tabbing through a CAB application and invoking logic on a control that was not being shown. This is a problem we ran into as well. He posts his solution here.

Our solution is quite different, so I thought I’d post it as well.

What we do is hook into the SmartPartActivated event for our workspaces. Our intention is to turn off the TabStop for all Controls, and then turn it on for the ActiveSmartPart, as well as set the Focus:

 private void EmployeeEditDeckWorkspace_SmartPartActivated(object sender, WorkspaceEventArgs e)
{
   Utility.FocusWorkspaceView(EmployeeEditDeckWorkspace);
}

The utility is a static class with a method that looks like so:

public static void FocusWorkspaceView(IWorkspace workspace)
{
   foreach(Control control in workspace.SmartParts)
      control.TabStop = false;

   Control smartPart = workspace.ActiveSmartPart as Control;
   smartPart.TabStop = true;
   smartPart.Focus();
}

I think static methods of this type are pretty ugly, but this is more of a short-term solution as well as a way to prevent ourselves from having to write repeating code. A more elegant solution, in my opinion, would be to put this code in the Workspaces themselves and recompile CAB for your solution.

At any rate, I thought I’d show there’s another way to solve this problem. After we hooked into the SmartPartActivated event for our workspaces our tabbing woes vanished.

Posted in CAB | No Comments »

Farewell Harry Potter

Sunday July 29th, 2007 @ 5:50 PM by Chris

A Word About Spoilers

I had not read a single Potter book until about six weeks ago. I had only known Harry Potter through the magic of the first four films, of which The Prisoner of Azkaban was my favorite. The Goblet of Fire had many holes, it seemed to me, that the film did not adequately explain, not the least of which was Priori Incantatem. I could not understand how Harry’s meager disarming spell could stop Voldemort’s Killing Curse, for which the film established that there was no known counter.

Desiring answers, I took up reading the books. I was unsure how much information might have been left out of the other films, so I started at the beginning with the first book. I had never followed Potter outside of the movies, so I had never been exposed to spoilers. I did not know how The Half Blood Prince ended.

I know other people only follow Harry Potter through the movies, and so you will not find any blatant spoilers here.

The Review

I Open at the Close

That is an inscription written in magic on a Snitch; the very first Snitch Harry ever captured in a game of Quidditch. It is given to him by Professor Dumbledor in a way that I will not reveal here, in case some people have not read The Half Blood Prince.

When first encountered in the book, the inscription’s meaning is unknown. It could just as easily have been intended to describe my tear ducts. They opened at the close. Quite liberally.

I admit to being cautious prior to reading this book; fearful of reading even one single sentence, review, or spoiler. For a long while prior to the publishing of The Deathly Hallows, there had been a rumor, perpetrated in part J.K. Rowling herself, that Harry might possibly die in this book, the seventh and final installment of the Potter series. I felt that if I read anything resembling “It sucks!” that would mean he died, and if I read anything resembling “It’s great!” he would have lived, so I avoided all media until I finished reading it. I did not want anything given away (I would advise anyone who wishes to read the book, who has not finished it yet, to avoid all reviews, even this one, until you are done with the novel).

What I didn’t realize about The Deathly Hallows is that it didn’t matter as much whether Harry lived or died, this was still going to be farewell. This was still going to be sad. This was the final chapter - the last book Rowling would write about Harry - and so in effect he does suffer a kind of death. Whether or not a literal death would be added to the equation was the mystery everyone in Potter fandom was waiting to discover.

I can say only this about the end of The Deathly Hallows: I, like most everyone else, had become so entranced by the seemingly binary possibility of Harry living or dying that I had no even considered any other alternatives. I had not considered that Rowling might do something much more creative with Harry’s final pages. I won’t reveal whether he ultimated lives or dies, but I can say with certainty that I felt the final chapters were some of Rowling’s best storytelling.

I did not think I would be able to say goodbye to Harry Potter and feel good about it. Rowling made that possible with the way she put the final chapters together.

As to the book: When a series gets beyond a 3rd installment and grows into a larger work (i.e. Frank Herbert’s Dune), I usually find it difficult to choose favorites. I loved The Prisoner of Azkaban and The Half Blood Prince. I also especially liked The Order of the Phoenix. I won’t say what I think about The Deathly Hallows for fear of tipping someone off.

That said, I think Rowling has put so much thought, work and plotting into these books that you can’t really judge them fairly as individual novels. They are portions of a larger story that is one of the most enchanting and entertaining of our time.

Rowling will never win an award for great literary accomplishment (Stephen King has joked that Rowling “never met an adverb she didn’t like”), but she has won something much more valuable I think: The hearts and minds of millions of fans. Harry Potter has entrenched itself in our popular culture. He’s an icon now, standing right along side the likes of Luke Skywalker and Frodo Baggins. And that is an achievement I envy. I think most creative people would wish to invent a world and characters as lasting as those that Rowling has created.

To say goodbye to such an extraordinary character in such an extraordinary place is a sad thing. But Rowling has showed, with The Deathly Hallows, that she knows how to bid farewell with style, in a way that her fans can appreciate and enjoy.

If you have not read the books for whatever reason, I recommend doing so. There’s a wonderful world awaiting. You may be tempted to just wait until all the movies have been released; I would encourage you to do otherwise. Rowling has created such a rich, deep and interesting world that there simply isn’t enough room to get it all down on film.

Harry’s story, quite simply, shouldn’t be missed.

Posted in Books | 3 Comments »

The Church Of I Don’t Know

Sunday July 29th, 2007 @ 9:53 AM by Chris

Scott Adams is fun to read. Today he has a post about Atheists that made me think. In the post he writes:

I sometimes call myself an atheist because it’s too hard to explain Spinoza’s version of god. And it’s too hard to explain that agnosticism is the only intellectually defensible position.

That comment made me think about the way I view religion and my own philosophy about life after death. I, like Adams, often use the term Atheist because it is a lot easier to say that to explain to people what I really think about God and the afterlife. Explaining my beliefs could take a long time; telling people you’re an Atheist takes about a half a second.

But I think I’ve come up with a better way to explain myself and still stick to the succinctness of “I’m an Atheist”: From now on I’m going to tell people I belong to The Church of I Don’t Know.

Because that is basically the way I think about God, religion and the afterlife. I simply don’t know, and I believe several things are very possible. For instance, I believe it is very possible that when we die the light simply goes out. There’s nothing else: No Afterlife, no Heaven, no Hell, no ghostly apparition. We just cease to exist because our brains cease to function.

That outlook is rather grim (at least to some people), however, so I also happen to believe it is very possible that there is some sort of Next Life. Maybe this life is just one in a long chain of lives; maybe we have somewhere to go after this, and somewhere to go after that, and so on and so forth.

Or maybe we just become one with the universe, from which we were born, living subconsciously in the cosmos without form.

Or maybe we reincarnate.

Or maybe we become Gods of our own universes.

Who knows?

The fact of the matter is: I don’t know. And I’m perfectly OK with that.

Because there is one constant among all the possibilities floating through my head: No matter if we existed before this life, or if we’ll exist in another form/place/time after this life, we have no knowledge of anything else other than this life. We know nothing for certain outside our immediate existence.

Which means that the only proof we have, the only thing we really know for sure, is that we’re alive now; this is the life we’ve been given. So it stands to reason that we better make the most out of it.

As to the rest of it - whatever came before and whatever is next - I don’t know. And I think that’s an answer that should be OK to give.

Posted in Religion | 2 Comments »

Comments? You Betcha

Saturday July 28th, 2007 @ 5:39 PM by Chris

Are comments on blogs worthwhile? That’s the question some folks are asking (and answering), namely Adi, Joel and Dave Winer.

Dave puts it like this:

Do comments make it a blog? Do the lack of comments make it not a blog?

Here’s my answer: Comments don’t really have anything to do with the core concept of a blog (self expression). They’re an optional feature. Whether they can add value to a blog depends entirely on (a) the quality of the comments coming in and (b) how the author handles them.

Dave and Joel don’t apparently think they add much value, regardless. Joel writes:

Look at this innocent post on a real estate blog. By comment #6 you’re already seeing complete noise. By #13 you have someone cursing and saying “go kill yourself.” On a real estate blog.

Dave and Joel seem to think that if you’ve got something to say then you should just start your own blog. That idea doesn’t strike me as particularly practical.

I don’t know about anyone else, but I don’t see blogging as a medium fit for everyone (that one-size-fits-all problem again). I think you have to have a little bit of extrovert in you in order to write a blog. Plus you have to, you know, actually like to write. Then on top of that you have to buy web space (preferably with your own domain name), install blogging software, and then blog. Regularly. And not suck at it.

That seems to me like a lot of work for someone who might just want to respond to something you wrote one time, and maybe they’ve got something worth saying.

Isn’t it worthwhile to hear what they have to say?

Adi seems to think so:

…I don’t see anonymous comments as the evil Joel compares them to. I have read many blogs from Jeff Atwood, Scott Hanselman, Phil Haack containing meaningful and entertaining comments, some of them anonymous. Someone may have great ideas and the desire to express them, but no desire to open a blog, and you can force that person to start blogging.

I’m with Adi here. I think there’s a lot of value in other people’s opinions. It’s how I learn. It’s how my own ideas get challenged. For me, a blog post is a starting point. It’s a placeholder for a potential conversation. Without comments, that’s a pretty one-sided conversation.

As for the really idiotic comments, well, that’s where moderation comes in. Now, I admit my site isn’t a juggernaut like Scott Hanselman’s, so maybe there will come a day when moderating comments gets to be too much work. But I think for the vast majority of blogs, moderating comments is well worth the effort. It lets you keep the crap out, while giving people who actually have something interesting to say a place to say it.

Plus, I think there’s another benefit here: It makes people who visit your blog feel welcome. It encourages them to contribute to the conversation; to read; to have their own ideas challenged; to learn.

I feel like my blog is an extension of me - of my house, if you will - and when you’re reading my blog you’re visiting my house. Now, I could go all Soup Nazi on my visitors and tell them to take off their shoes, not walk on the carpet and keep their mouths shut while they’re in my house. But I prefer to make them feel at home; welcome; like they are an invited guest.

Of course that’s just me. Your mileage may vary :)

Posted in General, Software Development | 1 Comment »

ALT.NET Conference: On Your Mark, Get Set, Wait…

Wednesday July 25th, 2007 @ 3:14 PM by Chris

Scott Bellware, stud that he is, has put together the ALT.NET Open Space Conference. It is scheduled for October 5th through the 7th in Austin, TX. The list of names participating in the organizing committee is impressive.

There’s just one snag: Scott says the limit for attendees will be 100 participants, and from the sounds of it, it will be first come first serve. I sense an RSS stakeout coming on…

Posted in .NET, Agile Development, Software Development | 1 Comment »

« Previous Entries