NHibernate missing or invalid object exceptions, with two databases
Currently, I’m working on a project which involves working with SqLite databases, and one of them is reserved for Undo operations, that is to say, the current state of an object in the main database is...
View ArticleAdding Business rules to your DAOs with Repository.
So if you have a series of POCOs, and like a good developer you’re using some nice ORM like NHibernate or Entity framework, and you have a Repository pattern going on, but now you want to add in...
View ArticleLogic teasers, Edition 2;
Reposted from : http://ayende.com/blog/163394/new-interview-question?Key=ba723523-5252-4377-8c54-239026db23e5 Given a finite set of unique numbers, find all the runs in the set. Runs are 1 or more...
View ArticleCodility Challenges
Well it’s been ages since I last posted, but I’m less busy than usual these next weeks. So what I’m doing is following through on my current obsession with Codility. I’ll be posting the results of my...
View ArticleRandomness in SQL (or lack thereof)
In case you didn’t know, SQL Server’s RAND() function is a bit of a joke. For a given seed value it will continually return the same number. Greeeeeat. So, here’s my implementation. /* Author : Mel...
View ArticleRed Gate Rant
God dammit Red Gate!! Why would I invest in a database comparison tool when a) it takes over 45 minutes of my time to do the comparison and b) by the time it finishes it has generated...
View ArticleMicroGoals, RockyTasks, and getting things done
I’m feeling a bit woozy today, as I ‘m having an operation done, but also a leetle bit… Talkative. I’ve recently begun a few separate changes in my life, i.e. this month: Moved job, away from FS into...
View ArticleSilly old VS2013 and XML Serialization
So had a bit of a gotcha this morning which cost me a good twenty minutes and some little anger. I kept getting an error when compiling in release mode – Could not find file...
View ArticleScript for sorting your photos
Quick one this, and apologies for not posting for ages; I’ve been busy. I love Dropbox camera upload; I come home from a trip, all photo’d up, and my iPhone syncs to my PC automagically. With a...
View ArticleLogic teasers, Edition 2;
Reposted from : http://ayende.com/blog/163394/new-interview-question?Key=ba723523-5252-4377-8c54-239026db23e5 Given a finite set of unique numbers, find all the runs in the set. Runs are 1 or more...
View ArticleLogic Teasers; Editions 1; Linked Lists
This begins a series of posts where I drop little logic and core programming questions which I come across as a kind of repository for the little brain teasers that I come across in my daily life and...
View ArticleApprenticeships ensure that young people in Switzerland are employable
Reblogged from Quartz: Imagine a teenager advising a hedge fund client or running a retail phone store. It may sound like a class project, but at Credit Suisse and Swisscom, up to 800 teens take on...
View ArticleYield keyword in C# – an illustrated example
So I was asked the other day about the Yield keyword in C#, specifically, “What’s the idea” with it? It seems there are quite a few who have never used it, simply because the intent isn’t totally...
View ArticleBit reversing in C#, Part 2
So further to my exposition of Part 1 of the series, I’d like to further elucidate the reason why I think this is a worthwhile pursuit; 1. When was the last time anyone asked you to do bitshifting in...
View ArticleBit reversing in C#, Part 1
So I recently had a discussion (read: interview) with an eminent member of Microsoft Ireland* where we discussed bit-reversing in C#. To be clear, I have no dealings with this level of code on a...
View ArticleVisual Studio 2012 Shouty menus
If you’ can’t stand the all upper case menus(TEAM!! YEAH, GO, TEAM!!) in Visual Studio 2012, here’s a way to get rid of this unsightly blight on Microsoft’s latest offering; Pop open rededit and create...
View ArticleQuickSort in Python
Just thought I’d post this little snippet to illustrate the facility with which array and list functions can be performed in Python, as opposed to classical languages like C++ Here’s a QuickSort...
View ArticleInt32 RangeTo() method
This little snippet, inspired by Ruby’s Range() method, allows you to do stuff like this; foreach (int rownum in 0.RangeTo(1)) { //dostuff } I haven’t done any performance metrics yet, but I like the...
View ArticleFluentSQL
This is my stab at a fluent interface for accessing SQL objects, using a minimum of fuss. It is strictly a work in progress, however, I mean to extend it. Somehow I never seem to be able to get away...
View ArticleObjectContextExtensions
This is a class of some useful extensions for the ObjectContext which make it more maintainable. I’ve always hated having to use strings in code and the ApplyCurrentValues method uses them. This code...
View Article