Google Analytics

Sunday, January 4, 2015

RIP Stuart Scott

Honestly, I never thought I'd shed a tear over the passing of Stuart Scott. I'll admit that I wasn't the biggest fan of him as a Sportscaster. Initially I thought that Boo-yah and all the other catch-phrases were sort of gimicky. I just wanted the sports scores. I didn't need SportsCenter to be entertaining. As a young white kid used to the vanilla delivery of the sports report each night and then each morning with the advent of ESPN, I found Scott's delivery to be uppity. There, I said it. Yes, UPPITY. Subtle racism that I didn't recognize at the time, but it amounted to this black man coming into a white man's world and overturning the apple cart. Thank God he did. Sportscasting has never been, and will never be, the same again.

There is one fewer innovator in the world this morning. Scott brought real soul, soul in the most African-American, hip-hop, barbershop, gospel choir sense of the word, to the mayonnaise on white bread world of Bristol, Connecticut's ESPN, and he did it unabashedly and without compromise. (Can I get an Amen?) He changed how every sportscaster would deliver the news, black or white. I'm paraphrasing, but one of the more insightful comments I read about Scott this morning was from one of his white colleagues (it escapes me just which one) saying that Scott came in and was just himself, a rather brash black man, and that gave everyone else the permission to just be themselves as well.

More recently, while I appreciated what he had contributed to his profession, I felt that he had grown a bit long in the tooth for his "cool as the other side of the pillow" persona. I remember though after his eye injury, someone taking a shot at him on social media about it and thinking, Really? Here's this big brash persona who puts himself in the public eye (still completely unabashed), is very good at what he does, and yet has plenty to criticize, and you want to take a shot at his appearance? And it was with great sorrow that I heard of his cancer diagnosis. Having lost loved ones to cancer, it isn't something I would wish on anyone.

I started following Stuart Scott on Twitter. It was then that I really began to admire him. Here was a man who was facing a devastating illness with such a quiet dignity. On Twitter he told of the doctor visits, the treatments, but never with any complaint. His concern was more for the young cancer patients he saw. He was always optimistic, always a warrior attitude toward the fight ahead. And still his timeline was mostly about sports and his children. On air, other than his increasingly thinner appearance, you'd never know anything about his fight with cancer. I was impressed to see him on air so soon after what I'm sure was some exhausting round of radiation. A professional. Cal Ripken and Lou Gehrig rolled up into one.

Today's news is further proof that cancer is a bitch. It doesn't care how optimistic you are, or how much of a fighter. I mean, those traits are certainly healthier for you in a fight with cancer than resignation. I just mean, that I've seen the most optimistic, courageous people lose to cancer. It's more proof that the fight cannot be left to those who have the disease or their immediate circles. The fight against cancer belongs to all of us. This world was a better one with Stuart Scott in it.

Tuesday, December 16, 2014

What Does That Have to do With the Price of Oil?

One thing that I really haven't heard anyone talk about concerning this precipitous drop in the price of oil is how OPEC hasn't cut their production. In years past when the price of oil threatened to drop liek this, OPEC would only need to threaten to cut production to keep prices stable. Now, even in the face of plummeting prices, OPEC has said they will not cut production. (http://www.bloomberg.com/news/2014-12-14/u-a-e-says-opec-won-t-change-output-even-if-price-drops-to-40.html)

The result of this is that Russia's economy, so dependent on oil, is going right down the crapper. (http://www.bloomberg.com/quote/RUBUSD:CUR) I don't think this is any accident. Of course, one can only speculate the conversations that go on behind closed doors between U.S. politicians and Arabian sheikhs, but certainly no one is in any hurry to throw Vladimir Putin a life ring. For as much as Putin kicked around Obama this summer, maybe Obama deserves some consideration for throwing a haymaker of his own.

Friday, December 5, 2014

I want to get this down in writing, though it is certainly only a half-baked idea. It isn't even really an idea, but a stream of thoughts. And this is why I need to get it down: it's a thought experiment, or a series of thought experiments, a hypothesis that needs to be held up to scrutiny in order to be refined.It's on the nature of good and evil, morality, right and wrong. I've been ruminating on it, turning over this big ball of dough in my mind, adding ingredients here and there, throwing out the entire batch at times and remixing it. Now it's time for me to throw these into the oven, bake it, and see how it tastes, see how others think it tastes.

As with baking, putting these ideas out there for public scrutiny is final. Final in a sense that once it's out there, especially on the internet, you can't just take it back. Just as once a cookie is baked, if it's terrible, you just can't break it back down and get your eggs, flour, sugar, and chocolate chips back. However, you can take the entire batch, throw it into the garbage and start again. I need to actually try this and see how it tastes finally.

So here goes: Good exists.

Good exists inherently in the universe. It wasn't invented by humans, but I'm not sure that I can positively say that it existed before humans. It wasn't invented by humans anymore than intelligence or creativity was invented by humans. It goes hand-in-hand with those things, so whether it existed before humans, I guess is one of those points of debate. I'll assert that it did, but that's for a later time. 

Good exists. That is my little leap of faith at which I start. It is the basis upon which I say I am a religious person. Science is based in fact. Theories that support certain facts are studied and tested until some fact, some evidence comes along to make that theory in its current state invalid. The theory changes and is re-evaluated until it no longer supports the evidence and must be again re-evaluated, ad infinitum. Philosophy and mathematics incorporate logic. "I think therefore I am." Logic is baked into that statement. Socrates used logic to prove that non-truths failed in their logical absurdity. Taking the logical inverse of some truth, he whittled it down to a point where it made no sense, thus the opposite of that case must be true. (I'm saying this badly, but again, this is just a thought experiment.) I have no evidence to disprove that Good does not exist. We can start with the premise that it does not exist and follow the logic through, and there is nothing that I think I can come up with that would make it a logical fallacy. Good may not exist. It's an examination that I want to work through later. However, I know that if Good does not exist in this world, then it is no ta world I want to be part of. And that is frightening. Too frightening for now, so I am starting with the premise that it does exist.

If good does not exist, then morality does not exist. Again, it's an assertion that I would like to examine later through its inverse, but provided I am making the assumption that Good exists, then I will also say that it is upon that assumption that morality is based. Let's now also assert that Evil then also exists being the negative counterpart or exact opposite of Good, Murder is evil. Rape is evil. Theft is evil. (As an aside, I think another idea to examine is that theft is at the heart of all crime, murder being the theft of life, rape the theft of sex and so forth.) One can argue that the idea that these things are bad or evil have emerged as a necessity of human evolution, that we are repulsed by the concept of murder or rape because it has been hard-wired into our DNA. If we were murdering and raping each other, we'd never evolve as a species in the first place. One can argue that the laws against theft were key inventions to us being able to live in an organized society (and thus not murder each other). This may be. Perhaps our sense of Good vs. Evil is some evolutionary necessity, that our sense of morality springs from us all trying to get along together. However, that begs the question. Perhaps we are evolving, but to what end? What's to say that evolving at all is good? Again, I simply have faith that it is. I believe, have mere faith in the fact, that we are being drawn toward some higher... purpose, for lack of a better term. And it is this higher purpose, this THING, that is not just the idea of Good, the Form of Good in the Platonic sense, but is God itself.

Tuesday, July 22, 2014

Begging Your Pardon

I have to get something off my chest, and it's petty and trite just as all my little pet peeves are. Consider it a public service announcement: "Begging the question" and "raising the question" are not the same, and normally when people say the former, they mean the latter.

Begging the question means to assume the very conclusion that you are trying to prove. Here's this example from the Wikipedia entry:

"To allow every man an unbounded freedom of speech must always be, on the whole, advantageous to the State, for it is highly conducive to the interests of the community that each individual should enjoy a liberty perfectly unlimited of expressing his sentiments."

Basically the above quote is saying "Freedom of speech in society is good because it is good to have a society with free speech." The argument begs the question of what makes free speech good in the first place. It is circular reasoning.

I don't fault and don't correct people who use "begs the question" to mean "raises the question". I used to do it as well until relatively recently. Now that I've been set right, when I hear it, and how often I hear it, it grates on me; just as fewer v. less and who v. whom are like sandpaper to my eardrums when I hear them. It's just personal, and I'm a grammatical jerk (uh... to coin a phrase).

Tuesday, July 15, 2014

Configuring GhostDoc Pro, part 1 - File, Class, and Properties Headers

I started this post back in the beginning of 2013. I apparently tossed my exported rules(*), so am redoing them and thought I would revisit my own, hopefully useful, advice.

I swear, why is it so hard to find documentation on doing some of the simplest programming things? Why is it that these companies can create such a relatively useful product, and yet it is impossible to find any real sort of documentation on how to use them? I have multiple blog entries brewing on my frustrations using Infragistics Reporting in their NetAdvantage suite. Today though, I'm going to rail against SubMain's GhostDoc Pro.

GhostDoc, a VisualStudio extension for automatically generating XML documentation and code comments, is a total time saver when it is properly configured. Because of the government certification our products generally go through, our code has to be meticulously commented in very specific ways. At one point my rules were properly configured and I had spent about half a day configuring the templates as well as I could, so that all I had to do was go to Tools > GhostDoc > Document File and my code file would be properly documented including headers, properties and fields. Unfortunately when I chose to upgrade my current version of GhostDoc it apparently took my desire to "Upgrade" my current rules file and merely used that as a "suggestion", which it then ignored, and I ended up with the default GhostDoc Rules templates. *So my first suggestion to you is that as soon as you have the templates the way you want them, export them to avoid having go through the hassle of re-creating them.

Secondly, bookmark this blog post as reference to refer back to later. The extent of SubMain's online documentation for creating your own templates seems to be to simply rely on the community of GhostDoc users creating blog posts in their community pages (http://community.submain.com/) and on StackOverflow. If you go to the tutorials on SubMain's site you will notice there are no tutorials for GhostDoc. (I take it back. Since I first began writing this blog article way long ago, a simple tutorial has been added. It is a very quick overview of all of GhostDoc Pro's features.) The help file that is downloaded for GhostDoc Pro contains an Introduction to T4 Templates and a description of each of the different templates that are used.

Editing T4 Templates
To edit the GhostDoc Pro T4 Rules templates, in Visual Studio go to Tools > GhostDoc Pro > Options > Rules and select the template you want to update. The template will open into an editor that does provide some Intellisense and color-coding.

Adding Global Properties
Global properties, accessible through the GetGlobalProperty of the Context object, can be added in the GhostDoc Pro options window under Global Properties. Here you can enter the key-value pairs for commonly used properties throughout your templates.

File Header

By necessity, our standard file header looks like this:

// -----------------------------------------------------------------------------
// <copyright company="Dominion Voting Systems" file="ElectionDataService.cs">
//     Copyright (c) 2013 Dominion Voting Systems, Inc. All Rights Reserved.
//     Any distribution of source code by others is prohibited.
// </copyright>
// <summary>
//    This file contains the Election Data Service Class
// </summary>
// <revision date="1/11/2013" revisor="ben.rice">
//     File created.
// </revision>
// -----------------------------------------------------------------------------

In order to create this I am using the following template.

<#@ template language="C#" #>
// -----------------------------------------------------------------------------
// ">
//     Copyright (c) <#= Context.DestinationFileCreationDateTime.ToString("yyyy") #> <#= Context.GetGlobalProperty("CompanyName") #>. All Rights Reserved.
//     Any distribution of source code by others is prohibited.
//
//









//     This file contains the <#= System.IO.Path.GetFileNameWithoutExtension(Context.DestinationFile) #> class.
//
// " date="<#= Context.DestinationFileCreationDateTime.ToString("MM/dd/yyyy") #>">
//     File created.
//
// -----------------------------------------------------------------------------

You can see that the Context object is perhaps the most useful in creating these templates. It's use is based on the template in which it is used. In this case, for example, the Context.Exceptions would be empty since the context of its use here is the File and Exceptions enumerates only any exceptions thrown by a method or property. You can also see the use of Context to retrieve our Global Properties. Of course, this can be done in whatever template you are editing. Also note that I can use the standard .Net objects and methods to get the file name without the file extension, for example. 

I need to modify the rule yet to add the "File modified." revision note. For now I throw that on manually.

Class Header
Our standard class header:

///









///     Interaction logic for navigating views within the Ballot Viewer.
///
///
///     Class created.
///

For this I am basically using the default class template for GhostDoc Pro.

<#@ template language="C#" #>
<#  CodeElement codeElement = Context.CurrentCodeElement; #>
///









///<# GenerateSummaryText(); #>
///
<#  if(codeElement.HasTypeParameters) 
{
for(int i = 0; i < codeElement.TypeParameters.Length; i++) 
{ 
TypeParameter typeParameter = codeElement.TypeParameters[i]; 
#>
/// <# GenerateTypeParamText(typeParameter, i); #>
<# }
} 
#>
<#= Context.GetNonGeneratedTags() #>
<# GenerateRemarksText(); #>

<#+
private void GenerateSummaryText()
{
if(Context.HasExistingTagText("summary"))
{
this.WriteLine(Context.GetExistingTagText("summary"));
}
else if(Context.CurrentCodeElement.IsSealed)
{
this.WriteLine("TODO: Add summary for Class " + Context.CurrentCodeElement.Name + ". This class cannot be inherited." + Context.ExecMacro("$(End)"));
}
else
{
this.WriteLine("TODO: Add summary for Class " + Context.CurrentCodeElement.Name + "." + Context.ExecMacro("$(End)"));
}
}
    
private void GenerateTypeParamText(TypeParameter typeParameter, int index)
{
if(Context.HasExistingTagText("typeparam", index)) 
{ 
this.Write(Context.GetExistingTagText("typeparam", index));
} 
else 
{
string typeParameterName = typeParameter.Name;
if(typeParameterName != null)
{
if(typeParameterName.Length == 1)
{
this.Write("");
}
else
{
this.Write("The type of " + Context.ExecMacro(typeParameterName, "$(TheAndAll)") + ".");
}            
}          
} 
}

private void GenerateRemarksText()
{
if(Context.HasExistingTagText("remarks"))
{ #>
/// <#= Context.GetExistingTagText("remarks") #>
<#+    }
else if (!string.IsNullOrEmpty(Context.GetGlobalProperty("DefaultBlankRemarksText")))
{ 
            // Should you require a default comment, set it in
// Options -> Global Properties -> DefaultBlankRemarksText
#>
/// <#= Context.GetGlobalProperty("DefaultBlankRemarksText") #>
<#+    }
}
#>

Notice that within the template I can call C# methods coded below. In this case we are generating type parameter elements for each type parameter if there are any. If a summary element or remarks element already exists in the header, that text is preserved, else some default text is inserted. Mine has a TODO reminder in the summary text to highlight that I need to change that.

I'm going to skip ahead now to the Properties rule

Our property header will look something like this:
///









///     Gets or sets the name of the election.
///
/// The name of the election.
///
///     Member created.
///
///
///     Changed to allow public setter.
///

I added to the default property generated in order to set the revision element.

<#@ template language="C#" #>
///









///<# GenerateSummaryText(); #>
///
<# GenerateValueText(); #>
<# if(Context.HasExceptions) 
{
foreach (System.Collections.Generic.KeyValuePair> pair in Context.ExceptionDictionary)
{
string exceptionText = Context.GetExistingExceptionTagText(pair.Key); #>
/// <#= ((exceptionText != null && exceptionText.Length > 0) ? exceptionText : Context.GetExceptionTagText(pair.Value)) #>
<# }
}  #>
<#= Context.GetNonGeneratedExceptionTags() #>
<#= Context.GetNonGeneratedTags() #>
<# GenerateRevisionTag(); #>
<# GenerateRemarksText(); #>

<#+
private void GenerateSummaryText()
{
CodeElement codeElement = Context.CurrentCodeElement;
   
if(Context.HasExistingTagText("summary"))
{
this.WriteLine(Context.GetExistingTagText("summary"));
}
else if(Context.HasInheritedTagText("summary"))
{
this.WriteLine(Context.GetInheritedTagText("summary"));
}
else if(IsBooleanProperty()) 
{
if(IsStateCheckBooleanProperty())
{
// state check boolean property
this.WriteLine(Context.ExecMacro("$(PropertyAccessText) a value indicating whether this instance $(PropertyName.Words.All)."));
}
else if(IsSingleWordBooleanProperty())
{
// single word boolean property
this.WriteLine(Context.ExecMacro("$(PropertyAccessText) a value indicating whether this $(DeclaringTypeName.ShortNameAsSee) is $(PropertyName.Words.First)."));
}
else
{
// boolean property
this.WriteLine(Context.ExecMacro("$(PropertyAccessText) a value indicating whether $(End)[$(PropertyName.Words.All)]."));
}
}
else if(Context.ContainsOfTheReordering(codeElement.Name)) 
{
this.WriteLine(Context.ExecMacro(codeElement.Name, "$(OfTheReordering)", Context.ExecMacro("$(PropertyAccessText)")));
}
else
{
this.WriteLine(Context.ExecMacro("$(PropertyAccessText) $(PropertyName.Words.TheAndAll)."));
}
}
        
private void GenerateValueText()
{
CodeElement codeElement = Context.CurrentCodeElement;
        
if(Context.HasExistingTagText("value"))
{ 
#>
/// <#= Context.GetExistingTagText("value") #>
<#+
}
else if(Context.HasInheritedTagText("value"))
{ 
#>
/// <#= Context.GetInheritedTagText("value") #>
<#+
}
else /*if(Context.CurrentCodeElement.HasSet) - commented for StypeCop compliance (SA1609) */
{
if(IsBooleanProperty()) 
{
.....
}
}

.... 
    
private bool IsBooleanProperty()
{
CodeElement codeElement = Context.CurrentCodeElement;  
return (bool)(codeElement.ReturnType != null && 
codeElement.ReturnType.FullName != null &&
codeElement.ReturnType.FullName.Length > 0 && 
(string.Compare( codeElement.ReturnType.FullName, "System.Boolean", true) == 0 ||
string.Compare( codeElement.ReturnType.FullName, "System.Nullable", true) == 0));
}  

private void GenerateRemarksText()
{
if(Context.HasInheritedTagText("remarks"))
{ #>
/// <#= Context.GetInheritedTagText("remarks") #>
<#+    }
else if(Context.HasExistingTagText("remarks"))
{ #>
/// <#= Context.GetExistingTagText("remarks") #>
<#+    }
else if (!string.IsNullOrEmpty(Context.GetGlobalProperty("DefaultBlankRemarksText")))
{ 
            // Should you require a default comment, set it in
// Options -> Global Properties -> DefaultBlankRemarksText
#>
/// <#= Context.GetGlobalProperty("DefaultBlankRemarksText") #>
<#+    }
}

private void GenerateRevisionTag()
{ 
if( Context.HasExistingTagText("summary")) {#>
/// <revision revisor="<#= Context.GetGlobalProperty("UserName") #>" date="<#= DateTime.Now.ToString("MM/dd/yyyy") #>">
///     TODO: Add Revision
/// </revision>
///
<#+
} else { #>
/// " date="<#= DateTime.Now.ToString("MM/dd/yyyy") #>">
///     Member created.
///
<#+ }
}
#>

Please note that in the interest of space, I omitted code that determines how to word the value element of a boolean property. In the custom "GenerateRevisionTag" method I did a check to see if the summary has already been written. If it hadn't been (prior to this GD call), I assume the property has just been created and add "Member created." to the revision text. Otherwise, I assume that the property already existed, but is being revised and add the reminder to myself to update what the revision was. Also note that the GenerateRevisionTag call is made after Context.GetNonGeneratedTags is written. This makes later revisions appear below previously written ones.

Monday, June 2, 2014

Wix and Feature Install Levels

I was just doing some digging for a colleague to find information on Wix and installing separate features by default or within a typical or custom install. This article does a comprehensive job of covering the topic. So for my own future reference and rather than rehash it, I will just post it here. (http://blogs.technet.com/b/alexshev/archive/2008/08/23/from-msi-to-wix-part-4-features-and-components.aspx). Note: I haven't actually tried the sample code yet.

Thursday, April 17, 2014

Amongst the Sinners

Tomorrow morning we are headed to Las Vegas for Viva Las Vegas, Rockabilly Weekend. VLV is a combined, car show, concert festival, burlesque show, and generally a scene for women to dress up like pinup models. Jen and I have gone now for years. It's always held on Easter weekend, and we kid, "Hey, where else would Jesus want us to be other than in Sin City for Easter, amongst the sinners, preaching His message?"

Okay, neither Jen nor I are the preaching type. In fact, we aren't exactly church-going types, though I think both of us wouldn't mind that changing. I feel like I am a very religious person, but not in a conventional sense. Maybe I would identify with being more "spiritual" than religious, except that for the fact that those who say they are "spiritual" often just use that as an excuse for either not wanting to think about it too much or not wanting to risk telling people they are religious.

I just don't identify with a particular religion, but in a way I identify with ALL of them, well, all the major ones. To me, they all carry the same message, just put into words that the people of a particular time and place could identify with. I have an entire treatise on this somewhere within me, but I don't want to get into that now, not on the eve of flying out to Las Vegas. Basically though I believe every religion says "Be good to each other." OR in the words of Bill & Ted, "Be Excellent to each other." What being good really means is perhaps what we all get hung up on. However, I simply believe that "goodness" exists, and that we should strive for that.

In doing that, in striving to be good, I feel I too often fall short. On the way home while driving today I was thinking about it. I was thinking about how hard I have been working to try and be better, and still falling short, wondering what I really need to do to become a better person. And I realize I have really been trying to do it on my own. Once in a while I can confide to Jen, or my brothers, or a close friend, but mostly I felt like I had to do everything on my own.

Then the thought, and the feeling came over me -- I don't have to do it alone. I'm not saying that I'm going to start calling upon God to make me a better person. I don't believe in Him like that. To say I believe in a Him at all in a conventional sense would be incorrect . But there is a reason that so many people find strength in prayer, in meditation, in the Bible, in the Koran, in going to church, in the buddha, dharma, and sangha. There is wisdom in religion.

We'll see where this really takes me. Happy Easter to all of you, however you plan to celebrate!