package granary
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Pure-OCaml SQL engine
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11
doc/src/granary.encoding/null_bitmap.ml.html
Source file null_bitmap.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50module Bigarray = Bigarray let pack_bits_of_bools is_null n = let n_bytes = (n + 7) / 8 in let b = Bytes.make n_bytes '\x00' in for i = 0 to n - 1 do if is_null i then ( let byte_idx = i / 8 in let bit_idx = i mod 8 in Bytes.set_uint8 b byte_idx (Bytes.get_uint8 b byte_idx lor (1 lsl bit_idx))) done; b ;; let pack_bits bits n = pack_bits_of_bools (fun i -> Bigarray.Array1.get bits i <> 0) n let pack_bits_into buf bits n = let n_bytes = (n + 7) / 8 in for j = 0 to n_bytes - 1 do let acc = ref 0 in let base = j * 8 in for k = 0 to 7 do let idx = base + k in if idx < n && Bigarray.Array1.get bits idx <> 0 then acc := !acc lor (1 lsl k) done; Buffer.add_char buf (Char.chr !acc) done ;; let unpack_bits buf off n = let bits = Bigarray.Array1.create Bigarray.int8_unsigned Bigarray.c_layout n in for i = 0 to n - 1 do let byte_idx = i / 8 in let bit_idx = i mod 8 in let is_set = (Bytes.get_uint8 buf (off + byte_idx) lsr bit_idx) land 1 in Bigarray.Array1.set bits i is_set done; bits ;; let unpack_bits_to_bools buf off n = let result = Array.make n false in for i = 0 to n - 1 do let byte_idx = i / 8 in let bit_idx = i mod 8 in result.(i) <- (Bytes.get_uint8 buf (off + byte_idx) lsr bit_idx) land 1 = 1 done; result ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>