This file contains hidden or 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
[Test] | |
public void CreateClassProxyWithTarget_Uses_The_Provided_Options() | |
{ | |
var proxyGenerator = new ProxyGenerator(); | |
var options = new ProxyGenerationOptions(); | |
options.AddMixinInstance(new SimpleMixin()); | |
var target = new SimpleClassWithProperty(); | |
var proxy = proxyGenerator.CreateClassProxyWithTarget(target, options); |
This file contains hidden or 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
String[] columns = new String[]{"columnA", "columnB", "columnC"}; | |
int[] widgets = new int[]{R.id.widgetA, R.id.widgetB, R.id.widgetC}; | |
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.list_item, cursor, columns, widgets); |
This file contains hidden or 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
@"c:\textfile.txt".ReadLinesFromTextFile().Where(x => x.Length > 10) |
This file contains hidden or 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
class SomeClass | |
someMethod: -> | |
x = 42 | |
switch x | |
when 41 | |
alert 'less' | |
when 43 | |
alert 'more' | |
This file contains hidden or 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
IQueryable<<>f__AnonymousType0<string>> <>f_AnonymousType0s = Expression[] expressionArray = new Expression[1].Select<string,<>f__AnonymousType0<string>>(Expression.Lambda<Func<string, <>f__AnonymousType0<string>>>(Expression.New(expressionArray[0] = parameterExpression, expressionArray, new MethodInfo[] { (MethodInfo)MethodBase.GetMethodFromHandle(Name, <>f__AnonymousType0<string>) }), new ParameterExpression[] { parameterExpression })); | |
This file contains hidden or 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
var queue = new TransactionalConcurrentQueue<int>(); | |
using (var scope = new TransactionScope()) | |
{ | |
queue.Enqueue(1); | |
// won't happen | |
queue.Dequeue(x => Console.WriteLine(x)); | |
scope.Complete(); |
This file contains hidden or 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
(use 'clojure.core.async) | |
;this is the function you want to use | |
(defn lazy-channels [chs] | |
(lazy-seq (cons (let [ [v _] (alts!! chs)] v) (lazy-channels chs)))) | |
;now for the tesging | |
(def chs [ (chan) (chan) (chan) ]) ; the channels can come from anywhere, here we are using three channels for testing |
This file contains hidden or 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
(ns qartoy.handler | |
(:require [clojure.tools.logging :as log] | |
[ring.util.response :refer [redirect]] | |
[compojure.core :refer :all] | |
[compojure.handler :as handler] | |
[compojure.route :as route] | |
[qarth.oauth :as oauth] | |
[qarth.impl.facebook :refer :all] | |
[qarth.impl.google :refer :all] | |
[qarth.impl.github :refer :all] |
This file contains hidden or 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
open System | |
let rec queryForNonNegativeInt msg = | |
printf msg | |
let parsed, number = Int32.TryParse(Console.ReadLine()); | |
if parsed then | |
if number < 0 then queryForNonNegativeInt msg | |
else number | |
else queryForNonNegativeInt msg |
OlderNewer