Geeks With Blogs
Bob Palmer's Developer Blog .NET, SQL, and Silverlight Development February 2010 Entries
C# - Quickly determining the Factors of a given number
This is another quick code snippet to help those working through Project Euler problems. A very common part of a problem involves factors or the counting of factors. This snippet below will make quick work of getting a list of a given integer's factors. Enjoy! private static IEnumerable<int> GetFactors(int num) { //Given anumber (num), return a list of all of it's //factors. //We're going to grab this from both ends, since a given factor //divided by our number will yield a second factor. for ......

Posted On Saturday, February 27, 2010 3:11 PM

How I came to embrace horrible code...
Today I'm working on some absolutely horrible code. And I'm completely ok with that. As a professional app developer, I've always felt that it's our responsibility to keep up with changes in technology, learn new things, and always focus on improving our skillset. And I'll add to that the caveat that the best place to learn these new technologies is not when you're trying to use them to save a floundering project, and certainly not when you're pressed to deploy a world class application for your ......

Posted On Sunday, February 21, 2010 1:58 PM

Calculating prime numbers in C#
For anyone participating in Project Euler, one of the first algorithms you will find yourself needing again and again is a good prime number calculator. One of the most efficient algorithms (and one that's very easy to code for) is the Sieve of Eratosthenes. I would recommend hitting this link for a quick review if you are not already familiar with it, since it does a great job of explaining how this algorithm works.Since I needed this routine for my own calculations, I've included it here to hopefully ......

Posted On Sunday, February 14, 2010 8:59 AM

Copyright © BobPalmer | Powered by: GeeksWithBlogs.net