CREATE TABLE [dbo].[UniqueIdentifier]
(
[Typ] NVARCHAR(50) NOT NULL PRIMARY KEY,
[CurrentMaxId] NVARCHAR(max) NOT NULL
)
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
///<remark> | |
/// Refactored Version (following IOSP) | |
///</remark> | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace primegenerator | |
{ |
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 Microsoft.FSharp.Core; | |
namespace FSharpConverter | |
{ | |
public static class ToFSharpFuncConverterExtensions | |
{ | |
private static readonly Unit Unit = (Unit)Activator.CreateInstance(typeof(Unit), true); | |
public static Func<T, Unit> ToFunc<T>(this Action<T> action) |
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 NUnit.Framework; | |
using System.Linq; | |
namespace function_composition_in_csharp | |
{ | |
// The NUnit Nuget package is required for this | |
// To install NUnit, run the following command in the Package Manager Console | |
// PM> Install-Package NUnit -Version 2.6.4 |
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
import Text.ParserCombinators.Parsec (char, many1, string, choice, try, parse) | |
import Text.Parsec.Prim (parserReturn, parserFail, ParsecT) | |
import Data.Functor | |
import Data.Functor.Identity | |
import Data.Either | |
import Test.Hspec | |
sat :: String -> (a -> Bool) -> ParsecT s u m a -> ParsecT s u m a | |
sat msg predicate parser = parser >>= (\x -> if predicate x then parserReturn x else parserFail msg) |
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.Collections.Generic; | |
namespace TicTacToe | |
{ | |
public enum Player | |
{ | |
PlayerX, | |
PlayerO | |
} |
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
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var list = new List<int> {4, 5, 4, 7, 9, 1, 6, 1, 0, -99, 10000, 3, 2}; | |
var sorted = list.QuickSort(); | |
Console.WriteLine(String.Join(", ", sorted)); | |
// output: -99, 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 9, 10000 |
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
module Git = | |
open System | |
open System.Diagnostics | |
let private runCommand cmd args = | |
let startInfo = new ProcessStartInfo() | |
startInfo.FileName <- cmd | |
startInfo.Arguments <- args | |
startInfo.UseShellExecute <- false | |
startInfo.RedirectStandardOutput <- true |
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 class EditedPair<T> | |
{ | |
public EditedPair(T old, T @new) | |
{ | |
Old = old; | |
New = @new; | |
} | |
public T Old { get; private set; } | |
public T New { get; private set; } |
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 CondictionalsExtensions | |
{ | |
public static Tuple<bool, T> If<T>(this T src, Predicate<T> p) | |
{ | |
return p(src) | |
? Tuple.Create(true, src) | |
: Tuple.Create(false, src); | |
} | |
public static Tuple<bool, T, R> Then<T, R>(this Tuple<bool, T> src, Func<T, R> f) |
OlderNewer