Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text;
namespace HashTable
{
public class HashTable
{
class HashTableItem
{
using System;
using System.Linq;
using System.Collections.Generic;
namespace AsciiLetters
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
namespace KataTriangles
{
class Program
{
static void Main(string[] args)
{
@oshea00
oshea00 / CodeInEnglish.cs
Created March 6, 2020 07:45
Code In English
void Main()
{
// Requirement: I want an Account that can have any type of identifier:
// Could a business analyst understand this code?
var accountWithInteger = new Account<int> {
Id = 3,
Name = "has integer key"};
var accountWithString = new Account<string> {
Id = "Stringy",
# Global Values
$excel = New-Object -ComObject Excel.Application
$server = "."
$db = "school"
$workbook = $excel.Workbooks.Open("C:\Users\mike\Documents\Downloads\databook.xlsx");
$accountToWorksheetMap = @{
'ACCT' = 'Sheet1'
}
# Global Functions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oshea00
oshea00 / kata.md
Last active October 4, 2019 21:39
Kata 1

Permutations
Take a string, say 'abcdefg' and scramble it into 'cgdaefb'.
There is an expression form for this permutation: (acd)(bg).
Read this expression as follows left to right:
"a becomes c, c becomes d, and d becomes a" (note: the last letter inside the parentheses loops back to the first)
then
"b becomes g, g becomes b"

The permutations of (e), and (f) are not explicitly stated in the expression, but it is not illegal to do so. "Multiplying" these expressions is the same as applying them in sequence against the starting string. The above expression is just that a multiplication of (acd) times (bg). Note that multiplication is not NECCESARILY commutative. The "unit" permutation is "()".

void Main()
{
Steps(0,5).Dump();
}
Dictionary<int,int> memo = new Dictionary<int,int>();
int Steps(int step, int numstairs)
{
if (numstairs == 0)
void Main()
{
var l = new LinkedList<string>();
l.Push("A");
l.Push("B");
l.Push("C");
l.Push("D");
l.Push("E");
String.Join(", ",l.ToList()).Dump();