NPM
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
class QuickSort | |
def self.sort!(keys) | |
quick(keys,0,keys.size-1) | |
end | |
private | |
def self.quick(keys, left, right) | |
if left < right |
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
(define reverse | |
(letrec ([loop (λ (l1 l2) | |
(cond [(null? l1) l2] | |
[else (loop (cdr l1) (cons (car l1) l2))]))]) | |
(λ (l) (loop l '())))) | |
(reverse '(a b c d e f g)) | |
;; ⇒ '(g f e d c b a) |
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
(define (cons1 x y) | |
(λ (m) (m x y))) | |
(define (car1 z) | |
(z (λ (p q) p))) | |
(define (cdr1 z) | |
(z (λ (p q) q))) | |
(define (cons2 x y) |
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
pragma solidity ^0.4.24; | |
pragma experimental "v0.5.0"; | |
contract ListSystematically { | |
struct Holder { | |
uint256 amount; | |
uint256 frees; | |
Share[] shares; | |
} |
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
(define combo | |
(let ([d (- n r)]) | |
(λ (n r) | |
(/ (factorial n 1) | |
(factorial r 1) | |
(factorial d 1))))) | |
(define factorial | |
(λ (x s) | |
(cond [(< x 1) s] |
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
O = [1, 2, 3] | |
A = [11, 22, 33] | |
B = [111, 222, 333] | |
C = [1111, 2222, 3333] | |
M = [O, A, B, C] | |
def transpose0(m): | |
return [tuple(r[c] for r in m) for c in range(len(m[0]))] |
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
[Unit] | |
Description=Daemon to start Shadowsocks Client | |
Wants=network-online.target | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/sslocal -c /etc/shadowsocks/client.json | |
PIDFil=/var/run/sslocal.pid |
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
[Unit] | |
Description=Daemon to start Jekyll service | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/jekyll serve --source /home/user/repos/blog --destination /srv/jekyll/blog | |
ExecStop=/usr/local/bin/jekyll clean --source /home/user/repos/blog --destination /srv/jekyll/blog | |
PIDFile=/var/run/jekyll.pid | |
[Install] |
OlderNewer