Skip to content

Instantly share code, notes, and snippets.

View sushain97's full-sized avatar

Sushain Cherivirala sushain97

View GitHub Profile
sushain97 / fenwick.ijs
Last active December 9, 2021 17:24
Fenwick tree implemented in J
NB. Implementation TODO: customizing assoc. fn?, custom OOB error?
coclass 'FenwickTree'
lsb =. #.@(#:*.#:@-) NB. TODO: Can I get rid of the repeated #.?
add =: 4 : 0 NB. i add v
idxs =. }:(<.&(#arr))@(+lsb@>:)^:a:x
arr =: (y+idxs{arr)idxs}arr
create =: 3 : 'arr =: y $ 0' NB. N TODO: Can this be tacit?
range =: 3 : 0 NB. range i j TODO: Can I accept only #2 list?
'i j' =. y
wget -O dial_up.ogg --no-clobber --quiet
while true
if ping -c 1 >> /dev/null 2>&1; then
<!DOCTYPE html>
<html lang="en">
<title>Apertium Source Browser</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="">
<link href="//" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="//" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
#!/usr/bin/env python3
import argparse
import hmac
import hashlib
import datetime
import urllib.parse
import collections
import operator
import base64
def min_hitting_set(students):
def help(students, tests):
students = sorted(list(filter(lambda s: s and not (s & tests), students)), key=set.__len__)
if students:
student, *students = students
return min(map(lambda t: help(students, set([t]) | tests), student), key=set.__len__)
return tests
return help(students, set())
sushain97 / Dockerfile
Last active April 27, 2018 01:35
FROM debian:jessie-slim
LABEL maintainer
RUN apt-get -qq update && apt-get -qq install apt-utils wget
RUN bash
RUN apt-get -qq update && apt-get -qq install \
sushain97 /
Last active February 14, 2017 20:59
rm -rf /tmp/handins/*; mkdir -p /tmp/handins; cd /afs/; for tarfile in *.tar; do tar -xf "$tarfile" -C /tmp/handins "code/hw03.sml" 2> /dev/null; mv /tmp/handins/code/hw03.sml "/tmp/handins/$tarfile.sml"; done; rm -r /tmp/handins/code;
python3 ~/private/ /tmp/handins
~/private/moss -l ml -b ~/private/15150-TA/asgn/hw/03/src/dist/hw03.sml /tmp/handins/* && rm -rf /tmp/handins/*
cd /afs/; rm -rf /tmp/handins/*; mkdir -p /tmp/handins; for tarfile in *.tar; do tar -xf "$tarfile" -C /tmp/handins hw03.pdf 2> /dev/null; pdftotext -q /tmp/handins/hw03.pdf "/tmp/handins/$tarfile.txt"; rm /tmp/handins/hw03.pdf; done;
python3 ~/private/ /tmp/handins
cd ~/private/15150-TA/asgn/hw/03/writeup/ && make && pdftotext bin/hw03-handout.pdf ~/private/hw03-handout.txt
~/private/moss -l ascii -b ~/private/hw03-handout.txt /tmp/handins/* && rm -rf /tmp/handins/*
rm -rf /tmp/handins/*; mkdir -p
import sys
import os
import collections
import itertools
import pprint
filenames = list(os.listdir(sys.argv[1]))
# filenames = list(filter(lambda x: any(map(lambda y: x.startswith('%s@' % y), andrew_ids)), filenames))
grouped_filenames = collections.defaultdict(list)
for filename in filenames:
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="author" content="Sushain K. Cherivirala (">
<title>CMU Senate: Faculty Student Lunch Professors</title>
<script type="text/javascript" src="//"></script>

Keybase proof

I hereby claim:

  • I am sushain97 on github.
  • I am sushain ( on keybase.
  • I have a public key ASAa5PVbF3RDg8gQxUEQk92URQeLFGyANKd3bZ0RndWAhgo

To claim this, I am signing this object: