Publisher cancels book contract because the writer is gay

Excellent! I’m way late to the party on this one but regardless, the point is valid; Cedar Fort really screwed the pooch here.

Monster Hunter Nation

http://wovenbook.com/

So Cedar Fort really likes a book submitted to them and says that they think it will sell well. Cedar Fort gives a contract to these two authors. They write their author bios. One mentions his “partner” instead of his wife. Cedar Fort flips out and drops them.

A couple of thoughts.

1. Just from a business/marketing perpsective, what a stupid, stupid, stupid, bone headed maneuver that was by Cedar Fort. Bad publicity for them, and on a side note way to make my home state look bad, because Cedar Fort is from Utah.

Cedar Fort is a regional publisher and sells lots of books to the LDS market. So by extension, way to make Mormons look bad, you dumbasses. Because the vast majority of Mormons don’t care if an entertainer is gay when we watch their movies, read their books, or listen to their music, you dipshits just…

View original post 516 more words

Posted in Uncategorized | Leave a comment

Visual Studio 2012, “Create Unit Tests” context menu item missing.

The latest contract I’m working on has me writing some unit tests for some legacy code. Someone had previously built an MS Test project for most of what I’ve been working on, using the handy “Create Unit Tests…” context menu item in Visual Studio 2010, which stubs out unit tests for methods in your code.

Once I had exhausted the list of auto-generated unit test methods and moved onto a project where no one had previously generated tests, I went looking for this generation method myself. Strangely enough, I found it missing.

It took me a while to poke around on the web and find a couple of different solutions, but the best post I was able to find on the subject is here (Firedancer Unleashed blog), wherein she describes exactly how to get the full functionality of that context-menu command, including the context-menu entry itself, back up and running.

Pay special attention to the “Caveats!” section near the bottom; she describes how to get the functionality working if you are getting errors or see the entry but it’s disabled. In my case, I had already added a Unit Test project to my solution and had already added classes for some tests, but apparently you have to add a “Unit Test” via the Add > New Item method before this option will be available.

Check it out and enjoy.

Posted in Uncategorized | 1 Comment

Renaming a foreign key column in EntityFramework Code-First

I fought this for a while before I finally figured this out, so I thought I’d pass along the info.

The scenario is this: when using a model that references another model via a foreign key and attempting to get it to rename the column to something other than [FK Table]_[FK Table’s Id Column Name] when doing an Update-Database from the package manager console (to build the database).

I searched through a plethora of google links attempting to find a solution, most of which involve using pre-release functionality (community preview-era EF 5). Most solutions attempt to fix this issue via the EF fluent api, but I couldn’t get it to work (I’m not very knowledgeable on that anyway; I find it awfully non-fluent).

I finally found a System.ComponentModel.DataAnnotations attribute, Association, with which I was able to accomplish exactly what I was after.

Given:

public class BaseTable
{
        [Required]
        public Guid BaseTableId { get; set; }

        [Association("RelatedTable", "RelatedTableId", "RelatedTableId")]
        public RelatedTable RelatedTable { get; set; }
        public int? RelatedTableId { get; set; }
}

public class RelatedTable
{
        [Required]
        public int RelatedTableId{ get; set; }
}

When you:

PM> Add-Migration
PM> Update-Database

You will get this table def for BaseTable*:

CREATE TABLE [dbo].[BaseTable] (
    [CharacterId]   INT NOT NULL,
    [RelatedTableId]        INT              NULL,
    CONSTRAINT [PK_dbo.BaseTable] PRIMARY KEY CLUSTERED ([BaseTableId] ASC),
    CONSTRAINT [FK_dbo.BaseTable_dbo.RelatedTable_RelatedTabldId] FOREIGN KEY ([RelatedTableId]) REFERENCES [dbo].[RelatedTable] ([RelatedTableId])
);

Interestingly enough, it still names the constraint [FK Table]_[FK Table’s Id Column Name], but at least the column name itself is now what I want it.

There’s probably an easier/better way to do this, but if so, it’s not easily found with a google search yet.

* I typed the code in this article, so I apologize if some of it doesn’t build, but you get the general idea.

Posted in Development | Leave a comment

Cool new Outlook.com feature

I’ve recently converted my hotmail account over to an Outlook.com account.  I also recently decided to reduce my “signal-to-noise ratio” in life.  To start out, one of the things I wanted to do is reduce the amount of emails I have to slog through every day in order to keep my wife off my back about the massive unread email number on my email tile on my Windows Phone.

I went into my inbox and notcied that at the bottom of one of my messages was a standardized message by the Outlook.com system:

Too Many Newsletters

If you click on the the unsubscribe link, it gives you the option to block the message sender and remove all messages from your inbox.

Pretty cool!

Posted in Uncategorized | Leave a comment

Visual Studio 11 beta – broken association to .sln, etc. files

For some unknown reason, myself and one other developer where I work suddenly found that when we launched a solution via the “pinned” feature through the Visual Studio 11 beta icon on the task bar, it would launch the solution in Visual Studio 10.  I’m not sure what caused this – neither one of us can pinpoint anything we did configuration-wise to cause this issue.

I have attempted to fix the issue via several routes:

  1. In Windows 7, you can right-click on a file and in the Open With submenu in the resulting context menu, chose “open with”.  The resulting dialog will give you the option of selecting a program and  checking a box to always use the current selection:
    Open With Dialog

    Open With Dialog

    If I chose Microsoft Visual Studio 11 Beta and check the appropriate box, it doesn’t save the setting.

  2. I have also attempted to set it through Visual Studio itself via the Tools > Options > Environment > General > Manage File Associations.  For whatever reason, it refuses to set the .sln (and .csproj, among others) to anything other than Visual Studio Version Selector.
  3. I even attempted to set it through the registry, but to no avail.

If anyone has any ideas on how to fix this issue, a comment would be greatly appreciated.

Posted in Development | 3 Comments

Welcome to the blog.

Ramblings by a guy slogging code for a living, frustrated by the fact that I’m just smart enough to know that I’m not smart enough.

Enjoy!

Posted in Uncategorized | Leave a comment