Skip to content

Instantly share code, notes, and snippets.

/**
* 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) {
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;
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,
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) {
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));
public static void main(String[] args) {
String initialInput;
String patternA;
String patternB;
int response;
int contA, contB, contC;
boolean success = false;
while (!success) {
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) {
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();
/*
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;
@Hulzenga
Hulzenga / designer.html
Created October 25, 2014 17:02
designer
<link rel="import" href="../paper-calculator/paper-calculator.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;