Skip to content

Instantly share code, notes, and snippets.

View tarunbod's full-sized avatar

Tarun Boddupalli tarunbod

View GitHub Profile

Lab 5.15

def caesar_cipher_encrypt(text, key, a):
    text = text.upper()
    encrypted_Text = ""
    for i in text:
        if i in a:
            index = (a.find(i) + key) % len(a)
            encrypted_Text = encrypted_Text + a[index]
        else:
@tarunbod
tarunbod / Controller.java
Created March 12, 2021 17:33
Import and Export with txt files
public class Controller {
/**
Controller method that is called when the user clicks "Import From File"
on the fourth tab in the application. This method asks the user to select
a text file that contains account database information, reads the file,
and populates the account database with the accounts found in the file.
Prints errors if the file could not be read or if it was in a bad format.
@param event the ActionEvent generated by the button press. Ignored for
our purposes.
*/
{"scores":{"main":{"score":40,"max_score":50,"output":{"hints":["hint"]}}},"scoreboard":[97],"version":"2.0"}
{"scores":{"main":{"score":100,"hints":[]}},"scoreboard":[100]}
HELLO WORLD
WHAT IS GOING ON
THIS IS A TEST TEXT FILE
YOOHOO
@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
@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 / 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 / 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 / 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)