Skip to content

Instantly share code, notes, and snippets.

@shreydesai
shreydesai / mongodb_redis_test.py
Created July 2, 2016 00:02
Benchmark performance test for writing and reading operations in MongoDB and Redis
from pymongo import MongoClient
from time import time
import redis
import sys
SIZE = int(sys.argv[1])
MONGODB_READ_RESULTS = 0
MONGODB_WRITE_RESULTS = 0
REDIS_READ_RESULTS = 0
REDIS_WRITE_RESULTS = 0
@shreydesai
shreydesai / A8Tester.java
Created October 27, 2016 14:18
CS 314 Assignment 8 Tests
private static boolean test(Object exp, Object actual, String test) {
String output = null;
if (exp.equals(actual)) {
output = "✔ Passed " + test;
System.out.println(output + "\n");
return true;
}
output = "***** FAILED ***** " + test + "\n" +
"Expected: " + exp + ", Actual: " + actual;
System.out.println(output + "\n");
@shreydesai
shreydesai / A9Tester.java
Created November 3, 2016 19:50
CS 314 Assignment 9 Tests
public class SetTester {
/**
* Runs tests on primitive data types
* pre: exp != null, actual != null, test != null
* post: output test failure or success
*/
private static boolean test(Object exp, Object actual, String test) {
String output = null;
if (exp.equals(actual)) {
@shreydesai
shreydesai / A10Tester.java
Created November 15, 2016 03:43
CS 314 Assignment 10 Tests
import java.util.ArrayList;
public class BSTTester {
/**
* Runs tests on primitive data types
* pre: exp != null, actual != null, test != null
* post: output test failure or success
*/
private static boolean test(Object exp, Object actual, String test) {
@shreydesai
shreydesai / A11Test.txt
Created November 29, 2016 20:01
Test log for Huffman coding
TEST SUMMARY
Test name: C S 314 Assignment 11 (Huffman) scoring test
Results: Passed: 26, Failed: 0, No result: 0
Classes tested:
* class SimpleHuffProcessor, loaded from file:/Users/shreydesai/Documents/workspace/Huffman/bin/
Environment: Java version 1.8.0_91, maximum heap size 3641 MB, running on Mac OS X 10.11.6 (x86_64)
@shreydesai
shreydesai / A12Tester.java
Created December 5, 2016 21:56
CS 314 Assignment 12 Tests
public class GraphAndRankTester {
public static void main(String[] args) {
testGraph1();
testGraph2();
testFootballRanker();
}
private static void testGraph1() {
@shreydesai
shreydesai / mass_email.py
Created January 6, 2017 19:53
Mass personalized email script
"""Mass personalized email script"""
import sys
import smtplib
import argparse
from email import encoders
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
@shreydesai
shreydesai / .tmux.conf
Created January 25, 2018 20:22
Tmux Config File
# Reload config
bind r source-file ~/.tmux.conf; display ' Reloaded'
# Colors
set -g default-terminal "screen-256color"
# Remaps leader
set-option -g prefix C-a
bind-key C-a last-window
@shreydesai
shreydesai / .vimrc
Created January 30, 2018 21:04
Vim Config File
colorscheme dracula
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Use filetype detection and file-based automatic indenting.
filetype plugin indent on
" Use actual tab chars in Makefiles.
autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
endif
@shreydesai
shreydesai / dracula.vim
Created January 30, 2018 21:05
Dracula Vim Theme
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "dracula"
hi Cursor ctermfg=17 ctermbg=231 cterm=NONE guifg=#282a36 guibg=#f8f8f0 gui=NONE