This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
def facechop(image): | |
facedata = "haarcascade_frontalface_default.xml" | |
DOWNSCALE = 1 | |
cascade = cv2.CascadeClassifier(facedata) | |
img = cv2.imread(image) | |
minisize = (img.shape[1]/DOWNSCALE,img.shape[0]/DOWNSCALE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Sep 03, 2012 | |
@author: Gregory A. Thompson Jr. | |
Truth Table Tester | |
booltest.py | |
-Asks the user a truth table-related question. | |
-Spits out correct answer if the answer provided is wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int is_inside(int a[]) | |
{ | |
int to_compare, flag; //the number to compare | |
// followed by the "is inside" flag, yes or no (1, NULL) | |
flag = 0; //first it's assumed that the number to_compare to the array elements is non-existent | |
cout << "Enter a value to check for: " << endl; | |
cin >> to_compare; //set to_compare to user input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encrypt(character, password): #takes one character, one password string | |
result = (int(character) % len(password)) - ord('a') #encryption operation | |
return result | |
def convert(password): #takes one password string | |
u_list = [ord(x) for x in password] #for each character in the password, get its ordinal version; unicode each character | |
result = [] #this will hold each character that's converted | |
for i in u_list: #for each character i in the unicoded character list | |
conversion = encrypt(i, password) #convert the current character i using the encryption algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
import cookielib | |
browser = mechanize.Browser() | |
# Cookie Jar | |
cj = cookielib.LWPCookieJar() | |
browser.set_cookiejar(cj) | |
# Browser options | |
browser.set_handle_equiv(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Convert | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner inChoice = new Scanner(System.in), //input object for choice | |
inF = new Scanner(System.in), //input object for F | |
inC = new Scanner(System.in); //input object for C | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Convert | |
{ | |
public static void main(String[] args) | |
{ | |
Float f, c; //f and c represent the actual float value of the input temperature | |
Scanner inTemp = new Scanner(System.in); //holds input Scanner object | |
char type; //holds the type of input temperature F or C | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bankaccounttest; | |
public class BankAccount | |
{ | |
private double balance; | |
//////Constructors////// | |
public BankAccount() //no-arg constructor | |
{ | |
this.balance = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Pet | |
{ | |
private String name; | |
private int age; | |
private double weight; | |
public void writeOutput() | |
{ | |
System.out.println("This is a pet named " + this.name + | |
"who is " + this.age + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first = 'pwn' | |
second = 3 | |
third = 'd' | |
newstring = ''.join([first, str(second), third]) | |
print newstring |
OlderNewer