Send mail to the author(s) E-mail

# Thursday, July 24, 2014

Looking in the Event Viewer, System, ever since I’ve had this PC I’ve been getting:

Windows Hardware Error Architecture

WHEA-Logger warnings:

A corrected hardware error has occurred.

Reported by component: Processor Core
Error Source: Corrected Machine Check
Error Type: Cache Hierarchy Error
Processor APIC ID: 2

The details view of this entry contains further information.


update BIOS and drivers for motherboard

maybe bump up voltage. offset +0.100?


Tested okay

BIOS is at latest version - F7

| | # 
# Tuesday, July 22, 2014

Getting the most out of your machine:


CPU: 4790K


Have gone from BIOS F6 to F7

Motherboard: Z97X-UD3H

Intel Devil's Canyon Core i7-4790K CPU Cinebench results

So possible 10% increase in perf going from 4.4 to 4.8


Look at BIOS update..

latest is F7 – 19/06/2014.  Had to format a mem stick to Fat32, copy the files over, then reboot and run the flash update in the BIOS.  - management?



Overclocked to 4.5GHz – Changed the Performance Upgrade switch in the BIOS


no overclock (4.4GHz.. or 4.0?)



Also how to find drivers

Installed :  Intel Management Engine Inerface.. got rid of 1 device not there.

And an INF update.. all good.

EasyTune.. need Gigabyte AppCenter utility


| | # 
# Wednesday, July 16, 2014


Going for a minimal install, but with client tools.  Also put on mixed mode authentication.  Rest are defaults.

| | # 

Disabling outlook alerts (2013)

setup power saving (if using desktop) to performance


setting up mstsc (inbound) – proving to be hard as I’m on a VPN to a corp network, so it should just work.

| | # 

“DI is a way to enable loose coupling, and loose coupling is first and foremost an efficient way to deal with complexity”


“Anyone can draw a three-layer application diagram, and [this] proves that I can, too”!

Building a tightly coupled application

MVC, EF and MSSQL application.  E-commerce.

  • List of featured products
  • If user is a preferred customer, the price on all products should be discounted by 5%

Data Layer

Creates a table in SSMS

Uses EF to create an Entity Model (db first).  She has changed Featured to IsFeatured in the model

Domain Layer

How to know who is a preferred customer?

    public partial class ProductService {
        private readonly CommerceObjectContext objectContext;

        public ProductService() {
            this.objectContext = new CommerceObjectContext();

        public IEnumerable<Product> GetFeaturedProducts(
            bool isCustomerPreferred) {
            var discount = isCustomerPreferred ? .95m : 1;
            var products = (from p in this.objectContext
                            where p.IsFeatured
                            select p).AsEnumerable();
            return from p in products
                   select new Product {
                       ProductId = p.ProductId,
                       Name = p.Name,
                       Description = p.Description,
                       IsFeatured = p.IsFeatured,
                       UnitPrice = p.UnitPrice * discount

She implements this in the domain layer.  However she needs a reference to the DAL as ObjectContext is defined there.

UI Layer

public ActionResult Index() {
    bool isPreferredCustomer = this.User.IsInRole("PreferredCustomer");

    var service = new ProductService();
    IEnumerable<Product> products = service.GetFeaturedProducts(isPreferredCustomer);
    this.ViewData["Products"] = products;

    return this.View();

Needs a reference to Domain layer, and DAL (as products are defined there). 

The answer as to why this was failing to compile on line 12 becomes clear when you use the type explicitly


Ahh, it is Product. Need a reference to System.Data.Entity (EF4) for EntityObject which Product inherits from.


As I couldn’t get the project to compile easily (MVC3) in VS2013, I created a new MVC5 and fitted in the code.

@using Ploeh.Samples.Mary.ECommerce.Data.Sql

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Featured Products</h2>
        @foreach (var prod in (IEnumerable<Product>) ViewData["products"]){
            <br />
            <br />

and web.config

    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5.1">
        <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

to get a reference to System.Data.Entity.  Also had to make sure the connection string was pointing to .\SQLEXPRESS where I generated the database.


Did Mary succeed?  No.  It looks like the coveted layered application, but the code is tightly coupled

Dependency graph showing how the modules depend on each other.  The arrows point towards a module’s dependency

The UI is dependant on both the Domain and Data Access layers!  It seems the UI mayy bypass the Domain in certain cases.

| | # 
# Monday, July 14, 2014
( Resharper | Xunit )

Resharper Manage Extensions


| | # 
# Friday, July 04, 2014

Rohans talk

What book?

Dave Kerr.. knows about messaging


Framework for doing a distributed application

Separate machines eg Web -> create user -> Console app picks up message to save... -> raise an event that this has happened

Another ConsoleApp picks up that message and then sends an email


MSMQ, RabbitMQ, Tables(!) in a DB, Azure

  • Error queue
  • Auditing


Why have an Interface over an Attribute for NServiceBus eg ICommand (a marker interface)

Command is somehting want to happen

Event is something after it happens

Resilient... eg if emailler console app went down.

Starbucks Analogy

1person - take order

cup is the message (written on)

1 person - makes


Other Products

NServiceBus and MassTransit started using MSMQ

EasyNetQ is a light .NET wrapper around RabbitMQ (Erlang open source)

RabbitMQ is a much more feature rich queuing system.. than MSMQ... perf slightly better at 8k messages per sec compare to 5k

| | # 
# Thursday, June 12, 2014

After a very interesting discussion at the Brighton Alt.NET meeting, and some follow up blog posts, I thought I’d explore why to use DI, then use it in my personal project to see if it does help.

This is a follow up to an interesting discussion the other night at the Brighton Alt.NET group on: “when is a project big enough to warrant using DI”

Interesting quote from Mark Seeman who wrote the book on DI in .NET:

“Since I wrote the article on when to use a DI Container, I've only strengthened my preference for Poor Man's DI. Unless I'm writing a very complex code base that could benefit from Convention over Configuration, I don't use a DI Container, but since I explicitly architect my systems to be non-complex these days, I haven't used a DI Container in production code for more than 1½ years.”

My initial concerns are:

  • Complexity
  • Harder to navigate through the code

What I’m hoping may happen is:

  • Less code
  • Greater testability
  • Less complex systems

What is Dependency Injection

“Dependency injection is a software design pattern that implements inversion of control and allows a program design to follow the dependency inversion principle” Wikipedia

“Dependency injection means giving an object its instance variables.” James Shore

Dependency Injection (DI) is the proper way to write loosely coupled code when using Object-Oriented Design.” Mark Seemann

Pluralsight – John Sonmez course

  • Dependency Inversion Principle – (DIP)
  • Inversion of Control – a pattern
  • DI - Implementation of IoC to invert dependencies
  • IoC Container – a framework

3rd module.. a quick demo on DI.. using types before they are made to help drive out… like TDD.

google TDD IoC DI C#?

Rob Conery

“You’ve got to be kidding me!”

ie why should we use this

Pluralsight – Jeremy Clark

| | #