Skip to content

Instantly share code, notes, and snippets.

View viswanathgs's full-sized avatar

Viswanath (Vish) Sivakumar viswanathgs

  • San Francisco, CA
View GitHub Profile
@viswanathgs
viswanathgs / BitonicSort.hs
Created November 27, 2020 18:22
Haskell bitonic sorter (non-parallel, power of 2)
{- stack script
--resolver lts-15.5
-}
-- To run:
-- stack BitonicSort.hs
module BitonicSort where
import Data.Bits as B
@viswanathgs
viswanathgs / remove-title-notifications.user.js
Last active March 24, 2024 11:26
Tampermonkey script to remove unread notification count from tab titles
// ==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==
commit 3d4383d88346b60d669ce72fa4e2a6d4a5e4861d
Author: Viswanath Sivakumar <viswanath@fb.com>
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
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)
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
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
#!/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
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 [] = []
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:
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