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 RandomMusings | |
{ | |
public class UnOrderedSet:IEnumerable<int> | |
{ | |
Dictionary<int,int> _set = null; | |
public UnOrderedSet () |
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.ComponentModel.Composition; | |
using System.ComponentModel.Composition.Hosting; | |
namespace RandomMusings | |
{ | |
public interface IVSFeature | |
{ | |
string Feature{get;} |
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 RandomMusings | |
{ | |
public struct Range | |
{ | |
public int start; | |
public int end; |
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
#define DEBUG | |
using System; | |
using System.Diagnostics; | |
namespace RandomMusings | |
{ | |
public class FunctionPointers | |
{ | |
public static Func<int,int[],int> Summer(Func<int,int,int> sumFunction) |
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 RandomMusings | |
{ | |
public class Hospital | |
{ | |
public event AlarmHandler Alarm; | |
public delegate void AlarmHandler(string message); | |
public Hospital () | |
{ |
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.Text.RegularExpressions; | |
namespace RandomMusings | |
{ | |
public class DetectPalidrome | |
{ | |
public DetectPalidrome () | |
{ | |
} |
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
def binaryAdder(arrayA,arrayB): | |
arrayC = [0] * (len(arrayA) + 1) | |
carry = 0 | |
for i in range(len(arrayA)-1,-1,-1): | |
eA = arrayA[i] | |
eB = arrayB[i] | |
if eA == eB == 1: | |
if carry == 1: | |
arrayC[i+1] = 1 | |
else: |
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 RandomMusings | |
{ | |
public class NumericalAlgorithms | |
{ | |
static void Main(){ | |
/*Console.WriteLine(IsPrime(13)); | |
Console.WriteLine(IsPrime(7)); |
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
def Sum(filePath): | |
total = 0 | |
with open(filePath,'rU') as f: | |
line = f.readline() | |
while(line != ''): | |
value = int(line) | |
total+=value | |
line = f.readline() | |
return total |
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
def CharacterSwap(inputString): | |
middle = len(inputString)/2 | |
length = len(inputString) | |
inputList = list(inputString) | |
for i in range(middle): | |
temp = inputList[i] | |
inputList[i] = inputList[length - 1 -i] | |
inputList[length -1-i] = temp | |
return ''.join(inputList) |