Free ebook on Parallel Programming with .Net
Stumbled upon this: http://msdn.microsoft.com/en-us/library/ff963553.aspx Enjoy!
Stumbled upon this: http://msdn.microsoft.com/en-us/library/ff963553.aspx Enjoy!
Most C# developers will know what “public”, “private”, “protected” and “internal” access modifiers mean and would have had to use them in their code, but rarely do we come across the “protected internal” access modifier. Now, protected means the type or member can be accessed by derived classes, NOT restricted to the same assembly, whereas …
Stumbled across ic#code‘s free ebook ‘The fine art of commenting’ this morning, it’s from 2002 but everything still applies, you can download it here. The book covers commenting in general and not just C#, but in relation to C# here’s the list of the predefined xml tags you can use in comments (something I have …
Having spent quite a bit of time coding in F# recently I have thoroughly enjoyed the experience of coding in a functional style and come to really like the fact you can do so much with so little code. One of the counter-claims against F# has always been the concerns over performance in the most …
Performance Test – Prime numbers with LINQ vs PLINQ vs F# Read More »
Ever tried to use IEnumerable<T>.Sum on an array of unsigned long integers? Well, you can’t, because the Sum method has not been implemented for ulong or ulong?, so to fill in the gap here’s the extension methods you need using more or less the same code as the existing Sum methods: I used some custom …
Extension methods to sum IEnumerable(ulong) and IEnumerable(ulong?) Read More »
Occasionally you might want to make the value of a static or instance field local to a thread (i.e. each thread holds an independent copy of the field), what you need in this case, is a thread-local storage. In C#, there are mainly two ways to do this. ThreadStatic You can mark a field with …
Problem In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way: High Card: Highest value card. One Pair: Two cards of the same value. Two Pairs: Two different pairs. Three of a Kind: Three cards of the same value. Straight: All cards are …
Problem The rules for writing Roman numerals allow for many ways of writing each number (see FAQ:Roman Numerals). However, there is always a “best” way of writing a particular number. For example, the following represent all of the legitimate ways of writing the number sixteen: IIIIIIIIIIIIIIII VIIIIIIIIIII VVIIIIII XIIIIII VVVI XVI The last example being …
Problem Consider quadratic Diophantine equations of the form: x2 – Dy2 = 1 For example, when D=13, the minimal solution in x is 6492 – 13×1802 = 1. It can be assumed that there are no solutions in positive integers when D is square. By finding minimal solutions in x for D = {2, 3, …
Oh, the Pain! Now and again we all come across an object which requires initialization before it can be used but with nothing there to stop us from trying to use it before it’s initialized. In most cases you will get a seemingly unrelated exception (e.g. null reference when the object tries to use some …
By continuing to use the site, you agree to the use of cookies. more information
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.