Skip to content

Instantly share code, notes, and snippets.

View tarunbod's full-sized avatar

Tarun Boddupalli tarunbod

  • GitHub
View GitHub Profile
@tarunbod
tarunbod / BinomialExpansion.java
Last active March 4, 2024 03:57
Binomial Expansion in Python
/**
* APCS-Programs
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Tarun Boddupalli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@tarunbod
tarunbod / sensor.ino
Created January 22, 2016 22:27
Arduino Ultrasonic Sensor Test
#define trigPin 11
#define echoPin 12
#define led 13
long distance, duration, lastDistance;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(trigPin, OUTPUT);
@tarunbod
tarunbod / light_sense.ino
Created January 23, 2016 22:26
Arduino - Turn on LED based on Photoresistor value
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
int lightLevel = analogRead(0);
if (lightLevel < 150) {
digitalWrite(13, HIGH);
} else {
@tarunbod
tarunbod / hex.py
Created July 26, 2016 21:56
Python command line hex-byte viewer
#!/usr/bin/env python
import os
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("file", help="which file to view in hex format")
parser.add_argument("-f", "--head", help="if given, show only the first n*16 bytes", type=int)
parser.add_argument("-t", "--tail", help="if given, show only the last n*16 bytes", type=int)
parser.add_argument("-s", "--split", help="if given, show n bytes per line", type=int, default=16)
@tarunbod
tarunbod / GradeChecker.java
Created November 1, 2016 22:15
Check your grades for parent portal
package me.tarunb.gradechecker;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.io.File;
import java.io.PrintStream;
@tarunbod
tarunbod / rockPaperScissors.py
Last active February 2, 2018 00:55 — forked from bharddwaj/rockPaperScissors.py
rock paper scissors in python for practice.
import random
def computerChoice():
random.seed()
a = random.randint(1,3)
choices = ["rock", "scissors", "paper"]
return choices[a - 1] ''' if a is 1, it'll return choices[0] which is rock, etc. '''
'''
if(a == 1):
@tarunbod
tarunbod / Mandelbrot.pde
Created January 27, 2019 01:34
mandelbrot processing sketch
double xmin = -2, xmax = 2;
double ymin = -2, ymax = 2;
double cx = /*0.13499624814721625;*/ 0.25; //-1.787; // -1.785
double cy = /*-0.9999288539922775;*/ 0;
double dx;
double dy;
int counter = 0;
@tarunbod
tarunbod / test.sh
Last active March 19, 2020 23:27
put this file in your project folder and run it with `sh test.sh`
echo "Generating inputs..."
# Generate random inputs
echo $RANDOM > sample0.tinyL.in
echo $RANDOM >> sample0.tinyL.in
echo $RANDOM >> sample0.tinyL.in
# echo >> sample0.tinyL.in
echo $RANDOM > sample1.tinyL.in
# echo >> sample1.tinyL.in
HELLO WORLD
WHAT IS GOING ON
THIS IS A TEST TEXT FILE
YOOHOO
{"scores":{"main":{"score":100,"hints":[]}},"scoreboard":[100]}