Skip to content

Instantly share code, notes, and snippets.

@winkel
winkel / MazoviaEncoding.cs
Created April 23, 2012 21:46
Mazovia Encoding class
using System;
using System.Collections.Generic;
using System.Text;
namespace System.Text
{
/// <summary>
/// This class was generated by a tool. For more information, visit
/// http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator
/// </summary>
@winkel
winkel / gist:760149
Created December 30, 2010 19:07
Prime numbers
class Sieve
{
public static List<int> GetPrimeNumbers(int maxValue)
{
List<int> primeNumbers = new List<int>(new int[] { 2, 3, 5 });
for (var testValue = primeNumbers.Max() + 1; testValue <= maxValue; testValue++)
{
int sqrtTestValue = (int)Math.Floor(Math.Sqrt(testValue));
bool isPrime = true;