Skip to content

Instantly share code, notes, and snippets.

View nathanesau's full-sized avatar
😃

Nathan Esau nathanesau

😃
View GitHub Profile
@nathanesau
nathanesau / bingo.py
Last active December 28, 2015 13:19
BingoPlanner1.0 (uses wx python for GUI)
__author = "Nathan"
# bingo.py
import wx
import sys
''' VARIABLES '''
# list of goals in a typical bingo row
goals = ['goal1','goal2','goal3','goal4','goal5']
ID_NEW_ROW = 100
ID_EXIT = 101
@nathanesau
nathanesau / bot.py
Last active December 28, 2015 13:19
ircBot
__author__ = 'Nathan'
import socket
import string
import sys
# for debugging purposes
debug = True
# connect variables
owner = "neutrondude"
server = "irc.twitch.tv"
@nathanesau
nathanesau / assign9.java
Last active December 29, 2015 14:39
acma 210, assignment 9
// one should rename this file to assign9.java before trying to compile it
public class assign9 {
public static void main(String[] args) {
// assignment question number
int questionNumber = 3;
// bounds for bisection methods
double jMin = 0.001;
double jMax = 0.500;
@nathanesau
nathanesau / stats285.java
Created December 4, 2013 23:48
methods used for stats 285
import java.util.Math;
public class stats285 {
public static void main(String[] args) {
// pass
}
}
class methods {
public static double variance(sample) {
@nathanesau
nathanesau / primes.py
Created January 19, 2014 08:37
prime numbers program
# return true if the number is prime
def isPrime(num):
# 1,2,3 are prime
if (num>3):
# only check the odd numbers
if (num%2 == 0):
return False
else:
for i in range(3, (num/2)+1, 2):
if (num%i) == 0:
#### SET UP CONSOLE, WORKSPACE AND OUTPUT ####
rm(list=ls()); cat("\014"); options(warn=-1); exportHtml = TRUE
if (exportHtml==FALSE) { graphics.off(); plotDims=c(2,2); par(mfrow=plotDims) }
#### vars ####
A = 0.00022
B = 2.5e-05
c = 1.1
l20 = 1e+05
x = 20
@nathanesau
nathanesau / assign4.C
Created March 15, 2014 18:41
assignment 4, cmpt 130
/**
* Cmpt 130, Assignment 4
*
* @author Nathan Esau (nesau@sfu.ca)
* @date 2014-03-14 21:26:18
* @version 1.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@nathanesau
nathanesau / assign3.C
Created March 16, 2014 01:18
assign3.C (cmpt 130)
/**
* Cmpt 130, Assignment 3
*
* @author Nathan Esau (nesau@sfu.ca)
* @date 2014-03-15 11:46:02
* @version 1.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@nathanesau
nathanesau / assign4.C
Created March 16, 2014 01:33
assign4 version 1.1
/**
* Cmpt 130, Assignment 4
*
* @author Nathan Esau (nesau@sfu.ca)
* @date 2014-03-14 21:26:18
* @version 1.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@nathanesau
nathanesau / assign5.c
Created March 22, 2014 22:05
assign5.C, cmpt 130
#include <stdlib.h>
#include <stdio.h>
void brute_force_test();
int is_permutation(int arr[], int n);
int* reverse(int *arr, int n);
int score(int arr[], int n);
void print(int arr[], int n);
int* make_perm(int n);
int factorial(int n);