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/local/bin/python | |
####################################################### | |
# Otsu's Method | |
# Author: Samuel Jackson ([email protected]) | |
# Date: 21/07/2013 | |
# Description: Performs Otsu's method of thresholding | |
# using the between class variance. | |
####################################################### |
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
####################################################### | |
# Knuth-Morris-Pratt Algorithm | |
# Author: Samuel Jackson ([email protected]) | |
# Date: 20/07/2013 | |
####################################################### | |
# implementation of KMP Search | |
def kmp_search(s, w): | |
m = 0 # current search start point | |
i = 0 # current index in target word |
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
class RunningStat | |
{ | |
public: | |
RunningStat() : m_n(0) {} | |
void Clear() | |
{ | |
m_n = 0; | |
} |
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
\documentclass{acm_proc_article-sp} | |
\usepackage{graphicx} | |
\usepackage{epstopdf} | |
\begin{document} | |
\title{A Comparison of Scheduling Algorithms} | |
\numberofauthors{1} | |
\author{ | |
\alignauthor |
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
import java.util.ArrayList; | |
public class Main { | |
public static void main(String[] args) { | |
new Main().calcSlot(7); | |
} | |
public int calcSlot(int priority) { | |
//list of jobs |
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
timeval t1, t2; | |
double elapsedTime; | |
//start timer | |
gettimeofday(&t1, NULL); | |
//do stuff... | |
//stop timer | |
gettimeofday(&t2, NULL); |
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
var ar = { | |
"Hello": { | |
score: 12, | |
run: function() | |
{ | |
return "hi"; | |
} | |
} | |
}; | |
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 the required packages. | |
\usepackage{float} | |
\usepackage{graphicx} | |
% insert a single centred image into a LaTeX document. | |
\begin{figure}[H] | |
\centering | |
\includegraphics[width=0.7\textwidth]{<path-to-file>} | |
\caption{<image-caption>} | |
\label{fig:<image label>} |
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 | |
##################################################### | |
#Fuzzy logic implementation of simple tipping system | |
#Author: Samuel Jackson ([email protected]) | |
#Date: 10/2/13 | |
##################################################### | |
################################# | |
# Functions for calculating # |
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
################################################ | |
# Simple Graph | |
# Author: Samuel Jackson | |
# Created: 28/1/13 | |
################################################ | |
class Node: | |
def __init__(self, data): | |
self.adjacents = [] | |
self.set_data(data) |