Beej's Guide to Network Programming in OCaml: showip.ml
I’m reading Beej’s Guide to Network Programming and porting the examples to OCaml for fun.
The first example is showip.ml (adapted from showip.c) from Section 5.1. This program takes a hostname as command-line argument, and prints the list of addresses suitable for communicating with that host as per getaddrinfo:
let () = match Sys.argv with | [| _; hostname |] -> let addr_infos = let service = "" in let opts = Unix.…
Read more ⟶
Sentence Spacing in Emacs
I don’t end sentences with a double space. But since type writers, some people end sentences with two spaces.
By default, Emacs considers that sentences are terminated by two spaces. I’d assume this is contrary to the expectation of most modern users. To change this, set sentence-end-double-space to nil:
(setq sentence-end-double-space nil) This will, for example, affect the behavior of M-x fill-paragraph, which by default introduces double spacing when joining lines.…
Read more ⟶