First PC Build (Part 1)

Add Comment | Aug 05, 2014

A couple of months ago I made the decision to build myself a new computer. The intended use is gaming and for using the last real version of Photoshop. I was motivated by the poor state of console gaming and a simple desire to do something I haven’t done before – build a PC from the ground up.

I’ve been using PCs for more than two decades. I’ve replaced a component hear and there, but for the last 10 years or so I’ve only used laptops. Therefore, this article will be written from the perspective of someone familiar with PCs, but completely new at building. I’m not an expert and this is not a definitive guide for building a PC, but I do hope that it encourages you to try it yourself.

Component List

Research

There was a lot of research necessary, because building a PC is completely new to me, and I haven’t kept up with what’s out there. The first thing you want to do is nail down what your goals are. Your goals are going to be driven by what you want to do with your computer and personal choice. Don’t neglect the second one, because if you’re doing this for fun you want to get what you want. In my case, I focused on three things: performance, longevity, and aesthetics.

The performance aspect is important for gaming and Photoshop. This will drive what components you get. For example, heavy gaming use is going to drive your choice of graphics card.

Longevity is relevant to me, because I don’t want to be changing things out anytime soon for the next hot game. The consequence of performance and longevity is cost.

Finally, aesthetics was my next consideration. I could have just built a box, but it wouldn’t have been nearly as fun for me. Aesthetics might not be important to you. They are for me. I also like gadgets and that played into at least one purchase for this build.

I used PC Part Picker to put together my component list. I found it invaluable during the process and I’d recommend it to everyone. One caveat is that I wouldn’t trust the compatibility aspects. It does a pretty good job of not steering you wrong, but do your own research.

The rest of it isn’t really sexy. I started out with what appealed to me and then I made changes and additions as I dived deep into researching each component and interaction I could find.

The resources I used are innumerable. I used reviews, product descriptions, forum posts (praises and problems), et al. to assist me. I also asked friends into gaming what they thought about my component list. And when I got near the end I posted my list to the Reddit /r/buildapc forum. I cannot stress the value of extra sets of eyeballs and first hand experiences.

Some of the resources I used:

PC Part Picker
Tom’s Hardware
bit-tech
Reddit

Purchase

PC Part Picker favors certain vendors. You should look at others too. In my case I found their favorites to be the best. My priorities were out-the-door price and shipping time.

I knew that once I started getting parts I’d want to start building. Luckily, I timed it well and everything arrived within the span of a few days. Here are my opinions on the vendors I ended up using in alphabetical order.

Amazon.com is a good, reliable choice. They have excellent customer service in my experience, and I knew I wouldn’t have trouble with them. However, shipping time is often a problem when you use their free shipping unless you order expensive items (I’ve found items over $100 ship quickly). Ultimately though, price wasn’t always the best and their collection of sales tax in my state turned me off them.

I did purchase my case from them. I ordered the mouse as well, but I cancelled after it was stuck four days in a “shipping soon” state. I purchased the mouse locally.

Best Buy is not my favorite place to do business. There’s a lot of history with poor, uninterested sales representatives and they used to have a lot of bad anti-consumer policies. That’s a lot better now, but the bad taste is still in my mouth. I ended up purchasing the accessories from them including mouse (locally) and headphones.

NCIX is a company that I’ve never heard of before. It popped up as a recommendation for my CPU cooler on PC Part Picker. I didn’t do a lot of research on the company, because their policy on you buying insurance for your orders turned me off. That policy makes it clear to me that the company finds me responsible for the shipment once it leaves their dock. That’s not right, and may run afoul of state laws. Regardless they shipped my CPU cooler quickly and I didn’t have a problem.

NewEgg.com is a well known company. I had never done business with them, but I’m glad I did. They shipped quickly and provided good visibility over everything. The prices were also the best in most cases. My main complaint is that they have a lot of exchange only return policies on components. To their credit those policies are listed in the cart underneath each item. The visibility tells me that they’re not playing any shenanigans and made me comfortable dealing with that risk. The vast majority of what I ordered came from them.

Coming Next

In the next part I’ll tackle my build experience.

Single-Click Checkbox in RadGridView

Add Comment | Jun 05, 2014

The Telerik RadGridView for WPF is a flexible visual control for displaying and manipulating tables of data. It’s not without it’s quirks though. I ran into one of those quirks recently.

The behavior of the RadGridView requires that you first activate the cell for editing. That enables the editing controls underneath. Although that provides better editing capabilities, it also can be unintuitive. In my case I don’t want my users to have to click a checkbox value twice in order to change the value.

This can be solved easily by setting the EditTriggers and AutoSelectOnEdit properties to CellClick and True respectively. Unfortunately, the story doesn’t end there. You would think you could set those properties in a style with a TargetType of GridViewCheckBoxColumn. You’d be wrong.

<!-- This works -->
<telerik:GridViewCheckBoxColumn Header="Flag #1"
      DataMemberBinding="{Binding Flag1}"
      EditTriggers="CellClick" AutoSelectOnEdit="True"/>

<!-- This doesn’t work -->
<Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">
      <Setter Property="EditTriggers" Value="CellClick" />
      <Setter Property="AutoSelectOnEdit" Value="True" />
</Style>

Telerik told me that is the correct, expected behavior, because the columns in the RadGridView are not visual elements. Their explanation is that the Style property comes from the base class FrameworkContentElement, but the column objects aren’t visual elements. That may be an implementation truth, but that doesn’t make the behavior correct or expected.

It’s unintuitive that the GridViewCheckBoxColumn exposes a Style property that cannot be used properly, but there it is. At least there’s a way to get the desired effect.

Restarting a Surface Pro 2

One Comment | Dec 09, 2013

Last Friday I encountered a problem resuming from sleep with my brand new Surface Pro 2. Of course this happened as I was getting everything ready to leave and catch a flight.

I had just put the Surface to sleep and realized I needed to get some information first. I tried to resume and nothing. After some basic troubleshooting I called Microsoft technical support.

Their technical support walked me through a few things including holding the power button down for longer then is normal to hard reset it. However, the magic tip was how to simulate the battery being removed.

To simulate the battery being removed and reinserted you hold down the Power and Volume Up buttons. And then release the Power button once you see the Surface logo. You go into a hardware setup screen. You exit from there and your Surface will restart as normal.

CryptoLicensing Evaluation

Add Comment | Nov 28, 2013

The software you write is valuable. Therefore, it should be protected. When you provide software for sale you need a mechanism to ensure it’s used within your purview. That mechanism usually involves licensing and copy-protection.

Enter CryptoLicensing

LogicNP handles the licensing and copy-protection using a military strength cryptographic technology. And it does so using a simple API that delivers all of the features you’d expect.

The webpage for CryptoLicensing lists all of the features. But, the following example demystifies the licensing process and proves how easy the software is to use.

Licensing Example

The documentation that comes with CryptoLicensing provides an example that is a good starting point.

The first thing you’ll do is create a licensing project using the CryptoLicensing Generator application. This allows use to create a key and any number of individual licenses for your application. The key is embedded in your application; and the licenses are normally provided to your end users. In the example, the license is embedded.

cldemo_keycodewindow

I took the example application a step further by encapsulating the licensing object in a special class. The implementation consists of a validation method and a property that provides a message that indicates the result of the validation.

The class implements IDisposable, because the CryptoLicense object does. There are areas that can be improved in my implementation. For example, you might want to keep the key and license strings as SecureString objects to keep them away from prying eyes.

public sealed class LicenseValidator : IDisposable
{
    readonly CryptoLicense licValidator;
    bool isDisposed = false;
    const string ValidationKey = "AMAAMAC…emkq==";

    public LicenseValidator()
    {
        licValidator = new CryptoLicense();
        licValidator.ValidationKey = ValidationKey;
    }

    public void Dispose()
    {
        licValidator.Dispose();
        isDisposed = true;
    }

    public string ResultMessage { get; private set; }

    public bool ValidateLicense(string licCode)
    {
        if (string.IsNullOrEmpty(licCode))
            throw new ArgumentNullException("licCode");
        if (isDisposed)
            throw new ObjectDisposedException("LicenseValidator");

        licValidator.LicenseCode = licCode;

        var status = licValidator.Status;
        ResultMessage = status.ToString();

        return (status == LicenseStatus.Valid);
    }
}

The LicenseValidator class is used at the start point of your application. I removed the reference to the startup window from App.xaml for my WPF application. And then I overloaded OnStartup in my App class.

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    using (var validator = new LicenseValidator())
    {
        string lic = "FgAAAAhH…vKldV9DE";

        if (validator.ValidateLicense(lic))
        {
            this.MainWindow = new MainWindow();
            this.MainWindow.Show();
        }
        else
        {
            MessageBox.Show("License validation failed ("
                + validator.ResultMessage + ")");
            this.Shutdown();
        }
    }
}

There is a glaring problem with this licensing example. It works, but the licensing key is hardcoded. And that’s not useful nor is it good practice.

The software provides three built-in ways of storing the license key. You can embed it as a resource in the assembly; although that is only slightly better than putting it in your code. You can also save it to a file or in the Registry.

The file and Registry options are the most useful, because they don’t tie the license code to your application. You then need a method of obtaining the license code from the user. CrytoLicensing has you covered there as well.

The EvaluationInfoDialog provides a mechanism to enter your license key in addition to verifying evaluation settings. The dialog works nicely enough to provide an easy way to enter a license. Unfortunately, it falls short in implementation.

cldemo_licentry

The problem is that the EvaluationInfoDialog inherits directly from System.Windows.Forms.Form. That means it’s a Windows Forms implementation. The ShowEvaluationInfoDialog method of the CryptoLicense object take this specific concrete class. Therefore, you’re stuck with a dependency on the Windows Forms technology if you want to use the built-in behavior and pattern. This is a poor design decision. It should have been implemented as an interface with one or two external concrete implementations.

Of course, there’s nothing stopping you from implementing your own dialog. Unfortunately, you’ll be on your own for the entire implementation. It’s a shame LogicNP didn’t implement this as well as the rest of their software. I  grudgingly added a reference to the System.Windows.Forms assembly for my WPF demo purposes.

The changes to my LicenseValidator class are minor. The signature of the ValidateLicense method changes. It no longer takes a license code as an argument. Instead, I attempt to load the license within that method. A helper method to show the dialog is also added.

public bool ValidateLicense()
{
    if (isDisposed)
        throw new ObjectDisposedException("LicenseValidator");

    if (!licValidator.Load())
    {
        if (!GetLicense())
        {
            ResultMessage = "License entry cancelled";
            return false;
        }
    }

    var status = licValidator.Status;
    ResultMessage = status.ToString();

    return (status == LicenseStatus.Valid);
}

private bool GetLicense()
{
    using (var dialog = new EvaluationInfoDialog(licValidator))
    {
        dialog.ProductName = "License Validator";
        dialog.PurchaseURL = "http://www.mycompany.com";

        return licValidator.ShowEvaluationInfoDialog(dialog);
    }
}

The changes to the App class are even simpler. I modify the method call, remove the license code variable, and I remove the message box, because the EvaluationInfoDialog shows what needs to be shown.

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    using (var validator = new LicenseValidator())
    {
        if (validator.ValidateLicense())
        {
            this.MainWindow = new MainWindow();
            this.MainWindow.Show();
        }
        else
        {
            this.Shutdown();
        }
    }
}

Beyond the Simple

That is only the beginning of the capabilities of CryptoLicensing. The demo illustrated a basic licensing situation. You will likely have more advanced needs.

The following are some of the licensing scenarios that you may need that the software supports:

Evaluation You define an evaluation license when you want your users to use your application for some limited duration. You can specify limits on days, execution count, total time used, et al.
Hardware-Locked This license option allows you to lock the license to a specific computer.
Activations You define a number of activations for the license, and a licensing service calculates a hardware-locked license for the computer that is being activated.
Concurrent This option is similar to the activated license. The difference is that the license is based on the number of activations at a given time. And a computer with an existing license can free it up for another to be activated.
With Features You can specify a license that enables specific features within your application, or you can define editions like Standard, Professional, and Enterprise.

The user interface within CryptoLicensing is setup with a series of tabs that have many options for defining your license. The first two define the main settings. And the second is related to .NET specific assemblies.

Profiles

Picking the correct settings for your project can be overwhelming. LogicNP provided a great feature called profiles to help with this. This feature allows you to create and save a series of settings based on your custom license.

You can create your own profiles or use one of the two that they provide out of the box – a normal license and a 30-day evaluation.

Licensing Service

Some of the features of CryptoLicensing require a licensing service. These features include concurrent licenses and dynamically hardware-locking licenses.

The provided licensing service is implemented as a Web service. It includes support for major eCommerce providers including PayPal, Plimus, et al.

The software installation comes with a complete Visual Studio solution that you compile and run after setting a few configuration options.

Usage Reporting

The licensing service comes with an added benefit. It can track how your application is used. This is similar in implementation to the Customer Experience Program you see in applications like Microsoft Office.

The part the user doesn’t see is a website you host. The website provides different views each of which focus on an aspect of the reported data. Usage reporting can be helpful in determining what features need your development resources.

Good and the Bad

The following are my general opinions about what sets CryptoLicensing apart and areas that could be improved.

Likes Dislikes
  • Features
  • Documentation
  • Application support
  • User interface
  • Windows Forms lock-ins

 

CryptoLicensing has a robust set of features that all work within the same interface. That means you’ll be able to add licensing features without requiring much rework of your existing code.

The documentation is excellent. The formatting can use some work, but you cannot complain about the content. LogicNP went above a simple documentation file and included several sample applications and instructional videos.

When I started using CryptoLicensing I thought it was going to be limited to your basic .NET application. It turns out that it supports many application types including Windows Phone, Mono, Mono Android, Windows Store, Office Addins, Sharepoint WebParts, et al.

I have the same complaints about the user interface as I do with Crypto Obfuscator. It’s convoluted and could use some attention. It’s easy for a developer to understand and use, but you may have a non-developer assigning and managing license codes when a licensing server isn’t involved.

My biggest complaint is the lock-in to Windows Forms for a couple of the helper windows. The UsageReportingConsentForm is derived from the Form class just as the EvaluationInfoDialog I already mentioned. There’s no reason you cannot implement your own, but there’s no good reason the implementation has been locked into a stagnant windowing technology either.

The Skinny

Licensing your software is a necessity in many cases in order to protect your intellectual property. But, it’s also a distraction from the core business problem you’re trying to solve. CryptoLicensing removes the distraction with a short learning curve and a robust set of features.

CryptoLicensing does everything I need for licensing. I plan on using it for my future projects that require licensing.

RegionManager missing from Namespace?

Add Comment | Oct 01, 2013

I struggled with an error in my XAML on a new project this weekend. The error is a design time error. That is, my project compiled and ran perfectly. But, the designer had the error:

The name ‘RegionManager’ does not exist in the namespace “http://www.codeplex.com/prism”.

This occurred in Visual Studio 2012 with the Prism 4.1 libraries that were especially compiled against .NET Framework 4.5. And that annoyingly had to be modified and resigned for the appropriate version of the Unity 3 library.

It turns out that the Zip file that the updated Prism libraries were distributed in was automatically blocked by Windows. When you decompress certain file types from a blocked Zip file the files will automatically be blocked as well. Fixing the problem was as simple as closing Visual Studio and unblocking each library using the following steps:

  1. Right click the library (DLL)
  2. Click Properties
  3. Click Unblock
  4. Click OK

You can also unblock the Zip and decompress the libraries again. However, in my case I had modified a library and it was easier to unblock the handful of files.

I hope this post will solve someone the hours it took me to solve this problem.

Crypto Obfuscator Evaluation

2 Comments | Sep 25, 2013
Obfuscation is the hiding of intended meaning. And within the context of programming it’s a necessary evil for different classes of programs. Programs written against the .NET Framework are compiled into intermediate code called Microsoft Intermediate Language (MSIL). MSIL preserves the structure and many of the details of your code. This makes decompiling trivial. Obfuscation isn’t something you think of as adding value to your program. It’s something you may be forced to do when you’re w