Skip to content

Instantly share code, notes, and snippets.

View shubhamkumar13's full-sized avatar
๐Ÿ˜‘
is existing

shubham shubhamkumar13

๐Ÿ˜‘
is existing
View GitHub Profile
add this to the start of the crontab file to access local packages
PATH=/usr/bin:/bin:/usr/local/bin/
@shubhamkumar13
shubhamkumar13 / open_in_ocaml.ml
Created June 19, 2021 11:06
how to read a file in ocaml as a string
let read_whole_file filename =
let ch = open_in filename in
let s = really_input_string ch (in_channel_length ch) in
close_in ch;
s
{"name":"crout-decomposition.","command":"taskset --cpu-list 5 ./crout_decomposition.exe","time_secs":1.442824125289917,"user_time_secs":1.422518,"sys_time_secs":0.020035,"maxrss_kB":67204,"ocaml":{"version":"4.12.0+multicore","c_compiler":"gcc","architecture":"amd64","word_size":"64","system":"linux","function_sections":"true","supports_shared_libraries":"true","linear_magic_number":"Caml1999L029"},"gc":{"allocated_words":551063459,"minor_words":543585663,"promoted_words":298455,"major_words":7776251,"minor_collections":2076,"major_collections":7,"forced_major_collections":0,"heap_words":7772654,"top_heap_words":7772654,"mean_space_overhead":10.166362},"codesize":345866.0,"ocaml_url":"https://github.com/ocaml-multicore/ocaml-multicore/archive/4.12+domains+effects.tar.gz"}
{"name":"menhir.ocamly","command":"taskset --cpu-list 5 menhir benchmarks/menhir/ocaml.mly --list-errors -la 2 --no-stdlib --lalr","time_secs":254.9907898902893,"user_time_secs":251.28706,"sys_time_secs":3.699927,"maxrss_kB":3490192,"ocaml"
orun LU_decomposition_multicore.12_2048.orun.bench [4.12.0+domains+effects+dlabs_1] (got signal SEGV)
(cd _build/4.12.0+domains+effects+dlabs_1/benchmarks/multicore-numerical && /home/shubham/sandmark/_opam/4.12.0+domains+effects+dlabs/bin/orun -o ../../LU_decomposition_multicore.12_2048.orun.bench -- taskset --cpu-list 2-13 ./LU_decomposition_multicore.exe 12 2048 &> /dev/null
orun LU_decomposition_multicore.16_2048.orun.bench [4.12.0+domains+effects+dlabs_1] (got signal SEGV)
(cd _build/4.12.0+domains+effects+dlabs_1/benchmarks/multicore-numerical && /home/shubham/sandmark/_opam/4.12.0+domains+effects+dlabs/bin/orun -o ../../LU_decomposition_multicore.16_2048.orun.bench -- taskset --cpu-list 2-13,16-27 ./LU_decomposition_multicore.exe 16 2048 &> /dev/null
orun LU_decomposition_multicore.20_2048.orun.bench [4.12.0+domains+effects+dlabs_1] (got signal SEGV)
(cd _build/4.12.0+domains+effects+dlabs_1/benchmarks/multicore-numerical && /home/shubham/sandmark/_opam/4.12.0+domains+effects+dlabs/bin
@shubhamkumar13
shubhamkumar13 / layers.export
Created March 5, 2021 13:49
Layers Segfault opam dependencies
opam-version: "2.0"
compiler: [
"base-bigarray.base"
"base-threads.base"
"base-unix.base"
"ocaml.4.10.0"
"ocaml-variants.4.10.0+multicore"
]
roots: [
"cmdliner.1.0.4"
@shubhamkumar13
shubhamkumar13 / errors.md
Last active February 1, 2021 11:30
zero2prod
     Running target/debug/deps/health_check-1b83a7cb3a2b9b85

running 1 test
test health_check_works ... FAILED

failures:

---- health_check_works stdout ----
thread 'health_check_works' panicked at 'Failed to spawn our app.: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', tests/health_check.rs:9:23

Error on page 31 zero2prod

error[E0277]: the `?` operator can only be applied to values that implement `Try`
 --> src/main.rs:5:5
  |
5 |     run()?.await
  |     ^^^^^^ the `?` operator cannot be applied to type `impl Future`
  |
  = help: the trait `Try` is not implemented for `impl Future`
 = note: required by `into_result`
```
allocated_words: 1215299627
minor_words: 1210056741
promoted_words: 135295454
major_words: 140538340
minor_collections: 4681
major_collections: 31
heap_words: 22173184
heap_chunks: 18
top_heap_words: 22173184