I hereby claim:
- I am connorbaker on github.
- I am connorbaker (https://keybase.io/connorbaker) on keybase.
- I have a public key ASDavI4e5NYfd4HiaXd8ehN-lv_erDyAQD_t-nJt0bTjDgo
To claim this, I am signing this object:
| {-# LANGUAGE DeriveFoldable, DeriveFunctor, ScopedTypeVariables #-} | |
| module Main where | |
| import Prelude hiding ( Left | |
| , Right | |
| ) | |
| import Data.List hiding ( insert ) | |
| import Control.Monad |
| {-# LANGUAGE DeriveFoldable, DeriveFunctor, ScopedTypeVariables #-} | |
| module Main where | |
| import Data.List hiding ( insert ) | |
| import Control.Monad | |
| data BTree a = Leaf | Branch (BTree a) a (BTree a) | |
| deriving (Eq, Foldable, Functor, Ord, Show) |
| import json | |
| from typing import Any, List, Type, Union | |
| db_names: List[str] = [] | |
| db_name_prefix: str = 'db' | |
| db_name_extension: str = '.json' | |
| BOILER_PLATE: str = """drop table if exists department; | |
| drop table if exists course; | |
| drop table if exists prereq; |
I hereby claim:
To claim this, I am signing this object:
| module WeightForWeight | |
| ( main | |
| ) | |
| where | |
| import Data.Char | |
| import Data.List | |
| -- Inspired by https://raymii.org/s/blog/Weight_for_Weight_a_coding_exersize_that_kept_me_busy.html |
| fn contiguous_subsequences(v: Vec<u64>) -> Vec<Vec<u64>> { | |
| let n = v.len(); | |
| let mut ret: Vec<Vec<u64>> = vec![Vec::with_capacity(1); n * (n + 1) / 2]; | |
| let mut index: usize = 0; | |
| for i in 1..n + 1 { | |
| for j in 0..n - i + 1 { | |
| ret[index] = v[j..j + i].to_vec(); | |
| index+=1; | |
| } |
| import java.util.ArrayList; | |
| import java.util.BitSet; | |
| import java.util.List; | |
| import java.util.stream.IntStream; | |
| import java.util.stream.LongStream; | |
| import static java.util.stream.Collectors.toList; | |
| public class Main { | |
| public static List<Long> binaryNialpdromes(int n) { |
| public static List<Long> binaryNialpdromes(int n) { | |
| final var ret = new ArrayList<Long>(n*(n+1)/2); | |
| for (int i = 0; i < n; i++) { | |
| for (int j = 0; j < i; j++) { | |
| ret.add((long) (Math.pow(2.0, i) - Math.pow(2.0, j))); | |
| } | |
| } | |
| return ret; |
| {-# OPTIONS_GHC -Wall -Wredundant-constraints -Wall-missed-specialisations#-} | |
| -- The more things that we export from the module, the larger the performance | |
| -- penalty. This is odd and I don't like it. | |
| module Lib | |
| ( someFunc | |
| -- , selectFrom | |
| -- , binaryNialpdromes | |
| -- , binaryNialpdromesOfLength | |
| -- , powersOfTwo |