.NET
Entity Framework – Generically Fetching Entities by Primary Key
Tuesday, April 10th, 2012
Recently I have come across a situation where it would be desirable to retrieve an entity based only on its type and its primary key. One possible way of doing this would be to implement and add a Find method to a partial class of each entity type. This would be possible for a small [...]
Posted in: .NET, C#, Entity Framework | No Comments »
Design-Time T4 Templates
Wednesday, December 7th, 2011
Design-time T4 text templates are a useful feature of Visual Studio that allow us to do a little meta-programming and generate code (or text) which is then compiled as part of a project. One problem I recently came up against which is nicely solved by T4 is a slight difficulty in using F#’s discriminated unions [...]
Posted in: .NET, C#, F#, T4 | No Comments »
Computing Perfect Numbers in F#
Monday, October 17th, 2011
In this (brief) post I’ll quickly look at how we can naively determine if a number is perfect using F#. A perfect number is an integer, whose proper factors sum to (where a proper factor is all the factors of except for itself). Now, a factor of is any integer, , in the set such [...]
Posted in: F#, Mathematics, Number Theory | No Comments »
F# – Sequences and Lists
Sunday, July 3rd, 2011
Two useful features of F# are its lists and sequences, both provide similar functionality but with quite drastically different implementations. A sequence is simply an alias for .NET’s IEnumerable and is therefore evaluated lazily; elements are only computed as they are needed (enumerated over). A list (despite its name) is unrelated to .NET’s List. It [...]
Posted in: .NET, F# | No Comments »
Category
- .NET (4)
- C# (2)
- Entity Framework (1)
- F# (3)
- T4 (1)
- Assembly (3)
- Magento (1)
- Mathematics (1)
- Number Theory (1)
- OS Development (2)
Archives
- May 2012
- April 2012
- December 2011
- October 2011
- July 2011
- April 2011