Skip to content

Instantly share code, notes, and snippets.

View jmcph4's full-sized avatar

Jack McPherson jmcph4

View GitHub Profile
@jmcph4
jmcph4 / bugs.cpp
Created October 19, 2011 07:57
QIP Set 1 - Bugs (Standard I/O)
#include <cstdio>
#include <iostream>
using namespace std;
int main(void)
{
int input;
cin>>input;
int dividend = 7;
@jmcph4
jmcph4 / 261011 Class Notes
Created October 26, 2011 06:50
Class notes on Probability Theory from University of Queensland QIP program.
remise - What is accepted to be true (fact).
Probability - The strength of an argument.
100 people
80 healthy
20 ill
Hypothesis Testing
Text Classification
@jmcph4
jmcph4 / bugs.cpp
Created October 26, 2011 07:18
QIP Set 1 - Bugs (Standard I/O) COMPLETE
#include <cstdio>
#include <iostream>
using namespace std;
int main(void)
{
int input;
cin>>input;
int dividend = 7;
@jmcph4
jmcph4 / bugs.cpp
Created October 26, 2011 07:58
QIP Set 1 - Bugs
#include <cstdio>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(void)
{
int input;
int dividend = 7;
int output = input % dividend;
char ifilename[] = "bugsin.txt";
@jmcph4
jmcph4 / books.txt
Created October 26, 2011 08:00
Books List
Programming Challenges
The Programming Contest Training Manual
@jmcph4
jmcph4 / euler.py
Created February 10, 2012 09:27
Euler Integrator Script
# 07:07:36PM, 10/02/2012 AEST-
# euler.py
def main():
p1s = input("Position:")
t1s = input("Time:")
p2s = input("Position:")
t2s = input("Time:")
@jmcph4
jmcph4 / misc.py
Created February 10, 2012 13:08
Miscellaneous Arithmetic in Python
# misc.py
pi = 3.14159265358979323846264
str_seed = input("Custom seed:")
seed = int(str_seed)
while 1:
seed += 1
result = pi / pi % seed + seed * 2 - seed % seed / pi * pi + 8
print(result)
@jmcph4
jmcph4 / gridster.html
Created October 22, 2012 03:41
A very quick and very messy example of the jQuery plugin gridster.js.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/ducksboard/gridster.js/master/dist/jquery.gridster.min.js"></script>
<script type="text/javascript">
$(function(){ //DOM Ready
$(".gridster ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [140, 140]
@jmcph4
jmcph4 / fizzbuzz.cpp
Last active December 16, 2015 04:39
Solution of the Fizz Buzz.
// Fizz Buzz Test
// fizzbuzz.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int main(void)
{
int i = 1;
int r3;
@jmcph4
jmcph4 / fibonacci.cpp
Created April 23, 2013 01:15
Very simple Fibonacci sequence generator in C++. It accepts a single command-line parameter, which is the quantity of numbers to generate.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int i = 0;
int n = atoi(argv[1]);
int f[n];