This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<?xml version="1.0" encoding="utf-8"?> | |
<key name="Software"> | |
<key name="ConEmu"> | |
<key name=".Vanilla" modified="2015-02-19 17:28:16" build="140505"> | |
<value name="ColorTable00" type="dword" data="00000000"/> | |
<value name="ColorTable01" type="dword" data="00800000"/> | |
<value name="ColorTable02" type="dword" data="00008000"/> | |
<value name="ColorTable03" type="dword" data="00808000"/> | |
<value name="ColorTable04" type="dword" data="00000080"/> | |
<value name="ColorTable05" type="dword" data="00800080"/> |
public static class MemoryCacheExtensions | |
{ | |
public static T AddOrGetExistingLazy<T>(this MemoryCache cache, string key, Func<T> valueFactory, CacheItemPolicy cacheItemPolicy) | |
{ | |
var newValue = new Lazy<T>(valueFactory); | |
var value = (Lazy<T>)cache.AddOrGetExisting(key, newValue, cacheItemPolicy); | |
return (value ?? newValue).Value; // Lazy<T> handles the locking itself | |
} | |
public static void SetLazy<T>(this MemoryCache cache, string key, T value, CacheItemPolicy cacheItemPolicy) |
module Blob | |
type Cell = | |
| Black | |
| White | |
type Grid = Cell [,] | |
Array2D.init 4 4 (fun x y -> x + y) |> Array2D.mapi (fun x y _ -> (x,y)) |
let optionList l = | |
let rec bindList xs acc = | |
match xs with | |
| [] -> Some acc | |
| h::t -> h |> Option.bind (fun x -> bindList t (x::acc)) | |
bindList l [] | |
module Option = | |
let map2 f a b = | |
a |> Option.bind (fun a' -> b |> Option.map (fun b' -> f a' b')) |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/ ***********************************************************/ | |
/ * Exercise: Fibonacci closure, http://tour.golang.org/#44 */ | |
/ ***********************************************************/ | |
package main | |
import "fmt" | |
func fibonacci() func() int { | |
x, y := 0, 1 |
// translated to F# Script from https://gist.github.com/brianlow/1553265 | |
open System.IO | |
open System.Reflection | |
type Reference = { | |
Assembly : AssemblyName | |
ReferencedAssembly : AssemblyName | |
} |
I hereby claim:
To claim this, I am signing this object:
2019-07-10 10:37:30.954 main-tokio-7 INFO substrate Idle (0 peers), best: #698 (0x42e4…3615), finalized #698 (0x42e4…3615), ⬇ 0 ⬆ 0 | |
2019-07-10 10:37:31.249 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":"0xc0282bc8bc7e85e87dbd080c37bbfd81ffe8b03de775ad4d062ebb0cf7642c14","id":472}. | |
2019-07-10 10:37:31.253 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":1,"id":478}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":2,"id":479}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":3,"id":474}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":4,"id":475}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":5,"id":476}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":6,"id":477}. | |
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":7,"id |
use std::any; | |
mod meta_type { | |
use super::*; | |
use super::TypeInfo; | |
use std::cmp::Ordering; | |
#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Debug)] | |
pub enum MetaType { | |
Parameter(MetaTypeParameter), |