This file contains hidden or 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
// Problem F: Three Sides Make A Triangle | |
// Author: Christopher Vo | |
#include <cstdio> | |
#include <cmath> | |
#define TOLERANCE 0.01 | |
#define swap(a,b,c) {c t=a; a=b; b=t;} | |
double len(double x1, double y1, double x2, double y2) | |
{ |
This file contains hidden or 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
#! /usr/bin/env python | |
# A script to delete all e-mails over IMAP | |
import imaplib, getpass | |
host = 'imap.server.com' | |
port = 993 | |
user = 'user' |
This file contains hidden or 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
// Problem D: A Round Peg in a Ground Hole | |
// Author: Christopher Vo | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
struct Point | |
{ | |
double x, y; |
This file contains hidden or 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
/* | |
* ACM 534: Frogger (ANSI C version) | |
* Author: Christopher Vo ([email protected]) | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
#define min(a, b) (((a) < (b)) ? (a) : (b)) | |
#define max(a, b) (((a) > (b)) ? (a) : (b)) | |
struct point { | |
int x, y; |
This file contains hidden or 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
// Frogger | |
// # 534 | |
// tags: dijkstra's, minimax, frogs | |
// | |
// by jamesob | |
import java.util.*; | |
public class Main { |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
int n, roads, min, i, j, k, l, u, v; | |
while (scanf("%d %d %d", &n, &roads, &min) == 3 && n != 0) | |
{ | |
char A[n][n], P[n][n], tmp[n][n]; | |
int n2 = n * n; |
This file contains hidden or 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
// StopWatch | |
// Simple multiple-stopwatch application | |
// Author: Christopher Vo ([email protected]) | |
public class StopWatch extends javax.swing.JFrame { | |
private static final long serialVersionUID = -7040646868513878300L; | |
private static int numTimers = 5; | |
public StopWatch() { | |
// make main window |
This file contains hidden or 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
void simMKPusher::computeOffset() | |
{ | |
c_mksum mksum; | |
c_ply & p = getP(); | |
p.beginPoly(); | |
for (int i = 0; i < m_target_border.size; i++) | |
p.addVertex(m_target_border.data[i].x(), m_target_border.data[i].y()); | |
p.endPoly(); |
This file contains hidden or 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
#!/usr/bin/env python | |
# getting number of search results from google | |
# by christopher vo | |
import urllib2, re, time | |
reg = re.compile('About(.*?)results') | |
for i in range(1, 20): | |
wut = 'w' + 'u'*i + 't' | |
url = 'http://www.google.com/search?q=' + wut | |
request = urllib2.Request(url) | |
request.add_header('User-agent', 'Chrome') |
This file contains hidden or 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
// this works! | |
for (RigidBodyList::const_iterator i = rigid_bodies.begin(), | |
end = rigid_bodies.end(); i != end; ++i) { | |
1+1; // do nothing | |
checkCollision(target_body, *i); | |
} | |
// this does not work. | |
for (RigidBodyList::const_iterator i = rigid_bodies.begin(), | |
end = rigid_bodies.end(); i != end; ++i) { |