Skip to content

Instantly share code, notes, and snippets.

View csabatini's full-sized avatar

Caleb Sabatini csabatini

View GitHub Profile
@csabatini
csabatini / Movie.java
Last active February 21, 2019 14:15
Movie.java
/** PROGRAM ASSIGNMENT 5 Movie.java
*
* Program Description
* This is the Movie class, which includes instance variables and instance
* methods that describe the Movie abstract data type.
*
*/
package library.films;
@csabatini
csabatini / Profitable.java
Last active December 16, 2015 10:59
Profitable.java
/** PROGRAM ASSIGNMENT 5 Profitable.java
*
* Program Description
* This is the Profitable interface, to be implemented in the Movie class
* and inherited by its subclasses.
*
*/
package library.films;
@csabatini
csabatini / Drama.java
Created April 20, 2013 02:07
Drama.java
/** PROGRAM ASSIGNMENT 5 Drama.java
*
* Program Description
* This is the Drama class, a subclass of the Movie class.
*
*/
package library.films;
public class Drama extends Movie {
@csabatini
csabatini / Documentary.java
Created April 20, 2013 02:08
Documentary.java
/** PROGRAM ASSIGNMENT 5 Documentary.java
*
* Program Description
* This is the Documentary class, a subclass of the Movie class.
*
*/
package library.films;
public class Documentary extends Movie {
@csabatini
csabatini / CalebSabatiniP5.java
Created April 20, 2013 02:10
CalebSabatiniP5.java
/** PROGRAM ASSIGNMENT 5 CalebSabatiniP5.java
*
* Program Description
* This is the client code for the Movie class and its subclasses, which
* allows the user to navigate a Warren movie theater menu.
*
*/
import library.films.*;
import java.util.Scanner;
@csabatini
csabatini / Animated.java
Created April 20, 2013 04:13
Animated.java
/** PROGRAM ASSIGNMENT 5 Animated.java
*
* Program Description
* This is the Animated class, a subclass of the Movie class.
*
*/
package library.films;
public final class Animated extends Movie {
import java.util.Scanner;
import java.util.Arrays;
public class Square {
public static void drawSquare(int dim) {
// Create an array with one string element to contain each row
String arr[] = new String[dim];
Arrays.fill(arr, "");
import java.util.Scanner;
public class Power {
public static int pow(int x, int n) {
if (n == 0)
return 1;
else
return x * pow(x, n-1);
}
from __future__ import print_function
from bs4 import BeautifulSoup
from urlparse import urlparse
from urlparse import parse_qs
import sys, logging
import mechanize
import time
import csv
import sqlite3
import requests
@csabatini
csabatini / db_setup.py
Last active August 29, 2015 14:16
MySQL-python
# MySQLdb - http://sourceforge.net/projects/mysql-python. Download MySQL-python-1.2.4b4.win32-py2.7.exe
# MySQL 5.6 Community. Download mysql-installer-web-community-5.6.23.0
import MySQLdb
db = MySQLdb.connect("localhost", "user", "pw")
cursor = db.cursor()
sql = 'CREATE DATABASE census'
cursor.execute(sql)
db.close()