2007-04-15 - Architecture Camp 2007

Well it's over - and it's been great!

First off Architecture Camp 2007 was a lot of fun to present at this weekend... the relaxed nature and opportunities for everyone to talk, rather than just listening, was great - a nice soft introduction to a newbie presenter such as myself!

And a big hat-tip to all the guys who helped put this together, including Alex James, Kurt (where's your blog boy!) and Chris + all the other presenters.

The thing I liked the most about this event was the number of people who brought their a-game... damn but there were some seriously experienced and intelligent guys in the audience, asking great questions - contrasted with the often pointless heckling and misguided questioning you can get at events like teched, this event was great ... if you couldn't make it, definitely try to get to the next architecture camp, and if you were a no-show ... shame on you!

I'm still not 100% sure if my session got recorded or not, but if it did, I'll point you to it at some point...  in the mean time - here's the presentation itself in both pdf and pptx (powerpoint 2007) formats.

Read More

Codeplex... Damned if you do... Damned if you dont...

In a follow up to this  post I made yesterday, it seems some people are annoyed that a Codeplex command line client exists at all...

I still can not help but feel some people are missing the point of Codeplex all together... as I see it (and these are only my opinions on the matter) - Codeplex:
  • Supersedes the aging gotdotnet.
  • Demonstrates TFS features
    • Scalability for high volumes of users (not necessarily usability, but they're working on that)
    • Case study for any large organizations considering deploying it across their organization.

  • Provides a place Microsoft can.
    • Host open-source projects for life.

    • Control and support the environment.
    • Keep a single message across their organization - we use TFS for source control from now on.

(At this point it's worth noting I'm a SVN/Trac/CC.Net guy myself... I can't actually justify the expenses of TFS at the moment)

For me the reasons to use codeplex over another open source provider are simply:

  • It's different / new.
  • It has a strong Microsoft / .Net focus.
  • It's easier to get going for a newbie .Net developer (integrated source control in VS.Net, simple wiki pages baked-in)
  • You can play with TFS.

They are reasons, but hardly "compelling" ones ;o)

The beta command line client is a good thing, but to counter that "6 months wasted effort" with a call to replace TFS with subversion in Codeplex ... that just seems counter-intuitive to me... suddenly you have a roll-on effect of zero integration between source control and the in-built issue tracking mechanisms... so what, lets replace that with Trac??... and now that comes with it's own wiki... so ditch the existing one... and suddenly Codeplex is nothing more then a shell for managing file releases with some forums.

What kind of message would it send to microsoft customers who have invested time and effort into team system... let's be reasonable, it's just not going to happen, so whats the next logical step... improve the tooling to work with the existing source control solution... first step to achieving that... build a decent command line client!

So... if you are looking for subversion based hosting why not use well established players who have been supporting open source from the beginning like SourceForge or tigris... don't they still deserve your love now more then ever since Codeplex is on the scene... what better way to vote than with your choice of OSS project hosting?

Codeplex is an alternative, not a replacement, for the likes of Sourceforge... perhaps what we need is a OssHostMatrix, much like WikiMatrix that compares
feature for feature so you can pick the host that's appropriate to your project on features alone, rather then bitching about what's missing in Codeplex, when it's freely available elsewhere...

I'm starting to feel sorry for some of the codeplex guys (like

Jonathan Wanagel, who I commend for being vocal about what's going on at codeplex... he seems to pop up on a lot of blogs I read) ... they certainly do seem a little damned if you, damned if you don't at the moment - especially when progress is slowly being made and demonstrated.

Read More

Some notes on creating your own license keys

If you have to make your own license keys i.e.


Here's some thoughts/ideas for things you can do to break up the key space a little so people can not easily brute-force your keys by fiddliing just a couple of numbers.

  • Select a range of numbers and letters that can be directly mapped to 32 values (10 digits and 22 alpha maybe?).
  • Know your maths.. creating helper classes for unpacking and packing bytes will help.
  • In this example you could carry 125bits (15 bytes and just over a nibble ;o) ... or 13 bytes + CRC16 (or Maybe an Adler16).
  • Use lookup tables to translate sequential values into pseudo-random values.
  • Break any multi-byte values up into individual bytes, stuff em around your payload of bytes in non-sequential offsets.
  • Calculate the CRC for your payload and include it as part of the key's data, verify it when you're decoding.
  • You can use structs with a sequential layout and a packing of 1 to define your structure...
  • Use Marshal.Copy etc. methods to copy between the struct and a byte array.
  • Remap individual bits in the overall payload.

The last one is something that works really well... it's hard
to avoid certain digits "sticking" when generating sequential keys
no matter what you do... but if you remap the individual bits of a
15 byte array (i.e. using a lookup table containing 120 indexes)
you end up with very unique looking keys that have no sequential behaviour to them (especially if you redistribute the bits of the CRC into all the bytes of the key, which in turn are repacked into 5 bit letters).
Read More

New codplex TFS command line client

Cast your mind back...

If you recall (maybe you don't) there was some discussion a while
back about Codplex, TFS and the fact that it's a bit of a wash for creating an collaborative environment for an open source project... why?  Well because of the chasm between developers for the project and those users who wish to collaborate by providing small patches, or working on the bleeding edge (i.e. checking out changes since the last time they build your project from source)

Just to recap the big problems were:

  • No support for patches
  • No anonymous check-outs
  • No easy way to diff/merge between your version and the latest version on source control (because you could only get the source as a tarball).

In particular I remember Ayendes posts on the subject, which sparked a bit of debate on the whole issue (and even got some feedback from the codeplex developers themselves...)

Codeplex's new command line client

Well it looks like one small step has been taken this week, check out this
on the codeplex blog ... There is now a .Net 2.0 command-line client being developed, which will include support for:
  • Anonymous checkouts (hurray! dragging down a tar ball every time there were changes... what an arse that is/was)
  • Merging
  • Patching

I got all excited (well as excited as you can be about a command line client for TFS) and grabbed the beta... really all I cared about was anonymous checkouts... I like my open source medium rare (mmm... nothing like a fresh check-out of castle... release candidates
never have any of the fun stuff!)

But my hopes were dashed - it appears there's no way to skip the authorisation check as far as I can see, and when supplying my own credentials I didn't have access:


cpc co reflectoraddins:/ c:devresourcesreflector


Username [sndanonymous_cp]: bittercoder

Password for bittercoder: ********

error: TF50309: You do not have sufficient permissions to perform
this operation

. ---> Attempted to perform an unauthorized operation.

I guess there's a little more waiting to go yet...

Still, not to get too disheartended I decided to try it on a project I coordinate for (ye olde Splicer...) and I can certainly confirm it works... considering that the command line tools are less than 200K, this is already a great improvement over the current situtation... (about 250mb to download Team Explorer's iso).


cpc co splicer:/ c:devhomesplicer_copy

A    c:devhomesplicer_copy

A    c:devhomesplicer_copysrc

A    c:devhomesplicer_copysrcASL - Apache
Software Foundation License.txt

.... and so on ;o)

So as you can see ... it does work... but I have to say it's pretty damn slow (could just be because I'm in New Zealand of course).

At any rate... I'll be keeping my eye on it... there may be hope for codeplex yet ;o)

... and on one last note... the gui check-in looks a little like TortoiseSVN don't you think...  hopefully the work towards some feature parity there.

Read More

Active Record & NHibernate User Types...

I've got a little project on at the moment which I chose to use ActiveRecord for... this is for a "legacy" database where there are existing nightly data warehousing scripts written against it... The cost of changing the database structure and tables is potentially quite high (it has run on effects to other systems, potentially effects SLA's when the nightly scripts fail.. and a small project ends up having a big impact)

At any rate, I'm just consuming the existing database as-is... which includes a single character status columns i.e. "A" for active, "P" for pending etc... after poking round with a few solutions I ended up creating an NHibernate custom type... first off, this was surprisingly easy... but it annoyed me a little that I had to create a different custom type for each set of enumerated values, and that this information was no longer declarative, compared to the rest of the ActiveRecord implementation...

So I took a few minutes to re-write it as generic solution to the problem today... which at least solves the declarative problem... first off, here's a property with the custom type applied - nothing amazing here, but notice the type is generic... with the type of status field itself qualifying the generic custom type...

[Property("dBlrStatus", "App.Model.MappedEnumerationHibernateType`1[[App.Model.Status, App.Model]], App.Model")]
public virtual Status Status {
get { return _status; }
set { _status = value; }

We then declare the mappings on the enumeration itself...

public enum Status
[MapToCharacters('A', 'a', '+')]
[MapToCharacters('I', 'i', '-')]

I think this is a good fit for ActiveRecord... If anyone wants the code at some point just leave a comment and I'll package it up and post it... it's pretty elementary stuff, though it might save some time if you wanted to re-implement it yourself...

Read More