Skip to content

Instantly share code, notes, and snippets.

View andrelashley's full-sized avatar

André Lashley andrelashley

  • BC Provincial Government
  • Victoria, British Columbia
View GitHub Profile
import java.util.jar.Attributes.Name;
public class Candidate implements CandidateInterface{
private String firstName;
private String lastName;
private int voteCount;
public Candidate(String inFirstName, String inLastName){
firstName = inFirstName;
lastName = inLastName;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Results</title>
</head>
<body>
<?php
/*
Lab 5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Results</title>
</head>
<body>
<?php
/*
Lab 5
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class Riding implements RidingInterface {
private String ridingName;
private List<CandidateInterface> candidates;
public Riding(String inRidingName) {
<?php
/**
* Convert color from hex in XXXXXX (eg. FFFFFF, 000000, FF0000) to array(R, G, B)
* of integers (0-255).
*
* name: rgb2array
* author: Yetty
* @param $color hex in XXXXXX (eg. FFFFFF, 000000, FF0000)
* @return string; array(R, G, B) of integers (0-255)
<?php
/**
* Convert color from hex in XXXXXX (eg. FFFFFF, 000000, FF0000) to array(R, G, B)
* of integers (0-255).
*
* name: rgb2array
* author: Yetty
* @param $color hex in XXXXXX (eg. FFFFFF, 000000, FF0000)
* @return string; array(R, G, B) of integers (0-255)
<?php
/**
* Convert color from hex in XXXXXX (eg. FFFFFF, 000000, FF0000) to array(R, G, B)
* of integers (0-255).
*
* name: rgb2array
* author: Yetty
* @param $color hex in XXXXXX (eg. FFFFFF, 000000, FF0000)
* @return string; array(R, G, B) of integers (0-255)
@andrelashley
andrelashley / AlternateHockeyPlayerComparer.java
Created February 21, 2012 17:54
Java Notes - February 21: Alternate forms of comparison
public class AlternateHockeyPlayerComparer{
int compare(HockeyPlayer a, HockeyPlayer b){
String aLastName = a.getLastName();
String bLastName = b.getLastName();
int difference = a.lastName.compareTo(b.lastName);
if(difference != 0){
return difference;
}
@andrelashley
andrelashley / challengeOne.py
Created February 21, 2012 18:56
Get user's information, display it and log it to a text file
# Author: Andre Lashley
# Date: February 21, 2012
# Description: Get user's information, display it and log it to a text file
def display_user_info():
# get the users name
name = raw_input("Hello there, what's your name? ")
# get the users age
@andrelashley
andrelashley / circle.php
Created February 21, 2012 22:18
Circle class
<?php
/*
Lab 7
circle.php
Andre Lashley (andre.lashley@gmail.com)
February 20, 2012
4 hours estimated completion time
4 hours actual completion time
This program draws 6 different shapes.
Visit http://deepblue.cs.camosun.bc.ca/~cst020/comp170/lab7/main.html to use it.