This file contains hidden or 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
type ordinals = Left | Right | Up | Down;; | |
let concat x y = x::y ;; | |
let rec map f l = match l with | |
| [] -> [] | |
| a::b -> f(a)::(map f b) | |
;; | |
let rec filter f l = match l with |
This file contains hidden or 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
let rec combinations_tail f k m prefix = match k, m with | |
| a, b when a < 0 || b < 0 -> failwith "ki or mi negative" | |
| a, b when a > b -> failwith "k > m" | |
| 0, 0 -> if f (Array.of_list prefix) then [prefix] else [] | |
| 0, b -> combinations_tail f 0 (b-1) (false::prefix) | |
| a, b when a = b -> combinations_tail f (a-1) (b-1) (true::prefix) | |
| a, b -> (combinations_tail f (a-1) (b-1) (true::prefix)) @ (combinations_tail f a (b-1) (false::prefix)) | |
;; | |
let generate_tail m n = |
This file contains hidden or 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
let rec combinations k m = match k, m with | |
| k, m when k < 0 || m < 0 -> failwith "ki or mi negative" | |
| k, m when k > m -> failwith "k > m" | |
| 0, 0 -> [[]] | |
| 0, m -> map (concat false) (combinations 0 (m-1)) | |
| k, m when k = m -> map (concat true) (combinations (k-1) (m-1)) | |
| k, m -> map (concat true) (combinations (k-1) (m-1)) @ map (concat false) (combinations k (m-1)) | |
;; | |
let generate m n = |
This file contains hidden or 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
var onEnter, onExit, $d, hovered; | |
$d = $('.label'); | |
$d.hide(); | |
//hovered = jgraph.makeMaterial(0xffffff); | |
onEnter = function (node) { | |
$d.html('<p><b>' + node.name + '</b></p><br><p>' + node.label + '</p>'); | |
$d.show(); | |
node.defaultMaterial = node.material; | |
node.material = hovered; | |
}; |
This file contains hidden or 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
$('a').each(function(i){ | |
if ($.trim($(this).text()) == 'EPUB') { //Change EPUB to whatever you want | |
$(this).click(); | |
} | |
}); |
This file contains hidden or 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
import ipyparallel as ipp | |
c = ipp.Client() | |
c.ids | |
c[:].apply_sync(lambda : "Hello, World") |
This file contains hidden or 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 n in `seq 7`; | |
do dd if=/dev/urandom of=/dev/sda bs=8b conv=notrunc; | |
done | |
&& | |
dd if=/dev/zero of=/dev/sda bs=8b & | |
disown; |
This file contains hidden or 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
%VARS | |
\def\Variable{Content} | |
%FUNCS | |
\newcommand{\Command1}{Contenu} | |
\newcommand{\Command2}[NbVar]{#1 #2 #3} | |
%USE CASE | |
\Variable | |
\Command1 | |
\Command2{x}{y}{z} |
This file contains hidden or 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/env python3 | |
#! encoding: utf-8 | |
import urllib.requests as ul2 | |
from bs4 import BeautifulSoup | |