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
#include <string> | |
#include <iostream> | |
#include <tesseract/baseapi.h> | |
#include <leptonica/allheaders.h> | |
extern "C" { | |
#include <caml/mlvalues.h> | |
#include <caml/memory.h> | |
#include <caml/alloc.h> | |
#include <caml/fail.h> |
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
open ZMQ | |
open ZMQ.Socket | |
let context = init () | |
let _ = print_endline "Connecting to hello world server..." | |
let requester = Socket.create context req | |
let _ = connect requester "tcp://localhost:5555" | |
let _ = | |
for i = 1 to 10 do |
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
open Cryptokit | |
let ($) f x = f x | |
let (%) f g = fun x -> f (g x) | |
let to_hex = transform_string (Hexa.encode()) | |
let of_hex = transform_string (Hexa.decode()) | |
let hmac_sha512 key str = | |
let blocksize = 128 in |
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
open Printf | |
module type T = sig | |
type t | |
val init : unit -> t | |
val get_msg : t -> t * string | |
end | |
type 'a global_context = { | |
g : float; (* global part of context *) |
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
(*ocamlfind ocamlopt -o sum_type -package xml-light sum_type.ml -linkpkg*) | |
open Printf | |
module X = Xml | |
type amazon_response_content = Xml of Xml.xml | Raw of string | |
let dump_response_content = | |
function | |
| Xml xml -> |
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
open Unix | |
open Printf | |
module SM = Map.Make(struct type t = Unix.file_descr let compare = compare end) | |
type context = { | |
buf : string; | |
smap : socket_context SM.t; | |
count : int; | |
history : string list; |
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
;; | |
;; OCaml mode | |
;; | |
(setq | |
opam-share | |
(substring | |
(shell-command-to-string "opam config var share 2>/dev/null") 0 -1)) | |
(setq load-path |
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
#use "topfind" | |
#require "unix" | |
open Printf | |
let _ = | |
let ts = Unix.gettimeofday () in | |
let str = sprintf "%0.5f" ts in | |
printf "%b\n" (ts = float_of_string str); | |
let str = sprintf "%0.6f" ts in |
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
open Unix | |
open Printf | |
exception EOF | |
exception WriteError | |
module BE = EndianString.BigEndian | |
module M = Map.Make(struct type t = int let compare = compare end) | |
type entry = Todo of (int * string) | Done of int |
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
open Unix | |
open Hashtbl | |
open Bigarray | |
open Bigarray.Array2 | |
module type Params = sig | |
type a | |
type b | |
type c | |
val kind : (a,b) Bigarray.kind |