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
[TestInitialize] | |
public void BeforeEach() | |
{ | |
_fixture = new Fixture(); | |
// client has a circular reference from AutoFixture point of view | |
_fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); | |
_fixture.Behaviors.Add(new OmitOnRecursionBehavior()); | |
} |
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.VisualStudio.TestTools.UnitTesting; | |
using Moq; | |
using Ploeh.AutoFixture; | |
using Ploeh.AutoFixture.AutoMoq; | |
namespace AutoFixtureDemo.MSTest | |
{ | |
public class Echoer | |
{ |
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
(map | |
#(str %1 ", " %2) | |
["Hello" "Hi" "Aloha"] | |
["Mike" "Kelsey" "Jack"]) | |
;; ("Hello, Mike" "Hi, Kelsey" "Aloha, Jack") |
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.Linq; | |
using Ploeh.AutoFixture; | |
using Ploeh.AutoFixture.Xunit2; | |
using Xunit; | |
namespace AutoFixtureDemo | |
{ | |
public class Demo |
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
select * from ( | |
select | |
key_col | |
,date_col | |
,data_col | |
,prev_data_col = lag(data_col, 1) over (partition by key_col order by date_col) | |
from tbl | |
) as z | |
where prev_data_col is not NULL | |
and data_col <> prev_data_col |
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.Linq; | |
namespace Cipher | |
{ | |
public class Rot13 | |
{ | |
public static string Encode(string text) | |
=> new string( | |
text.ToCharArray() |
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
-- https://stackoverflow.com/a/23702332/2370606 | |
select * | |
from sys.objects | |
where modify_date > dateadd(d, -1, getdate()) |
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
select | |
key_col | |
,startdate | |
,enddate | |
,change_col | |
from ( | |
select distinct | |
key_col | |
,startdate = min(date_col) over (partition by group_key, key_col) | |
,enddate = max(date_col) over (partition by group_key, key_col) |
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
Require Import Coq.Arith.Arith. | |
Require Import Omega. | |
(* from http://stackoverflow.com/a/44039996/2370606 *) | |
Lemma subtraction_does_not_commute : | |
forall a b : nat, a <> b -> a - b <> b - a. | |
Proof. | |
induction a. intros b. | |
- now rewrite Nat.sub_0_r. | |
- destruct b. |
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
{ | |
"name": "extra", | |
"version": "1.0.0", | |
"description": "", | |
"main": "test.js", | |
"scripts": { | |
"test": "mocha" | |
}, | |
"author": "Mike Harris", | |
"license": "ISC", |
NewerOlder