Conditional Sql parameters with nHibernate

The problem is a the nHibernate’s CreateSqlQuery needs a complete sql string to be created, but you can’t create a string until you’ve evaluated the parameters. The only work around is to evaluate the conditional parameters to create the sql string to create the nHibernate session and then revaluate the parameters again to add them…

A Simple Guide to Finding Your Next Job

It’s time to look for the next job, eh? I feel for you. Finding a job sucks. It’s one of those things that everyone must do at some point. I equate it to looking for love. Every aspect of “you” is on display. When someone passes on you, it’s hard not to take it personally….

Crystal Reports 13 Maximum Report Processing Limit Reached Workaround

In the Visual Studio 2012 version of Crystal Reports 13 there is a threshold that throttles concurrent reports, this also includes subreports, to 75 reports across a machine. This means if there are 5 web applications on a given server all opened reports across all 5 web applications counts toward the 75 report limit. The…

Considerations When Throwing Exceptions

A co-worker sent an email with some code he’s struggling with. He’s trying to avoid using try/catches to drive business logic. The problem is not the try/catches it’s simply a symptom of the problem. Can you spot the problem? You’ll have to make some assumption, but I have faith you’ll come to the same conclusion…

When are you a Senior Developer?

When I hear “Senior Developer” I think of someone who has mastered programming. I think of a person who can design, code and test a system. They can talk to system architecture or component design. They understand and use design patterns. This person can anticipate the performance bottlenecks, but knows not to pre-optimize. This person…

Setting up Single Sign On with Windows 2012 and ASP.Net MVC 4

Requirements Windows 2012 AD FS 2.0 Feature installed ASP.Net MVC 4.0 Valid SSL certs Visual Studio 2012 This document covers setting up an ASP.NET MVC 4.0 application using Visual Studio 2012, Windows 2012 and AD FS 2.0 to enable Web Single Sign On. It’s important to have valid SSL certificates. Self signed certificates will not…

Creating a Generic Type at Runtime

I have a type (at runtime), I want to use it with an IOC container (in this case StructureMap) to find a generic implementation using this type. How do I do that? It’s simpler than you’d think: Type genericType = typeof (AbstractValidator); Type type = genericType.MakeGenericType(bindingContext.ModelType); //Structure Map container var instance = _container.GetInstance(type);

Deploying with MsDeploy Outside of Visual Studio

Building the msdeploy package with MSBuild. This requires MsDeploy to be installed on the build machine. MSBUILD /T:Package /P:Configuration=QA;PackageLocation=”C:\Build\Artifacts\eserve\DEV\QA\QA.zip” Deploying the package with MsDeploy to a web site How to get the msdeploy command. -source:package=’C:BuildArtifactseserveDEVQAQA.zip’ -dest:auto,ComputerName=’https://eserve-dev.sacda.org:8172/MsDeploy.axd?site=eserve-dev’,UserName=’conwayc’,Password=’austin_1′,IncludeAcls=’False’,AuthType=’Basic’ -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -retryAttempts=2 Copying the package with ROBOCOPY Copying the package to another folder with robocopy…

All UTC times are not necessarily the same

A friend pointed out that all UTC Time is not the same. When he told me, I responded with “What!?! What are you talking about? It’s the same.” “No it’s not” he said. He explained, that yes using UTC will allot you an agreed upon time format but that does not guarantee that both server’s…

2 minutes on Migrating Data

I had a great talk with my friend Dave today. He’s a Data Scientist. He knows his stuff, for sure. We talked about a number of things, but one that really stuck out was data migration. He says never to migrate via code, use a tool. You are reinventing the wheel. You are locked into…