Skip to content

Instantly share code, notes, and snippets.

View vingkan's full-sized avatar

Vinesh Kannan vingkan

  • Ambience
  • San Francisco, California
View GitHub Profile
@vingkan
vingkan / database-items.txt
Last active November 24, 2017 17:37
Text Files as a Database
Make my CS100 project awesome
@vingkan
vingkan / solution.sql
Created November 14, 2017 23:20
11/17 Solutions: Two Truths and a Lie with the COPA Dataset
# There are more than 16,000 complaints submitted by males. (True)
SELECT COUNT(*)
WHERE sex_of_complainants = "Male"
SELECT COUNT(*)
WHERE sex_of_complainants LIKE "%Male%"
# Excessive Force was the most common category of complaints in September 2017. (True)
@vingkan
vingkan / readme.md
Last active November 12, 2017 02:28
ScarletHacks Java Battleship Tournament

Java Battleships

Instructions

  1. Visit class.mimir.io and create an account. Click the Join Course button in the left pane and enter the code 13eaf0a5e1 to join the Battleships tournament.
  2. Find the Battleships project and click Open IDE to access the development area for this challenge.
  3. Open ships/BattleShip.java and edit the name and owner of your ship. A very basic ship has been created for you. Can you figure out what it does?
  4. Simulate the battle. Run these commands in the terminal each time you want to test your ship.
javac battlehub/TeamMain.java
java battlehub.TeamMain
@vingkan
vingkan / instructions.md
Last active September 21, 2021 07:39
Getting Started with Nightmare.js

Getting Started with Nightmare.js

In today's Testing Analyst workshop, we played around with Nightmare.js, a JavaScript browser automation library that is useful for testing website interfaces.

It is easier to work with Nightmare on your computer, rather than to use it in Cloud9. Here are the instructions to install and get started.

Step 1. Install Node.js

JavaScript normally runs in the browser. Node.js is a version of JS that can run on a server, in a terminal, or on some other device. It allows you to easily prepare and run Nightmare scripts.

@vingkan
vingkan / README.md
Last active September 24, 2017 03:43
Battleship Quick Start

Battleship Quick Start

Clone the Respositories

~workspace $ git clone https://github.com/illinoistechesi/battleship.git
~workspace $ git clone https://github.com/illinoistechesi/battlehub.git

Setup Your Directory

@vingkan
vingkan / README.md
Last active September 17, 2017 03:19
Rover Mission Activity

Rover Mission: Part I

Activity Time: 20 minutes

To access this activity, go to Cloud9 and clone the workspace: vingkan/rover_mission

You are an engineer at a space exploration agency that is creating a rover to conduct research on another planet. These missions last many years and cost millions of dollars. It would be anticlimactic and frustrating to launch and land a rover, only to have it fail due to programming errors.

The prototyping team has created a software project to simulate sending commands to the rover in a test terrain environment. You get the fun assignment: break it.

@vingkan
vingkan / hawklinkrosterscraper.js
Created September 14, 2017 19:58
Improved Roster Scraper for Campus Labs
var orgID = // Your Organization ID;
getOrganization(orgID, 1).then((initialOrg) => {
getOrganization(orgID, initialOrg.totalItems).then((fullOrg) => {
let promises = [];
fullOrg.items.forEach((item) => {
let memberID = item.account.id;
let p = getMember(memberID);
promises.push(p);
});
Promise.all(promises.map(reflectPromise)).then((res) => {
@vingkan
vingkan / hawklinkscraper.js
Created September 12, 2017 00:49
Scrape emails from HawkLink roster page.
var container = document.querySelector('[role="main"]').children[0].children[3].children[0].children[1].children[0];
var boxes = Array.from(container.children);
var results = [];
getEmailByBoxIndex({
container: container,
results: results,
boxes: boxes,
index: 0,
callback: printResults
});
@vingkan
vingkan / MinHealthSearch.java
Last active September 3, 2017 01:21
Battleships: Searching for an enemy ship with the lowest health to fire at.
@Override
public void doTurn(Arena arena) {
// Fill in your strategy here
int minHealth = 100;
this.move(arena, Direction.EAST);
Ship target = null;
List<Ship> nearby = this.getNearbyShips(arena);
for (int i = 0; i < nearby.size(); i++) {
Ship ship = nearby.get(i);
String myTeam = this.getTeam();
@vingkan
vingkan / SampleStrategy.java
Last active September 3, 2017 01:00
Battleships: Sample Student Strategy
@Override
public void doTurn(Arena arena) {
//Fill in strategy here
this.move(arena, Direction.NORTH);
List<Ship> nearby = this.getNearbyShips(arena);
for (int i = 0; i < nearby.size(); i++)
{
Ship unknown = nearby.get(i);
boolean isOnMyTeam = this.isSameTeamAs(unknown);
if (isOnMyTeam) {