This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace NumericalIntegration { | |
class Program { | |
static void Main(string[] args) { | |
int iterations = 100000; | |
double x, start, end, dist, sum = 0, sumT = 0; | |
Console.Write( "Input range start: " ); | |
start = double.Parse( Console.ReadLine() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
namespace LINQExample { | |
class Program { | |
static void Main() { | |
var e = new XElement( "Person", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace IteratorsExample { | |
class Program { | |
static void Main(string[] args) { | |
// Create an instance of the collection class | |
EvenIntegers ei = new EvenIntegers(); | |
// Iterate with foreach | |
foreach ( int num in ei ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyResource : IDisposable { | |
// Pointer to an external unmanaged resource. | |
private IntPtr handle; | |
// Other managed resource this class uses. | |
private Component component = new Component(); | |
// Track whether Dispose has been called. | |
private bool disposed = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
/* | |
* Sample Output | |
* | |
* 10 miles (16.09344 km) | |
* 86 miles (138.403584 km) | |
* 146 miles (234.964224 km) | |
* 214 miles (344.399616 km) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
namespace HashtableExample { | |
class Program { | |
static void Main(string[] args) { | |
// Create a new hashtable | |
Hashtable genericDomains = new Hashtable(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace GenericSortedList { | |
class Program { | |
static void Main(string[] args) { | |
// Creates and initializes a new SortedList. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace GenericQueueEnumerator { | |
class Program { | |
static void Main(string[] args) { | |
// Initialize a new instance of Queue<string> | |
Queue<string> myQ = new Queue<string>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace GenericQueue { | |
class Program { | |
static void Main(string[] args) { | |
// Creates and initializes a new Queue<string>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace GenericListEnumerator { | |
class Program { | |
public class Domain { |