text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String args[]) {
initialize();
while (true) {
// resets the board to the screen
Interperet.reset();
// moves the best move
Calculate.move(Calculate.bestMove());
}
} | 1 |
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher dispatcher = null;
try {
// get the action class to be called
// to do this, we grab the URL and take the ".action" off of it
String servletpath = request.g... | 5 |
public static String getSqlWhereWithValues(Map<String, Object> sqlWhereMap) throws SQLException {
if (sqlWhereMap.size() < 1)
return null;
StringBuffer sqlWhere = new StringBuffer();//SQL语句
Set<Entry<String, Object>> entrySets = sqlWhereMap.entrySet();
for (Iterator<Entry<String, Object>> iteraotr = entry... | 4 |
public void run() {
if (progressBar != null) {
progressBar.setMinimum(0);
progressBar.setMaximum(countClasses(0, ""));
}
readPackage(0, new HashMap(), "", 0);
TreeModelListener[] ls;
synchronized (listeners) {
ls = (TreeModelListener[]) listeners
.toArray(new TreeModelListener[listeners.size()]... | 2 |
public JSONObject parseUserAnimeListXML(InputStream inputXML) throws MALException, IOException {
// My storage variables
final ArrayList<Anime> myAnime = new ArrayList<Anime>();
final JSONObject animeListData = new JSONObject();
final Anime currentAnime = new Anime();
final User currentUser = new User();
... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof UnitsValue<?>) {
UnitsValue<?> uv = (UnitsValue<?>) obj;
return mUnits == uv.mUnits && mValue == uv.mValue;
}
return false;
} | 6 |
public void export(Exporter ex) throws SQLException, IOException {
ex.start(settings.getName());
String query = "SELECT entry_id FROM entry";
EnumSet<ExporterSettings> expSetting = ex.getSettings();
if (expSetting == null) {
expSetting = EnumSet.noneOf(ExporterSettings.class);
}
if (expSetting.contain... | 3 |
/* @ pure */ public Coordinate recursiveCheck(int x, int y, Mark mark, int xOffset,
int yOffset, boolean seenSomething) {
if (x < 0 || y < 0 || x > DIM - 1 || y > DIM - 1) {
return null;
} else if (fields[index(x, y)] == Mark.EMPTY) {
return null;
} else if (fields[index(x, y)] == mark && seenSomething) ... | 9 |
public final void encode(final IAMCodec codec, final IAMIndex source) throws IOException, IllegalArgumentException {
final int mappingCount = source.mappingCount();
final int listingCount = source.listingCount();
final IAMINDEXTYPE xmlIndex = new IAMINDEXTYPE();
xmlIndex.byteOrder = codec.getByteOrder().toStri... | 6 |
public static void main(String[] args) {
try {
initParameters(args);
File file = new File(filePath);
Input input = InputReader.readInput(file);
List<Cluster> clusters = DBScan.run(input.getTimeSeries(), eps, minNrOfNeighbours);
runPlotPrintingThread(input, clusters);
runClusterPlotScript... | 4 |
public void update( final double ct ) {
// get the array of entities
final Entity[] entities = getEntities();
// update all entities
for( final Entity entity : entities ) {
entity.update( ct );
}
// check for collisions
for( final Entity entityA : entities ) {
for( final Entity entityB : ent... | 9 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Ventana window = new Ventana();
window.frmClienteChat.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
private String prettyPrinterDados(List<Object> dados) {
int cont = 0;
StringBuilder pretty = new StringBuilder();
for (Object o : dados){
if (o instanceof EData1)
pretty.append((cont > 0) ? " e Temperatura" : "Temperatura");
else if (o instanceof EData2)
pretty.append((cont > 0) ? " e Hemoglobina" :... | 9 |
private String classNameToZipEntryName(String className) {
return className.replace('.', '/')
+ ".class";
} | 0 |
public static void checkNotNull(Object o, Class<?> c) {
if (o == null) {
throw new PrecondictionException("");
}
} | 2 |
public void selectPreviousStream() {
int selectedRow = table.getSelectedRow();
int numberOfStreams = controlStreams.getStreamVector().size();
//no stream is selected
if(selectedRow == -1 && numberOfStreams > 0) {
selectedRow = numberOfStreams-1;
} else if (selectedRow >= (numberOfStreams-1)) {
select... | 4 |
public void setNumeroInt(TNumeroInt node)
{
if(this._numeroInt_ != null)
{
this._numeroInt_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.par... | 3 |
public String getRegion() {
return region;
} | 0 |
private static Token matchIdentifier(String word, int line, int position){
StringBuilder token = new StringBuilder();
int i=0;
for (; i<word.length(); i++){
char current = word.charAt(i);
if (!Character.isLetterOrDigit(current)){
break;
}
token.append(current);
}
if (i != 0) {
Keyword... | 4 |
private void printScore() {
aiTimer.stop();
playerTimer = new Timer(SCORE_SHOW_DELAY, this); // TODO: 300
playerTimer.start();
ballMovement = false;
} | 0 |
public void run(){
try {
_serverSocket = new ServerSocket(_listenPort);
System.out.println("Listening...");
} catch (IOException e) {
System.out.println("Cannot listen on port " + _listenPort);
}
UserDatabase.getUsers();
Statistics statistics= Statistics.getStatisticsObject();
while (!_serverStop.g... | 4 |
private boolean checkForObjectRestore(int i, float days, String root) {
// float[][] data = new float[dbSet.length][];
float[][] data = DataUtil.restore2D(root + File.separator + "OBJECTS"
+ File.separator + "DATA_" + days);
if (data == null)
return false;
// float[][][] pdata = new float[dbSet.length]... | 4 |
@Override
public String toString() {
return "IkszorBinaryObject " +
"[encodedValue=" + IkszorManager.booleanArray2BinaryString(encodedValue) + "["+(encodedValue != null ? encodedValue.length : "null")+"]" +
", symmetricKey=" + IkszorManager.booleanArray2BinaryString(symmetricKey) + "["+(symmetricKey != null ... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Port other = (Port) obj;
if (this.numberOfBerthes != other.numberOfBerthes) {
return false;
... | 5 |
private List<Teleporter> getTeleportersOfGrid(Grid grid) {
final List<Teleporter> teleporters = new ArrayList<Teleporter>();
for (Element e : grid.getElementsOnGrid())
if (e instanceof Teleporter)
teleporters.add((Teleporter) e);
return teleporters;
} | 2 |
public void setLine(int line) {this.line = line;} | 0 |
public static void testFindFieldsbyXpath() throws Exception {
try{
getDriver().get("http://www.google.com/webhp?complete=1&hl=en");
// assertEquals("Google", getDriver().getTitle());
// Find the text input element by its Xpath
WebElement element = getDriver().findElement(By.xpath("//in... | 1 |
@Override
public void setFloat(long i, float value)
{
if (value != 0.0 && value != 1.0) {
throw new IllegalArgumentException("The value has to be 0 or 1.");
}
if (ptr != 0) {
Utilities.UNSAFE.putByte(ptr + i, (byte) value);
} else {
if (isConst... | 4 |
public void deductCost(Player player) {
for (int i = 0; i < costs.size(); i++) {
Item item = costs.get(i);
if (item instanceof ResourceItem) {
ResourceItem ri = (ResourceItem) item;
player.inventory.removeResource(ri.resource, ri.count);
}
}
} | 2 |
public void update() {
player.update();
player.checkAttack(enemies);
player.checkCoins(coins);
finish.update();
finish.checkGrab(player);
bg.setPosition(tileMap.getx(), tileMap.gety());
if(player.isDead()){
player.setPosition(100, 400);
player.revive();
player.reset();
restart();
... | 6 |
public static Map<String, String> simpleCommandLineParser(String[] args) {
Map<String, String> map = new HashMap<String, String>();
for (int i = 0; i <= args.length; i++) {
String key = (i > 0 ? args[i - 1] : null);
String value = (i < args.length ? args[i] : null);
if (key == null || key.star... | 9 |
public void connect() {
// STEP 1 - CONNECT ALL UNCONNECTED
// NEIGHBOURS------------------------------------------------
// picks random room based on index from 0 to times*times(nb. of rooms)
Random rand = new Random();
int currentRoom = rand.nextInt(roomBase * roomBase);
// the starting room for the pla... | 8 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "This command is not supported from console.");
return true;
}
if (!sender.hasPermission("timebasic.adweather") && (!sender.isOp()))... | 7 |
public String arabToRome(int arabNum, int digits){
String romeNum = "";
String[] digits1 = new String[]{"I","X","C","M"};
String[] digits2 = new String[]{"II","XX","CC","MM"};
String[] digits3 = new String[]{"III","XXX","CCC","MMM"};
String[] digits4 = new String[]{"IV","XL","CD"};
String[] digits5 = new St... | 9 |
public void affichePacman(Graphics pacman, GestionGraphismes g)
{
String img = "pacman_"+mvmt;
if (ferme > 15)
img = img+"_ferme";
if (invincible && (timer > 100 || timer%10<5))
img = img+"_invincible";
if (!invisible || (invisible && timer % 15 < 10))
pacman.drawImage(g.getPacman(img), positionX, ... | 7 |
public static void UpdateImportFile(String profile, String genername, String importfile)
{
File file = new File(profile);
if (file.exists())
{
try
{
// Create a factory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// Use the factory to create a builder
... | 7 |
public void handle(Packet packet) {
if (packet instanceof ConnectPacket) {
// do nothing, already handled elsewhere
} else if (packet instanceof ShootPacket) {
shoot();
} else if (packet instanceof AdjustShooterAnglePacket) {
System.out.println("recv");
double angle = ((AdjustShooterAnglePacket)packet... | 3 |
public boolean hasMatchedWord(String wordnum) {
return dictionary.containsKey(wordnum);
} | 0 |
@Override
public String execute() throws Exception {
try {
Map session = ActionContext.getContext().getSession();
Campaign camp = (Campaign) session.get("campa");
CampaignDevice campdev = new CampaignDevice(camp, getPlatform());
getMyDao().getDbsession().sa... | 3 |
@Override
public String toString() {
if (type == NUM) {
return "NUM: " + value;
} else if (type == CMD) {
return "CMD: " + name;
} else if (type == UNK) {
return "UNK";
} else if (type == EOF) {
retur... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
Player p = Bukkit.getPlayer(sender.getName());
if(cmd.getName().equalsIgnoreCase("hub")){
Bukkit.dispatchCommand(p, "warp hub");
return true;
}
if(cmd.getName().equalsIgnoreCase("kits")){
KitPvP.kit(p, ... | 5 |
public void mouseInput(){
int mouseX = Mouse.getX();
int mouseY = Mouse.getY();
if (!justRequested){
distributePoints(mouseX, mouseY);
justRequested = true;
}
for (int x = 0; x < windowslist.size(); x ++){
if (windowslist.get(x).recieveMouseEvent(mouseX, mouseY)){
break;
}
}
pane... | 9 |
public final LogoParser.sum_return sum() throws RecognitionException {
LogoParser.sum_return retval = new LogoParser.sum_return();
retval.start = input.LT(1);
Object root_0 = null;
Token PLUS43=null;
Token MINUS44=null;
LogoParser.mult_return o1 =null;
LogoPar... | 9 |
public InstructionStack(final MethodEditor method) {
this.method = method;
this.stacks = new HashMap();
this.preexists = new HashMap();
// Initially only the parameters to the method prexist
final Type[] paramTypes = method.paramTypes();
this.currPreexists = new HashMap();
for (int i = 0; i < paramTypes.... | 3 |
private boolean canNotPassWall(double x, double dx, double y, double dy){
for (Wall wall: walls){
if (wall.crossedWall(x, dx, y, dy)){
return true;
}
}
return false;
} | 2 |
protected String startSetToString() {
StringBuffer FString = new StringBuffer();
boolean didPrint;
if (m_starting == null) {
return getStartSet();
}
for (int i = 0; i < m_starting.length; i++) {
didPrint = false;
if ((m_hasClass == false) ||
(m_hasClass == true && i... | 7 |
@Override
public void deconnecter() throws SQLException {
getConnexion().close();
} | 0 |
public boolean estTerminee(){
if(this.etat == TERMINEE){
return true ;
}
else {
return false ;
}
} | 1 |
public void run(){
try {
while(true){
Thread.sleep(MS_PER_SHRINK); // milliseconds
synchronized(vTrapped){
for(SpaceObject uObj : vTrapped){
if(uObj.getRad() > 0){
double x = uObj.getCenterX();
double y = uObj.getCenterY();
uObj.setRad(uObj.getRad() - 1); //decrease radius
... | 6 |
private void merge(int[] left, int[] right)
{
int leftIndex = 0; // current left index
int rightIndex = 0; // current right index
int i = 0; // current index in a
// merge the left and right arrays into a
while (leftIndex < left.length &&
rightIndex < right.length)
{
if (... | 5 |
public HashMap<String, Integer> calculateDocumentOccuriences(
List<String> unique, List<List<String>> documents)
throws InvalidFormatException, IOException {
HashMap<String, Integer> map = new HashMap<>();
for (String uniqueToken : unique) {
map.put(uniqueToken, 0);
for (List<String> list : documents)... | 4 |
@Override
public void doLoopAction()
{
if (hit)
{
doHit();
}
if (changeAni)
{
setAnimation();
changeAni = false;
}
} | 2 |
public void act(){
//if it gone past the start menu
if (start){
MouseInfo mouse = Greenfoot.getMouseInfo();
uiAct();
s.run();
//if the level started, increase the time and prepare the spawn
if (levelStart){
prepareSpawn(... | 6 |
private void tryMove() {
for(BB bb : level.collidables) {
if(bb.intersects(this.x + this.xa, this.y, width, height)) {
if(this.xa > 0) {
this.x = bb.getX() - width;
} else if(this.xa < 0) {
this.x = bb.getX() + bb.getWidth();
}
this.xa = -xa;
}
i... | 7 |
public synchronized byte[] sendMutualAuth(byte[] rndIFD, byte[] rndICC,
byte[] kIFD, SecretKey kEnc, SecretKey kMac)
throws CardServiceException {
try {
ResponseAPDU rapdu = transmit(createMutualAuthAPDU(rndIFD, rndICC,
kIFD, kEnc, kMac));
byte[] rapduBytes = rapdu.getBytes();
if (rapduBytes == nu... | 5 |
@Override
public void updateUser(UserDTO user) throws SQLException {
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.update(user);
session.getTransaction().commit();
}... | 3 |
static String makeRgbaData(int width, int height, int bpp, boolean has_alpha) {
final int CHECK_SIZE = 20;
assert (bpp == 4);
assert (has_alpha);
int rowstride = width * bpp;
char[] pixels = new char[height * rowstride];
for (int y = 0; y < height; y++) {
int i = 0;
for (int x = 0; x < width; x++)... | 8 |
public double variance_of_ComplexRealParts() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
double[] re = this.array_as_real_part_of_Complex();
double variance = Stat.variance(re);
Stat.nF... | 2 |
public void unDeplacement(){
this.flackBoy.avancer();
/*System.out.println("ANGLE = "+this.flackBoy.getTrajectoire().angleActuelle());
System.out.println("VITESSE = "+this.flackBoy.getTrajectoire().vitesseActuelle());
System.out.println("X = "+this.flackBoy.getX());
... | 8 |
public int getStringWidth(String par1Str)
{
if (par1Str == null)
{
return 0;
}
int i = 0;
boolean flag = false;
for (int j = 0; j < par1Str.length(); j++)
{
char c = par1Str.charAt(j);
int k = getCharWidth(c);
... | 9 |
public static void main(String[] args) {
Scanner tecla=new Scanner(System.in);
String opcion=" ";
System.out.println("ELECCIONES");
do{
System.out.println("Elige una opcion (a-e), o teclea 'X' para terminar:");
opcion=tecla.next();
switch (opcion){
case "a":
String nombre=" ";
St... | 9 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g.create();
int h = getHeight();
int w = getWidth();
int pct=2;
float tran = 0.1f + pct * 0.9f;
GradientPaint GP = new GradientPaint(0, 0, COLOR1, 0, h, COLOR2, true);
g2d.setPaint(GP);
ButtonModel model = getModel();
if (!... | 3 |
private void loadGame(BasicGame rps) {
Util.initialPromtVersion(rps);
// get all the available items for this verison of game
Set<Item> itemSet = rps.getItems();
while (true) {
currentLine = scanner.nextLine();
try {
//your current picked item.... | 9 |
private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed
ctrlP.suivant();
}//GEN-LAST:event_jButtonNextActionPerformed | 0 |
public ComparableNode getLeftmostProperDescendant() throws MaltChainedException {
NonTerminalNode node = this;
ComparableNode candidate = null;
while (node != null) {
candidate = node.getLeftChild();
if (candidate == null || candidate instanceof TokenNode) {
break;
}
node = (NonTerminalNode)candid... | 8 |
static final public void metodos() throws ParseException {
if (jj_2_4(2147483647)) {
metodos_com_parametros();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOUBLE:
case FLOAT:
case LONG:
case CHAR:
case INT:
case VISIBILITY:
case IDENTIFIER:
... | 9 |
@Override
public void free_result() throws SQLException {
// no need to close a stmt which doesn't exist
if(this.stmt != null && !this.stmt.isClosed()) {
this.stmt.close();
this.stmt = null;
this.last_prepare = "";
}
if(this.res != null && !this.res.isClosed()) {
this.res.close();
this.res = nul... | 4 |
private void dissipate() {
float flowRate = Globals.getSetting("Dissipation strength", "Water");
for(int x = 0; x < Globals.width; x++){
for(int y = 0; y < Globals.height; y++){
for(int[] neighbor : HexagonUtils.neighborTiles(x, y, false)){
if(groundWaterLevel[neighbor[0]][neighbor[1]] < groundWaterLeve... | 5 |
public static void parseArguments(final String[] args) {
for (int i = 0; i < args.length; i++) {
final String element = args[i];
if (element.equalsIgnoreCase("-h") || element.equalsIgnoreCase("--h") || element.equalsIgnoreCase("--help") || element.equalsIgnoreCase("-help") || element.equalsIgnoreCase("hel... | 8 |
public static void main(String[] args)
{
HashSet set1 = new HashSet();
set1.add("a");
set1.add("b");
set1.add("c");
set1.add("d");
// Iterator iter = set1.iterator();
// while(iter.hasNext()){
//
// String value = (String)iter.next();
//
// System.out.println(value);
// }
for(Iterator... | 1 |
private void writeToFile(String strRep, String path) {
FileOutputStream fos = null;
File file;
try {
//Get all current text into temp
String temp = "";
Scanner sc = new Scanner(new File(path));
while(sc.hasNextLine()) {
temp += sc.... | 5 |
static double[][] multiply(double[][] A, double[][] B){
double[][] AB = new double[A.length][B[0].length];
for(int i = 0; i < A.length; i++){
for(int j = 0; j < B[i].length; j++){
for(int k = 0; k < B.length ; k++){
AB[i][j] += A[i][k]*B[k][j];
}
}
}
return AB;
} | 3 |
private void initEnemies() {
for(int i = 0; i < 12; i++) {
Mho newEnemy = initRandMho();
if(!(grid[newEnemy.getX()][newEnemy.getY()] instanceof Fence) && !(grid[newEnemy.getX()][newEnemy.getY()].contains(Mho.class))) {
grid[newEnemy.getX()][newEnemy.getY()].occupy(newEnemy);
}
else i--;
}
} | 3 |
public Double[][] sum(Double[][] a, Double[][] b) {
Double[][] ans = new Double[2][a[0].length+b[0].length];
boolean flag = false;
for(int i=0; i<a[0].length; i++){
ans[0][i] = a[0][i];
ans[1][i] = a[1][i];
}
if(a[0].length < b[0].length){
Doub... | 6 |
@Override
public void delete(Match obj) {
PreparedStatement pst = null;
try {
pst = this.connect().prepareStatement("DELETE FROM Matches where id=?;");
pst.setInt(1, obj.getId());
pst.executeUpdate();
System.out.println("suppressi... | 3 |
public static void flatten3(TreeNode root) {
if (root == null || (root.left == null && root.right == null)) return;
if (root.left != null) {
TreeNode tmp = root.right;
root.right = root.left;
root.left = null;
TreeNode rightMost = findRightMostNode(root.right);
rightMost.right = tmp;
flatten3(r... | 5 |
public void clear(){
wrncnt=0;
errcnt=0;
messagequeue.clear();
} | 0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((val == null) ? 0 : val.hashCode());
return result;
} | 1 |
public void delete(int index){
if(index >= size || index < 0){
System.out.println("Invalid index");
}else{
maxHeap[index] = maxHeap[size - 1];
size --;
MaxHeap.maxHeaplify(maxHeap, index, size);
}
} | 2 |
private List<Reducer> estimateReducers(List<Mapper> newMapperList) {
int fReducerNum = finishedConf.getMapred_reduce_tasks();
if(fReducerNum == 0)
return null;
ReducerEstimator reducerEstimator = new ReducerEstimator(finishedConf, newConf, newMapperList, false);
List<Reducer> newReducerList = new Arra... | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY);
if(target==null)
return false;
if(!(target instanceof Armor))
{
mob.tell(mob,target,null,L("You ca... | 7 |
public boolean canShiftLeft(){
if(loc1.getColumn() == 0 || loc2.getColumn() == 0|| loc3.getColumn() == 0
|| loc4.getColumn() == 0){
return false;
}
//gets all of the rightmost locations of the piece
ArrayList<Location> leftLocs = getLeftLocs();
for(int i = 0; i < leftLocs.size(); i++){
if(board.getV... | 6 |
public boolean onCommand(CommandSender cs, Command cmd, String string,
String[] args) {
if(!(cs instanceof Player)){
cs.sendMessage("This is not a console command!");
return false;
}
if(string.equalsIgnoreCase("tp")){
Teleport teleportObj = new Teleport(MainClass);
teleportObj.teleport(cs, cmd, ... | 4 |
public void linearInterpolation(){
if(this.nAnalyteConcns<2)throw new IllegalArgumentException("Method cubicInterpolation requres at least 2 data points; only " + this.nAnalyteConcns + " were supplied");
this.methodUsed = 14;
this.sampleErrorFlag = false;
this.titleOne = "Linear interpol... | 4 |
@Override
@Command
public MessageResponse setUserPublicKey(String userName) throws IOException {
if(initRMI()) {
String pathToPublicKey = keysDir+"/"+userName+".pub.pem";
PEMReader in;
try {
in = new PEMReader(new FileReader(pathToPublicKey));
PublicKey publicKey = (PublicKey) in.readObject();
... | 2 |
public GameData getData() {
// creating a new gamedata object
GameData gd = new GameData();
// setting the MP and gem
gd.setMP(MagicPower.getMP());
gd.setGem(gem);
gd.setCounter(counter);
// adding the enemies
List<Enemy> enemyList = new ArrayList<Enemy>();
for (Tile t : map) {
if (t instanceof ... | 7 |
@Override
public boolean export(final File target, HistorySorter sorter) {
boolean result = false;
if (sorter == null) {
throw new IllegalArgumentException("Null sorter not allowed");
}
try {
final Document doc = prepareDocument();
final Element ... | 5 |
private void printImplementors(final Type iType, final PrintWriter out,
final boolean recurse, final int indent) {
final Iterator implementors = this.implementors(iType).iterator();
while (implementors.hasNext()) {
final Type implementor = (Type) implementors.next();
indent(out, indent);
out.println(imp... | 2 |
@Override
Shape getShape(String shapeName) {
// Java 8 can use Strings in switch.
switch (shapeName) {
case "CIRCLE":
return new Circle();
case "RECTANGLE":
return new Rectangle();
case "SQUARE":
return new Square();
default:
return null;
}
} | 3 |
private boolean catchEntryRefs(E entry) {
strongRefs.clear();
if (entry == null) {
return true;
}
final List<? extends Reference<?>> refs = entry.getReferences();
if (refs == null) {
return true;
}
for (... | 7 |
public void check() throws IllegalStateException {
Run currentRun = getFirst();
int curLength = 0;
int totalLength = width * height;
while(hasNext(currentRun)) {
if((currentRun.getRunType() == currentRun.getNext().getRunType())
&&(currentRun.getHungerVal() == currentRun.getNext().getHungerVal()))... | 6 |
Object createPrimitiveFor(Class<?> primitiveT) {
if (primitiveT == Boolean.TYPE) {
return arbBoolean();
} else if (primitiveT == Character.TYPE) {
return arbChar();
} else if (primitiveT == Byte.TYPE) {
return arbByte();
} else if (primitiveT == Short.... | 9 |
final void method1716(boolean bool) {
anInt5931++;
if (bool != false)
aClass351_5929 = null;
if (((Class239) this).aClass348_Sub51_3136.method3422(674)
!= Class10.aClass230_186)
((Class239) this).anInt3138 = 1;
else if (((Class239) this).aClass348_Sub51_3136.method3425(-125))
((Class239) this).a... | 5 |
public void drawStringMoveY(int waveSpeed, String string, int waveAmount, int y, int x, int color) {
if (string == null) {
return;
}
double speed = 7D - (double) waveSpeed / 8D;
if (speed < 0.0D) {
speed = 0.0D;
}
x -= getTextWidth(string) / 2;
y -= baseHeight;
for (int index = 0; index < string.l... | 4 |
@Override
public void reset () {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
if (field[i][j] instanceof EmptyCell) {
field[i][j] = new EmptyCell();
}
}
}
openedCells.clear();
isProce... | 3 |
private void hitEnemy(Player player, Enemy[][] enemys){
for(int i = 0; i < enemys.length; i++) {
for(int j = 0; j < enemys[i].length; j++) {
for(int k = 0; k < player.getProjectiles().length; k++) {
if(player.getProjectiles()[k].getCollider() != null) {
if(enemys[i][j].getCollider().overlaps(player.... | 7 |
private void setUpValueSelection(Instances format) {
if (format.classIndex() < 0 || format.classAttribute().isNumeric()) {
// cant do anything in this case
return;
}
if (m_displayValNames == false) {
remove(m_messageLabel);
}
int existingClassVal = m_classValuePicker.getClassV... | 7 |
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e)
{
IrcClient client = Parent.Manager.getCurrentClient();
for(String s : client.getMcEcho_ActiveChannels())
{
try{ client.PrivMsg(s, IrcColor.formatMCMessage(ChatManagerUtils.ParseDisplayName(e.getPlayer())) + IrcColor.N... | 3 |
public void createStockArff(String stockName, ArrayList<Integer> years) {
String result = "";
int instances = 0;
result += "@RELATION " + stockName + "\r\n";
result += "@ATTRIBUTE day NUMERIC " + "\r\n";
result += "@ATTRIBUTE price NUMERIC " + "\r\n";
result += "@DATA " ... | 9 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.