Quantcast
Channel: Ed Spencer's Blog
Browsing all 132 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Warning: Your data is not safe with Eukhost

In this previous post I outlined why if you were considering shared hosting, you should avoid Eukhost. I am writing this post as an urgent warning to anyone currently hosting with Eukhost, or...

View Article



Image may be NSFW.
Clik here to view.

Dependency Injection with ninject.mvc3 nuget

Quick post, just because this is mega easy. Traditionally, adding dependency injection with any standard injection package to an MVC solution would normally mean that you would have to write a...

View Article

Image may be NSFW.
Clik here to view.

HTML and CSS layout frameworks

Here’s a brief list of some great HTML and CSS frameworks. I’d recommend that all sites being developed now use a good CSS layout engine – doing so will save you hours of development time in tweaking...

View Article

Image may be NSFW.
Clik here to view.

Put your controllers on a diet

Have a read of this fantastic post by Yngve Bakken Nilsen on cleaning up your controllers. Nilsen accurately points out that in the real world, controllers, even with the best of engineering...

View Article

Image may be NSFW.
Clik here to view.

Seed data from SQL scripts using Entity Framework Migrations (EF 4.3 +)

Normally you would add seed data using native C#. You can also execute arbitrary SQL statements. To do so, in your Seed method (which can be overriden from your Migration folder in your Configuration...

View Article


Image may be NSFW.
Clik here to view.

New Year Promises

Everything is late. Even my new year promises are late – it’s nearly February after all. My excuse is that I’ve been Down Under since new years day. It was an awesome trip but I returned with some...

View Article

Image may be NSFW.
Clik here to view.

Mocking HttpContext (And setting it’s session values)

Thanks to this Stack Overflow answer that pushed me in the right direction, I was able to mock HttpContext and set values that it encompasses. Firstly, you will need a helper somewhere in your test...

View Article

Image may be NSFW.
Clik here to view.

Using MVC4 bundling and minification in an MVC3 project

When you push any site to production, you should at least do some basic front end optimisation. Running through a number of optimisation steps will ultimately make your website load quicker and feel...

View Article


Image may be NSFW.
Clik here to view.

Drop all tables in a SQL Server database (Azure Friendly!)

Most online solutions to this problem will point you in the direction of the undocumented stored procedure, “sp_MSforeachtable“. This stored procedure takes in a string of SQL as a parameter, and will...

View Article


Image may be NSFW.
Clik here to view.

Making Microsoft Security Essentials behave like antivirus software

I have been running Microsoft’s free antivirus software, Security Essentials, on all of my home machines since it first was released. On three separate occasions, I’ve discovered Trojans running on...

View Article

Image may be NSFW.
Clik here to view.

Running Entity Framework code first migrations programatically

Entity Framework code first migrations can easily be run programmatically. You can specify a specific migration, or you can just update to the latest migration. To rollback all migrations (calls the...

View Article

Image may be NSFW.
Clik here to view.

Why I wont be installing another custom rom on my Android phone

A while back I rooted my Samsung Galaxy S2. I decided to root the phone and swap the rom out after getting frustrated waiting for Android updates to firstly get updated again by Samsung, and then...

View Article

Image may be NSFW.
Clik here to view.

Creating a composite primary keys in Entity Framework 4.1

There are two main ways of achieving this. Let’s look at an object – Brochure: { ProductId, Year, Month, ProductName}. We want: ProductId Year Month To make up the primary key. Method 1 – Data...

View Article


Image may be NSFW.
Clik here to view.

Redirecting legacy pages in asp.net

Picture this situation. An old (legacy) application has landed on your project pile. It is largely built in php, and you intend on re-writing it in asp.net MVC. You will therefore need to somehow...

View Article

Image may be NSFW.
Clik here to view.

Running SQL commands with EF Code First

Before ORMs we used to write SQL code. Yes – real, “bare metal” SQL. We used it for our CRUD operations, and to perform other larger data manipulation tasks. The database server should be the quickest...

View Article


Image may be NSFW.
Clik here to view.

Using NDepend to clean up code and remove smells

At some point in your development career, you would have had an existing project dumped on you that you will have problems understanding and generally getting around the code. Those difficulties can be...

View Article

Image may be NSFW.
Clik here to view.

Using a Nexus 4 in x64 Windows Land

I’ve had a horrible morning. I’ve been dealing with shitty, unpolished crappy software all damned morning. All because people that are too intelligent aren’t stepping back from what they are doing and...

View Article


Image may be NSFW.
Clik here to view.

In defence of the RDBMS: Development is not slow. You just need better tooling.

I pride myself on being a real world software developer. Anything that I publish in this blog is a result of a some real world coding. I don’t just play around with small, unrealistic demoware...

View Article

Image may be NSFW.
Clik here to view.

That CSS / Javascript library isn’t as big as you think

I take some pride in going against the current tide of thought in most things. This is especially true when it comes to such a trend based industry, such as software development. We suffer from Hype...

View Article

Image may be NSFW.
Clik here to view.

Not doing code reviews? NDepend can help you

In a previous post about NDepend, I looked at how it can be used to clean up codebases by easily and quickly isolating blocks of code or classes that violate a set of rules. Helpfully, NDepend ships...

View Article
Browsing all 132 articles
Browse latest View live




Latest Images