Skip to content

Instantly share code, notes, and snippets.

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

shubham shubhamkumar13

๐Ÿ˜‘
is existing
View GitHub Profile
@shubhamkumar13
shubhamkumar13 / cached_vs_uncached.md
Created October 26, 2020 12:54
cached vs uncached
name cached vs uncached
0 LU_decomposition.1024 0 (0.0%)
1 bdd.26 2 (0.04265301770100235%)
2 binarytrees5.21 0 (0.0%)
3 cpdf.blacktext 0 (0.0%)
4 cpdf.scale 0 (0.0%)
5 cpdf.squeeze 0 (0.0%)
6 cubicle.german_pfs.cub 0 (0.0%)
7 cubicle.szymanski_at.cub 0 (0.0%)
@shubhamkumar13
shubhamkumar13 / report_minor_collections.md
Created October 23, 2020 12:44
younglimit vs 2bb2bde
name variant gc.minor_collections
10 LU_decomposition.1024 4.12.0+PR+2bb2bde 8218
10 LU_decomposition.1024 4.12.0+younglimit 8218
31 bdd.26 4.12.0+PR+2bb2bde 4689
31 bdd.26 4.12.0+younglimit 4691
24 binarytrees5.21 4.12.0+PR+2bb2bde 3527
24 binarytrees5.21 4.12.0+younglimit 3527
29 cpdf.blacktext 4.12.0+younglimit 221
29 cpdf.blacktext 4.12.0+PR+2bb2bde 221
@shubhamkumar13
shubhamkumar13 / report.md
Created October 23, 2020 12:40
younglimit vs 2bb2bde

| | name | command | time_secs | user_time_secs | sys_time_secs | maxrss_kB | codesize | ocaml_url | ocaml.version | ocaml.c_compiler | ocaml.architecture | ocaml.word_size | ocaml.system | ocaml.function_sections | ocaml.supports_shared_libraries | gc.allocated_words | gc.minor_words | gc.promoted_words | gc.major_words | gc.minor_collections | gc.major_collections | gc.heap_words | gc.heap_chunks | gc.top_heap_words | gc.compactions | gc.forced_major_collections | variant | display_name | |---:|:-----------------------------------|:--------------------------------------------------------------------------------------------------------------------|------------:|-----------------:|----------------

@shubhamkumar13
shubhamkumar13 / valid_parenthesis.rs
Created October 23, 2020 03:43
Leetcode - Valid Parenthesis
// Problem link -> https://leetcode.com/problems/valid-parentheses/
fn main() {
assert_eq!(Solution::is_valid("()".to_string()), true);
assert_eq!(Solution::is_valid("()[]{}".to_string()), true);
assert_eq!(Solution::is_valid("(]".to_string()), false);
assert_eq!(Solution::is_valid("([)]".to_string()), false);
assert_eq!(Solution::is_valid("{[]}".to_string()), true);
assert_eq!(Solution::is_valid("]".to_string()), false);
}
type matrix = (int * int) * float array array
exception NonSquare
exception ImproperDimensions
let empty (rows : int) (columns : int) : matrix =
if rows > 0 && columns > 0 then
try
let m = Array.make_matrix rows columns 0. in
@shubhamkumar13
shubhamkumar13 / inv_ut.md
Created October 16, 2020 10:38
Inverse of upper triangular matrix
In [24]: A = [[1, 2, 3], [0, 4, 5], [0, 0, 6]]                                                 

In [25]: n = len(a[0])                                                                         

In [26]: B = zeros(n)                                                                          

In [27]: for i in range(0, n): 
    ...:     B[i][i] = 1/A[i][i] 
 ...: for j in range(0, i-1): 
@shubhamkumar13
shubhamkumar13 / fft.md
Created October 13, 2020 17:30
redoing fft

| | name | command | time_secs | user_time_secs | sys_time_secs | maxrss_kB | codesize | ocaml_url | ocaml.version | ocaml.c_compiler | ocaml.architecture | ocaml.word_size | ocaml.system | ocaml.function_sections | ocaml.supports_shared_libraries | gc.allocated_words | gc.minor_words | gc.promoted_words | gc.major_words | gc.minor_collections | gc.major_collections | gc.heap_words | gc.heap_chunks | gc.top_heap_words | gc.compactions | gc.forced_major_collections | variant | display_name | |---:|:-------|:-------------------------------|------------:|-----------------:|----------------:|------------:|-----------:|:---------------------------------------------------------------------------------------|:-----------------------|:-------------------|:---------------------|------------------:|:---------------|:--------------------------|:--------

@shubhamkumar13
shubhamkumar13 / error.md
Created October 13, 2020 03:30
error log
sk@pop-os:~ $ git clone https://github.com/utkarshkukreti/reaml-starter
Cloning into 'reaml-starter'...
remote: Enumerating objects: 118, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 118 (delta 73), reused 77 (delta 36), pack-reused 0
Receiving objects: 100% (118/118), 177.60 KiB | 103.00 KiB/s, done.
Resolving deltas: 100% (73/73), done.
sk@pop-os:~ $ cd reaml-starter/
@shubhamkumar13
shubhamkumar13 / csv_to_html_table.ml
Created October 12, 2020 17:02
Convert as csv to an html table
module String = struct
include Astring.String
let tail str = with_index_range ~first:1 ~last:(length str) str
end
let create_thead str =
let rec loop acc_lst acc_str str =
match String.head str with
| Some ch when ch = ',' -> loop (acc_str :: acc_lst) "" (String.tail str)

| | name | command | time_secs | user_time_secs | sys_time_secs | maxrss_kB | codesize | ocaml_url | ocaml.version | ocaml.c_compiler | ocaml.architecture | ocaml.word_size | ocaml.system | ocaml.function_sections | ocaml.supports_shared_libraries | gc.allocated_words | gc.minor_words | gc.promoted_words | gc.major_words | gc.minor_collections | gc.major_collections | gc.heap_words | gc.heap_chunks | gc.top_heap_words | gc.compactions | gc.forced_major_collections | variant | |---:|:-------|:-------------------------------|------------:|-----------------:|----------------:|------------:|-----------:|:---------------------------------------------------------------------------------------|:-----------------------|:-------------------|:---------------------|------------------:|:---------------|:--------------------------|:-------------------------