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
#!/bin/bash | |
for j in `docker service ls | grep batch | cut -d ' ' -f 9`;do | |
echo -n $i | |
docker service rm $j | |
done |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
"time" | |
) | |
type SC struct { | |
L int |
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
#! /usr/local/bin/scheme --libdirs --script | |
;; chmod +x ./y.ss | |
;; echo "" | ./y.ss | |
;; The Little Schemer, Friedman & Felleisen, 4th Edition | |
;; | |
;; Chapter 9 "... and Again, and Again, and Again, ..." | |
;; | |
;; Skipping partial vs. total functions with examples Ackerman, termination. |
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
--http://www.vex.net/~trebla/haskell/fix.xhtml | |
module TryFixPoint where | |
import Data.Function | |
{-- | |
-- | @'fix' f@ is the least fixed point of the function @f@, | |
-- i.e. the least defined @x@ such that @f x = x@. |
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 RankNTypes #-} | |
-- Example of rank-2 type, from http://blog.mno2.org/posts/2012-04-06-what-is-rank-n-types-in-haskell.html | |
module Main(main) where | |
import Prelude hiding (length) | |
-- The function as the first argument to check is itself | |
-- of rank-1 type. |
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
-- http://en.wikibooks.org/wiki/Haskell/Denotational_semantics | |
-- Begin Quote " | |
-- We are now looking for suitable mathematical objects that we can attribute to every Haskell program. | |
-- In case of the example 10, 2*5 and sum [1..4], it is clear that all expressions should denote the | |
-- integer 10. | |
-- Generalizing, every value x of type Integer is likely to be an element of the set \mathbb{Z}. | |
-- The same can be done with values of type Bool. For functions like f :: Integer -> Integer, | |
-- we can appeal to the mathematical definition of "function" as a set of (argument,value)-pairs, |