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
#include <stdio.h> | |
#include <time.h> | |
static int table[] = { | |
0, 1, 11, 2, 8, 12, 28, 3, | |
9, 26, 13, 15, 29, 23, 4 ,17, | |
31, 10, 7, 27, 25, 14, 22, 16, | |
30, 6, 24, 21, 5, 20, 19, 18 | |
}; |
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/sh | |
cat /dev/null > mylog | |
# ThinpMixin needs this | |
modprobe dm-bufio | |
# dm-writeboost needs these | |
modprobe libcrc32c | |
# insmod /root/dm-writeboost/src/dm-writeboost.ko |
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
let put_stone t (i, j) a = set (get t i) j a | |
let put_stones t [] = () | |
let put_stones t ((i, j, a) :: xs) = | |
put_stone t (i, j) a ; | |
Printf.printf "(%d,%d,%d)" i, j, a ; | |
put_stones t xs | |
;; |
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
let rec zip ((i, j) :: xs) (a :: ys) = (i, j, a) :: (zip xs ys) | |
let zip [] _ = [] | |
let zip _ [] = [] | |
;; |
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
# CASE1 | |
// C code | |
if (cond) | |
do_A() | |
do_B() | |
// OCaml |
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
let will_take_one t (i, j, a) = | |
let r = ref false in | |
begin | |
t.matrix.(i).(j) <- a ; | |
r := List.length @@ remove_list_by_put t (i, j, a) = 1; | |
t.matrix.(i).(j) <- 3 ; | |
end ; | |
!r | |
;; |
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
Installing base-no-ppx.base. | |
Building lwt.2.4.6: | |
./configure --prefix /home/akira/.opam/4.01.0 --disable-libev --enable-react --disable-ssl --enable-unix --enable-extra --enable-preemptive --disable-glib --disable-ppx | |
make build | |
make install | |
Installing lwt.2.4.6. | |
Building lambda-term.1.7: | |
ocaml setup.ml -configure --prefix /home/akira/.opam/4.01.0 | |
ocaml setup.ml -build | |
ocaml setup.ml -install |
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
diff --git a/drivers/staging/writeboost/dm-writeboost-target.c b/drivers/staging/writeboost/dm-writeboost-target.c | |
index 01349a5..b30227d 100644 | |
--- a/drivers/staging/writeboost/dm-writeboost-target.c | |
+++ b/drivers/staging/writeboost/dm-writeboost-target.c | |
@@ -990,6 +990,7 @@ static void dec_inflight_ios(struct wb_device *wb, struct segment_header *seg) | |
* After returned, refcounts (in_flight_ios and in_flight_plog_writes) | |
* are incremented. | |
*/ | |
+static void might_cancel_read_cache_cell(struct wb_device *, struct bio *); | |
static void prepare_write_pos(struct wb_device *wb, struct bio *bio, |
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
DM-Writeboost | |
============= | |
DM-Writeboost target provides block-level log-structured caching. | |
All cache data, writes and reads, are written to the cache device in sequential | |
manner. | |
Mechanism | |
========= | |
Controlling three layers (RAM buffer, cache device and backing device) |
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
type | |
T1 {.inheritable.} = object | |
T2 = object of T1 | |
T3 = object of T1 | |
method f(x:T2) = | |
echo "I am T2" | |
method f(x:T3) = | |
echo "I am T3" | |
type S1 = object | |
t: T1 |