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 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 3,380 |
github-java-corpus | 2,012 | package net.sqlcipher;
import android.database.Cursor;
import android.database.CrossProcessCursor;
import android.database.CursorWindow;
import android.database.CursorWrapper;
public class CrossProcessCursorWrapper extends CursorWrapper implements CrossProcessCursor {
public CrossProcessCursorWrapper(Cursor curs... | 307 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 211 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 213 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 710 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 3,879 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 8,726 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 2,366 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 1,256 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 1,830 |
github-java-corpus | 2,012 | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 185 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import argo.jdom.JsonNode;
/**
*
* @author ril3y
*/
public class ResponseHeader {
//{"r":{"bd":{"":""},"sc":0,"sm":"OK","buf":255,"ln":1,"cks":""}}
public static String statusMessage = "";
... | 303 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx.system;
/**
*
* @author ril3y
*/
public class StatusCode {
int statusNUmber;
String message;
String line;
String statusType;
public StatusCode(int sn, String msg, String lne, String... | 164 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx.system;
import java.util.ArrayList;
import java.util.List;
/**
* [xmp] x_machine_position 0.000 mm [xwp] x_work_position 0.000 mm [xam]
* x_axis_mode 1 [standard] [xfr] x_feedrate_maximum 2400... | 3,791 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx.system;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author ril3y
*/
public class Machine {
/**
* [fc] config_version 0.00 [fv] firmware_version 0.93 [fv] firmwa... | 3,316 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx.system;
/**
*
* @author ril3y
*/
public class Motor {
private int id_number; //On TinyG the motor ports are 1-4
private int ma;// map_to_axis
private int mi; //Microsteps
... | 799 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import gnu.io.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Enumerat... | 1,123 |
github-java-corpus | 2,012 | /*
* tgFX Socket Monitor Class
* Copyright Synthetos.com
*/
package tgfx.external;
import tgfx.SerialDriver;
import gnu.io.SerialPort;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Observable;
import java.util.Observer;
import tgfx.TinygDriver;
/**
*
* ... | 716 |
github-java-corpus | 2,012 | /*
* Copyright Synthetos LLC
* Rileyporter@gmail.com
* www.synthetos.com
*
*/
package tgfx;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFound... | 13,055 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx.render;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.paint.*;
/**
*
* @author ril3y
*/
public class Draw2d {
static Paint retPaint;
... | 664 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.ArrayBlockingQueue;
import ja... | 7,837 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import java.util.concurrent.BlockingQueue;
import java.util.Observable;
import java.util.concurrent.BlockingQueue;
import tgfx.TinygDriver;
/**
*
* @author ril3y
*/
public class QueueReader extends Ob... | 779 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import argo.jdom.JdomParser;
import argo.jdom.JsonRootNode;
import argo.saj.InvalidSyntaxException;
import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.ArrayBlockingQueue;
i... | 4,253 |
github-java-corpus | 2,012 | package tgfx;
public class Command {
private int size;
private long lineNumber;
private String expectedReturn;
public Command(String command, long lineNumber) {
expectedReturn = command.substring(0, command.length()-2); //will probably not have the end tag at the same spot
size = command.length() + 1; //comm... | 178 |
github-java-corpus | 2,012 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tgfx;
import org.apache.log4j.PropertyConfigurator;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.c... | 201 |
github-java-corpus | 2,012 | package com.android.phasebeam;
import android.app.Activity;
import android.os.Bundle;
public class PhaseBeam extends Activity {
private PhaseBeamView mView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mView = new PhaseBeamView(this);
... | 64 |
github-java-corpus | 2,012 | package com.android.phasebeam;
import android.app.Service;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.renderscript.RenderScript;
import android.renderscript.RenderScriptGL;
import android.service.wallpaper.WallpaperService;
import android.util.DisplayMetrics;
import android.view.Surf... | 734 |
github-java-corpus | 2,012 | package com.android.phasebeam;
import static android.renderscript.Sampler.Value.NEAREST;
import static android.renderscript.Sampler.Value.WRAP;
import android.content.res.Resources;
import android.renderscript.Allocation;
import android.renderscript.Matrix4f;
import android.renderscript.Mesh;
import android.renderscr... | 2,010 |
github-java-corpus | 2,012 | package com.android.phasebeam;
import android.content.Context;
import android.renderscript.RSSurfaceView;
import android.renderscript.RenderScriptGL;
import android.view.SurfaceHolder;
public class PhaseBeamView extends RSSurfaceView {
private RenderScriptGL mRS;
private PhaseBeamRS mRender;
public Phas... | 253 |
github-java-corpus | 2,012 | package com.rethinksun;
/* references
* http://www.hardill.me.uk/wordpress/?p=204
* http://dalelane.co.uk/blog/?p=1599 - for more complete example using a service for MQTT
* http://saeedsiam.blogspot.com/2009/02/first-look-into-android-thread.html - handler example
*/
import android.app.Activity;
import androi... | 695 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
import java.util.ArrayList;
import java.util.List;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encod... | 1,708 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
import java.util.HashMap;
import java.util.Map;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class TopologySay implements MySay {
//... | 927 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public enum MessageType {
FOOD(1),
TOPOLOGY(2),
NUMBERING(3),
NEST_LOCATION(4),
// Can only have 3 bits of message type
// So, a max of 0-7 message types.
;
MessageType(int num) {
_number = num;
}
private int _number;
public int serialize() {
return _number;
}
publ... | 162 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public class BoundaryReportSay implements MySay {
// Id of the reporting ant.
public int id;
// X boundary to report, if any, relative to nest.
// Note that this can be negative.
// Also, note that 0 is not a valid value.
public int x = 0;
// Y boundary to report, if any, ... | 490 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public interface MySay {
public SayType getType();
public String serialize();
}
| 24 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public class NumberingMessage implements Message {
private int _number;
@Override
public MessageType getType() {
return MessageType.NUMBERING;
}
private NumberingMessage() {}
public NumberingMessage(int number) {
setNumber(number);
}
public static NumberingMessage... | 170 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public class MessageManager {
public Message deserialize(long message) {
MessageType messageType = MessageType.deserialize((int)(message & Message.FIELD_MASK_MESSAGE_TYPE));
if (messageType != null) {
switch(messageType) {
case FOOD: return FoodMessage.deserialize(message... | 258 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
import ravi.contest.ants.map.Location;
public class FoodMessage implements Message {
// 3 bits for message type already allocated - bits 0-2.
// 3 bits for food quantity - bits 3-5.
public static final long FIELD_MASK_FOOD_QUANTITY = 0x38; // 0011.1000
// 20 bits for location ... | 851 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
import ravi.contest.ants.map.Location;
public class NestLocationMessage implements Message {
// 3 bits for message type already allocated - bits 0-2.
// 20 bits for location - bits 3-22.
public static final long FIELD_MASK_NEST_LOCATION = 0x7FFFF8; // 7.F:F.F:F.1000
private Lo... | 264 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public interface Message {
public static final long FIELD_MASK_MESSAGE_TYPE = 0x7; // first 3 bits.
public MessageType getType();
public long serialize();
}
| 42 |
github-java-corpus | 2,012 | package ravi.contest.ants.message;
public enum SayType {
BOUNDARY_REPORT,
TOPOLOGY,
TOPDIR, // topology with directions only.
;
}
| 37 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Move;
import org.linkedin.con... | 1,343 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.api.WorldEvent;
import org.linkedin.contest.ants.api.Write;
import ravi.contest.ants.Const... | 1,744 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
public enum State {
START,
TERRITORY_SEARCH, // first attempt at migrating to allotted territory
BOUNDARY_REPORT, // if first attempt at allotted territory hits a boundary, need to report back to nest.
WAIT_FOR_FULL_BOUNDARY_REPORT, // partial boundary info available, need to wait ... | 156 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.api.WorldEvent;
public class WaitForBoundaryReportStateHandler implements StateHandler {
... | 113 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import ravi.contest.ants.Constants;
public class StateUtils {
public static boolean isOracle(int id) {
return (id == Constants.NUM_ANTS - 1);
}
}
| 48 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.api.WorldEvent;
import ravi.contest.ants.Knowledge;
import ravi.contest.ants.message.Messa... | 369 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Move;
import org.linkedin.contest.ants.api.WorldEvent;
import ravi.contest.ants.K... | 1,169 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Move;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.... | 457 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.api.WorldEvent;
public class ForageStateHandler implements StateHandler {
@Override
pub... | 107 |
github-java-corpus | 2,012 | package ravi.contest.ants.state;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.WorldEvent;
public interface StateHandler {
public Action act(Environment environment, List<WorldEvent> events);
public State g... | 69 |
github-java-corpus | 2,012 | package ravi.contest.ants.oracle;
import java.util.HashMap;
import java.util.Map;
import ravi.contest.ants.Constants;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.ants.map.Point;
public class TerritoryMap {
private TerritoryType[][] _map;
private Point _center;
private Map<Point, TerritoryType> ... | 377 |
github-java-corpus | 2,012 | package ravi.contest.ants.oracle;
import java.util.Map;
import ravi.contest.ants.Knowledge;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.message.TopologySay;
public class OracleUtils {
public static void updateTopology(Knowledge knowledge, TopologySa... | 197 |
github-java-corpus | 2,012 | package ravi.contest.ants.oracle;
public enum TerritoryType {
REACHABLE,
PARTLY_REACHABLE,
PROBABLY_UNREACHABLE,
PROBABLY_ENEMY,
UNKNOWN,
;
}
| 47 |
github-java-corpus | 2,012 | package ravi.contest.ants.movement;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Direction2;
import ravi.contest.ants.map.Point;
public class MovementUtils {
// Maximum ratio allowed for the length of a walk to average distance between two points.
// If it takes us more than this to... | 297 |
github-java-corpus | 2,012 | package ravi.contest.ants.movement;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.Constants;
import ravi.contest.ants.map.Direction2;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.map.Walk2;
public... | 716 |
github-java-corpus | 2,012 | package ravi.contest.ants;
public class Constants {
public static final int BOARD_SIZE = 512;
public static final int NUM_ANTS = 50;
public static final int MAX_TIME = 100000;
}
| 45 |
github-java-corpus | 2,012 | package ravi.contest.ants;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Ant;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Move;
import org.linkedin.contest.ants.api.Wor... | 1,079 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class Walk2 {
private List<Point> _walk;
private Set<Point> _vertices;
public Walk2() {
_walk = new ArrayList<Point>();
_vertices = new HashSet<Point>();
}
public void c... | 1,065 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import org.linkedin.contest.ants.api.Direction;
public class Point {
// Number of bits occupied by this object.
public static final int MASK_NUM_BITS = 20;
// 9 bits for relative X co-ordinate.
public static final int MASK_X = 0x01FF; // Mask = 0001.1111.1111
// 1 bit for X's s... | 737 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.linkedin.contest.ants.api.Direction;
// Note: "Direction"'s vectors are messed up!
// North is -1 and South is +1 in that model.
// Inconsistent with my model.
// Use Direction.deltaX and .deltaY wit... | 551 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import org.linkedin.contest.ants.api.Direction;
public class Location {
// Number of bits occupied by this object.
public static final int MASK_NUM_BITS = 20;
// 9 bits for relative X co-ordinate.
public static final int MASK_X = 0x01FF; // Mask = 0001.1111.1111
// 1 bit for X'... | 857 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import ravi.contest.ants.Constants;
public class LocalMap {
public enum SquareType {
UNKNOWN,
OBSTACLE,
HAS_FOOD,
EMPTY,
;
}
private Map<Long, Sq... | 906 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import org.linkedin.contest.ants.api.Direction;
public class DirectedSegment {
private Direction _direction;
private int _distance;
public DirectedSegment(Direction dir, int dist) {
_direction = dir;
_distance = dist;
}
public Direction getDirection() {
return _direction;... | 109 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import java.util.ArrayList;
import java.util.List;
import org.linkedin.contest.ants.api.Direction;
public class Walk {
// Walk is essentially a stack data structure
// with directed segments as elements.
private List<DirectedSegment> _walk;
public Walk() {
_walk = new ArrayList... | 344 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
import ravi.contest.ants.Constants;
public class MapUtils {
public static int getDistance(Point a, Point b) {
return getDistance(a.x, a.y, b.x, b.y);
}
public static int getDista... | 1,266 |
github-java-corpus | 2,012 | package ravi.contest.ants.map;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.Constants;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.movement.NavigationAdvisor;
public class Short... | 3,212 |
github-java-corpus | 2,012 | package ravi.contest.ants;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Square;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.... | 1,842 |
github-java-corpus | 2,012 | package amaitjo.brains;
import amaitjo.common.DirectionHelper;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EmptyStackException;
import java.util.List;
import java.util.Stack;
import java.util.UUID;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Ant;
imp... | 819 |
github-java-corpus | 2,012 | package amaitjo.brains.bt.writing;
import java.math.BigInteger;
import java.util.BitSet;
import java.util.LinkedHashMap;
import java.util.Random;
import sun.security.util.BigInt;
public class BitMap
{
public interface BitMapHandler
{
public void read(BitSet bits);
public BitSet writer();
}
public s... | 1,179 |
github-java-corpus | 2,012 | package amaitjo.brains.bt.writing;
import java.math.BigInteger;
import java.util.BitSet;
import java.util.LinkedHashMap;
public class Graffiti
{
public double FOOD_PHEROMONE_DECAY_PER_TURN = MAX_PHEROMONE / 8000.0f; // % of pheromone lost per turn
public static int MAX_PHEROMONE = 4095;
public static int MA... | 1,800 |
github-java-corpus | 2,012 | package amaitjo.brains.bt;
import amaitjo.brains.bt.writing.Graffiti;
import amaitjo.common.Coord;
import amaitjo.common.DirectionHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
i... | 7,030 |
github-java-corpus | 2,012 | package amaitjo.brains.bt;
public class EvilOzzy extends Ozzy
{
public static int SECRET = 0x6666; // ByteBuffer.wrap(EvilAntyGaga.class.getClass().toString().getBytes()).asIntBuffer().get();
@Override
protected int getSecret()
{
return SECRET;
}
}
| 71 |
github-java-corpus | 2,012 | package amaitjo.brains;
import java.util.List;
import org.linkedin.contest.ants.api.Action;
import org.linkedin.contest.ants.api.Ant;
import org.linkedin.contest.ants.api.Environment;
import org.linkedin.contest.ants.api.Pass;
import org.linkedin.contest.ants.api.WorldEvent;
public class PassAnt implements Ant
{
... | 133 |
github-java-corpus | 2,012 | package amaitjo.common;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.linkedin.contest.ants.api.Direction;
import org.linkedin.contest.ants.api.Environment;
public clas... | 1,278 |
github-java-corpus | 2,012 | package amaitjo.common;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class MessageCodec {
private SecretKeySpec key = null;
private IvParameterSpec ivSpec = null;
private Cipher cipher = null;
public MessageCodec()
{
this("ANTTECH","900... | 680 |
github-java-corpus | 2,012 | package amaitjo.common;
import java.util.Random;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Point;
public class Coord
{
public int X;
public int Y;
public final static Coord ORIGIN = new Coord(0,0);
public Coord(int x, int y)
{
X = x;
Y = y;
... | 569 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Location;
import ravi.contest.ants.message.FoodMessage;
import ravi.contest.ants.message.FoodMessage.FoodQuantity;
import ravi.contest.ants.message.MessageType;
publi... | 559 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import ravi.contest.ants.message.BoundaryReportSay;
import junit.framework.TestCase;
public class TestBoundaryReportSay extends TestCase {
public void testDeserialization() {
BoundaryReportSay say = BoundaryReportSay.deserialize("BOUNDARY_REPORT[id=5,x=30,y=-75]");
assertE... | 451 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.message.TopologySay2;
public class TestTopologySay2 extends TestCase {
public void testCreatio... | 683 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import junit.framework.TestCase;
import ravi.contest.ants.message.MessageType;
import ravi.contest.ants.message.NumberingMessage;
public class TestNumberingMessage extends TestCase {
public void testCreation() {
int number = 25;
long bits = MessageType.NUMBERING.serialize... | 268 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import junit.framework.TestCase;
import ravi.contest.ants.message.NestLocationMessage;
public class TestNestLocationMessage extends TestCase {
public void testCreation() {
NestLocationMessage message = new NestLocationMessage(-45, 100);
long serialized = message.serialize(... | 352 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.message;
import java.util.Map;
import junit.framework.TestCase;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.message.TopologySay;
public class TestTopologySay extends TestCase {
public void testCreation() {
TopologySa... | 408 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.oracle;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.oracle.TerritoryMap;
import junit.framework.TestCase;
public class TestTerritoryMap extends TestCase {
public void testGetTerritory() {
Point p = TerritoryMap.getTerritory(0, 0);
// Above point should be at the ce... | 87 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.movement;
public class TestWalkBloatGraph {
public static void main(String[] args) {
for (int i=10; i<75; i++) {
double obstacleDensity = i * 1.0 / 100;
// e^{(2*x)^5} = e^{32*x^5} - appears to approximate empirical data.
System.out.println(obstacleDensity + "\t" + Math.pow(M... | 119 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.movement;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.map.Walk2;
import ravi.contest.ants.movement.MovementUtil... | 10,177 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.movement;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.ants.map.Point;
import ravi.c... | 1,921 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Walk;
public class TestWalk extends TestCase {
public void testCreation() {
Walk walk = new Walk();
walk.goForth(Direction.east);
walk.goForth(Direction.north);
... | 150 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Point;
public class TestPoint extends TestCase {
public void testSerialization() {
Point p1 = new Point(13, 90);
Point p2 = new Point(-13, 90);
Point p3 = new Poin... | 633 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import junit.framework.TestCase;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.map.ShortestPathCalculator;
import ravi.contest.ants.map.Walk2;
public class TestShortestPathCalcul... | 1,781 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import junit.framework.TestCase;
import ravi.contest.ants.map.MapUtils;
import ravi.contest.ants.map.Point;
public class TestTerritory extends TestCase {
public void testNumTerritoriesAlongASide() {
// Assuming board size is 512x512 and num ants is 50.
assertEquals(7, MapUtils... | 1,122 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import junit.framework.TestCase;
import ravi.contest.ants.map.Point;
import ravi.contest.ants.map.Walk2;
public class TestWalk2 extends TestCase {
public void testOne() {
Walk2 wal... | 1,406 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import java.util.TreeSet;
import junit.framework.TestCase;
import ravi.contest.ants.map.LocalMap;
import ravi.contest.ants.map.LocalMap.SquareType;
import ravi.contest.ants.map.Point;
public class TestLocalMap extends TestCase {
public void test1() {
LocalMap localMap = new Lo... | 1,115 |
github-java-corpus | 2,012 | package ravi.contest.ants.test.map;
import junit.framework.TestCase;
import org.linkedin.contest.ants.api.Direction;
import ravi.contest.ants.map.Location;
public class TestLocation extends TestCase {
public void testCreation() {
Location loc = new Location();
loc.add(Direction.north, 1);
assertTrue(loc.getY... | 691 |
github-java-corpus | 2,012 | package amaitjo;
import amaitjo.brains.bt.writing.BitMap;
import amaitjo.brains.bt.writing.Graffiti;
import java.util.Random;
import junit.framework.TestCase;
public class TestGraffiti extends TestCase
{
int _secret = new Random().nextInt();
private int getSecret()
{
return _secret;
}
int _region = ... | 713 |
github-java-corpus | 2,012 | package com.inmobi.messaging.flume;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.flume.Event;
... | 615 |
github-java-corpus | 2,012 | package com.inmobi.messaging.client;
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
*/
pub... | 147 |
github-java-corpus | 2,012 | package com.inmobi.instrumentation;
import java.util.concurrent.atomic.AtomicLong;
/**
* Store a cumulative stats for invocation of some piece of code.
*
* Note that only usage convention governs the semantics of values stored in
* here. This is not meant to be AOP style code that does the actual magic.
*
* ... | 944 |
github-java-corpus | 2,012 | package com.inmobi.messaging.thrift;
import java.io.UnsupportedEncodingException;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TTransport;
class TStringByteProtocol extends TBinaryProtocol {
public TStringByteProtocol(TTransport trans) ... | 178 |
github-java-corpus | 2,012 | package com.inmobi.messaging.netty;
import static org.jboss.netty.channel.Channels.pipeline;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Length... | 264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.