This file contains 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
/** | |
* isSubset(a,b) determines whether Set a is a subset of Set b | |
* | |
* @param a | |
* - the first set | |
* @param b | |
* - the second set | |
* @return - true or false | |
*/ | |
public static boolean isSubset(Set a, Set b) { |
This file contains 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
package lib; | |
import org.newdawn.slick.*; | |
import org.newdawn.slick.state.*; | |
public class Play extends BasicGameState { | |
Animation Player, movingLeft, movingRight, notMoving, notMoving1; | |
Image worldMap; | |
boolean quit = false; |
This file contains 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.*; | |
public class CookingHelper | |
{ | |
// this variable belongs inside the method | |
// private static String ingredients = "Couldn't find this recipe."; | |
/* | |
* the cookbook on the other hand remains the same during each method call, |
This file contains 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
private int popupStack = 0; | |
private boolean showingPopup = false; | |
public void showPopup() { | |
if (!showingPopup) { | |
showingPopup = true; | |
//if this isn't popup number 0 one should be eliminated from the stack | |
if (popupStack > 0) { |
This file contains 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
public class Main { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
Observation o1 = new Observation(); | |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); |
This file contains 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
public static void main(String[] args) { | |
String initialInput; | |
String patternA; | |
String patternB; | |
int response; | |
int contA, contB, contC; | |
boolean success = false; | |
while (!success) { |
This file contains 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
private static final long SLEEP_TIME = 16; | |
private volatile float mTargetX, mTargetY; | |
private volatile boolean mMoving = false; | |
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
mTargetX = event.getX(); | |
mTargetY = event.getY(); | |
if (event.getAction() == MotionEvent.ACTION_DOWN) { |
This file contains 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.Scanner; | |
public class test { | |
public static double[][] get2DArrayInput(int array1DLength) { | |
Scanner stdin = new Scanner(System.in); | |
System.out.println("Please enter the data for the two-dimensional array."); | |
int rows = array1DLength; | |
System.out.print("Please enter the number of columns of the 2D array: "); | |
int columns = stdin.nextInt(); |
This file contains 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
/* | |
Author: Oscar Bell | |
Date: 9th May 2014 | |
Description: Program to count the occurrences of words in a string | |
*/ | |
import java.util.*; | |
import java.util.Map.Entry; | |
This file contains 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
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
OlderNewer