Sudoku solver in C#

using System; using System.Collections.Generic; using System.Text; using System.IO;   namespace SudokuSample {     class Driver     {         public static string Usage = “sudoku <filename> \r\n where <filename> is a text file containg the initial board state as a 9×9 matix of integers, zero for blanks”;         static void Main(string[] args)         {             //checking…

3

Prime Number Sieve of Eratosthenes in C# and VB.NET

The following code implements the in VB (C# is a little further down the page): Imports System Imports System.Collections.Generic Imports System.Text Imports System.Diagnostics ‘Sieve of Eratosthenes     Public Class PrimeSieve       Private values As Numbers()       Public Sub New(ByVal max As Integer)         ReDim values(max)     End Sub       Public Function ComputePrimes()…

3

BradA's Top Book List [Week of 2/21/2005]

All (BradA’s Top List) Rank(All) Cover Title Sales Rank (lower is better) Buzz (higher is better) 1. Programming C#, Third Edition (ISBN:0596004893) 2,941 21,501,420 2. Windows Forms Programming in C# (ISBN:0321116208) 2,846 2,740,530 3. ASP.NET Unleashed, Second Edition (ISBN:067232542X) 6,274 15,901,130 4. Applied Microsoft .NET Framework Programming (ISBN:0735614229) 6,626 2,990,770 5. Essential ASP.NET With Examples…

2

Resource management

[Copy of orginal message found on the Develop archives: Resource management] Date:         Fri, 6 Oct 2000 08:22:59 -0700Reply-To:     dotnet discussion <DOTNET@DISCUSS.DEVELOP.COM>Sender:       dotnet discussion <DOTNET@DISCUSS.DEVELOP.COM>From:         Brian Harry <bharry@MICROSOFT.COM>Subject:      Resource management I know people have been waiting a long time for someone at Microsoft to saysomething about the issue of resource management and deterministicfinalization.  Because this is…

5

Internal Coding Guidelines

Table of Contents 1. Introduction………………………………………………………………………………………………………………………… 1 2. Style Guidelines…………………………………………………………………………………………………………………… 2 2.1 Tabs & Indenting……………………………………………………………………………………………………………….. 2 2.2 Bracing…………………………………………………………………………………………………………………………….. 2 2.3 Commenting………………………………………………………………………………………………………………………. 2 2.3.1 Documentation Comments………………………………………………………………………………………………. 2 2.3.2 Comment Style…………………………………………………………………………………………………………….. 3 2.4 Spacing…………………………………………………………………………………………………………………………….. 3 2.5 Naming…………………………………………………………………………………………………………………………….. 4 2.6 Naming Conventions……………………………………………………………………………………………………………. 4 2.6.1 Interop Classes…………………………………………………………………………………………………………….. 4 2.7 File Organization………………………………………………………………………………………………………………… 5   1. Introduction First, read the .NET Framework…

142

Obsolete Members in Whidbey Beta1

namespace Microsoft.CSharp {     [Obsolete(“Use Microsoft.CSharp.CSharpCodeProvider, System.CodeDom.Compiler.ICodeCompiler, and System.CodeDom.Compiler.CompilerError instead.  http://go.microsoft.com/fwlink/?linkid=14202”)]     public class Compiler     {     }       [Obsolete(“Use Microsoft.CSharp.CSharpCodeProvider, System.CodeDom.Compiler.ICodeCompiler, and System.CodeDom.Compiler.CompilerError instead.  http://go.microsoft.com/fwlink/?linkid=14202”)]     public class CompilerError     {     }       [Obsolete(“Use Microsoft.CSharp.CSharpCodeProvider, System.CodeDom.Compiler.ICodeCompiler, and System.CodeDom.Compiler.CompilerError instead.  http://go.microsoft.com/fwlink/?linkid=14202”)]     public enum ErrorLevel     {     }   }…

2

Disposable Enumerator

#region Using directives using System; using System.Collections.Generic; using System.Text; #endregion namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyList<string> l = new MyList<string>(); l.Add (“hello”); l.Add (“wild”); l.Add (“world”); l.Add (“!”); foreach (string s in l) { Console.WriteLine(s); } Console.ReadLine(); } } public class MyList<T> : IList<T> { List<T> list; public MyList()…

1

Usage data on “Callback” vs. “CallBack”

Usage data on “Callback” vs. “CallBack” in the whidbey build of the .NET Framework     CallBack           5             System._AppDomain::public Void DoCallBack(CrossAppDomainDelegate theDelegate);  System.AppDomain::public Void DoCallBack(CrossAppDomainDelegate callBackDelegate);        System.Runtime.Remoting.Contexts.Context::public Void DoCallBack(CrossContextDelegate deleg);            System.DirectoryServices.Protocols.LdapSessionOptions::public ReferralCallBack ReferralCallBack { get; set; }            System.DirectoryServices.Protocols.ReferralCallBack       Callback            70         System.AsyncCallback  System.Threading.SendOrPostCallback  System.Threading.ContextCallback        System.Threading.WaitCallback System.Threading.WaitOrTimerCallback  System.Threading.IOCompletionCallback            System.Threading.TimerCallback            System.Runtime.Serialization.IDeserializationCallback     System.Runtime.InteropServices.ExtensibleClassFactory::public static Void RegisterObjectCreationCallback(ObjectCreationDelegate callback);           …

1