Skip to content

Instantly share code, notes, and snippets.

View rrajasek95's full-sized avatar

Rishi Rajasekaran rrajasek95

View GitHub Profile
@rrajasek95
rrajasek95 / util.py
Last active August 22, 2018 07:33
Python Snippets
"""
A set of basic util functions.
They're pretty simple recipes which can be stored as snippets.
Available at:
https://gist.github.com/rrajasek95/3c43fafdd85d02e55dc2d5fad8798ac2
"""
from itertools import repeat
import sys

Keybase proof

I hereby claim:

  • I am rrajasek95 on github.
  • I am rrajasek95 (https://keybase.io/rrajasek95) on keybase.
  • I have a public key ASCh-KQKQ71NS4buH5wWWFFO7KqUkekgpiDMMsb3AWqBRAo

To claim this, I am signing this object:

@rrajasek95
rrajasek95 / convert-wav.sh
Last active July 26, 2017 18:17
Data Processing of recordings for Transcriber Qualification
#!/usr/bin/env bash
source functions.sh
folder=$1
find $folder -name "*.mp3" | while read file;
do
basename=${file%.mp3}
echo "Converting $basename"
f_mp3towav $file $basename".wav"
done
@rrajasek95
rrajasek95 / addagrams.py
Created June 4, 2017 22:08
A command line python script to help generate addagrams
"""Addagrams."""
import argparse
import pickle
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def load_dictionary(filename):
with open(filename) as file:
words = [word.strip().lower() for word in file]
@rrajasek95
rrajasek95 / transcription_form.html
Created March 20, 2017 18:25
Converted the form at http://talknicer.com/recdemo/ to one that supports the writing of a transcript for a given audio.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Exemplar Provider Registration</title>
<style type="text/css">
body {
font: 16px "Open Sans", Helvetica, Arial, sans-serif;
color: white;
background-color: #003300;
@rrajasek95
rrajasek95 / crypto-assignment-3-solns-16-to-24.md
Last active May 27, 2019 04:30
Crypto Assignment 3 Solutions

16. Using only CRT show that if $x \equiv y \ (mod\ p) $ and $ x \equiv y \ (mod \ q) $, then $ x \equiv y \ (mod \ N)$ where $N = pq$

According to Chinese Remainder Theorem: If $ a \equiv b\ (mod \ m) $ and $ a \equiv c \ (mod \ n) $, then: $ a \equiv cm((m^{-1}(mod \ n) + bn(n^{-1}(mod \ m)\ (mod \ mn)$

Then by CRT: $$ \begin{align} x &\equiv yp(p^{-1}(mod\ q)) + yq(q^{-1}(mod\ p) (mod\ N) \ &\equiv y(p(p^{-1}(mod \ q)) + q(q^{-1}(mod \ p))) - (1)

@rrajasek95
rrajasek95 / assignment-solutions-16-to-21.md
Last active May 27, 2019 04:27
Crypto assignment 2 Solutions

16 Birthday Paradox

The Birthday Paradox question is stated as follows:

Given that there are $k$ people in a room, what is the minimum value of $k$ that the probability that any two people in the room share a birthday is at least $\frac{1}{2}$

We can note the following events:

  • A = nobody shares a birthday
  • B = At least two people share a birthday

$$ P(B) = 1 - P(A) $$