I hereby claim:
- I am isaiah-perumalla on github.
- I am isaiah_p (https://keybase.io/isaiah_p) on keybase.
- I have a public key ASB2WZfQUWqLR4Aci20nORmizByne74eM-xm_t-EX9diowo
To claim this, I am signing this object:
--------------------------- MODULE concurrent_map --------------------------- | |
EXTENDS TLC, Integers, FiniteSets, Sequences | |
ReaderCount == 2 | |
Readers == 1..ReaderCount | |
I hereby claim:
To claim this, I am signing this object:
package com.company; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
public class Main { | |
public static final int INF = Integer.MAX_VALUE; | |
public static void main(String[] args) { |
package practice; | |
import java.util.ArrayDeque; | |
import java.util.ArrayList; | |
import java.util.Queue; | |
import practice.BinarySearchTree.Node; | |
public class BSTPrint { | |
def calc_avg(items): | |
if not items: | |
return 0 | |
total = sum(items) | |
return float(total)/len(items) | |
def std_deviation(items): | |
if not items: return 0 | |
mean = calc_avg(items) |
//function return all subset of a list | |
sset: {[xs] (enlist ()) {x, (y,) each x }/ xs} | |
//or using the map each right /: | |
sset: {[xs] (enlist ()) {x, y ,/: x }/ xs} | |
//q)sset (1; 2; 3;`a) | |
() | |
,1 | |
,2 | |
2 1 |
I hereby claim:
To claim this, I am signing this object:
[<Measure>] type p | |
let count ps = let rec countcs acc = function | |
|[] -> acc | |
|(_, qty)::xs -> (countcs (acc+qty) xs) | |
in countcs 0 ps | |
let lessThan (x:int<p>) xs = List.filter (fun (coin, _) -> x >= coin) xs | |
let num_coins (coin:int<p>, qty:int) (amt:int<p>) = min qty (int(amt/coin)) | |
let better ps bs = |
def longest_subpalindrome_slice(s): | |
longest=(0,0) | |
start_idx=0 #index of palindrone ending at i | |
repeated = True | |
#loop invariant we know longest palindrome in s[0:i] | |
#and we know longest palidrom ending at i | |
for i in xrange(1,len(s)): | |
if(start_idx != 0 and s[start_idx-1] == s[i]) : | |
start_idx = start_idx-1 | |
repeated = False |
#include <pthread.h> | |
#include <stdio.h> | |
int x, y = 0; | |
int r0, r1; | |
void *core0 (void *arg) | |
{ | |
x = 1; | |
asm volatile ("mfence" ::: "memory"); // ensure compiler or hardware will not reorder, store buffer is drained |