Thursday, 28 November 2013

Fluent with Enumerations

fluent-nhibernateCurrently investigating the usage of nHibernate (fluently) as an ORM to be used within our software. First impressions are that I like it a lot. I feel that we should have made this move a long time ago but sometimes with the  time constraints its not always feasible to stray from well trodden paths… Currently flying at plenty of new tech though so expect plenty of postings!

Whilst putting together my first sample classes I came across a small gotcha whilst defining my LogonClass and retrieving the associated data. Code snippets follow:-

Read full blog here.

Written by Conrad Rowlands, Senior Systems Architect and Developer, DSCallards.

XML Schema Validation Issues

Working on one of our long term projects recently I came across a gotcha that I have never encountered before when working with Xml Schema documents. Whilst researching and correcting this issue I have subsequently seen a lot of other people making the same mistake on many other forums and so I thought I should share. The issue arose when I had a loaded Xml document that I subsequently wished to validate against a schema that we have defined, fine I thought, I will use the following code….  More.

Written by Conrad Rowlands, Senior Systems Architect and Developer, DSCallards.

Thursday, 7 November 2013

Float Like a Butterfly ... Errr




floatlab



 
I know, I know…., in an ideal world we’d all have the latest and greatest browsers but in the real world companies are not so ‘lithe’ when it comes IT infrastructure.

Recently whilst putting a .NET web project to bed we had some reports from the field of some rendering issues with Internet Explorer 7.  Of course we had tested IE 7 using the compatibility modes present within later versions of IE but seemingly this does not throw up many issues that arise in the ‘real’ browser.  


One such issue being reported has been recorded in my blog, here.

Written by Conrad Rowlands, Senior Systems Architect and Developer, DSCallards.

Theory of Relativity


Recently whilst putting a .NET web project to bed we had yet more reports from the field of some rendering issues with Internet Explorer 7.  Of course we had tested IE 7 using the compatibility modes present within later versions of IE but seemingly this does not throw up many issues that arise in the ‘real’ browser.

Relativity-formulaI know, I know…., in an ideal world we’d all have the latest and greatest browsers but in the real world companies are not so ‘lithe’ when it comes IT infrastructure.

The issue being reported was that one form displaying an accordion control, which in turn had embedded within it a scrollable div which in turn contained three or four divs as well as a JQGrid was having ‘issues of parentage’… When the main scrollable div was being scrolled all underlying divs were being rendered correctly and scrolling with the content whilst the JQGrid was not moving at all, just merely floating in space and generally getting in the way. After a lot of digging I found the following solution that cured my issues:- The main HTML was defined thus







  with the ‘QuestionnaireGrid’ being the location that the javascript JQGrid is rendered into, The issue however seems to lie with the parent div and not the JQGrid itself, what I needed to do was attach a style via the css to the ‘QuestionnaireGridContainer’ div like thus:
 
 


 
This ‘position:relative’ style  in this instance seems to explicitly force all children objects to behave correctly with regard to their location within time and space and now when i scroll my div content all child objects are scrolled exactly as I would expect.

Written by:  Conrad Rowlands, Senior Systems Architect and Developer, DSCallards

Wednesday, 16 October 2013

Sending Error Mail from Elmah



As part of a recent release of a web application we decided that in order to make the best use of error logs being created by Elmah we should email these to stakeholders as and when they happen to improve the general response times. Here is how we set up ‘that thing’ in our .NET MVC4 application! The red sections indicate properties that were either added or edited to enable the email functionality and green section indicate those fields you will need to change to reflect your choice of smtp server.

Click here for the full blog.

Written by:  Conrad Rowlands, Senior Systems Architect and Developer, DSCallards,

Displaying Alternative Coloured Images in JQ Grid


RedAmberGreenWhilst coding up a recent .NET MVC application built heavily using JQGrid I came across a requirement which to be honest I struggled with at first . In short I wanted to, on a column by column basis, colorise the icons that were to be displayed. Now JQGrid supports a icon colorset which seemingly cannot be changed easily so in the end I had to resort to changing the styles. Here is how I achieved this, warts and all….


Firstly of course JQGrid uses the standard set of JQuery Ui Icons to provide its user interface. I say ‘Icons’ but this is of course provided as one image which is broken up into sprites of 16 x 16 pixels, more of that later. So the first step is to download the set of colour icons that you require…. JQueryUI.com provides a standard set of these icons rolled in every colour you can dream so its in fact very easy. The hardest part is arriving at your chosen colours!

Click here for the full blog.

Written by:  Conrad Rowlands, Senior Systems Architect and Develope, DSCallards


The Piece of Wood and Full Possession of the Facts


 Wood


Now I can’t lie to you, I’m not an insanely practical man….. When it comes to home repairs and the like I’d prefer to pay a man (or woman) who knows what they are doing to do the job; They won’t swear half as much, will generally get the job done without resort to every ill fitting tool in my toolbox, without the use of a calendar and they’ll also have an understanding of the problems that are likely to be encountered on the way. More importantly they’ll plan to avoid the potential issues. (in)Famously I once tweeted that ‘there are only so many ways that 15 pieces of wood can be put together to make a wardrobe, I know because I’ve tried all the others!’

I once knew a guy who was immensely practical, being a general builder for much of his life I asked, and he agreed, to assist me with repairing some windows as I wanted to learn; maybe I could become self sufficient in all my windowing needs and move onto doors and the like… possibly take over the world, I don’t know what I was thinking. Anyway we first needed some strips of wood to replace the pieces that we were going to have to break in repairing the window. How hard could this be? I mean it’s just a piece of wood right, so long as the dimensions are fine and it looks clean…. However I was aware of time passing as we stood in the local ‘shed’ looking at various seemingly identical pieces of strip wood. After he had discarded what seemed like the 7th identical piece I asked what he was doing… I don’t remember his exact response but I do remember that he was particularly keen to ensure that the grain of the wood was absolutely as he needed for a good deal many reasons. It was at this point that my practical life in windows was curtailed as there was clearly way more to think about that I had previously imagined.

I know what you re thinking….. no code snippets in a developer blog? The answer this week is a resounding No! Before one line of code can be written the problem MUST be understood in it’s entirety, you can’t code for a problem until you understand the problem and you can’t code a solution unless you understand how your chosen platform allows you to best solve a problem, well you could but like with the window if we’d used just any piece of wood it would likely have just broken midway through the job.

I guess you can sum this post up in one word ‘Experience.’

Written by:  Conrad Rowlands, Senior Systems Architect and Developer, DSCallards