Skip to content

Instantly share code, notes, and snippets.

View JamesEarle's full-sized avatar

James Earle JamesEarle

View GitHub Profile
@JamesEarle
JamesEarle / Iterative
Last active March 11, 2019 01:48
Iterative vs. Recursive Tower of Hanoi
import java.util.Stack;
/* An iterative approach to the Tower of Hanoi puzzle. Uses
* 3 stacks as a representation to replace the recursive method
* and approaches all possible legal moves between every peg
* combination at any point in the puzzle.
*
* @author James Earle
*/
@JamesEarle
JamesEarle / TBS_Home.html
Last active December 28, 2015 20:39
Documentation + CSS for store website (example for class COSC 2P89)
<!--
TBS_Home.html
COSC 2P89, Fall Semester
James Earle, 5017843
Tuesday, October 22, 2013
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> The Branch Store Home </title>
@JamesEarle
JamesEarle / Example Input
Created November 20, 2013 17:06
Recursive Sudoku Puzzle Solver
Medium
9 5 0 4 8 1 7 6 3
4 8 7 2 6 0 9 1 5
1 6 3 9 5 7 2 8 4
5 2 8 1 0 6 4 3 9
7 9 1 3 4 0 5 0 6
3 4 0 5 9 2 8 7 1
0 7 9 8 1 4 3 5 2
2 0 4 0 0 5 0 9 8
8 3 5 6 2 9 1 4 7
@JamesEarle
JamesEarle / RationalCalc.adb
Created February 11, 2014 17:27
Rational Number Calculator
with
Ada.Text_IO,
Ada.Strings,
Ada.Strings.Fixed,
RATIONALS;
use
Ada.Text_IO,
Ada.Strings,
Ada.Strings.Fixed,
RATIONALS;
@JamesEarle
JamesEarle / Comments.php
Last active August 29, 2015 13:56
The Drummers Throne - A musicians blog / forum. COSC 2P89 Final Project - Fall 2013 (Only main files included)
#!/usr/local/bin/php
<?php
// $con = DB CONNECTION HERE. Removed for security purposes.
if (array_key_exists('isThread',$_POST)) {
//We're coming from "Threads.php" get top value
if (array_key_exists('topPerc',$_POST)) {
$selectedPost = 'topPerc';
}
@JamesEarle
JamesEarle / linkedlist.adb
Created March 11, 2014 00:25
Generic, Circularly Linked List using Ada (with example client)
with
Ada.Text_IO,
Ada.Strings,
linkedlist;
use
Ada.Text_IO,
Ada.Strings;
------------------------------------------------------------------------
-- Author - James Earle, Std. #5017843
-- Email - je11zi@brocku.ca
/*
* Date: March 21st, 2014
* Author: James Earle, 5017843
* Email: je11zi@brocku.ca
*
* COSC 2P91 - Procedural Programming
* Assign. 2, Section 3: Solving Tricky Equations
*
* The program below will read in user input for the
* value of a, computing a*x and sin(x), and using
/*
* Date: March 21st, 2014
* Author: James Earle, 5017843
* Email: je11zi@brocku.ca
*
* COSC 2P91 - Procedural Programming
* Assign. 2, Section 2: Modelling Electronic Circuits
*
* The program below will read from file and simulate
* the effects of a Wheatstone Bridge, outputting the
@JamesEarle
JamesEarle / assign.pl
Created May 9, 2014 16:38
Making use of recursive Prolog predicates for list manipulation. COSC 2P93 Final Assignment.
% James Earle - je11zi@brocku.ca
% 5017843
%
% COSC 2P93 - Winter, 2014
% Assignment
% Question #1
% List of cities altered in accordance with question #5
cities([liverpool,preston,lancaster,carlisle,manchester,leeds,
toronto,brampton,markham,mississauga,
@JamesEarle
JamesEarle / Bucket.java
Last active August 29, 2015 14:01
Use of Bucket Sort to emulate an extendible hash table with given input Strings converted into binary representation.
/* Bucket is used to store a number of Nodes, limit specified
* by user, in an array. To be be accessed and used through
* extendible hashing.
*
* @author James Earle <je11zi@brocku.ca>
* @version 1.0
* @since 2013-12-02
*/
public class Bucket {