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; | |
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; | |
/* | |
* 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
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; | |
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
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 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; | |
namespace StackExample { | |
class Program { | |
static void Main(string[] args) { | |
// Creates and initializes a new stack | |
Stack stackColl = new Stack(); |
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
CSC 340 Scientific Computing | |
Machine Epsilon Homework | |
Andrew M. Barfield | |
Wednesday, January 14, 2009 | |
3:15:29 PM | |
Float: | |
01) 0.5 | |
02) 0.25 |
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
CSC 340 Scientific Computing | |
Calculate exp(3.7) using Taylor's Expansion | |
Andrew M. Barfield | |
Thursday, January 15, 2009 | |
1:56:36 PM | |
Answer calculated in 29 iterations. | |
exp(3.7) = 40.447 |