web 2.0

BlogEngine.Net

A while I had a problem with my old blog at goinsane, and as I was now posting regularly at devlicio.us I didn’t pay it too much attention. Recently I have had a few people contacting me about my old site not working, so I figured I best get it up and running properly.

Looking around at blog software, I went through the usual suspects including DasBlog which I used to use. Great piece of software that DasBlog is, I kept finding references to BlogEngine.Net so I thought I would give it a try.

The software itself was simplicity to get up and running, far easier than I remember it was with DasBlog, and a whole world of pain less that Community Server. Pretty much an FTP to my host, and I had a blog up and running.

After playing around a while I found a few things were annoying me, so I looked to get those sorted out.

Code Formatting

This has always been a problem, due to the peculiar way markup works, and due to various addins, I can never seem to get code quite the way I would like. On devlicio.us I have been using the formatter from manoli.net but this often has quirks.

BlogEngine.Net has a version of the manoli formatter built in as an extension (extensions are a really cool idea in BlogEngine), but it wasn’t quite working for me – sometimes my code formatted one way, sometimes another. It turns out that this has been mentioned a few times in various places, and it seems the built in extension is a little picky on how things are formatted.

After a bit of searching I came across SyntaxHighlighter, but the theme I had chosen to use doesn’t like <pre> tags too much. A little more searching and I came across an alternative SyntaxHighlighter for BlogEngine.Net on CodePlex. This one was much simpler to install – just copy over the .cs files to your extensions folder, replacing the built in formatter. And it looks great:

 

TinyMCE to FCKEditor

Now my next annoyance, TinyMCE is the chosen editor in BlogEngine.Net, and one of the things TinyMCE does badly is let you put in the tags to get the syntax highlighting working.

Luckily, it is pretty easy to replace the editor in BlogEngine.net, and so I searched around and found some pretty good instructions. Fifteen minutes later and my editor was replaced.

Conclusion

All in all, BlogEngine.Net has been a delight to setup, and although my main blog will remain at devlicio.us, I will now try and ensure I cross post to my own domain just to keep Google happy.

If you need to get a blog up and running on your own domain, you should certainly check BlogEngine.Net out

Currently rated 3.7 by 3 people

  • Currently 3.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

BlogEngine.NET

Repost of Some Old Posts

A while back I was blogging at http://blog.goinsane.co.uk, using DasBlog. At this time my host had some weird settings and I never quite got things the way I wanted.

The guys at devlicio.us kindly invited me to join them, and I was happy to join a very prestigious bunch of guys – so I moved my blog there. My old blog continued to remain on http://blog.goinsane.co.uk, until recently when I managed to trash it and lose all the posts – some of which I hadn’t copies to devlicio.us. It happens that this site had a fair bit of Google traffic previously, and I have had a few requests from people who got an annoying 404.

Last week I was playing with BlogEngine.Net and fancied getting it up and running – it turned out to be a really nice, friendly piece of software, and so soon my old blog was up and running – minus all the old posts unfortunately.

So I have re-posted some of the ones I consider less trivial and more useful, some of these have proved very popular reading in the past. From now I’ll keep both blogs running, that way my rants can be found more easily!

http://blog.goinsane.co.uk/blog/post/Good-Development-Practices-Basic-Reading-List.aspx

http://blog.goinsane.co.uk/blog/post/Measuring-Progress.aspx

http://blog.goinsane.co.uk/blog/post/Statistics-and-How-They-Lie.aspx

http://blog.goinsane.co.uk/blog/post/What-Determines-High-Quality-Code.aspx

http://blog.goinsane.co.uk/blog/post/The-Only-Certainty-is-Change.aspx

http://blog.goinsane.co.uk/blog/post/How-to-Make-Late-Software-Even-Later.aspx

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

patterns and practices | architecture

Good Development Practices - Basic Reading List

It struck me that a good reading list is always welcome to find, and while I suspect most of these books are not entirely new to you, I thought it a good idea to list what I think is the basis of any good development library. Start with these books and you cannot go far wrong, what they teach will be valuable for many years to come.

The links go off to Amazon for information purposes, but I get no referrer fee or credits, so feel free to purchase where you find the best deal!

 

Code Complete 2Code Complete 2

There is no better book for teaching the fundamentals of good software development. This is a book that explains exactly what goes wrong in software projects, and makes excellent observations and recommendations to avoid falling into the same pitfalls over and over again.

 


Domain Driven DesignDomain Driven Design

Eric Evans has made a wonderful contribution to code design with this book, neatly encapsulating a number of OOD and OOP principles into a coherrent world he defined as Domain Driven Design. Regardless of whether you buy into DDD as a fashion accessory, this book provides masses of valuable information on how to structure and design your applications.

 

Enterprise Integration PatternsEnterprise Integration Patterns

This is a no compromise, heavy reading book on just how to put patterns into your enterprise code. It proves to be an invaluable resource when read alongside Domain Driven Design, giving well explained patterns for dealing with many of the concepts DDD puts forwards. Martin Fowler writes the forward (I put him as the author ... silly me!)

 

Patterns of Enteprise Application ArchitecturePatterns of Enterprise Application Architecture

A Martin Fowler classic, that has become almost the bible of patterns in the enterprise world. While some of the patterns here may run contrary to later evolutions and thinking, this book provides a good solid foundation of patterns at a higher (and in my opinion, more useful) level than the original GoF book did.

 

Refactoring To PatternsRefactoring to Patterns

Where most books focus on defining patterns in isolation from real code, or real usage, this book very clearly sets out to put patterns in their context in existing code bases, and provides many good approaches to refactoring code into a set of recognisable patterns. If nothing else, this book shows how to improve your own code, by showing how simple it is to make a few small changes, and increase code quality significantly.

 

Effectively Working With Legacy CodeWorking Effectively With Legacy Code

Sometimes you cannot avoid legacy code, sometimes you end up with legacy code on a new project. Michael Feathers' book is an excellent resource when trying to bring some sense of order back on to an unruly code base. At a slightly grittier level than Refactoring to Patterns, this book gives practical ways of dealing with low quality code, and either isolating it, or bringing it into some kind of order.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

patterns and practices | architecture

Frustration Friday - How NHibernate Can Waste Your Day

Well, OK I exaggerate slightly, it wasn't NHibernate that wasted most of my day, but the fact that we are having to use a slightly out of date version of 2.0 to allow us to use NHSearch.

NHibernate Search is a great piece of code, it abstracts Lucene.NET away from your application, and lets you pretty much pretend that you are dealing with NHibernate. However NHSearch has slipped a little in development behind the main NHibernate trunk.

So earlier today, one of our devs got a problem with his seemingly correct query:

var newsGroupTitles = new[] { "Steel News" };
var tagTitles = new[] { "Asia" };
var criteria = DetachedCriteria.For(typeof(Article), "article")
.CreateCriteria("article.NewsGroupList", "newsGroups")
.Add(Property.ForName("newsGroups.Title").In(newsGroupTitles))
.CreateCriteria("article.TagList", "tags")
.Add(Property.ForName("tags.Title").In(tagTitles))
.AddOrder(new Order("article.Date", true));

Well, actually that query worked just fine, until you added a simple .SetMaxResults() to it ... at which point it threw an exception and told us that the id had been duplicated in the query:

System.Data.SqlClient.SqlException : The column 'articleid' was
specified multiple times for 'query'.
The column 'articleid' was specified multiple times for 'page'.

Of course this didn't look right. So I dropped it onto the NH users group on Google, and awaited someone far more knowledgeable to point out what I had done wrong. Tuna Toksöz promptly pointed out, somewhat less than helpfully, that this was probably fixed in the last two days. Of course Tuna thought he was being very helpful - unfortunately we were running a few versions behind the trunk due to NHSearch - so I couldn't get the latest version to see this bug disappear ... my only option was very loud cursing.

So with some to and fro, and some suggestions from Ayende and Fabio, I stumbled along trying to get something to work - and as per the last time I tried, I failed miserably to get all the NH components to compile against each other, NHSearch was still the limiting factor.

Eventually Tuna provided me with the HQL version of the query we were trying to do, which alleviated my initial problem, though in a less than perfect way. But, solve the problem it did, and so it will get into our code base on Monday, and probably be semi-replicated across other entities we need to query in similar ways. BIG thanks go to Tuna!

IList result = sess.CreateQuery(
"from Article a join a.TagList tag join a.NewsGroupList newsGroup
where tag.Title in (:tagtitle) or newsGroup.Title
in (:grouptitle) order by a.Date"
)
.SetParameterList("tagtitle", tagTitles)
.SetParameterList("grouptitle", newsGroupTitles)
.SetMaxResults(15).List();

An even better result, it turns out that Ayende has NHSearch on his radar imminently (this weekend was mentioned), so I am really hopeful that I can get an up to date version of all my favourite components working in harmony again, I may even be able to put Rhino Commons back in and remove my awful home grown versions of Repository and UoW!

This has to be the biggest reason to go with a mature open-source project like NHibernate, apart from it being pretty much the market leader in it's field, it has possibly the best support network you could hope for.

For all those companies that worry that using an open-source component in their code will be risky due to lack of a "real company" backing it up, I can only say:

"that big company could never be half as effective or responsive as the community support that exists around projects like NHibernate, Castle, Moq, Rhino, xUnit, and all the other great open-source work on which I depend to help me deliver high quality software"

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

nhibernate