This file contains 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.Diagnostics; | |
using System.Linq; | |
namespace PerformanceKata | |
{ | |
internal class Program | |
{ | |
private static void Main() |
This file contains 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 ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var myNubers = new byte[] { 72, 97, 112, 112, 121, 32, 66, 105, 114, 116, 104, 100, 97, 121, 33 }; | |
for (int i = 0; i < myNubers.Length; i++) |
This file contains 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 SwapTooNumbers | |
{ | |
public class StartUp | |
{ | |
// How to swap to numeric values | |
public static void Main(string[] args) | |
{ | |
int first = 1; |
This file contains 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
// html | |
<canvas width="300" height="300" id="ccc"> </canvas> | |
// css | |
#ccc {border:1px solid #000;} | |
// js | |
var canvas = document.getElementById("ccc"); | |
var context = canvas.getContext('2d'); | |
with(context){ |
This file contains 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
namespace MoreDotNet.Tests.Extensions.Common.RandomExtensions | |
{ | |
using System; | |
using MoreDotNet.Extensions.Common; | |
using Xunit; | |
public class NextBoolTests | |
{ |
This file contains 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 static class IEnumerableExtensions | |
{ | |
public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action) | |
{ | |
foreach (var item in collection) | |
{ | |
action(item); | |
} | |
} | |
} |
This file contains 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; | |
public static class ObjectExtensions | |
{ | |
public static T CastTo<T>(this object obj) | |
{ | |
var result = Activator.CreateInstance(typeof(T)); | |
foreach (var property in obj.GetType().GetProperties()) | |
{ |
This file contains 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; | |
class BinarySearch | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Enter string [example: 2, 3, -6, -1, 6, 4, -8, 8]"); | |
string input = Console.ReadLine(); | |
// Comment left for testing purposes only | |
// string input = "2, 3, -6, -1, 6, 4, -8, 8"; |