RambleJam

My little rambles in cyberspace …

Entries Comments


Introduction to Composite WPF (CAL, Prism) Part 1

13 June, 2009 (20:44) | .NET / C#, WPF / XAML | No comments

I’ve just published Part 1 of my introduction to Composite WPF series of articles.  The main aim of this article was to provide a really simple illustration of how it can be used.  The subsequent parts to the application will build on the complexity of the project.

You can read the article and download the demo code on the Code Project site here:

http://www.codeproject.com/KB/WPF/IntroductionCompositeWPF.aspx

.NET 3.5 Client Profile

7 June, 2009 (19:58) | General Jamblings | No comments

This is all very welcome stuff.  I’ve already found myself fielding questions and opinions regarding the installation process for SampleSort.  It seems that many people are put off from trying out the software due to the possibility of needing the “whole shebang” of a 200mb+ download that the offline archive version of .NET 3.5 presents to end-users.

Couple that with the fact that Microsoft leaves the .NET framework as an optional update via Windows Update and you can be loosing potential users.  Not good …

However, there are solutions!!  Check out the following link for some much needed goodness:

http://windowsclient.net/wpf/wpf35/wpf-35sp1-client-profile-config-overview.aspx

Foreign Key Constraints in SqlCe

1 May, 2009 (20:31) | General Jamblings | No comments

How do you add foreign key constraints in SqlCe?  Like this:

ALTER TABLE tablename ADD CONSTRAINT FK__nameofforeignkey FOREIGN KEY (id) REFERENCES tablename(id) ON UPDATE CASCADE

How do you check it’s there?

SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS

Install SQLExpress 2008 “Access Denied” Error

28 April, 2009 (23:35) | .NET / C#, Computing | No comments

What a day!

I’ve completely lost count of the number of times I’ve tried to install SQLExpress 2008 in the last 12 hours.  It seemed like a never ending series of errors and permissions problems.  Though I have now found a solution and thought it worth blogging as it took some digging to find it.  Some of the errors were linked to SQL Server Native Client and linked to this page on microsoft.com.  I found the advice on the page was near pointless.  Some of the errors were reporting that it couldn’t make tempdb.  I also saw:

“Login failed for user … “.  Reason: Server is in single user mode. Only one administrator can connect at this time.  Error 18461

The root of the issue seems to be related to Debug Programs Policy.  Check the following policy to see what accounts have Debug permissions set:

[Start] >> [Administrative Tools] >> [Local Security Policy]

Security Settings\Local Policies\User Right Assignment\Debug Programs

You need to add any relevant accounts and/or groups to this policy.  Once you have done that, log off and then log back on again to reload the new policy settings.  Now make sure you completely un-install SQLExpress 2008 and any other bits installed along with it (apart from things like PowerShell as you need that).  Make sure you delete anything left behind in %Program Files% and from the registry.

Restart a fresh SQLExpress 2008 install, you should now get a successful installation.

Hmm …

There are lots of details of solutions to various problems on this page, including details of how to make sure your machine is clean of previous installs.  I initially came across the solution to this on a Feedback item on microsoft.com which you can read here.  As you can see from some of the discussions this really does need to be addressed.  I’ve lost a lot of time over this and it seems many others have also lost significant amounts of time on what appears to be a bit of an oversight in some ways.

Object Orientation Principles

23 April, 2009 (13:55) | .NET / C#, Computing | No comments

As I become a more rounded developer (through lack of exercise mainly) I’m starting to get more exposure to various methodologies and ways of thinking that really do make the whole development experience much more enjoyable.  There are a number of established patterns that I have used in the production of SampleSort that include things like Singleton, Model-View-Presenter, Single-Responsibility etc.

There are many, many such design patterns that you can adopt in order to solve various programming tasks, some of them take a lot of effort to fully understand whereas some just make sense as soon as you start looking at examples.  However, lately during some design tasks questions relating to actualy OO principles have come into play, something I’ve only recently started to really get into.  After identifying some things that I really needed to understand I thought I’d share some resources here.

The most obvious one of the GOF (Gang of Four) for your design patterns.  You can find a lot of really good information and examples of DPs here:

DOFactory

Here are some great links to sites that talk about pure OO principles:

Object Mentor - OO Design Principles

OODesign.com

Principles of OO Design

Sacha Barber

5 April, 2009 (20:15) | Computing, General Jamblings | 2 comments

I just finished reading Sacha Barbers latest article on CodeProject called GeoPlaces.  There are a few people publishing on the CP site which are required reading in my opinion and Sacha is one of them.  After reading this last article I left a note showing my appreciation stating that I thought Sacha should write a book.  Fortunately for us peons it looks like that message might have rang one of Sachas many bells.

Sachas articles feel like they are complete packages.  A situation or problem is devised that provides the purpose of the article and then solved using the most appropriate methods, with a good helping of other tidbits along the way (Barbers Pearls? … ahem).  To see the complete view of a system or working application is a million times more helpful or informative than bitesize code snippets that contribute to a solution.  I’ve always appreciated Sachas production of these articles, they are major works in themselves and it’s clearly all for the love of it, plain and simple.  Gotta respect that.

Working with other devs is sometimes a real chore and can seriously impact a projects ‘completeness’ or ‘correctness’ they’ll most likely write something in a way they are already versed in, other devs are obviously very passionate and dynamic in terms of the solution they end up employing for any given problem.

I reckon I know which camp Sacha is in.  I’ve worked with some devs that leave you feeling inspired to improve, and it really does wonders for your own efforts.  Since I’ve only been doing .Net for a little over a year I hope I’ll become one of them in time, meanwhile we should read all the good stuff we can hopefully we’ll be able to read Sachas offering soon!

Vote for a book from Sacha on his blog!

Oh, and I think he’s already coined a phrase … DubPF … :)

WCF Security Guidance

5 February, 2009 (11:15) | .NET / C# | No comments

Anyone working on WCF components and services really need to have a good read of this.  Its another great free resource from the Patterns & Practices folks.  Its a big PDF file with about 690 pages of great information about securing your WCF bits and pieces for production environments.

Codeplex - WCF Security Guidance Book Download

SNOW!!

2 February, 2009 (19:19) | General Jamblings | No comments

Wow, for the first time in what seems to be 20+ years we have some real snow!!  Has got in the way of a few plans that’s for sure.  Howeve, I guess that’s fine when you get to go to the park with your 9 month old daughter who has no idea what to make of it!  I’m just collating a nice photo gallery of it all.

So far its been snowing all day and we’ve had about 5-6 inches, its supposed to carry on overnight and into tomorrow as well so many, many photo opportunities are awaiting.

Think I’m going to get up very early and wonder the streets of Frome looking for good photos.

Debug - C# Express 2008

6 December, 2008 (16:19) | .NET / C#, General Jamblings | No comments

There is no doubt that C# is a great language, on top of that Microsoft have released some great IDE’s, and on top of that, some of them are FREE!  I recently considered going for a paid option as C# Express hasn’t got the full feature set of something like Visual Studio 2008 Professional (as you would expect).  The thing that I don’t understand is the rationale behind what features are taken out and what are kept for the free versions.  It seems almost arbitrary in some cases.

For instance if you right-click on a class code editor in VS2008 Pro you can see two nice options “Extract Method” and “Extract Interface”, in C# Express we only have “Extract Method” … go figure …

Anyway, one feature that really is needed and itsn’t available in C# Express is the ability to specify an external program to start when you hit debug.  If you making a composite app or are doing some unit testing with its own UI it helps greatly.  In VS2008 Pro you can simply go to the “Debug” tab on the Project Properties page and set this up.  In C# Express the Start option isn’t available, you are only presented with the “Command Line” box and bizzarely the “Working directory” selector.  You can however get around this by opening the .csproj.user file for the project you want to debug and enter in the Xml by hand. The code below is taken from a C# Express .csproj.user file for a set of tests I’m currently writing …

With this Xml placed inside the .csproj.user file I can now happily set my class library format project as the startup project in the solution and have it load the xUnit GUI whenever I hit Debug.

I do find this odd on Microsofts part. If C#Express is still capable of doing these things don’t arbitrarily remove the UI access to it and leave the functionality in the actual program. Oh well …

What’s Wrong with NASA’s IT Department??

28 August, 2008 (10:41) | Computing, Political Stuff | No comments

I don’t know if you have been following certain news items regarding NASA but I have and I really can’t work out what is going on.  It seems that someone somewhere in the chain of command really hasn’t got their eye on the ball … any ball in fact …

Firstly, in 2002 you may have heard about the case of Gary McKinnon who was caught ‘hacking’ (I’ll explain further why that’s in quotes later!) NASA computer systems.  He was attempting to find, or rather corroborate, some claims that he had found about the fact that NASA has teams of people that spend their time erasing details from official photos before general release.  These teams of people are apparently referred to as ‘Strippers’ due to their job of stripping details.

So why ‘hacking’.  I’m sure most peoples stereotypical idea of ‘computer hacking’ is some geekoid sat at a computer with streams of digits and characters flowing over their screens in order to ‘crack’ the security layer that protects the inner workings of a corporate or government computer network.  The reality is that Gary was using a tiny dial-up modem (likely running at 56kbps) which is miniscule in comparison to the now ubiquitous multi megabyte broadband connections that are popular today.  Anyone that was taking their ‘hacking’ seriously would not be using such technology.  Gary also didn’t make any attempt to hide the ‘paper trail’ of IP addresses leading back from NASA to him meaning that it was a trivial task to track him down.

However, the most important point about the hole deal is that Gary found that NASA had basically left all their machines wide open.  Computers have what are known as ‘User Accounts’.  If you use a computer at work and you have to log on, you will be logging on using a ‘User Account’.  Once you are logged on the rights and permissions associated with that account govern what you are allowed to do to that machine or the network you have logged on too.  For instance you may not be able to install software, change network settings etc … in order to perform these sorts of tasks there is a default ‘Local Administrator’ account.  These ‘Local Administrator’ accounts have full control over the machine and allow anyone logged on with this account to change any and all settings on that machine.  Gary found that the machines at the NASA facilities he ‘hacked’ HAD A BLANK ADMINISTRATORS PASSWORD … I can’t stress that enough, its amazing, its a school boy IT error to make.  At my place of work this is grounds for an internal investigation and heads would roll basically, its such a fundamental mistake that to my mind it makes NASA grossly negligent in terms of protecting its IT infrastructure.  So basically, Gary didn’t even need to ‘hack’ anything … it was left wide open … unprotected and asking for trouble.  The dictionary.com definition for hack is:

Computers. to devise or modify (a computer program), usually skillfully.

I argue that no skill is involved in order to obtain access to a computer system that is left with a blank administrator password, you don’t have to do any work at all in order to access that machine.  Bascially the person at NASA in charge of IT infrastructure security should be extremely embarrassed over this, if not sacked outright.

This isn’t all …

Yesterday I read in the news that a laptop aboard the International Space Station is infected with a W32.Gammima.AG worm!!!  And it was also admitted that this isn’t the first time!!  Our corporate network at my place of work has not had a virus infection problem in years … I personally have not had a virus infection problem in years either.  OK, its fair to say that NASA has a much higher profile that either of these examples but the virus is not targeting NASA specifically, its a well known 1 year old virus … on a laptop … floating in space … in the International Space Station.  Apparently its ‘OK’ since the laptop is not critical to any command and control operations.  I personally think that is a good thing but its also splitting hairs …

What is wrong with NASA’s IT Department??  What are they doing???

And they have the gall to extradite a UK citizen when in fact its their own utter lackadaisical excuse for IT security that is to blame …

« Older entries