Source stringclasses 1
value | Date int32 2.01k 2.01k | Text stringlengths 3 15.9M | Token_count int32 1 2.44M |
|---|---|---|---|
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.strategy;
import java.awt.Point;
import junit.framework.Assert;
import org.junit.Test;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.Node;
import uk.ac.ed.inf.sdp2012.group7.strategy.planning.TargetDecision;
public class BallPredictionTest {
//width and height of pitc... | 1,658 |
github-java-corpus | 2,012 | /*
package uk.ac.ed.inf.sdp2012.group7.testing.strategy;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.awt.Point;
import java.util.ArrayList;
import math.geom2d.Point2D;
import uk.ac.ed.inf.sdp2012.group7.strategy.ControlInterface;
public class ... | 889 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.planning;
import java.awt.Point;
import junit.framework.Assert;
import org.junit.Test;
import uk.ac.ed.inf.sdp2012.group7.strategy.planning.AllStaticObjects;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.WorldState;
public class AllStaticObjectsTest {
private Al... | 285 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.vision;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
import j... | 1,432 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.vision;
import static org.junit.Assert.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import java.awt.Color;
import java.awt.Point;
import uk.ac.ed.inf.sdp2012.group7.vision.InitialLocation;
import o... | 400 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.vision;
import javax.swing.filechooser.FileFilter;
import java.io.File;
public class XMLFilter extends FileFilter {
public boolean accept(File f) {
if (f.isDirectory()) return true;
String s = f.getName().toLowerCase();
if(s.endsWith(".xml")) return true;
return f... | 90 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.vision;
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class VisionPanel extends Panel {
private static final long serialVersionUID = -7017770406... | 166 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.vision;
import java.io.File;
import javax.swing.*;
import java.awt.Panel;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.util.ArrayList;... | 2,613 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.testing.control;
import static org.junit.Assert.assertTrue;
import java.awt.Point;
import org.junit.Test;
import uk.ac.ed.inf.sdp2012.group7.control.Tools;
/**
*
* A few obvious tests of some helper functions to make sure they work.
*
* @author TT
*
*/
public class Tool... | 629 |
github-java-corpus | 2,012 | /*
package uk.ac.ed.inf.sdp2012.group7.testing.strategy;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.awt.Point;
import java.util.ArrayList;
import math.geom2d.Point2D;
import uk.ac.ed.inf.sdp2012.group7.strategy.ControlInterface;
public class ... | 889 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
public class PlanTypes {
public static enum PlanType {
PENALTY_DEFENCE,
PENALTY_OFFENCE,
FREE_PLAY,
HALT,
}
public static enum ActionType {
DRIVE,
KICK,
STOP,
ANGLE,
FORWARD_WITH_DISTANCE,
BACKWARD_WITH_DISTANCE,
FORWARDS,
BACKWARDS
}
}
| 101 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
/**
* Defines an arc to be used for a robot to drive on
*
* True for turning left, false for turning right
* @author David Fraser - s0912336
*
*/
public class Arc {
private double radius;
private boolean left;
//This is the number of cm in a golf ball
p... | 194 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Observable;
import java.util.Observer;
import uk.ac.ed.inf.sdp2012.group7.strategy.Arc;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.Node;
i... | 3,776 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import java.awt.Point;
import java.util.ArrayList;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.heuristics.ClosestHeuristic;
public class OldAStarRun {
private OldPath shortestPath;
private OldAre... | 721 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import java.awt.Point;
import java.util.ArrayList;
public class OldAStarRunTest {
public static void main(String[] args) {
// set start and end points of the path
Point start = new Point(32,14);
Point end = new Point(27,14);
// set obstacle... | 233 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import java.awt.Point;
import java.util.ArrayList;
public class OldPath {
// The waypoints in the path (list of coordinates making up the path)
private ArrayList<OldNode> waypoints = new ArrayList<OldNode>();
public OldPath() {
}
public Ar... | 603 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
//import uk.ac.ed.inf.sdp2012.group7.strategy.astar.utils.Logger;
import org.apache.log4j.Logger;
public class OldAreaMap {
private int mapWidth;
private int mapHeight;
private OldNode[][] map;
private int startLocationX = 0;
private int startLoc... | 782 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
public interface OldAStarHeuristic {
/**
*
* The heuristic tries to guess how far a given Node is from the goal Node.
* The lower the cost, the more likely a Node will be searched next.
*
* @param map The map on which the path is being foun... | 173 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import java.util.ArrayList;
import java.util.Collections;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
public class OldAStar {
private OldAreaMap map;
private OldAStarHeuristic heuristic;
// searched nodes
private ArrayList<OldNode> clo... | 1,507 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import java.awt.Point;
public class OldNode implements Comparable<OldNode> {
// properties of this node
OldAreaMap map;
boolean visited;
float distanceFromStart;
float heuristicDistanceFromGoal;
OldNode previousNode;
int x;
int y;
boolean... | 693 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.oldastar;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.heuristics.ClosestHeuristic;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.utils.StopWatch;
public class OldTestAStar {
private static int mapWi... | 312 |
github-java-corpus | 2,012 | /**
*
*/
package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.awt.Point;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.Node;
import uk.ac.ed.inf.sdp2012.group7.vision.VisionTools;
... | 2,337 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.awt.Point;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.PlanTypes;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.Node;
import uk.ac.... | 6,015 |
github-java-corpus | 2,012 | /**
*
*/
package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.util.Observable;
import java.util.Observer;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.planning.PlanMonitor;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.WorldState;
/**
*
*/
/**
* @author tw... | 260 |
github-java-corpus | 2,012 | /**
*
*/
package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.awt.Point;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.*;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.WorldState;
/**
* @author s0955088
*
*/
public class Plan... | 1,211 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.imageio.Imag... | 1,475 |
github-java-corpus | 2,012 | /**
*
*/
package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.util.Observable;
import java.util.Observer;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.PlanTypes;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strategy;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.... | 558 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.planning;
import java.awt.Point;
import java.util.ArrayList;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.WorldState;
import uk.ac.ed.inf.sdp2012.group7.strategy.astar.Node;
public class AllMovingObjects {
//REQUIRED TO TURN ALL TO NODES
private AllStaticObjec... | 1,540 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
import uk.ac.ed.inf.sdp2012.group7.vision.VisionTools;
public class ControlInterfaceTools {
/*
* Changes the angle provided by vision into one required by the calculations
* @param angle the original angle to be converted in radians
*
* @return The converted an... | 475 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sdp2012.group7.strategy.planning.*;
/**
*
* Milestones so far
*
*/
public class Strategy {
public static final Logger logger = Logger.getLogger(Strategy.class);
private static final int LOOKAHEAD = 10;
priv... | 407 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy;
import org.junit.Test;
public class ControlInterfaceTest {
@Test
public void test1(){
}
}
| 36 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.awt.Point;
import java.util.ArrayList;
import org.apache.log4j.Logger;
public class AStar {
private int height, width;
private Node start, target;
private ArrayList<Node> balls, oppositions, closedList;
private SortedNodeList o... | 1,616 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.awt.Point;
public class ClosestHeuristic implements AStarHeuristic {
@Override
public double getEstimatedDistanceToGoal(Node a, Node b) {
return Point.distance(a.x, a.y, b.x, b.y);
}
}
| 68 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar.heuristics;
import uk.ac.ed.inf.sdp2012.group7.strategy.oldastar.OldAStarHeuristic;
/**
* A heuristic that uses the tile that is closest to the target
* as the next best tile.
*/
public class ClosestHeuristic implements OldAStarHeuristic {
public float... | 146 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
public interface AStarHeuristic {
/**
*
* The heuristic tries to guess how far a given Node is from the goal Node.
* The lower the cost, the more likely a Node will be searched next.
*
* @param map The map on which the path is being found
... | 163 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.awt.Point;
import java.util.ArrayList;
public class AStarRunTest {
public static void main(String[] args) {
// set start and end points of the path
Node start = new Node(new Point(30,16), 0);
Node end = new Node(new Point(15,... | 431 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.awt.Point;
public class Node extends Point implements Comparable<Node> {
/**
*
*/
private static final long serialVersionUID = 2860136886021314030L;
private Node parent = null;
private double obstacleCost;
private boolean op... | 923 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.util.ArrayList;
import java.util.Collections;
class SortedNodeList extends ArrayList<Node>{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public boolean add(Node node) {
boolean temp = super.add(node);
Collection... | 82 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar;
import java.util.ArrayList;
public class AStarRun {
private int height, width;
private Node start, target;
private AStar astar;
private ArrayList<Node> balls, oppositions, path;
public AStarRun(int height, int width, Node start, Node target, ArrayList<Nod... | 195 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.strategy.astar.utils;
/*
Copyright (c) 2005, Corey Goldberg
StopWatch.java is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the Licen... | 316 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.ui;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io... | 6,086 |
github-java-corpus | 2,012 | //TODO: Is this class even used any more?
package uk.ac.ed.inf.sdp2012.group7.ui;
/* FROM: https://github.com/ernieyu/Swing-range-slider */
/* The MIT License
Copyright (c) 2010 Ernest Yu. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associat... | 849 |
github-java-corpus | 2,012 | //TODO: Is this class used any more?
package uk.ac.ed.inf.sdp2012.group7.ui;
/* FROM: https://github.com/ernieyu/Swing-range-slider */
/* The MIT License
Copyright (c) 2010 Ernest Yu. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated do... | 4,439 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import uk.ac.ed.inf.sdp2012.group7.simulator.Simulator;
import uk.ac.ed.inf.sdp2012.group7.strategy.Strat... | 245 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.image.BufferedImage;
import java.awt.Point;
/**
* Class to remove barrel distortion from bufferedimages
*
* @author Rado
* @author James Hulme
*
*/
public class DistortionFix {
private static int width = 640;
private static int height = 480;
p... | 646 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.util.ArrayList;
import java.awt.Point;
/**
* Get the robot's orientation
*
* @author Dale Myers
* @author Rado
*/
public class OrientationFinder{
ThresholdsState thresholdsState;
/**
* A constructor
*
* @param thresholdsStat... | 661 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import java.awt.Point;
/**
* Represents the position of an object, for example the ball or a robot.
*
* @author Dale Myers - 0942590
*/
public class ObjectPosition{
private static final long serialVersionUID = -31952448440473456L;
private volatile Point t... | 751 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.ObjectPosition;
public interface Unmoveable{
ObjectPosition getPosition();
}
| 46 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
public class WorldState{
private static WorldState worldState = null;
volatile int shootingDirection = -1; //-1 = left, 1 = right
volatile Color o... | 2,670 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import java.awt.Point;
public class TimePoint extends Point{
private static final long serialVersionUID = -3693845226820198796L;
volatile long timestamp;
public TimePoint(int x, int y, long t){
super(x,y);
timestamp = t;
}
public TimePoint(Point p,... | 109 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import java.awt.Point;
import java.util.ArrayList;
import uk.ac.ed.inf.sdp2012.group7.vision.VisionTools;
public class MovingObject {
volatile ObjectPosition position = new ObjectPosition();
volatile double velocity;
volatile double angle;
volatile fl... | 1,050 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
/**
* Represents the distance and direction of one object from another
*
* @author Dale Myers - 0942590
*/
public class Vector2{
private volatile int magnitude; //Magnitude 9. It's super effective. Pikachu fainted
private volatile double direction;
pub... | 170 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision.worldstate;
import uk.ac.ed.inf.sdp2012.group7.vision.Vision;
import java.awt.Point;
public class Pitch extends ObjectPosition{
private volatile int topBuffer = 0;
private volatile int bottomBuffer = 480;
private volatile int leftBuffer = 0;
private volatile int righ... | 540 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.WorldState;
/**
* Contains the tools we use for converting stuff
*
* @author Dale Myers
*/
public class VisionTools {
private static WorldState worldState = WorldState.getInstance();
//TODO: Test ALL of these. ... | 576 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
/**
* Stores the states of the various thresholds.
*
* @author s0840449
*
*/
public class ThresholdsState implements java.io.Serializ... | 1,380 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.image.BufferedImage;
import javax.swing.JLabel;
import uk.ac.ed.inf.sdp2012.group7.control.Tools;
import uk.ac.ed.inf.sdp2012.group7.vision.Thresholding;
import uk.ac.ed.inf.sdp2012.grou... | 2,984 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.*;
import java.io.File;
import java.util.ArrayList;
import javax... | 1,919 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import au.edu.jcu.v4l4j.V4L4JConstants;
import au.edu.jcu.v4l4j.exceptions.V4L4JException;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
/... | 479 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.util.ArrayList;
/**
* Finding rectangles around the green plate
*
* @author Dale Myers
*/
public class Plate{
/**
* Get the corners of a plate
*
* Use Dale's triangle method to ge... | 1,635 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.awt.Point;
import java.util.ArrayList;
import uk.ac.ed.inf.sdp2012.group7.vision.ThresholdsState;
import uk.ac.ed.inf.sdp2012.group7.vision.worldstate.MovingObject;
import uk.ac.ed.inf.sdp2012.group7.vis... | 6,971 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.vision;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JFrame;
import javax.swing.JLabe... | 1,503 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import java.io.*;
import java.net.*;
public class SimulatorCommunication implements CommunicationInterface {
private String simHost = "localhost";
private int simPort = 10000;
private Socket socket;
private OutputStream os;
private InputStream is;
publi... | 447 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;
import org.apache.log4j.Logger;
import uk.ac.ed.inf.sd... | 2,248 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import java.io.IOException;
public interface CommunicationInterface extends ConstantsReuse {
/**
* Sends a command to the robot
*
* @param command - The command to send (4 bytes)
* @return OpCodes - The robots response
*/
public OpCodes sendToRobot(byte[] comm... | 98 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommException;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;
public class BluetoothCommunication implements Com... | 384 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;
import java.io.*;
import java.util.Arrays;
/**
*
* Ping clone for NXT!
* Output is similar to unix ping(8) utility.
*
* @author s0927919
*
*/
public class TestConn... | 980 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
public interface ConstantsReuse {
public static final String ROBOT_NAME = "Hacktar";
public static final String ROBOT_MAC = "00:16:53:08:9F:AF";
// NXT Opcodes
public static enum OpCodes {
DO_NOTHING,
FORWARDS,
BACKWARDS,
BACKWARDS_WITH_DISTANCE,
STOP,
C... | 181 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.control;
import java.awt.Point;
public class Tools {
private Tools() {
}
public static double getAngleFrom0_0(Point pos) {
// deals with cases where pos is on the x-axis
if (pos.y == 0) {
return (pos.x > 0 ? 0 : Math.PI);
} else {
if (pos.x > 0)
return (Math.at... | 426 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.robot;
import java.io.InputStream;
import java.io.OutputStream;
import lejos.nxt.LCD;
import lejos.nxt.Sound;
import lejos.nxt.comm.Bluetooth;
import lejos.nxt.comm.NXTConnection;
import uk.ac.ed.inf.sdp2012.group7.control.ConstantsReuse;
/**
* Simple NXT bluetooth pong
*/
publi... | 271 |
github-java-corpus | 2,012 | package uk.ac.ed.inf.sdp2012.group7.robot;
import java.io.InputStream;
import java.io.OutputStream;
import lejos.nxt.LCD;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.Sound;
import lejos.nxt.TouchSensor;
import lejos.nxt.comm.Bluetooth;
import lejos.nxt.comm.NXTConnection;
import lejos.robotic... | 1,895 |
github-java-corpus | 2,012 | package org.jmendeth.redasm;
import java.io.*;
import java.nio.channels.*;
import java.nio.file.StandardOpenOption;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import static org.fusesource.jansi.Ansi.*;
import org.fusesource.jansi.AnsiConsole;
/**
* The main redasm-abc app.
*/
public class Ap... | 2,989 |
github-java-corpus | 2,012 | package org.jmendeth.redasm;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.fusesource.jansi.Ansi.*;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
/**
* Ut... | 960 |
github-java-corpus | 2,012 | package org.jmendeth.redasm;
public class RABCDasmException extends Exception {
private final int code;
private final String out;
public RABCDasmException(int code, String out, String message) {
super(message);
this.code = code;
this.out = out;
}
public int getCode() {
... | 92 |
github-java-corpus | 2,012 | package org.jmendeth.redasm;
import java.io.File;
/**
* Represents info about an ABC block and its disassembly.
*/
public class BlockInfo {
private File dir;
private File block;
private int idx;
private Long recomp_time;
private Long actual_time;
public BlockInfo(File dir, File block, int i... | 353 |
github-java-corpus | 2,012 | package org.jmendeth.redasm;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppT... | 148 |
github-java-corpus | 2,012 | package net.caustic.http;
import net.caustic.util.StringUtils;
/**
* This {@link HttpRequestException} should be thrown when there is a problem
* following HTTP redirects.
* @author realest
*
*/
class HttpRedirectException extends HttpRequestException {
/**
*
*/
private static final long serialVersionUID ... | 376 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.io.InputStreamReader;
/**
* An interface for handling the response from a URL requested by
* {@link HttpRequester}.
* @author talos
*
*/
interface HttpResponse {
public static final String LOCATION_HEADER_NAME = "location";
public static final String CONTENT_TYPE_HEADER_N... | 295 |
github-java-corpus | 2,012 | package net.caustic.http;
/**
* Parent {@link Exception} class for both problems both making HTTP
* requests and reading HTTP responses.
* @author realest
*
*/
public class HttpException extends Exception {
/**
*
*/
private static final long serialVersionUID = 8080881196440155065L;
protected HttpExcept... | 83 |
github-java-corpus | 2,012 | package net.caustic.http;
import net.caustic.util.StringUtils;
/**
* This {@link HttpRequestException} is thrown when a {@link String} is not a valid
* URL.
* @author talos
*
*/
class BadURLException extends HttpRequestException {
/**
*
*/
private static final long serialVersionUID = 8615649313297986L;
... | 155 |
github-java-corpus | 2,012 | package net.caustic.http;
/**
* This {@link HttpRequestException} should be thrown when an HTTP request returns
* a code that cannot be handled, for example 4XX.
* @author realest
*
*/
class BadHttpResponseCode extends HttpRequestException {
/**
*
*/
private static final long serialVersionUID = -231700314... | 122 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
import java.util.Vector;
import net.caustic.http.RateLimitManager;
import net.caustic.log.Loggable;
import net.caustic.log.Logger;
import net.caustic.log.MultiLog;
import net.caustic.regexp.Pattern;
imp... | 3,581 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.util.Hashtable;
/**
* An interface to make HTTP requests, returning {@link HttpResponse}. Implementations should
* not follow redirects automatically.
* @author talos
*
*/
interface HttpRequester {
/**
* Make an HTTP Head request. This does not return anything, but it... | 491 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.util.Date;
import java.util.Hashtable;
/**
* Keep track of how many bytes are loaded from hosts, and when. Used to calculate rate
* limits.
* @see #rememberResponse(String, int)
* @see #getRateSinceLastResponseFrom(String)
* @author realest
*
*/
class RateLimitManager {
... | 861 |
github-java-corpus | 2,012 | package net.caustic.http;
/**
* This {@link HttpException} is a superclass for all handled exceptions
* that prevent an HTTP request from being completed (including redirects).
* @author realest
*
*/
class HttpRequestException extends HttpException {
/**
*
*/
private static final long serialVersionUID = 1... | 85 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import net.caustic.util.StringUtils;
/**
* Idiotic cookie handling. Stores only name-value pairs on a host-by-host basis.
* @author talos
*
*/
... | 791 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.util.Hashtable;
/**
* The {@link CookieManager} stores and disburses cookies.
* @author talos
*
*/
interface CookieManager {
/**
* The Cookie request header.
*/
public static final String COOKIE_HEADER_NAME = "Cookie";
/**
* The Cookie response header.
*/
publi... | 570 |
github-java-corpus | 2,012 | package net.caustic.http;
public interface HttpUtils {
/**
* Try to get the host from a {@link String} URL.
* @param urlStr The {@link String} URL.
* @return The host of the URL.
* @throws BadURLException If the URL is invalid.
*/
public abstract String getHost(String urlStr) throws BadURLException;
}
| 80 |
github-java-corpus | 2,012 | package net.caustic.http;
import java.io.IOException;
/**
* This {@link HttpException} is thrown when there is a problem obtaining
* a the content of a response from an HTTP response.
* @author realest
*
*/
class HttpResponseContentException extends HttpException {
/**
*
*/
private static final long seri... | 178 |
github-java-corpus | 2,012 | package net.caustic.http;
/**
* This {@link Exception} is thrown when {@link CookieManager}
* cannot store a cookie.
* @author realest
*
*/
class CookieStorageException extends HttpException {
/**
*
*/
private static final long serialVersionUID = -124484083215012353L;
public CookieStorageException(Stri... | 83 |
github-java-corpus | 2,012 | package net.caustic.http;
/**
* Class to handle response headers from an {@link HttpResponse}.
* @author talos
*
*/
interface ResponseHeaders {
/**
*
* @return An array of {@link String}s containing an element
* for the name of every header in {@link ResponseHeaders}.
* A zero-length list if there are ... | 187 |
github-java-corpus | 2,012 | package net.caustic.deserializer;
import net.caustic.database.Database;
import net.caustic.instruction.Instruction;
import net.caustic.scope.Scope;
/**
* Interface to generate {@link Instruction}s from {@link String}s.
* @author talos
*
*/
public interface Deserializer {
/**
* Try to deserialize a {@link Str... | 257 |
github-java-corpus | 2,012 | package net.caustic.deserializer;
import java.util.Vector;
import net.caustic.database.DatabaseException;
import net.caustic.database.Database;
import net.caustic.instruction.Find;
import net.caustic.instruction.Instruction;
import net.caustic.instruction.InstructionArray;
import net.caustic.instruction.Load;
import ... | 4,776 |
github-java-corpus | 2,012 | package net.caustic.deserializer;
import net.caustic.instruction.Instruction;
import net.caustic.util.Result;
/**
* This class is a {@link Result} that holds {@link Instruction}s when
* {@link #isSuccess()} is <code>true</code>.
* @author realest
*
*/
public class DeserializerResult implements Result {
private ... | 434 |
github-java-corpus | 2,012 | package net.caustic.log;
/**
* An implementation of {@link BasicLogger} using {@link System#err}.
* @author talos
* @see Logger
* @see BasicLogger
* @see System#out
*/
public final class SystemErrLogger extends BasicLogger {
protected void write(String text) throws IllegalStateException {
System.err.print(t... | 83 |
github-java-corpus | 2,012 | package net.caustic.log;
import java.util.Vector;
/**
* A {@link MultiLog} is an implementation of {@link Loggable}
* to coordinate many {@link Logger}s simultaneously through
* {@link Logger}'s own methods.
* <p>
* All {@link Logger}s that are registered will receive
* the {@link Logger} methods called on the ... | 216 |
github-java-corpus | 2,012 | package net.caustic.log;
import java.util.Date;
/**
* An abstract implementation of {@link Logger} that truncates entries and
* prepends a timestamp & level identification.
* <p>
* Subclasses still must implement {@link #write(String)}.
* @author talos
* @see Logger
*
*/
public abstract class BasicLogger ... | 273 |
github-java-corpus | 2,012 | package net.caustic.log;
/**
* A basic interface for logging text and {@link Throwable}s.
* @author talos
* @see #i(String)
* @see #w(Throwable)
* @see #e(Throwable)
*
*/
public interface Logger {
/**
*
* Log a {@link Throwable} as an error.
* @param e The {@link Throwable} to log.
* @throws Illegal... | 214 |
github-java-corpus | 2,012 | package net.caustic.log;
/**
* Interface for any class that can write to a {@link Logger}.
* @author talos
*
*/
public interface Loggable {
/**
* Any calls to this {@link Loggable} will be sent to the registered <code>
* logger</code> as well.
* @param logger The {@link Loggable} to register.
*/
public... | 90 |
github-java-corpus | 2,012 | package net.caustic.template;
import net.caustic.regexp.StringTemplate;
/**
* This {@link Exception} is thrown when the successful substitution of a tag in a {@link HashtableTemplate}
* would cause the overwriting of a preexisting key.<p>
* This would be thrown if a {@link HashtableTemplate} with this mapping:<p>
... | 284 |
github-java-corpus | 2,012 | package net.caustic.template;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import net.caustic.database.Database;
import net.caustic.database.DatabaseException;
import net.caustic.regexp.StringTemplate;
import net.caustic.scope.Scope;
import net.caustic.util.HashtableUtils;
import... | 751 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.