Community developer blogs

Thom Lawrence

Website

Recent Posts

  • Method missing in C# 4.0

    Posted: 07 Jun 2009 at 10:44 by Thom

    I was hoping this would be quite easy, however I ran into this problem. Any answers much appreciated.

  • Mocking class methods in Objective-C

    Posted: 09 May 2009 at 13:14 by Thom

    If you ever find yourself shying away from class methods in your Objective-C designs on the grounds that they reduce the testability of your code, think again: - (void)testDateSwizzling { Method originalDate = class_getClassMethod([NSDate class], @selector(date)); Method mockDate = class_getInstanceMethod([self class], @selector(mockDate)); method_exchangeImplementations(originalDate, mockDate); STAssertEquals([NSDate date], [NSDate distantPast], @"Should have mocked method");

  • Linking to dynamic libraries in Xcode

    Posted: 06 Mar 2009 at 00:15 by Thom

    I like to think it’s entirely a lifestyle choice that Cocoa exposes no regular expression API to developers. It’s probably the same motivation behind making Xcode such a tortuous IDE - Apple just don’t want the rabble writing Mac apps. But, nevertheless, we plug away, and of the half-dozen available regex libraries out there, I settled [...]

  • XNA Studio 3.0 under Parallels

    Posted: 28 Sep 2008 at 22:55

    Still no joy with the new beta. Any VMWare Fusion peeps have any luck?       

  • Magic: the Gathering with normal playing cards

    Posted: 23 Sep 2008 at 21:11

    Rules Shuffle all 52 cards together and lay the deck face down. Players draw from this single deck. When the last card is drawn from the deck, shuffle all graveyards back into the deck. There is no mana burn. Other than that, it’s just the same game. Cards All nonland cards have a casting cost

  • Ode to a Karplusan Wolverine

    Posted: 19 Jul 2008 at 00:05

    How do I love thee? Let me count the ways. Thou art a one-drop with first strike. When blocked, thou hast double strike. Thou mayst deal thine combat damage as if thou wert not blocked. There are some who call thee… ‘Tim’. And, if God choose, I shall but love thee better after 20 d

  • TELL WORDPRESS “IMPORT FROM DASBLOG”

    Posted: 11 Jul 2008 at 22:06

    You have been killed by a grue. Update: donning my anti-grue kit (XSLT and Emacs), I have managed to resurrect the old posts. Much rejoicing and broken HTML.

  • Can haz pluginz?

    Posted: 11 Jul 2008 at 13:34

    require 'rubygems' require 'active_record' class ActiveRecord::Base class << self def method_missing_with_lol(sym) if sym.to_s =~ /^can_haz_(\w+)?/ send "acts_as_#{$1}" else method_missing_without_lol sym end end alias_method_chain :method_missing, :lol end end class [...]

  • Card of the Day

    Posted: 16 Aug 2007 at 00:01

    If you’re on a Mac and love Magic: The Gathering, you can use this Dashboard widget to view the card of the day from the Wizards site. Seeing as everyone’s copy of Dashcode has expired now, I doubt I’ll spend any more time on it. It’s basically just an Ajax request from Proto

  • Card of the Day

    Posted: 16 Aug 2007 at 00:01 by thom@thom.org.uk (Thom Lawrence)

    If you're on a Mac and love Magic: The Gathering, you can use this Dashboard widget to view the card of the day from the Wizards site. Seeing as everyone's copy of Dashcode has expired now, I doubt I'll spend any more time on it. It's basically just an Ajax request from Prototype and a regex to fin

  • Worst Update Ever

    Posted: 02 Jul 2007 at 21:31

    So Parallels 3.0 has continued to frustrate me. I can forgive the XNA thing - seems just as likely to be Microsoft’s fault. I filed a bug (or is it ‘participated’ in a ‘connection’?) on the atrocious Connect site, which you can vote up if you like… a few people ha

  • Worst Update Ever

    Posted: 02 Jul 2007 at 21:31 by thom@thom.org.uk (Thom Lawrence)

    So Parallels 3.0 has continued to frustrate me. I can forgive the XNA thing - seems just as likely to be Microsoft's fault. I filed a bug (or is it 'participated' in a 'connection'?) on the atrocious Connect site, which you can vote up if you like... a few people have come here from Google with see

  • Parallels 3.0 & XNA Studio

    Posted: 14 Jun 2007 at 21:52

    I enthusiastically upgraded to Parallels 3.0, hoping to enjoy its DirectX support. XNA Studio is one of the reasons this interests me - with my MacBook I’m not expecting to write or indeed play many 3D games, but you can’t run XNA projects without acceleration. However: System.ArgumentEx

  • Parallels 3.0 & XNA Studio

    Posted: 14 Jun 2007 at 21:52 by thom@thom.org.uk (Thom Lawrence)

    I enthusiastically upgraded to Parallels 3.0, hoping to enjoy its DirectX support. XNA Studio is one of the reasons this interests me - with my MacBook I'm not expecting to write or indeed play many 3D games, but you can't run XNA projects without acceleration. However: System.ArgumentException was

  • Future Values With Castle’s DynamicProxy

    Posted: 29 May 2007 at 20:20

    .NET has lots of support for asynchronous processing, which ASP.NET packages up very nicely in PageAsyncTasks. And yet I almost always find an excuse not to use them - they’re hard to test, it’s not instantly obvious what the logic of the page is when you have delegates and handlers all

  • Future Values With Castle's DynamicProxy

    Posted: 29 May 2007 at 20:20 by thom@thom.org.uk (Thom Lawrence)

    .NET has lots of support for asynchronous processing, which ASP.NET packages up very nicely in PageAsyncTasks. And yet I almost always find an excuse not to use them - they're hard to test, it's not instantly obvious what the logic of the page is when you have delegates and handlers all over the pl

  • Perfidy: Performance Testing In NUnit

    Posted: 17 Sep 2006 at 02:29

    Unsatisfied with calling QueryPerformanceCounter and being done with it, I spent today coming up with a fluent interface for performance testing in NUnit: using (At.Most(5).Seconds) { // Stuff that should take under 5 seconds } using (At.Most(1).Minute.GiveOrTake(10).Seconds) { // Stuff that should

  • Perfidy: Performance Testing In NUnit

    Posted: 17 Sep 2006 at 02:29 by thom@thom.org.uk (Thom Lawrence)

    Unsatisfied with calling QueryPerformanceCounter and being done with it, I spent today coming up with a fluent interface for performance testing in NUnit: using (At.Most(5).Seconds) { // Stuff that should take under 5 seconds } using (At.Most(1).Minute.GiveOrTake(10).Seconds) { // Stuff that should

  • NHibernate-friendly Types

    Posted: 11 Sep 2006 at 22:42 by thom@thom.org.uk (Thom Lawrence)

    It's probably a combination of laziness and plan bad form to try and map too many BCL types to your database, but if you're interested, I've gone through a few important assemblies and compiled a list of classes that: Are visible outside their assembly Are neither abstract nor sealed Are non-generi

  • ObjectSpaces Xml Documentation

    Posted: 11 Sep 2006 at 22:03 by thom@thom.org.uk (Thom Lawrence)

    Does anyone else have System.Data.ObjectSpaces.xml in their Framework\v2.0.50727 directory? I've never had the ObjectSpaces bits on this machine, so I assume this is just a standard bit of cruft that comes with the framework. Anyhow, I know Paul Wilson drew a lot of inspiration from ObjectSpaces, a

Events coming up

  • Nov 27

    The Colorado Springs Open Source Software November Meetup

    Colorado Springs, United States

    AGENDA 6:00 - 6:30 PM - Food, Drinks & Networking 6:30 - 6:40 PM - Announcements 6:40 - 7:10 PM - Basic Concepts 7:10 - 7:20 PM - Break 7:20 - 8:40 PM - Main Speaker 8:40 - 8:55 PM - Door Prize Drawings MAIN TOPIC ABSTRACT NetKernel NetKernel is a software platform that combines the idea of simple abstractions and sets of tools (awk, grep, sed, etc.) with the flexibility of the World Wide Web.

Related blogs

  • espertini.com | .net playground

    personal / technical weblog of Davide Espertini, a web developer located in Milano, Italy. He talk about ASP.Net, JavaScript, BlogEngine, DotNetNuke, Design, JQuery and much more about the IT world.

  • Joseph Wilk

    Joseph Wilk on AI, The Web, Usability & Software process

  • Thushan Fernando Uncut

    Not Even Remotely Dorky thoughts from a Windows/Linux, .NET, C/C++ & Java software developer. From computer software, programming and hardware to motorshows and travel to various countries.

Related podcasts

  • The State of IronRuby

    In this episode, I talk with Aaron Junod and Michael Letterle on the state of the IronRuby project for the .NET framework.This episode of the Alt.NET Podcast is brought to you by Red Gate's ANTS Profiler. First-class developers insist on knowing how their code performs before releasing to t...

We'd love to hear what you think! Submit ideas or give us feedback