Richard's Blog

  • Reviewing my data access layer using the Entity Framework Profiler

    Inspired by Oren Eini’s series of blog post code reviews and hearing him talk on This Developers Life Life I decided to review the data access of my latest application using the Entity Framework Profiler.

    This is the second application I’ve used the Entity Framework for, and I’ve found it a joy to work with. I’d heard the arguments against ORMs that said they can’t produce good SQL, but I’d also heard the argument that ORMs are made by very smart people and they can probably make better SQL than most people. What I hadn’t heard till I heard Oren’s interview was that a smart ORM will still …

  • .NET MVC Security

    Most web security attacks are based on doing unexpected things to user input to fool the website into doing something it shouldn't. As web developers we all know this, but it's hard to keep track of all the exploits that are out there and it's easy to overlook things. The attacks that target the users of a website, work by making them enter unexpected input without them realising it. This often relies on them being logged on to the target site in question so their browser is authenticated when the user clicks on a link in a phishing email.

    These notes are about how to avoid making a site …

  • They Landed in Las Vegas

    Website screenshot

    I'm very pleased to announce that I’ve just launched the 'They Landed in Vegas' website. It’s my entry for the Orchard Module Challenge.

    The task for round one was to create a module for Microsoft's new Orchard CMS and if you got through round one then in round two you had to create a website to show that module off.

    I love maps and I like the idea of creating tools that help people share their local knowledge using maps. So I created the Bing Map List module. The module lets you create lists of places, which you can then click on to get more information. The admin interface is really simple …

  • Amazon Simple Email Service and MailChimp

    Amazon announced in January their new Simple Email Service. This was timely as the project I'm working on at the moment needs to send out quite a lot of transactional emails. A few days later MailChimp announced they'd created a layer on top of the Amazon service that gave some extra and very useful reporting features.

    We were sending emails from our webserver's mail server. This was fine most of the time, but even in testing we were finding that a few emails were getting turned down as spam by people’s email clients. Using an email sending service was something we were considering to help us …

  • A sneak preview of my latest Orchard module

    I'm working on a new Orchard module at the moment for the Orchard Module Contest. It's been my evening project for the last week and I've had a really good day working on it today. I've figured out most of the difficult stuff so it's looking like I will (fingers crossed) finish in time for the deadline on 15 March. There are still a lot of things to add and tidy up though.

    The module lets you create content items for places and then add them to a Bing map. Even if it doesn't win, it's something that should help with several project ideas I have. It would be nice to win though.

    When it's …

  • Using Orchard caching to cache data for a length of time

    You can use standard ASP.NET caching in Orchard, but it makes more sense to use Orchard's CacheManager service. It works better with tenants and I think it’s a bit nicer to use than the usual .NET way.

    I needed to add caching to the driver of my weather module. It gets the weather data from the BBC. This information doesn’t change that often and it takes a while to get. So it made a lot of sense to cache it.

    There are several ways to invalidate a cache, but in this case I just want my cached result to last for a certain amount of time.

    To do this you’ll need an instance of ICacheManager and …

  • Theming Orchard

    I’ve just finished redesigning my site and implementing that design as an Orchard Theme. While it’s still fresh in my head I wanted to write down what I’d learnt. The documentation on the Orchard site is pretty good, but I wanted to write down the things that I found most important. I hope you find it useful.

    An Orchard page is made of lots of bits; layout, zones, shapes, items, parts and fields. This can be a bit confusing and I’m still getting my head round it. You can find a more complete description of all of these in the anatomy of a theme in the Orchard documentation.

    The HTML that …

  • Nogginbox reimagined

    Screenshot of new Nogginbox design

    Today I’m very excited to announce my redesigned website. Ever since becoming a freelance web developer my website has been a work in progress; something that I would finish off when I was less busy. I’m sure my old site must have put some clients off and it definitely didn’t reflect me in the way I wanted.

    Well, I’m still busy, but I decided that 2011 would be the year I made my website something I was really proud of. It’s been my evening and weekend project for a little while now, and all the effort has finally paid off.

    On previous redesign attempts I’ve got stuck at the idea stage. I …

  • Microsoft release more things than you can shake a stick at

    There are quite a few tools and products I’ve been eagerly awaiting from Microsoft. I’ve been working with beta versions and anxiously watching mailing lists for news of new features and possible release dates. I knew some of them would probably come out in January, but they went and released them all, and more this Thursday. It’s very exciting, but this simultaneous release is going to make it harder to learn about all of them.

    Orchard 1.0

    I’m most excited about this. I’ve been working with Orchard and writing some modules for it since their first alpha release in March 2010. Orchard is an …

  • Quitting Google AdSense

    I discovered Google AdSense in 2005 and thought I’d try it out. I didn’t think it would I make a fortune (straight away), but I thought it might pay for at least some of my hosting fees.

    Google will only send you your money once you earn over £60. I didn’t think this would be a problem. It took 6 years. I just got my first cheque from Google. It’s for sixty pounds and sixty six pence. I’ve decided that it’s not really worth it for a site with my level of traffic and I've now removed all the Google Ads from my site.

    I’m not sure who really does well out of Google AdSense, apart from Google. I …