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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class | |
import Prelude hiding (log) | |
-------------------------------------------------------------------------------- | |
-- The API for cloud files. | |
class Monad m => MonadCloud m where | |
saveFile :: Path -> Bytes -> m () |
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
Exception in thread "main" java.lang.AbstractMethodError: cljsbuild.compiler.SourcePaths._find_sources(Ljava/lang/Object;)Ljava/lang/Object;, compiling:(/tmp/form-init5931832452504796267.clj:1:73) | |
at clojure.lang.Compiler.load(Compiler.java:7239) | |
at clojure.lang.Compiler.loadFile(Compiler.java:7165) | |
at clojure.main$load_script.invoke(main.clj:275) | |
at clojure.main$init_opt.invoke(main.clj:280) | |
at clojure.main$initialize.invoke(main.clj:308) | |
at clojure.main$null_opt.invoke(main.clj:343) | |
at clojure.main$main.doInvoke(main.clj:421) | |
at clojure.lang.RestFn.invoke(RestFn.java:421) | |
at clojure.lang.Var.invoke(Var.java:383) |
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; | |
namespace ColourCoding.Parallel | |
{ | |
public interface IConsumer : IDisposable | |
{ | |
bool Wakeup(); | |
} | |
public interface IConsumer<TShard> : IConsumer | |
where TShard : class |
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 Day19 where | |
import Data.Maybe (maybe) | |
import Data.List (find, findIndex, unfoldr) | |
import Data.Char (isLetter) | |
day19text :: IO [[Char]] -- We could use a better data structure, but the code only gets run once | |
day19text = lines <$> readFile "C:\\Users\\me\\advent\\day19.txt" | |
isWire :: Char -> Bool |
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
Good morning, oregenes and guardians | |
Stills and mother-losing grits | |
This a ten-ringer named 'Baster coming | |
And he's here to end your world, | |
Start a tale that will soon be classic | |
About a woman you already no | |
No four-ringer she but rather the saviour of your species | |
Geo Control (Are you ready?) | |
Our story begins in the fulcrum |
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
{-# LANGUAGE FlexibleContexts, FlexibleInstances, RankNTypes, InstanceSigs, TypeApplications, ScopedTypeVariables, MultiParamTypeClasses #-} | |
{-# LANGUAGE StandaloneDeriving, DerivingVia, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies, GADTs #-} | |
{-# LANGUAGE AllowAmbiguousTypes, UndecidableInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Day4 where | |
import Data.Functor.Foldable(hylo) |
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
### This assumes that appsettings configurationpath was equal to delta.rb | |
ext "fixConnection" do | |
senderCompId "IOM" | |
targetCompId "JEFNET" | |
heartbeatInterval 60 | |
reconnectInterval 1 | |
protocolVersion "FIX.4.2" | |
shouldCheckLatency false | |
isInitiator 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
// Broken version | |
use std::convert::TryInto; | |
impl Solution { | |
pub fn find_smallest_interval<T, F>(elements : &Vec<T>, predicate : F) | |
-> Option<(usize, usize)> | |
where F : Fn(&T, &T) -> bool { | |
let mut minLength = elements.len(); | |
let mut result = None; |
OlderNewer