Skip to content

Instantly share code, notes, and snippets.

View edwintorok's full-sized avatar
💭
I may be slow to respond.

Török Edwin edwintorok

💭
I may be slow to respond.
View GitHub Profile
test_entropy alias tests/runtest
no CPU RNG available
test entropy OK
test_symmetric_runner alias tests/runtest
accel:
..............................................................................................................................................
Ran: 142 tests in: 0.54 seconds.
OK
test_random_runner alias tests/runtest
.........
@edwintorok
edwintorok / rdrand.c
Created January 11, 2021 23:13
gcc rdrand.c -O2 -o rdrand -fopenmp -Wall
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff -rwu chase-lev-deque/deque.c chase-lev-deque-bugfix/deque.c
--- chase-lev-deque/deque.c 2020-08-25 20:29:46.964661118 +0100
+++ chase-lev-deque-bugfix/deque.c 2020-08-25 20:29:46.963661116 +0100
@@ -50,7 +50,7 @@
for(i=top; i < bottom; i++) {
atomic_store_explicit(&new_a->buffer[i % new_size], atomic_load_explicit(&a->buffer[i % size], memory_order_relaxed), memory_order_relaxed);
}
- atomic_store_explicit(&q->array, new_a, memory_order_relaxed);
+ atomic_store_explicit(&q->array, new_a, memory_order_release);
printf("resize\n");
@edwintorok
edwintorok / codegen.ml
Last active August 23, 2020 20:42
ocaml code generator
let prologue =
{|
(* This code is automatically generated *)
let string_of_string x = x
|}
let epilogue =
{|
let print t = pp Format.std_formatter t
let prologue =
{|
{-# language DeriveGeneric #-}
module Parser where
import Data.Csv
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import GHC.Generics
import Control.Monad
open Sexplib
let reformat sexp = sexp
let vparens pp ppf = Fmt.pf ppf "@[<v1>(%a)@]" pp
let slist = Fmt.(list ~sep:sp)
let spair = Fmt.(pair ~sep:sp)
let canonicalize_set = List.sort_uniq (*Sexp.*)compare

Keybase proof

I hereby claim:

  • I am edwintorok on github.
  • I am edwintorok (https://keybase.io/edwintorok) on keybase.
  • I have a public key whose fingerprint is B32F 9BE2 E22D 4615 ABD2 CE8E 814A 3A7A 06AA 1295

To claim this, I am signing this object:

Script started on Sun 08 Jan 2017 02:58:15 PM EET
[edwin@bolt mobile]$ eliom-distillery -name ocsimobile -template os.pgocaml && cd ocsimobile && sed -i -e '/CREATE EXTENSION citext/d
' ocsimobile.sql && sed -i -e 's/citext/text/g' ocsimobile.sql
Destination directory "ocsimobile" doesn't exist. Create it? (YES/no) y
Generated ocsimobile/demo_react.eliom
Generated ocsimobile/mobile/www/img/logo.png
Generated ocsimobile/ocsimobile_tips.eliomi
Generated ocsimobile/ocsimobile_drawer.eliom
Generated ocsimobile/mobile/.chcpignore
Generated ocsimobile/Makefile.options