This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- stack script | |
--resolver lts-15.5 | |
-} | |
-- To run: | |
-- stack BitonicSort.hs | |
module BitonicSort where | |
import Data.Bits as B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name remove-title-notifications | |
// @namespace distractions | |
// @version 0.1 | |
// @description Tampermonkey script to remove unread notification count from tab titles | |
// @author Viswanath Sivakumar | |
// @match */* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 3d4383d88346b60d669ce72fa4e2a6d4a5e4861d | |
Author: Viswanath Sivakumar <[email protected]> | |
Date: Tue Aug 25 10:49:59 2020 -0400 | |
TODO nocommit | |
diff --git a/platform/pybmi/pybmi/modeling/keystrokes/corpus.py b/platform/pybmi/pybmi/modeling/keystrokes/corpus.py | |
index 30b4b8fd9..9f1bd7431 100644 | |
--- a/platform/pybmi/pybmi/modeling/keystrokes/corpus.py | |
+++ b/platform/pybmi/pybmi/modeling/keystrokes/corpus.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/platform/pybmi/pybmi/torch/__init__.py b/platform/pybmi/pybmi/torch/__init__.py | |
index fa5c5f69a..71e24ea74 100644 | |
--- a/platform/pybmi/pybmi/torch/__init__.py | |
+++ b/platform/pybmi/pybmi/torch/__init__.py | |
@@ -3,5 +3,5 @@ from .modules import ( | |
GRU, LSTM, Conv1d, Conv2d, MaxPool2d, Module, Permute, Permuted, | |
RotationInvariantMLP, Sequential, SkipConnection, Slice, StackTime, | |
Stateless, StatelessWrapper, TdsFullyConnectedBlock, TdsConv2dTimeBlock, | |
- TdsBlock, DistributedDataParallel, save) | |
+ TdsBlock, DistributedDataParallel, save, BatchNorm1d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Mapping | |
class Solution: | |
dp: Mapping[int, Mapping[int, int]] = {} | |
def minDifficulty(self, jobDifficulty: List[int], d: int) -> int: | |
self.jobDifficulty = jobDifficulty | |
self.n = len(jobDifficulty) | |
self.d = d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Trie: | |
def __init__(self, character, prob): | |
self.character = character | |
self.probability = prob | |
self.children = {} | |
def add_child(self, child): | |
assert self.character != '$', "Cannot add child to end token" | |
if child.character not in self.children: | |
self.children[child.character] = child |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
## Input: | |
# 3 3 | |
# 6 7 9 | |
# 2 8 1 | |
# 3 4 4 | |
# 2 | |
# 0 0 1 1 1 1 2 2 | |
# 0 0 2 2 0 2 1 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Globber (matchGlob, parseGlob, GlobPattern) where | |
type GlobPattern = String | |
type AST = [Node] | |
data Node = Literal Char | AnyChar | AnyString | SetMatch Ranges String deriving (Show, Eq) | |
type Ranges = [(Char, Char)] | |
parseGlob :: GlobPattern -> AST | |
parseGlob [] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
# Axes3D import has side effects, it enables using projection='3d' in add_subplot | |
import matplotlib.pyplot as plt | |
import random | |
import copy | |
# From https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf | |
# | |
# Linear equations: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
# Axes3D import has side effects, it enables using projection='3d' in add_subplot | |
import matplotlib.pyplot as plt | |
import random | |
# From https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf | |
# | |
# Linear equations: | |
# 3x + 2y = 2 |
NewerOlder