Monday, August 11, 2008

An Answer and A Question

This afternoon a colleague was attempting to add an image to his WPF application. What made this unusual was that he wanted to get the image from a resource cooked into an assembly. This was not particularly straightforward to do.

The image itself was in c:\dev\project\framework\IntranetFramework\Content\Images\CSiLogo.png. And we were putting into the IntranetFramework assembly. That seemed to go straightforwardly, but there arose a problem when we went to use it.

Ultimately we added to the xaml file the following:


What's interesting is the syntax that we had difficulty getting right. Don't forget the initial "slash" followed by the assembly name delimited by semi-colon followed by "component" followed by the path within the project's directory tree to the image in question.

It took a fair amount of googling to add the "/" and the "component/" to the image source attribute.

You might keep that in mind if you're struggling with something like this.

It was my friend who did all the work, but I just sat watching. When I thought I understood what he did, I did likewise with a different image file I added to the project and then added to another xaml. Everything the same except the different filename.

It didn't work. Then my friend told me what he'd done before I dropped by. He added the image file to the project as a Resource, then immediately deleted it again. Whereupon my version started working. I don't exactly know why; I figure it's a bug in Visual Studio 2008's WPF code generator. If anybody figures it out, please add a comment explaining it.

Thursday, August 07, 2008

Whereupon Stoicism Ensued

Last night I walked out of a writers' group that I attend and was surprised. I'm quite anxious about a party I'm throwing tonight and so I've been watching the weather all week. I watch weather more closely nowadays because I ride my scooter to and fro. It's a great way to go. You're outside with the wind in your hair. When I scooter into work you can tell because I'm grinning all day.

This week it rained Monday morning so I drove and grumbled to work, but the weather said it'd be iffy Tuesday and Thursday, but sunny Wednesday. I scootered to work in wonderful weather and then rode to my writers' group, but I noted a bit of cloud cover. When the group broke up last night, I stepped outside and felt a couple drops sprinkling on me. Instead of loitering and chatting, I bid my farewells and scooted.

My writers' group meets in downtown Grand Rapids and I live in the northeast suburbs. It's about a five mile ride to get home. I started out and after a block the rain was pouring down.

You can tell when I go past on my scooter because I've got a grin on my face. Last night the grin became a grimace. I got as far as Fuller avenue and noticed my scooter lacks the power to climb the hill on Fuller faster than about 15 mph. I was soaked to the skin with almost the entire ride ahead of me. And there was a traffic snag at Fuller and Lake. It is a very low feeling to sit in a downpour waiting for traffic when you've got most of your ride ahead of you.

After a few cycles of the streetlight, I got moving again and the rain was now a full downpour. Hard to see. I was driven to distraction by the fear of an unseen pothole opening before me, and also the fear that my tires would lose traction. Thus I proceeded more slowly as some light hail joined the downpour. Thus I proceeded until I was 2/3rds of the way home.

On Plymouth avenue there is an overpass. I sheltered there and tried unsuccessfully to dry my goggles. You can't dry goggles when everything you have is soaked. After a few minutes of laboring in vain, I proceeded home.

Upon turning onto my street, I noticed the road beneath the trees was dry and that the rain was letting up. The rain ended as I drove into my garage.

My wife met me with great sympathy and she helped me strip. My shirt and undershirt and backpack came off to begin their process of making puddles on the hallway floor. I got in the shower, but before I did I tried to wring water out of my underwear: the item of clothing I thought would be the last to be soaked. I got a fair amount of water out.

The shower was hot and I enjoyed the sensation. I was safe and warm. A few minutes later I had changed into dry clothes and this ordeal was past tense. I tease my Prius-driving friend about how I use less gas and have a lot more fun than he does. I figure that when he reads this he'll feel some measure of vindication.

Monday, August 04, 2008

Weber Gas Grill Pizza

I have an aging Weber Silver gas grill. It's a nice day today, but a bit hot and humid. On a couple occasions when my wife has been busy, I've wanted to get Papa Murphy's pizza, but I didn't want to heat up the house with pizza baking.

What to do?

I got my pizza stone out and placed it in the center of my cold gas grill. Then I put the spurs to it, getting my grill as hot as it would go. It topped out around 500 degrees, less when the breeze kicked up. When I guessed the pizza stone was at thermal equilibriuum, I put the first pizza on. Gave it 10 minutes, then opened the grill a crack to see if it looked OK. It did. Gave it five more minutes. Should have given it one or two more. The top was nicely browned, but I was anxious about the crust in the center. Another minute would have addressed that.

I almost lost the pizza taking it off the grill/pizza stone. I used a half-sheet pan instead of a peel. Note to self, buy a peel.

Second pizza was a thinner gourmet pizza. The pizza stone was at temperature by that time and I gave it more time. I was rewarded with more GBD (gold, brown, delicious) on the top and the crust was a perfect shade of brown.

And all that heat of pizza baking is outside on my deck.

Friday, August 01, 2008

Check Your Premises

I'm told that Ayn Rand was wont to tell people to check their premises. With this in mind, I recently read this essay. The essayist angrily accuses a large group of people of being irrational in their response to the mishandling of a cracker. I agree that it is irrational for people to get upset about a cracker.

However, there's more to this story than just a cracker. I do not believe in the Roman Catholic doctrine of transubstantiation. But I do understand the doctrine. In short, it claims that the elements of the Lord's Supper, bread and whine, are transformed by the priest's recitation of the rite into the body and blood of Christ.

It is one thing to mishandle a cracker. It is another thing to mishandle the body of Christ. Whereas the essayist signifies the flap as concerning a cracker, millions of Catholics and Orthodox Christians would claim what was once a cracker is no longer a cracker. To them, the flap is over desecration of the body of Christ. If you desecrate a cracker it is one thing, but if you desecrate the body of Christ that is another thing entirely.

Catholic ire is premised upon the mishandling of the body of Christ. The essayist chooses not to recognize the significance of Christ in the elements of the Lord's Supper.

A Catholic friend who pointed this essay out to me is greatly exercised at the essayist's insensitivity. And I sympathize with him. He also made dark hints that violence might be directed against the desecration.

I don't believe in transubstantiation. But if I did, I would not be as ired as the Catholics seem to be. Christ is either living or dead; either capable of taking care of himself or powerless beyond the activism of his Church. I happen to believe in the former.

In Old Testament times, the prophets of Ba'al contested with the prophet Elijah on Mount Carmel. The contest was simple: Here's an altar with a sacrifice upon it, let the deity that really exists set it afire. As you may recall, the prophets of Ba'al got themselves into a lather to no effect, whereas Elijah poured water on the altar and made sure that only God could get the credit. And then fire came from heaven and burnt everything up. In this we see contrasted the religion of dead idols and the religion of a living God.

Thus, I see Christ as more than capable of protecting himself from, or responding forcefully to, any desecration. I think members of the Roman church are responsible to take every reasonable measure to maintain the integrity of their rites and relics. But this stops short of unethical measures. Islam is the religion of riots and murders over a rumored desecration.

This reminds me of another situation where people attach different significances objects. Consider a cluster of a few thousand cells. I've a pro-abortion friend who considers this cluster of a few thousand cells "a bit of goo." Conversely, when this cluster of cells is a fetus I regard it as constituting a human being with rights. I was pro-choice until I signified the fertilized ovum as a distinct human life whereupon I became pro-life.

I think that people who think that fetuses are humans with rights are obligated to take every reasonable measure to secure the rights of such powerless individuals. But this stops short of bombing abortion clinics or shooting abortionists. Such actions are not pro-life.

Partisan arguments about the cracker and the bit of goo are so bitter because each side starts with different premises and reasons from there to conclusions that the other side is populated by demons or madmen. For this reason, we each have to acknowledge our own premises and those of our interlocutors. Humans are by-and-large reasonable creatures. We have the ability to reason from the other fellow's premises. I think we should do so periodically to remind ourselves that the fellows on the other side are not demons.