There are plenty of mocking frameworks out there, with Rhino Mocks and Moq leading the way. Personal preferences aside, I am currently working on a project that is using NMock2 for mocking and found that the following feature isn’t very well known. In the process of adding unit tests to some legacy code, before IContinue reading “Get NMock2 to Return Out Params”
AJAX Ready State Codes
If you are hand-cranking an AJAX request, you’ll be looking for a Ready State of 4 and a Status of 200. But what other Ready State Codes are there and what do they mean? request.onreadystatechange = function () { alert(“readyState: ” + request.readyState); }; 0. Uninitialized 1. Set up, but not sent 2. Sent 3.Continue reading “AJAX Ready State Codes”
Firefox About URI Schema
The “about:” URI schema has been around since the days of Netscape, but there is more to it than the common “about:blank” reference for an empty page. Some of these options give you an advanced view over Firefox and its cache – and others a just a bit of entertainment. Here is a list ofContinue reading “Firefox About URI Schema”
Auto Load Your PHP Classes
In PHP you can create classes to organise your code and represent objects that you want to pass around. This has long been a feature of other languages and was a fundamentally important step forward for PHP. There was one thing, though, that I didn’t like about PHP classes. If I wanted to instantiate aContinue reading “Auto Load Your PHP Classes”
The Specified Directory Service Attribute or Value Does Not Exist
“The specified directory service attribute or value does not exist” If you’ve come across this problem while trying to use Active Directory, you may well be dancing the double-hop. This issue can occur when you switch on “Integrated Windows Authentication” in IIS and then try to get some information from Active Directory for the logged-inContinue reading “The Specified Directory Service Attribute or Value Does Not Exist”
Search Titles Only with Windows Search
Revised, July 2014. Just a note to say this still works on later versions of windows, so although this article talks about the old Windows Search – give these tricks a go! If you’ve got your hands on Windows Search (formally known as “Windows Desktop Search”), you’ll probably agree that it is much better andContinue reading “Search Titles Only with Windows Search”
Find Out Who is Logged In to a Server and Kick Them Off
If you remote onto a Windows server with any kind of regularity, you will probably have come across a scenario where the number of concurrent connections has reached the limit. This is often followed by shouting across the office or sending an email asking people if they are connected and whether they can log offContinue reading “Find Out Who is Logged In to a Server and Kick Them Off”
Steve Fenton and Stephen Fenton Roll Call
This is just a brief article to give a who’s who of people named Steve or Stephen Fenton the world over and gives you an idea of where to find some other sources of Steve Fenton genius. If you are another Steve or Stephen Fenton who would like a shout on this page, just getContinue reading “Steve Fenton and Stephen Fenton Roll Call”
JavaScript and Noisy HTML
I was answering a question on a popular coding forum and it once again highlighted the age old problem of terribly bad JavaScript. This was the HTML code in question: <a id=”image1″ href=”#”><img src=”image.png”></a> And there was a bit of JavaScript adding an onclick event to the anchor tag. An innocent looking example. An anchorContinue reading “JavaScript and Noisy HTML”
JavaScript Namespacing
This is just a quick article to demonstrate a quick bit of JavaScript namespacing. Why would you do this? Well, this allows you to put functions and variables inside of an identifier. It acts like a “box of stuff” and prevents variable and function name conflicts. It also supplies a neat way to organise andContinue reading “JavaScript Namespacing”