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
(* -*- coding: utf-8 -*- *) | |
open Core.Std | |
module Strrange = struct | |
let (//) opt def = match opt with Some x -> x | None -> def | |
let min x y = if x < y then x else y | |
type t = {base: string; mutable start: int; mutable finish: int} | |
let create ?(start=0) ?finish ?(empty=false) str = |
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
(* -*- coding: utf-8 -*- *) | |
open Core.Std | |
module Util = struct | |
let min x y = if x < y then x else y | |
let apply_if opt fn v = | |
match opt with | |
| None -> v | |
| Some bound -> fn bound v |
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
(* -*- coding: utf-8 -*- *) | |
open Core.Std | |
open Core_bench.Std | |
let (|>) x f = f x | |
let run_bench tests = | |
Bench.bench | |
~ascii_table:true | |
~display:Textutils.Ascii_table.Display.column_titles |
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
(* -*- coding: utf-8 -*- *) | |
open Core.Std | |
module Util = struct | |
(** Perl5's defined-or operator *) | |
let (//) opt def = match opt with Some x -> x | None -> def | |
let min x y = if x < y then x else y | |
let apply_if opt fn v = |
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
(defun camldebug (command-line) | |
"Run camldebug on program FILE in buffer *camldebug-FILE*. | |
The directory containing FILE becomes the initial working directory | |
and source-file directory for camldebug. If you wish to change this, use | |
the camldebug commands `cd DIR' and `directory'." | |
(interactive | |
(list (read-from-minibuffer "Run ocamldebug on command-line: "))) | |
(let* ((words (split-string-and-unquote command-line)) | |
(path (expand-file-name (car words))) |
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
diff --git a/SdlTkInt.c b/SdlTkInt.c | |
index 2ccb1da..f4e04bf 100644 | |
--- a/SdlTkInt.c | |
+++ b/SdlTkInt.c | |
@@ -653,6 +653,12 @@ skipTranslation: | |
case SDL_KEYDOWN: | |
case SDL_KEYUP: | |
state = SDL_GetMouseState(&x, &y); | |
+ { | |
+ /* To make sure all key-related events has empty charValuePtr. */ |
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/tksqlite.tcl | |
+++ b/tksqlite.tcl | |
@@ -8703,7 +8703,8 @@ proc Sqlite::publish {query tableName rawdataName} { | |
set _temp [string map {, { } \" {}} $query] | |
set _temp [SQLParser::removeComment $_temp] | |
set sqlcmd [string tolower [lindex $_temp 0]] | |
- if {$sqlcmd ne "select" && | |
+ if {$sqlcmd ne "select" && | |
+ $sqlcmd ne "with" && | |
$sqlcmd ne "pragma" && |
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 'a ring_t = { | |
value: 'a; | |
mutable next: 'a ring_t; | |
mutable prev: 'a ring_t; | |
} | |
let init value = | |
let rec x = {value; next = x; prev = x} in | |
x |
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/zsh | |
typeset -A dup; dup=() | |
grep libssl /proc/*/maps|grep deleted|while read fn rest; do | |
pid=${${fn#/proc/}//\/*/} | |
((dup[$pid]++)) && continue | |
echo -n $pid " "; readlink /proc/$pid/exe | |
done |
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
## Test array size=1048576 | |
(filled - start).live_words = 6291460 | |
(end - filled).live_words = -6291452 | |
(end - start).live_words = 8 | |
(filled - start).live_blocks = 2097153 | |
(end - filled).live_blocks = -2097151 | |
(end - start).live_blocks = 2 |