by Dan Matthews
29. July 2008 14:11
On our blogs, we recently found we were getting this error when trying to edit some posts: The id's given were occasionally different but it was always the same format... "Could not find category id XX in the Checkbox list which has XX items." Somehow it seems that SubText has got itself in a twist and allocated invalid category id's to the posts. I suspect that this is actually caused by a funny bug between SubText and Microsoft Live Writer. You see, when you write an article in Live Writer you can allocate the categories for it and post it up to SubText. So far, so good. However, the b...
[More]
269af0c8-96f5-4d06-8522-7445e3d6befd|0|.0
Tags:
by Dominic Zukiewicz
23. July 2008 14:23
Microsoft recently (on my birthday) released a tool to analyse coding structure and formatting. No - its not FxCop - StyleCop analyses syntactical formatting. Let me explain: Background When Microsoft released FxCop, some people cringed. I remember at my previous job when having a code review and the conversation following: Consultant: "Have you FxCop'd it?". Me: "No...." Consultant: "Hahahah - see you in 3 months!" Those days, for me anyway, have gone. I started to use it in my everyday coding and am now pleased I use it without a second thought. In my position with this com...
[More]
by Dominic Zukiewicz
23. July 2008 09:06
I was generating some test data and tried to use the RAND() function to query data. When trying this out on the Northwind database, it returned with the following result:
SELECT LastName, RAND() from Employees
LastName
(No column name)
Buchanan
0.747783
Callahan
0.747783
Davolio
0.747783
Dodsworth
0.747783
Ful...
[More]
c012da3b-5358-4847-b7ac-becccefdc8ed|0|.0
Tags:
Testing
by Dominic Zukiewicz
21. July 2008 12:14
After a trip to London to visit one of my friends who works for Rightmove - the UK's No 1 Online Housing Site and we (we meaning I) got into talking about the ways we test our code. He told me that they started to use a Test Driven Development methodology. When testing in a development environment, their test framework used something called "mock objects" - these are objects that simulate behaviour, but in reality, don't do anything! I was intrigued....
Background
One of the drawback of the development process, especially with Test Driven Development, is that there comes a stage when a larg...
[More]
3cb9f442-7584-4668-b316-61d67f97b7f8|0|.0
Tags:
Testing
by Dan Matthews
18. July 2008 08:48
I was at a client's office yesterday for the final review meeting of a two-week Use Case exercise. The particular area of the operations that we were pulling out into Use Cases had been the subject of various patchy projects within the organisation over a couple of years. As far as I can tell some of that work had been really good and laid the groundwork for the Use Cases, but it was not organised into any kind of overall picture or process and there was a certain lack of confidence in the previous projects. The concept of the Use Case approach was really quite radical for them, and the timeli...
[More]
b3c3ba68-6f61-4428-bf05-f7f2ad6120d0|0|.0
Tags:
by Dan Matthews
16. July 2008 10:11
I've been back on the Use Cases recently after a bit of a time away from them doing some fairly deep techie stuff. Every time I work with Use Cases I find myself wondering why people aren't using them more (or similar methods) because they are just such a logical way of doing things. Let's face it - who really wants to bounce around a 100 page requirements document between inboxes ad infinitum with no-one really understanding or owning it? And what IT department wants to get a document like that landing on their desks? One of the real beauties of Use Cases is how they feed into the Project Pl...
[More]
7dd0e161-eb17-4f49-984c-c567fc59ef22|0|.0
Tags:
by matt
10. July 2008 15:27
If you're using BizTalk Server maps, it is about 99.999% likely that you are using logic in them. Testing this functionality in Visual Studio can be tedious as the only way to change the test document is in the properties of the map. So if you have quite a few scenarios to test, this method sucks. BizTalk Server 2000 and 2002 allowed you to select the test document at runtime, which was nice I suppose but it still meant that you had to do it manually all the time. With the exception of either figuring out how to use BizUnit and actually deploying your solution, there are not too many ways ...
[More]
by matt
9. July 2008 09:12
I tend to spend a lot of time adding assemblies to the GAC (Global Assembly Cache) in order to run unit tests or work with BizTalk Server assemblies. Usually, I'll do this using the Visual Studio command prompt or the .Net configuration tool. I wanted to find a marginally quicker way to add assemblies to the GAC so I started to look at the 'Send To' menu. In order to add shortcuts to your 'Send To', simply navigate to the following folder: C:\Documents and Settings\<User Name>\SendTo In here you can create simple shortcuts to applications. So for example you can add a 'Send To ...
[More]
by Stephen Horsfield
4. July 2008 11:55
I'm currently conducting a due-diligence review of a technical system. The system is a classic distributed, two-tier system with data held centrally and business-logic delegated to an application tier. I've been asked to perform a security analysis as part of my review. I can't tell you anything about the project itself, for confidentiality (and security) reasons, but I thought I'd share some of the thought processes behind what I've been doing.
Reviewing security
The foremost rule of security assessment is to include the entire system. Don't just look at technical aspects of security bu...
[More]
by Dominic Zukiewicz
3. July 2008 09:45
I don’t know about you, but when I’ve seen some string comparisons, some people use:
string text = GetStringFromDB()
if( text != string.Empty )
DoThis();
This looks good, but its actually quite a long running process, as the CLR has to compare both strings character by character. It is much better to use String.IsNullOrEmpty to cater for this, or use .Length == 0 property, as this never changes and is computed when assigned. Here is what the String.IsNullOrEmpty method looks like:
public static bool IsNullOrEmpty(string value)
{
if (value != null)
{
...
[More]
by Dominic Zukiewicz
1. July 2008 15:50
When catering for null values, I use the ternary operator ?, which is used to do an inline IF statement. For example:
public void CheckText(string text)
{
if(String.IsNullOrEmpty(text))
{
throw new ArgumentException("Parameter is " + (text==null ? "null." : "empty."));
}
//Other code here
}
This would allow you to cater for 2 exception cases:
When the parameter is null, the exception message states "Parameter is null.";
When the parameter is "", the exception message states "Parameter is empty.";
Since testing for null is a fairly...
[More]
92e993a8-0fab-4b0a-9fc4-4ef09293acb8|0|.0
Tags:
Framework