text stringlengths 14 410k | label int32 0 9 |
|---|---|
private Map<String, Quantity> loadStock() {
if(stock == null) {
stock = Maps.newConcurrentMap();
declare(stock, "Coffee", 10);
declare(stock, "Chocolate", 10);
declare(stock, "OrangeJuice", 10);
declare(stock, "Tea", 10);
declare(stock, "To... | 1 |
public void assignAffectedPerts( Residue res ){
if(res.perts != null){
PriorityQueue<Integer> affected = new PriorityQueue<Integer>();
for(int b=0;b<res.perts.length;b++){
Perturbation pert = perts[res.perts[b]];
for(int c=0;c<pert.successors.length;c++){... | 8 |
@SuppressWarnings("unchecked")
char getCharValue(Object obj, int k) {
if ((obj instanceof ArgHolder<?>)
&& ((ArgHolder<?>) obj).getType().equals(Character.class)) {
return ((ArgHolder<Character>) obj).getValue();
} else if (obj instanceof char[]) {
return ((char[]) obj)[k];
} else {
... | 5 |
private Salir() {
// JFormDesigner - Action initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
putValue(NAME, "Salir");
putValue(SHORT_DESCRIPTION, "Salir el programa");
putValue(LONG_DESCRIPTION, "Salir el programa");
putValue(ACCELERATOR_KEY, KeyStro... | 0 |
public void determinSched(int days, int[] sec, int min){
int num_sec = sec.length;
int [][] M = new int[days + 1][num_sec + 1];
int T = 0;
for(int j=0; j<=10; j++){
T = T + sec[j];
if(j == 0){
M[1][j] = (int)Math.pow(Math.max(min-0, 0), 4) + Math.max(0-min, 0);
}
else{
M[1][j] = (int)Math.po... | 7 |
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 1; i++) {
try {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0: jj_3_1(); break;
}
}
... | 5 |
private void inicializaPercentuaisDesconto() {
switch (diaDaSemana) {
case SEGUNDA:
descontosPorTipo.put(TiposDeIngresso.CRIANCA, 10);
descontosPorTipo.put(TiposDeIngresso.ESTUDANTE, 10);
descontosPorTipo.put(TiposDeIngresso.IDOSO, 10);
break;
case TERCA:
descontosPorTipo.put(TiposDeIngresso.CRIANC... | 6 |
public UploadListener(HttpServletRequest request, long debugDelay)
{
this.request = request;
this.delay = debugDelay;
totalToRead = request.getContentLength();
this.startTime = System.currentTimeMillis();
} | 0 |
@Override
public void doSomething() throws IOException, ParsingException, LexingException, IncorrectProofException {
String[] temp = in.readLine().split(Pattern.quote("|-"));
if (temp.length > 2) {
throw new IOException("more than one |- in first line");
}
String s = temp... | 9 |
public PogNode chooseNeighborWeighted_Fast(TreeQualifier qualifier, Random generator) {
Node editedNode = null;
boolean isAdded = false;
if (addableList.isEmpty() && removableList.isEmpty()) { // this is a null node; choose a node to add from the whole dataset
isAdded = true;
... | 9 |
private void validateParticipantsInCSVFile(List<Participant> participants) {
List<String[]> results = new ArrayList<String[]>();
try {
CSVReader reader = new CSVReader(new FileReader(csvPath));
results = reader.readAll();
reader.close();
} catch (FileNo... | 3 |
public boolean canIssue(Instruction instruction) {
boolean freeResStat = false;
String opcode = instruction.getOpcode();
for (int i = 0; i < reservationStations.size(); i++) {
ReservationStation resStation = reservationStations.get(i);
if (resStation.getUnit().equals(opcode)) {
if (!resStation.isBusy())... | 4 |
private void computeRoutingTablesParser(String input){
boolean splitHorizon = false;
int i = 0;
Scanner inputscanner = new Scanner(input);
inputscanner.next(); //take away command
while(inputscanner.hasNext()){
String token = inputscanner.next();
if (token.charAt(0)=='t'|| token.charAt(0)=='T'){
... | 5 |
private Integer Find(String key, Node node) {
if(node instanceof LeafNode){
for(int i = 0; i <= node.getSize() - 1; i++){
if(key.compareTo(node.getKey(i)) == 0){
return node.getValue(i);
}
}
return null;
}
if(node instanceof InternalNode){
for(int i = 1; i <= node.getSize();i++){
... | 6 |
public static void handleEvent(int eventId)
{
// return to main menu
if(eventId == 1)
{
System.out.println("Exit new game menu selected");
Main.newGameMenu.setVisible(false);
Main.newGameMenu.setEnabled(false);
Main.newGameMenu.setFocusable(false);
Main.mainFrame.remove(Main.newGameMenu);
M... | 5 |
public void Start(String name)
{
Land_objects = new ObjectsThread(Land_Matrix);
Animal_objects = new ObjectsThread();
Char_objects = new ObjectsThread();
for (int ix = 0; ix < Land_Matrix.length; ix++)
for (int iy = 0; iy < Land_Matrix[ix].length; iy++)
... | 5 |
public double getY2Coordinate()
{
return y2Coordinate;
} | 0 |
public CharacterBoard() {
try {
charSheetBig = ImageIO.read(new File("sprites/player.png"));
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
charSheet = new BufferedImage[charRows * charCols];
for (int i = 0; i < charCols; i++) {
for (int j = 0; j < charRows... | 3 |
public void close() {
try {if (dataParser != null) dataParser.close();}
catch (IOException e) {}
try {if (resourceParser != null) resourceParser.close();}
catch (IOException e) {}
} | 4 |
public static void main(String[] args) {
Map<Model,Model> map = new HashMap<Model, Model>();
for(int i = 0;i<100;i++){
Model m = new Model(i);
map.put(m, m);
map.put(m, m);
}
while(true){
Set<Model> set = map.keySet();
if(!"[57, 33, 20, 71, 4, 49, 42, 23, 39, 35, 15, 18, 74, 14, 94, 77, 58, 25, 8... | 3 |
public void operationManager(char symbol) throws DivisionByZeroException {
if (!"".equals(text.getText())) {
switch (symbol) {
case '+':
memory = memory + Double.parseDouble(text.getText());
break;
case '-':
... | 7 |
private void buildHotSpots() {
File hotSpotFile = new File(MODEL_PATH + name + ".hspot");
BufferedReader in;
String line;
try {
if (hotSpotFile.exists()){
in = new BufferedReader(new FileReader(hotSpotFile));
File transformFile = new File(MOD... | 6 |
public void visitIincInsn(final int var, final int increment){
if(currentBlock != null)
{
if(compute == FRAMES)
{
currentBlock.frame.execute(Opcodes.IINC, var, null, null);
}
}
if(compute != NOTHING)
{
// updates max locals
int n = var + 1;
if(n > maxLocals)
{
maxLocals = n;
}
}
// ... | 7 |
public int individualHappy(Room r) {
int totalHappy = 0;
String good = this.roomList();
String bad = this.noRoomList();
String[] goodName = good.split(",");
String[] badName = bad.split(",");
for(Person q : r.roomies) // See how they feel about eve... | 8 |
protected void end() {
} | 0 |
public static String reverseSubstring(String string, int startIndex, int endIndex) {
if (string == null || startIndex < 0 || startIndex > endIndex || endIndex > string.length())
return null;
// build result
String result = string.substring(0, startIndex); // prefix
int currIndex = endIndex;
while (cu... | 5 |
public String getHelpText(HelpType command) throws CheckersException {
String helpText = "";
switch (command) {
case INSTRUCTIONS:
case BOARD:
case GAME:
case REAL_PLAYER:
case LOCATION:
case MARKER:
helpText = comma... | 6 |
public boolean openAndReadTemplate(){
try {
String line;
reader = new BufferedReader(new FileReader(file));
while ((line = reader.readLine()) != null) {
template.add(line);
}
reader.close();
return true;
} catch (FileNotFoundException e) {
writeLog(e);
return false;
} catch (IOExceptio... | 3 |
public List<Integer> getSCC(Graph graph, Graph reversedGraph) {
List<Integer> result = new ArrayList<Integer>();
System.out.println("Start sorting");
Stack<Vertex<T>> dfsSorting = getDfsSorting(graph);
System.out.println("End sorting");
Stack<Vertex<T>> stack = new Stack<Vert... | 5 |
protected Class getTransitionClass()
{
return MooreTransition.class;
} | 0 |
public void displayCardValues() {
for (Card card : cards) {
if (card.isAce()) {
System.out.println(card.getType().toString() + " ACE");
} else if (card.getValue() == 11) {
System.out.println(card.getType().toString() + " JACK");
} else if (card.getValue() == 12) {
System.out.println(card.getType(... | 5 |
public void setEssensration( int rationssatz )
{
if ( rationssatz == 1 )
{
this.essensration = 1;
}
else if ( rationssatz == 2 )
{
this.essensration = 2;
}
else if ( rationssatz == 3 )
{
this.essensration = 4;
}
} | 3 |
@EventHandler
public void onClick(PlayerInteractEvent e){
Player p = e.getPlayer();
if(e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_AIR){
if(p.getInventory().getItemInHand().equals(guns.ChickenGun())){
p.getWorld().spawnEntity(p.getEyeL... | 5 |
public Cell(int x, int y) {
// Passing default values to prevent null pointer exceptions during testing
this.pos[0] = x;
this.pos[1] = y;
this.rock = false;
this.adjacentAntsBlack = 0;
this.adjacentAntsRed = 0;
this.anthill = "none";
this.food = 0;
... | 1 |
public int[] getIntArrayArgument(String name, boolean required){
if(M.containsKey(name))
{
String a = M.get(name).trim();
if("iI".indexOf(a.charAt(0)) == -1){illFormedArray(a," expected integer array");}
if(a.charAt(1) != '[' || a.charAt(a.length()-1) != ']'){illForme... | 8 |
public AbstractFileProtocol() {} | 0 |
public boolean contains(Info otherInfo) {
if ((otherInfo.color != null && otherInfo.color != color) ||
(otherInfo.size != null && otherInfo.size != size) ||
(otherInfo.location != null && otherInfo.location != location) ||
(otherInfo.image != null) && otherInfo.image != image) {
return false;
}
ret... | 8 |
public int tally(int[] parValue, String[] scoreSheet) {
int total = 0;
for(int i = 0; i < parValue.length; i++){
int current = 0;
if(scoreSheet[i].equals("double bogey")){
current = parValue[i] + 2;
}else if(scoreSheet[i].equals("bogey")){
current = parValue[i] + 1;
}else if(scoreSheet[i].equal... | 9 |
public void renderSprite(int xp, int yp, Sprite sprite, boolean fixed) {
if (fixed) {
xp -= xOffset;
yp -= yOffset;
}
for (int y = 0; y < sprite.getHeight(); y++) {
int ya = y + yp;
for (int x = 0; x < sprite.getWidth(); x++) {
int xa = x + xp;
if (xa < 0 || xa >= width || ya < 0 || ya >= heig... | 7 |
public static ArrayList<ArrayList<Integer>> generate(int numRows) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
if (numRows == 0){
return result;
}
for (int i = 0;i<numRows;i++){
ArrayList<Integer> temp = new ArrayList<Integer>();
... | 5 |
public synchronized void unlock() {
if (ASSERTS && owner != Thread.currentThread()) {
Thread.dumpStack();
throw new IllegalLockStateException("Don't own monitor");
}
locked = false;
if (waiters > 0) {
if (STATISTICS) {
unlock_waiting++... | 9 |
private static final int reduce(int current, int desired) {
if (current > desired) {
current -= current / 7;
if (current < desired) {
current = desired;
}
}
return current;
} | 2 |
private boolean SingleLineConditionCheck(String type,String string){
Scanner scanner = new Scanner(string);
boolean condition = false;
scanner.useDelimiter(type+"\t*");
while(scanner.hasNext()){
String getcontent = scanner.next();
if(type.equals("name")){
if(this.NameFieldCheck(getcontent)){
... | 9 |
private int unaryExecute(int i) {
switch(sim40.memory[i]) {
/* Unary Instructions */
case 4: /* cclear */
switchOffFlag(2);
break;
case 5: /* cset */
switchOnFlag(2);
break;
case 6: /* xinc */
sim40.memory[Simulator.XREG_ADDRESS]++;
checkResetOverflow(Simulator.XREG_ADDRESS);
break;
... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Client other = (Client) obj;
if (this.ip == null) {
if (other.ip != null)
return false;
} else if (!this.ip.equals(other.ip))
return ... | 7 |
public void put(Node node, long key) {
try {
if (node.previous != null) {
node.unlink();
}
Node previous = cache[(int) (key & size - 1)];
node.previous = previous.previous;
node.next = previous;
node.previous.next = node;
node.next.previous = node;
node.hash = key;
return;
} catch (Ru... | 2 |
public boolean isPerson(String word) {
int i;
// Teste referente ao tamanho da palavra, excluindo palavras com menos
// de 3 caracteres e mais de 10.
//
if (word.length() < 3 || word.length() > 10) {
return false;
}
// Teste referente a primeira le... | 5 |
private static boolean canInvokeWithArguments(Method method,
Object[] arguments) {
Class<?>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length != arguments.length) {
return false;
}
for (int index = 0; index < arguments.length; index++) {
... | 8 |
public AIUnit yieldUnit(UnitType ut, AIObject o) {
float unitWeight = 99f;
AIUnit yieldedUnit = null;
boolean isOwnUnit = false;
Iterator<AIUnit> uit = getOwnedAIUnitsIterator();
while (uit.hasNext()) {
AIUnit u = uit.next();
//all units in one goal have... | 6 |
public static void backTrace (int[][] s, int[][] c, int f, int e, int base) {
if ( e == 0 || f == 0 ) {
return;
}
int p = c[f][e];
System.out.println(String.format("floor: %d, egg: %d, choose %d", f, e, p+base) );
if ( s[p-1][e-1] > s[f-p][e] ) {
backTrace(s, c, p-1, e-1, base);
} else {
backTra... | 3 |
public IllegalOrphanException(List<String> messages) {
super((messages != null && messages.size() > 0 ? messages.get(0) : null));
if (messages == null) {
this.messages = new ArrayList<String>();
}
else {
this.messages = messages;
}
} | 3 |
protected int findColumnStrict(String col) throws IllegalArgumentException {
if (col == null) {
throw new IllegalArgumentException("Got null column name.");
}
int val = columnNames.indexOf(col);
if (val < 0) {
throw new IllegalArgumentException("Invalid column: " + col);
}
return val... | 2 |
protected void match(int w, int j) {
matchJobByWorker[w] = j;
matchWorkerByJob[j] = w;
} | 0 |
private void createOpdrachtLink(Opdracht opdracht) {
String type = opdracht.getClass().getSimpleName();
Connection con = maakVerbinding();
PreparedStatement createLink = null;
if (type.equals("EenvoudigeOpdracht")) {
try {
createLink = con.prepareStatement(insertEenvoudigeOpdracht);
createLink.setInt... | 8 |
@Override
public void run() {
for(int i = 0; i<active.length; i++){
for(int j = 0; j<active[0].length; j++){
if (strengthMap[i][j] != 0 && active[i][j] == Board.VISUAL_EMPTY_AREA){
active[i][j] = strengthMap[i][j] == Tetromino.STRENGTH_MANA ? Board.VISUAL_MANA_ORB : ViewController.getRandomVisual();... | 5 |
private AccessToken requestAccessToken(Map<String, String> params)
throws AuthorizationException {
try {
HttpRequest request = HttpRequest.post("https://graph.renren.com/oauth/token");
request.form(params);
int statusCode = request.code();
String body ... | 9 |
final public String literalPredicate() throws ParseException {
Token argument=null;
// LiteralVariable lv=null;
String predicate=null;
if (jj_2_30(7)) {
argument = jj_consume_token(NUMBER);
} else if (jj_2_31(7)) {
predicate = literalFunction();
} else if (jj_2_32(7)) {
argument = jj_con... | 6 |
public String getToolTip() {
return "De-expressionify Transition";
} | 0 |
public void useTransportableTool(State state, ObjectInstance tool, ObjectInstance container, String agent) {
if (ToolFactory.isEmpty(tool)) {
Set<String> contentNames = ContainerFactory.getContentNames(container);
Set<String> includes = ToolFactory.getIncludes(tool);
Set<String> excludes = ToolFactory.getExc... | 9 |
public int search(int[] A, int target) {
if (A == null || A.length == 0)
return -1;
int leftIndex = 0;
int rightIndex = A.length - 1;
int middle;
while (leftIndex <= rightIndex) {
middle = leftIndex + (rightIndex - leftIndex)/2;
... | 9 |
public int method304(int i, int j, int k, int l)
{
Ground class30_sub3 = groundArray[i][j][k];
if(class30_sub3 == null)
return -1;
if(class30_sub3.obj1 != null && class30_sub3.obj1.uid == l)
return class30_sub3.obj1.aByte281 & 0xff;
if(class30_sub3.obj2 != null && class30_sub3.obj2.uid == l)
return cl... | 9 |
public void step(SimState state) {//2 prey in same state with mating motor neuron firing
final WallBuilding wb = (WallBuilding)state;
if((wb.prey.allObjects.size() < WallBuilding.PREY_CAP) && WallBuilding.DO_PREY_CAP){//this is a bit harsh, but I need it! AND BROKEN
for(int x = 0; x < WallB... | 8 |
private static void setPropertyFromString(String line) {
line = line.trim();
/* ignore blank lines */
if (line.equals("")) return;
/* ignore comments */
if (line.startsWith("//")) return;
if (line.startsWith("##")) return;
/* ignore lines that do not have a space in them */
if (line.indexOf(" "... | 7 |
void processResponseHeaders(Map<String, List<String>> resHeaders) {
for (Map.Entry<String, List<String>> entry : resHeaders.entrySet()) {
String name = entry.getKey();
if (name == null)
continue; // http/1.1 line
List<String> values = entr... | 9 |
public static <T extends DC> Set<Set<Pair<Pair<PT<Integer>,T>,Pair<PT<Integer>,T>>>> getAllPhis(Set<Pair<PT<Integer>,T>> baseSetA,
Set<Pair<PT<Integer>,T>> baseSetB)
{ Set<Set<Pair<Pair<PT<Integer>,T>,Pair<PT<Integer>,... | 7 |
public static Direction getOppositeDirection(Direction d) {
switch(d) {
case SOUTHWEST : return NORTHEAST;
case SOUTH : return NORTH;
case SOUTHEAST : return NORTHWEST;
case WEST : return EAST;
case NONE : return NONE;
case EAST : return WEST;
case NORTHWEST : return SOUTHEAST;
case NORTH : return SOU... | 9 |
@DELETE
@Path("/{idres}")
public void deleteResena(@PathParam("idres") String idres) {
String username;
Connection conn = null;
Statement stmt = null;
String sql;
ResultSet rs;
try {
conn = ds.getConnection();
} catch (SQLException e) {
throw new ServiceUnavailableException(e.getMessage());
}
... | 6 |
public int saveUser(User userToSave) {
try {
// Erforderlicher SQL-Befehl
String sqlStatement = "INSERT INTO bookworm_database.users VALUES (default, '"
+ userToSave.getUserName()
+ "', md5('"
+ userToSave.getUserPassword()
+ "'), '"
+ userToSave.getUserRole() + "');";
// SQL-Befeh... | 1 |
public boolean equals(Object obj)
{
if (obj == this)
{
return true;
}
if (obj != null && obj instanceof Position)
{
Position other = (Position)obj;
if (super.equals(obj) && other.z == z)
{
return true;
}
}
return false;
} | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Resource other = (Resource) obj;
if (price != other.price)
return false;
if (resourceType == null) {
if (other.resourceType != null)
... | 7 |
public Type getComponent() {
return dims == 1 ? (Type)component : new MultiArrayType(component, dims - 1);
} | 1 |
public byte[] read(long pos,int length){byte[] b=new byte[length];
try{if(VRAM){long[] disk;long end=pos+length;int r=0;
System.out.println("Read Ram Address: Position="+pos+",End="+end+"");
while(pos<end){disk=VraToPh(pos);
System.out.println("Reading Section: Position="+disk[0]+",End="+(disk[0]+disk[1])+"");
if(di... | 5 |
int numroots(int np, poly sseq[], int at[])
{
int atposinf, atneginf, s;
double f, lf;
atposinf = atneginf = 0;
/*
* changes at positive infinity
*/
lf = sseq[0].coef[sseq[0].ord];
for ( s =... | 8 |
@Override
public boolean supportsAttributes() {return true;} | 0 |
public void create(TipoFreio tipoFreio) {
if (tipoFreio.getConfiguracaoFreioCollection() == null) {
tipoFreio.setConfiguracaoFreioCollection(new ArrayList<ConfiguracaoFreio>());
}
if (tipoFreio.getConfiguracaoFreioCollection1() == null) {
tipoFreio.setConfiguracaoFreioCol... | 9 |
@Test
public void depth0opponent1() {
for(int i = 0; i < BIG_INT; i++)
{
int numPlayers = 2; //assume/require > 1, < 7
Player[] playerList = new Player[numPlayers];
ArrayList<Color> factionList = Faction.allFactions();
playerList[0] = new Player(chooseFaction(factionList), new SimpleAI());
... | 5 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BeanFilter_train bf_train = null;
try {
bf_train = new BeanFilter_train();
if("yahoo".equals(request.getParame... | 5 |
static private boolean jj_3R_10() {
if (jj_scan_token(ACTOR)) return true;
if (jj_scan_token(TYPEIDENT)) return true;
if (jj_scan_token(LBRACE)) return true;
Token xsp;
if (jj_3_4()) return true;
while (true) {
xsp = jj_scanpos;
if (jj_3_4()) { jj_scanpos = xsp; break; }
}
re... | 6 |
public EncoderDrive(double goal, double driveSpeed){
_goal = goal;
_driveSpeed = driveSpeed;
requires(Robot.driveTrain);
} | 0 |
public void book_search(Member loginmem) throws Exception{
int a=0;
//ִܿµ & ԷѴܾԵȸ絵Ѵ.
String newtitle;
do{
System.out.println("*******************************************************************");
System.out.print(":");
newtitle = scan.next();
if(bookcollect.getequal2(newtitle)==1){
a=1;... | 4 |
static private int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
case 40:
return jjStopAtPos(0, 12);
case 41:
return jjStopAtPos(0, 13);
case 42:
return jjStopAtPos(0, 7);
case 43:
return jjStopAtPos(0, 5);
case 45:
return jjStopAtPos(0,... | 7 |
public int puntajeTotal(){
int acum =0;
for(Pregunta pregunta: preguntas)
{
acum= acum + pregunta.puntaje;
}
return acum;
} | 1 |
public Transition copy(State from, State to)
{
return new MooreTransition(from, to, getLabel(), getOutput());
} | 0 |
public void winn() {
SoundManager.play("win");
hasWinn = true;
player.setWinn(true);
new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
getStageManager().setStatge(StageManager.STAGE_SHOP, null);
}
... | 1 |
public void accessCell(int accessType,int x,int y)
{
if (accessType == 0) { //reveal
if (!cells[x][y].getRevealed() && !cells[x][y].getFlagged()) { //note if a cell is flagged in cannot be revealed until unflagged
score--;
cells[x][y].setRevealed(true);
if (cells[x][y].getMined()) { //this is the... | 9 |
public CtMember compile(String src) throws CompileError {
Parser p = new Parser(new Lex(src));
ASTList mem = p.parseMember1(stable);
try {
if (mem instanceof FieldDecl)
return compileField((FieldDecl)mem);
else {
CtBehavior cb = compileMeth... | 3 |
final boolean method2500(int i, int i_0_) {
if (!((Class318_Sub3) this).aBoolean6401)
return false;
int i_1_ = (((Class318_Sub3) this).anInt6406
- ((Class318_Sub3) this).anInt6405);
int i_2_ = (((Class318_Sub3) this).anInt6404
- ((Class318_Sub3) this).anInt6402);
int i_3_ = i_1_ * i_1_ + i_2_ * i_2... | 6 |
public CSVObject addLine() {
//protect against multiple calls to addLine()
if(actLine != null && lastIndex <= 0)
return this;
return addLineForced();
} | 2 |
public static boolean eat(final Player player, Item item, int slot) {
Food food = Food.forId(item.getId());
if (food == null)
return false;
if (player.getFoodDelay() > Utils.currentTimeMillis())
return true;
if (!player.getControlerManager().canEat(food))
return true;
String name = ItemDefinitions.ge... | 7 |
private void parseRxResponse() throws IOException {
//TODO untested after 64-bit refactoring
if (apiId == ApiId.RX_16_RESPONSE || apiId == ApiId.RX_64_RESPONSE) {
if (apiId == ApiId.RX_16_RESPONSE) {
response = new RxResponse16();
((RxBaseResponse)response).setSourceAddress(this.parseAddress16());
} ... | 7 |
private void getPicturesPath(DefaultListModel<String> list) {
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle("Chose JPEG file");
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if(ProjectMainView.actualFolder!=null)
chooser.setCurrentDire... | 3 |
public void sortColors(int[] A) {
int i = 0;
int mm = -1;
int nn = A.length;
while(i < nn){
if(A[i] == 0){
// do need ++i actually because in the next iteration the 3rd condition would work
// A[i++] = A[++mm];
A[i] = A[++mm];
... | 3 |
@Override
protected void setColoredExes() {
ParametricCurve besie = new BesieCurve(allex);
coloredEx = besie.Calculation();
} | 0 |
public String [] getResultNames() {
int addm = (m_AdditionalMeasures != null)
? m_AdditionalMeasures.length
: 0;
int overall_length = RESULT_SIZE+addm;
overall_length += NUM_IR_STATISTICS;
overall_length += NUM_WEIGHTED_IR_STATISTICS;
overall_length += NUM_UNWEIGHTED_IR_STATISTICS;
... | 7 |
public GameSettingsDialog(Campaign campaign)
{
super();
setTitle("Ustawienia widok\u00F3w");
this.setSize(new Dimension(600, 262));
this.campaignRef=campaign;
this.setVisible(true);
this.setResizable(false);
getContentPane().setLayout(new FlowLayout());
background1Label=new JLabel("T\u0142o 1");
b... | 0 |
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_SPACE) {
fire();
}
if (key == KeyEvent.VK_LEFT) {
dx = -1;
}
if (key == KeyEvent.VK_RIGHT) {
dx = 1;
}
if (key == KeyEvent.VK_UP)... | 5 |
public void init() {
for (int i = 0; i < TEST_SIZE; i++) {
graph[i] = new NonDirectedGraph<Integer>();
}
Scanner scanner = new Scanner(getClass().getResourceAsStream("/kargerMinCut.txt"));
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
... | 6 |
public int getTotalCount(int itemID) {
int count = 0;
for (int j = 0; j < c.playerItems.length; j++) {
if (Item.itemIsNote[itemID+1]) {
if (itemID+2 == c.playerItems[j])
count += c.playerItemsN[j];
}
if (!Item.itemIsNote[itemID+1]) {
if (itemID+1 == c.playerItems[j])
count += c.playerIt... | 7 |
public static long toLong(byte ... b) {
/*
long l = 0;
int len = b.length;
if (len > 0)
l += b[0];
if (len > 1)
l += ((long) l << 8 | b[1]);
if (len > 2)
l += ((long) l << 16 | b[2]);
if (len > 3)
l += ((long) l << 24 | b[3]);
if (len > 4)
l += ((long) l << 32 | b[4]);
if (len > 5)
l ... | 2 |
/* */ @EventHandler
/* */ public void onPlayerQuit(PlayerQuitEvent event)
/* */ {
/* 61 */ if (Main.getAPI().isSpectating(event.getPlayer()))
/* */ {
/* 63 */ Main.getAPI().stopSpectating(event.getPlayer(), true);
/* 64 */ return;
/* */ }
/* 66 */ if (Main.getAP... | 6 |
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.