π θ Ψ φ ε ∞
⊕ · ⊗ ∫ ± ∂ √ ∛ ∜
〈 〉 ⟨ ⟩ °
≈ ≤ ≥ ∝
⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉
⁺⁻⁼⁽⁾ⁱⁿ₊₋₌₍₎ₐₑₒₓₔₕₖₗₘₙₚₛₜ
⅟ ½ ⅓ ¼ ⅕ ⅙ ⅐ ⅛ ⅑ ⅒
⅔ ⅖
[Test] | |
public void TestEmpty() | |
{ | |
CollectionAssert.AreEqual( | |
new int[0].MinsBy(i => i), | |
new int[0]); | |
} | |
[Test] | |
public void TestPreserveOrderAndValue() |
+(void) runBlock:(VoidBlock)callback | |
afterDelay:(NSTimeInterval)delayInSeconds | |
unless:(TOCCancelToken*)unlessCancelledToken { | |
__block VoidBlock callbackForBlock = callback; | |
NSObject* lock = [NSObject new]; | |
VoidBlock allowDeallocWrapper = ^{ | |
VoidBlock callbackPeek; | |
@synchronized(lock) { |
#import "TOCCancelTokenAndSource.h" | |
#import "TOCFutureAndSource.h" | |
#import "TOCInternal.h" | |
#include <libkern/OSAtomic.h> | |
static TOCCancelToken* SharedCancelledToken = nil; | |
static TOCCancelToken* SharedImmortalToken = nil; | |
@implementation TOCCancelToken { | |
@private NSMutableArray* _cancelHandlers; |
#import <XCTest/XCTest.h> | |
#import "TwistedoakCollapsingFutures.h" | |
#define notificationName @"note" | |
static int counter = 0; | |
@interface NSNotificationCenter (CancelToken) | |
-(void) addObserverForName:(NSString*)name |
Imports Tinker.Pickling | |
Namespace WC3 | |
Public NotInheritable Class GameServer | |
Inherits DisposableWithTask | |
Private Shared ReadOnly InitialConnectionTimeout As TimeSpan = 5.Seconds | |
Private ReadOnly inQueue As CallQueue = MakeTaskedCallQueue | |
Private ReadOnly outQueue As CallQueue = MakeTaskedCallQueue |
// FakeScheduler.h | |
#import "ReactiveCocoa.h" | |
@interface FakeScheduler : RACScheduler | |
-(instancetype) init; | |
-(void) advanceTimeBy:(NSTimeInterval)duration; | |
-(NSTimeInterval)time; | |
-(NSDate*) date; | |
-(NSDate*) dateAtTimeZero; |
// An infinite bit-string. | |
public interface Bits { | |
// requires n >= 0 | |
boolean bit(int n); | |
} | |
// Determines the equivalence of predicates over infinite-bit-strings. | |
// Requires that the given predicates halt for all inputs. | |
public final class BitsPredicateEquivalence extends Equivalence<Predicate<Bits>> { |
# coding=utf-8 | |
import math | |
import itertools | |
def evaluate_circuit(gates, initial_bits=None): | |
""" | |
:param gates: [( [controls], [targets] )] | |
:param initial_bits: set(on_bits) |
# -*- coding: utf-8 -*- | |
import numpy as np | |
import math | |
import cmath | |
np.set_printoptions(precision=2, suppress=True) | |
qubit_count = 2 | |
σx = np.mat([[0, 1], [1, 0]]) | |
σy = np.mat([[0, -1j], [1j, 0]]) | |
σz = np.mat([[1, 0], [0, -1]]) |