Problems Clojure thinks I have with C#
I am reading “Joy Of Clojure”. It seems like a good book, but it keeps telling me about these problems I have which I don’t percieve as problems.
I am reading “Joy Of Clojure”. It seems like a good book, but it keeps telling me about these problems I have which I don’t percieve as problems.
July 5, 2011 · c# postsharp aop
This comes in handy sometimes.
April 12, 2011 · attribute-based-caching c#
David Cookery did a short write up of my AOP caching framework on infoQ. As a result downloads and usage have spiked.
January 29, 2011 · attribute-based-caching c# release
Attribute Based Caching 1.2 has been Released. It’s still the .net only caching library that has declarative cache invalidation.
Attribute Based Caching 1.1 had almost 100 downloads! Release 1.2 contains some small improvements like disk based cache and a time-to-live setting.
November 20, 2010 · parser parser-combinator antlr parsec f# c# nparsec
Haskell has parsec, f# has fparsec. I went searching for a good option for creating parsers in c#.
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210
What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
Discover the largest product of five consecutive digits in the 1000-digit number.
October 26, 2010 · c# attribute-based-caching
“There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors.”
I am a big fan of postsharp and its creator Gael. There are a number of examples floating around of doing caching with postsharp. However, none handled cache invalidation in a nice declarative way.
Problem 3: What is the largest prime factor of the number 600851475143 ?
With enough extension methods we can make 3 really simple:
600851475143.LargestPrimeFactor()
Where:
October 9, 2010 · c# NakedObjectsFramework
If you would like to expose the results of an entity framework call as the index page or any other get based url using naked object mvc, a custom controller is required.
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
Here is my solution to the following project Euler Problem:
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
Ok, this one is stupidly simple:
var squaredsum = Math.Pow(1.To(100).Sum(), 2);
var sumedsquare = 1.To(100).Select(x => x * x).Sum();
Console.WriteLine(squaredsum - sumedsquare);