I hereby claim:
- I am etrepum on github.
- I am etrepum (https://keybase.io/etrepum) on keybase.
- I have a public key whose fingerprint is 0ADE DB65 BB14 2A89 3A2F 00A8 4F18 52C4 AD9C 3A69
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
INPUT_TEXT="""\ | |
Processor : Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz (24 cores/threads) | |
Memory : 81877MB | |
Controller Slot : 0 | |
BIOS : 3.0a 11/12/2013 3.1 | |
IPMI FW rev : 2.20 |
See also merge sort.
-- version 3 | |
import qualified Data.Set as S | |
import Data.List (partition) | |
import System.Environment (getArgs) | |
data LWG = LWG { _lion, _wolf, _goat :: {-# UNPACK #-} !Int } | |
deriving (Show, Ord, Eq) | |
lionEatGoat, lionEatWolf, wolfEatGoat :: LWG -> LWG | |
lionEatGoat (LWG l w g) = LWG (l - 1) (w + 1) (g - 1) |
import Data.Either (isLeft) | |
import Control.Exception (try, evaluate, SomeException) | |
import Test.QuickCheck (Property, quickCheck) | |
import Test.QuickCheck.Monadic (monadicIO, run, assert) | |
isFailure :: a -> IO Bool | |
isFailure = fmap isLeft . tryEval | |
where | |
tryEval :: a -> IO (Either SomeException a) | |
tryEval = try . evaluate |
Welcome to Swift! Type :help for assistance. | |
1> func derp(a,b,c) { return a + b + c } | |
<REPL>:1:11: error: use of undeclared type 'a' | |
func derp(a,b,c) { return a + b + c } | |
^ | |
<REPL>:1:13: error: use of undeclared type 'b' | |
func derp(a,b,c) { return a + b + c } | |
^ | |
<REPL>:1:15: error: use of undeclared type 'c' | |
func derp(a,b,c) { return a + b + c } |
{-# LANGUAGE OverloadedStrings, BangPatterns #-} | |
module Megahaskhal.Dictionary ( | |
Dictionary, | |
addWord, | |
addAllWords, | |
findWord, | |
lookupIndex, | |
replicateM, | |
forM_, |
import qualified Data.ByteString.Lazy.Char8 as LC | |
import qualified Data.List as DL | |
import qualified Data.List.Split as LS | |
import System.IO | |
-- | Reformat the Vim key log from stdin to stdout. | |
main :: IO () | |
main = hSetEncoding stdout utf8 >> | |
LC.getContents >>= mapM_ putStrLn . process |
>>> class Foo(object): | |
... pass | |
... | |
>>> def bar(): | |
... class Bar(Foo): | |
... pass | |
... | |
>>> Foo.__subclasses__() | |
[] | |
>>> bar() |
## This is the implementation of the terrible hack | |
from sys import _getframe | |
from importlib import import_module | |
def import_(name, as_=None, globals_=None): | |
as_ = as_ or name.partition('.')[0] | |
globals_ = globals_ or _getframe(1).f_globals | |
globals_[as_] = import_module(name) | |
## This is what usage looks like: |