text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setBytesRead(long bytesRead)
{
this.bytesRead = bytesRead;
} | 0 |
public static void main(String[] args) {
// list (interface) et ArrayList (implementation)
Collection<Integer> integers1 = new ArrayList<>();
integers1.add(1);
integers1.add(2);
integers1.add(3);
for(Integer i : integers1){
System.out.println(i);
}
logger.info("Taille de integers1 "+... | 7 |
public static int getSelectedIndex() {
if (getSelected() == null) {
return -1;
}
RSInterface parent = getInterface();
if (parent.children == null) {
return -1;
}
for (int index = 0; index < parent.children.size(); index++) {
if (parent.children.get(index) == getSelected().id) {
return index;
... | 4 |
public final boolean equals(final Object object) {
if (this == object) {
return true;
}
if (!(object instanceof Binding)) {
return false;
}
final Binding binding = (Binding) object;
if (!Util.equals(getParameterizedCommand(), binding
.getParameterizedCommand())) {
return false;
}
if (!Uti... | 8 |
public String toString(){
return "minus ";
} | 0 |
protected void drawTransitions(Graphics g) {
java.awt.Graphics2D g2 = (java.awt.Graphics2D) g;
super.drawTransitions(g);
Iterator it = selectedTransitions.iterator();
while (it.hasNext()) {
Transition t = (Transition) it.next();
try {
arrowForTransition(t).drawHighlight(g2);
} catch (NullPointerExc... | 2 |
public boolean validateTextboxes() {
boolean error = false;
if (txtAname.getText().isEmpty()) {
error = true;
}
if (txtISBNNo.getText().isEmpty()) {
error = true;
}
if (txtName.getText().isEmpty()) {
error = true;
}
if (txtSname.getText().isEmpty()) {
error = true;
}
if (txtTitle.getTe... | 5 |
public static String removeComments(String code) {
String codeWithoutComments = "";
char command = 0;
// copy whole code without comments
for (int i = 0; i < code.length(); i++) {
command = code.charAt(i);
if (command == '/') {
command = code.charAt(i + 1);
switch (command)... | 9 |
public ProtobufDecoder(String[] classpath, String rootClass,
FieldDefinition[] fields) throws ProtobufDecoderException {
try {
URL[] url = new URL[classpath.length];
for (int i = 0; i < classpath.length; ++i) {
String file = classpath[i];
if (file.startsWith("file://")) {
file = file.substring(... | 9 |
@SuppressWarnings("unchecked")
private void checkPartition(String partitionName, String dn,
HashMap attributes) throws Exception {
LoggerFactory.getLogger(this.getClass()).debug("Adding partition:"+partitionName+dn+attributes.toString());
Partition apachePartition = addPartition(partitionName, dn);
// Index ... | 4 |
public boolean isTranslucencySupported(Translucency translucencyKind, GraphicsDevice gd) {
Object kind = null;
switch(translucencyKind) {
case PERPIXEL_TRANSLUCENT:
kind = PERPIXEL_TRANSLUCENT;
break;
case TRANSLUCENT:
kind = TRANSLUCENT;
break;
case PERPIXEL_TRANSPARENT:
kind = PERPIXE... | 4 |
@Override
public void onMoveTick(int x, int y, Game game) {
SinglePlayerGame spg = (SinglePlayerGame) game;
Location loc = spg.getFirstSquareNeighborLocation(x, y, 5, zombie.id);
if (loc == null) {
if (filterByID(spg.getSquareNeighbors(x, y, 2), human.id).isEmpty()) {
... | 4 |
@Override
public void run() {
long lastTime = System.nanoTime();
double ns = 1000000000.0 / 60.0;
double delta = 0;
long lastTimer = System.currentTimeMillis();
int ticks = 0, frames = 0;
requestFocus();
while (running) {
long now = System.nanoTime();
delta += (now - lastTime) / ns;
lastTime = n... | 3 |
@Override
public void handleEvent() {
LogManager.getLogger(FileAppender.class).info("handle event");
try {
int readed, wrote;
while ((readed = pipe.source().read(dst)) != 0) {
if (readed > 0) {
if (readed < dst.capacity()) {
dst.put(System.lineSeparator().getBytes());
}
dst.flip();
... | 4 |
public void registerEngine(Engine engine) throws EngineException {
final EngineInfo engDep = engine.getClass().getAnnotation(EngineInfo.class);
if (engDep != null) {
String[] depends = engDep.depends();
for (String s : depends) {
if (!isRegistered(s)) {
if (!engineQueue.contains(engine)) {
engi... | 7 |
public void processPacket(String received) {
stringParts = received.split(" ");
try {
// auction- ended- notification
if (stringParts[0].equals("!auction-ended")) {
String describtion = "";
// user is the highest bidder
if (username.equals(stringParts[1].trim())) {
for (int i = 3; i < st... | 9 |
public QuickSort(List liste, int debut, int fin) {
listeComparable = liste;
int gauche = debut - 1;
int droite = fin + 1;
// reset Pivot
pivot = null;
pivot = listeComparable.get(debut);
/* Si le tableau est de longueur nulle, il n'y a rien à faire. */
if... | 5 |
public SemanticsAnalyzer(Node tree) {
SymbolTable.resetAll();
output = new StringBuilder();
this.generativeTree = tree;
Scanner fr = null;
try {
fr = new Scanner(new File("produkcije.txt"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String curr = null;
int index = 0;
productio... | 5 |
public static void main(String[] args) {
{
int x = 12;
// Only x available
{
int q = 96;
// Both x & q available
}
// Only x available
// q is "out of scope"
}
{
String s = new String("a string");
}
// System.out.println(s); // Error
} | 0 |
public static void impt() throws Exception {
File f = new File(System.getenv("APPDATA")
+ "//.pokechrome/player.sav");
FileInputStream fstream = new FileInputStream(f);
BufferedReader br = new BufferedReader(new InputStreamReader(
fstream));
String strLine;
while ((strLine = br.readLine()) != null) ... | 7 |
void exportAutomaton() {
Environment e = ((EnvironmentFrame) frame).getEnvironment();
AutomatonPane a = new AutomatonPane(drawer);
e.add(a, "Current FA");
e.setActive(a);
} | 0 |
public static int getCount() {
return phones.size();
} | 0 |
@SuppressWarnings("unchecked")
public static <T extends Object> List<T> addArrayToList(List<T> list, T[] obj) {
for(int i = 0; i < obj.length; ++i) {
list.add(obj[i]);
}
return list;
} | 1 |
public PadSelection() {} | 0 |
public static BooleanWrapper secondp(Stella_Object number) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(number);
if (Surrogate.subtypeOfIntegerP(testValue000)) {
{ IntegerWrapper number000 = ((IntegerWrapper)(number));
return ((((0 <= number000.wrapperValue) &&
... | 6 |
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_... | 9 |
public String genContent(String httpUrl) {
Object response = null;
for (String key : requests.keySet()) {
if (httpUrl.endsWith(key)) {
response = requests.get(key);
break;
}
}
if (response instanceof String) {
return (String) response;
}
throw (RuntimeException)... | 3 |
public void zeigeRaeumeAn(String input, ArrayList<Raum> raumListe) {
Analyser ana = new Analyser();
String[] data = ana.splitArguments(input);
int sort = ana.analyseSort(data[0]);
if (sort == 0) {
Collections.sort(raumListe);
} else if (sort == 1) {
Co... | 9 |
public static void remove ( LinkedListNode head ) {
LinkedListNode nd = head;
LinkedListNode pre = null;
HashMap<Integer, Boolean> hm = new HashMap<>();
// travel through the list
while ( nd != null ) {
// 1. check if the data has aldy existed in the HashTable
if ( hm.containsKey(nd.data) ) {
p... | 2 |
public String getQueryRes() {
return queryRes;
} | 0 |
public boolean isSelected(int index) {
if (index < 0 || index >= mSize) {
return false;
}
return mSelection.get(index);
} | 2 |
public boolean shouldExitLoop() {
if (isDebug) {
if (KeyInput.wasKeyPressed('r')) {
I.say("RESET MISSION?") ;
resetScenario() ;
return false ;
}
if (KeyInput.wasKeyPressed('f')) {
I.say("Paused? "+PlayLoop.paused()) ;
PlayLoop.setPaused(! PlayLoop.paused()) ... | 5 |
public int escribir(String nombre, String rutaArchivo) {
InputStream entrada = null;
PreparedStatement pst = null;
int ingresados = 0;
try {
File archivo;
String insert;
z.con.setAutoCommit(false);
insert = "Insert into docu... | 7 |
public boolean autorizeRemoval (Block block, Player player){
boolean authorized = true; // By default, let it be removed.
if (player != null && plugin.permit(player, "repairchest.destroy")){
authorized = true;
/*
* Basically "do nothing", but this IF block avoids a lot of work for authorized users.
*... | 8 |
public void visitReturnStmt(final ReturnStmt stmt) {
if (CodeGenerator.DEBUG) {
System.out.println("code for " + stmt);
}
genPostponed(stmt);
stmt.visitChildren(this);
method.addInstruction(Opcode.opcx_return);
// Stack height is zero after return
stackHeight = 0;
} | 1 |
private void adjustStat(Actor a, int increment){
if(a instanceof Asteroid){
asteroidCount += increment;
} else if(a instanceof Bandit){
banditCount += increment;
} else if(a instanceof BanditBase){
banditBaseCount += increment;
}
} | 3 |
@Override
public String getStat(String code)
{
if (CMLib.coffeeMaker().getGenMobCodeNum(code) >= 0)
return CMLib.coffeeMaker().getGenMobStat(this, code);
switch (getCodeNum(code))
{
case 0:
return "" + getWhatIsSoldMask();
case 1:
return prejudiceFactors();
case 2:
return budget();
case 3:
... | 8 |
public int getSecondID() {
return second_land.getID();
} | 0 |
public int getNumber()
{
int value=0;
if (q.size() > 0)
{
value = (Integer)q.remove();
}
return value;
} | 1 |
private static Stock parseStock(String line) {
String[] parts = line.split(",");
if (parts[2].equals("0.00")) {
System.err.println("Stock " + parts[1] + " does not exist!");
return null;
}
Stock s = new Stock(parts[1].replace("\"", ""),
parts[0].re... | 1 |
public Integer getSuccessCount() {
return successCount;
} | 0 |
public boolean isReleased() {
if(isDisabled())
return false;
return released;
} | 1 |
final public SimpleNode Start() throws ParseException {
/*@bgen(jjtree) Start */
SimpleNode jjtn000 = new SimpleNode(JJTSTART);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
expression();
jj_consume_token(21);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
{if (... | 9 |
private MyConnection() {
try {
connection = DriverManager.getConnection(url,login,pwd);
} catch (SQLException ex) {
Logger.getLogger(MyConnection.class.getName()).log(Level.SEVERE, null, ex);
}
} | 1 |
@Override
public String[][] getListOfGames(Member member) {
List<Game> gameList = data.getListOfGames(member);
String [][] gameArray = new String[gameList.size()][3];
for(int i=0;i<gameList.size();i++){
gameArray[i][0]=gameList.get(i).getDate().toString();
gameArray[i][1]=gameList.get(i).getMembe... | 1 |
private void loadDataToComboboxHMP(){
this.cmbAulaHMP.removeAllItems();
this.cmbDiaHMP.removeAllItems();
this.cmbMateriaHMP.removeAllItems();
this.cmbHorarioHMP.removeAllItems();
this.cmbGrupoHMP.removeAllItems();
this.cmbUsuarioHMP.removeAllItems();
for(String n: this.hmp.listIdAula){
... | 5 |
protected int getEscapeRoute(int directionToTarget)
{
if(directionToTarget < 0)
return directionToTarget;
Room shipR=CMLib.map().roomLocation(loyalShipItem);
if(shipR!=null)
{
int opDir=Directions.getOpDirectionCode(directionToTarget);
if(isGoodShipDir(shipR,opDir))
return opDir;
final List<Int... | 8 |
private String showAnnonce(int i) {
String res = "";
//////
if (voyages.length > 0) {
sb.append("Destination");
sb.append(voyages[i].getDestination());
sb.append("\n");
sb.append("Date_depart");
sb.append(voyages[i].getDate_depart());
... | 1 |
public static double FindMax (boolean x, double n, List<Point2D> connection_p)
{
double _n = 0;
for (int i = 0; i < connection_p.size(); i++)
{
if(x)
{
double _x = connection_p.get(i).getX();
if (_x > _n)
{
_n = _x;
}
}
else
{
double _y = connection_p.get(i).getY();
do... | 5 |
public boolean equals(Object o) {
return (o instanceof TreeElement)
&& fullName.equals(((TreeElement) o).fullName);
} | 1 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS))
&&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL)
&... | 9 |
public static byte[] getUnsignedBytes(BigInteger number, int length) {
byte[] value = number.toByteArray();
if (value.length > length + 1) {
throw new IllegalArgumentException(
"The given BigInteger does not fit into a byte array with the given length: " + value.length
+ " > " + length);
}
byte... | 3 |
private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", "U... | 4 |
public InfoNode dealWithPromote(InfoNode infoNode, Node node) {
if(infoNode == null){return null;}
node.add(infoNode.newKey, infoNode.rightChild);
if(node.getSize() <= maxDegree){return null;}
InternalNode sibling = new InternalNode();
int mid = (node.getSize()/2)+1;
int j = 1;
int loopTo = ((InternalNode... | 4 |
protected void setOrientation(int orientation) {
Integer bigTextTopMargin = null;
Integer installButtonTopMargin = null;
Integer peopleTopMargin = null;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
bigTextTopMargin = 8;
installButtonTopMargin = 6;
... | 8 |
private void compare() {
// 第一次执行compare()时,preScan.size() == 0
if (preScan.size() == 0) {
return ;
}
if (!preScan.equals(cruScan)) {
onChange();
}
} | 2 |
@Override
public void receive(Map myCustomEvent) {
applicationEventPublisher.publishEvent(new MyCustomEventApplicationEvent(this, myCustomEvent));
} | 0 |
private void initArrays() {
if (data == null || picsize != data.length) {
data = new int[picsize];
magnitude = new int[picsize];
xConv = new float[picsize];
yConv = new float[picsize];
xGradient = new float[picsize];
yGradient = new float[picsize];
}
} | 2 |
public static void ClearCheckedHostmasks(){ CheckedHostmasks.clear(); } | 0 |
private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
// TODO add your handling code here:
int song = -1;
if (repr.isVisible()) {
song = reprList.getSelectedRow();
if (song != -1) {
playFromRepr... | 7 |
public static void main(String[] args) {
System.out.println("Printing only even numbers (multiples of two)");
for(int i=0; i<=20; i++){
System.out.println(i++);
}
System.out.println("Printing all number from 0 to 20");
for(int i=0; i<=20; i++){
System.out.println(i);
}
System.out.println("Prin... | 9 |
public Limbs(int upgradeCount, String name) {
super(upgradeCount, UpgradeType.Limbs, name);
} | 0 |
public void runGame(int rolls) {
while (totalRolls < rolls) {
// First, check if the piece is currently on a "Chance Card"
// location...
if (board.getChanceLocations().contains(currentLocation))
drawChanceCard();
else {
// ... or a "Community Chest Card" location
if (board.getComChestLocatio... | 7 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(true);
String op = request.getParameter("op");
String userid = "";
String actionUrl = "";
Member user = (Member) session.getAttribute("user");
... | 9 |
private static final double distanceBase(double[] coord1, double[] coord2, int order)
{
if (coord1.length != coord2.length)
throw new IllegalArgumentException ("Number of dimensions is not equal");
final int NUM_DIMENSIONS = coord1.length;
double distance = 0;
for (int d = 0; d < NUM_DIMENSIONS; d++) ... | 2 |
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((classMetadata == null) ? 0 : classMetadata.hashCode());
result = prime * result
+ ((fieldMetadata == null) ? 0 : fieldMetadata.hashCode());
result = prime * result
+ ((qualifiedName ... | 3 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
SnakePiece other = (SnakePiece) obj;
if (type != other.type)
{
return false;
}
if (x != other.x)
{
return ... | 6 |
public void actionPerformed(ActionEvent ae) {
//
// Process the action command
//
// "new" - Add a price history element
// "delete" - Delete a price history element
// "done" - All done
//
try {
String action = ae.getActionCommand();
... | 6 |
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 fe... | 6 |
public void giveBonus(MOB mob, Electronics item)
{
if((mob==null)||(item==null))
return;
if((System.currentTimeMillis()-lastCastHelp)<300000)
return;
String experName;
if(CMLib.dice().rollPercentage()>50)
{
final Manufacturer m=item.getFinalManufacturer();
if(m!=null)
{
experName=m.name(... | 9 |
protected boolean[] datasetIntegrity(
boolean nominalPredictor,
boolean numericPredictor,
boolean stringPredictor,
boolean datePredictor,
boolean relationalPredictor,
boolean multiInstance,
int classType,
boolean predictorMissing,
boolean classMissing) {
... | 9 |
private int makeRandom() {
int num = random.nextInt(6);
if (num == 1 || num == 2 || num == 3) {
num = random.nextInt(4);
if (num == 1 || num == 2 || num == 3) {
num = random.nextInt(4);
if (num == 1 || num == 2) {
num = random.nextInt(4);
if (num == 2) {
num = random.nextInt(4);
}... | 9 |
@RequestMapping(method = RequestMethod.POST)
public @ResponseBody
JsonResponse uploadAction(@Valid @ModelAttribute(value = "image") Image image,
@RequestParam(value = "captcha_challenge", required=true) String challenge,
@RequestParam(value = "captcha_response", required=true) String response,
Bindin... | 4 |
@Override
public long deriveMudHoursAfter(TimeClock C)
{
long numMudHours=0;
if(C.getYear()>getYear())
return -1;
else
if(C.getYear()==getYear())
{
if(C.getMonth()>getMonth())
return -1;
else
if(C.getMonth()==getMonth())
{
if(C.getDayOfMonth()>getDayOfMonth())
return -1;
else... | 7 |
public String getAccountName() {
return accountName;
} | 0 |
public Collection<IrodsFile> listFiles() throws IrodsException {
List<IrodsFile> l = new ArrayList<IrodsFile>();
for (File f : irodsFile.listFiles()) {
if (f instanceof IRODSFile && f.isFile()) {
l.add(new JargonFile(conn, (IRODSFile) f));
}
}
return l;
} | 3 |
@Test
public void testVoterVote()
{
String pollId = null;
Socket socket = null;
try {
socket = connectToServer();
} catch (IOException e) {
e.printStackTrace();
}
// send a connection message indicating email address
this.writer.println(MessageFactory.getConnectMessage("test@email.ca"));
/... | 9 |
public void actionPerformed(ActionEvent e) {
if (ModelerUtilities.stopFiring(e))
return;
Object src = e.getSource();
if (!(src instanceof ActivityButton))
return;
ActivityButton ab = (ActivityButton) src;
String pageGroup = ab.getPageNameGroup();
if (pageGroup == null)
return;
if (question()) {
... | 9 |
public void run() {
this.running = true;
while (this.alive) {
synchronized (this) {
while (this.alive && (!this.running) && (!this.reload)) {
try {
wait();
} catch (InterruptedException e) {
kill();
}
}
}
synchronized (this) {
if (this.alive && this.reload) {
thi... | 8 |
void selectpanel() {
if(s.gettype().endsWith("bubble")) {
modulepanel.setVisible(false);
carrowpanel.setVisible(false);
dspanel.setVisible(false);
entitypanel.setVisible(false);
bubblepanel.setVisible(true);
arrowpanel.setVisible(false);
... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof Item) {
Item i = (Item) obj;
if (! this.getCode().equals(i.getCode()))
return false;
}
return true;
} | 4 |
private void setCurrentAction(Action action) {
currAction = action;
timeSpentCompletingCurrentAction = 0;
switch(action) {
case MOVE:
timeNeededToCompleteCurrentAction = timeNeededToCommitMove;
break;
case MOVE_COMMITTED:
timeNeededToCompleteCurrentAction = timeNeededToCompleteMove;
break;
... | 4 |
private void checkStmt() throws SQLException {
if(this.stmt == null || this.stmt.isClosed())
throw new SQLException("Statement not ready.");
} | 2 |
public JLabel getPlayer2Name() {
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: getPlayer2Name() BEGIN");
}
if (test || m_test)
System.out.println("Drawing:: getPlayer2Name() - END");
return m_player2Name;
} | 4 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
if((mob==null)||(mob.playerStats()==null))
return false;
if(commands.size()<2)
{
final String pageBreak=(mob.playerStats().getPageBreak()!=0)?(""+mob.playerStats().getPageBreak()):"Disabled";
... | 8 |
@Override
public void updateLong() {
super.updateLong();
if(generationTimerEnd == 0) {
resetGenerationTimer();
}
if(generationTimerEnd <= System.currentTimeMillis() && this.isActivated()) {
placeableManager.playerAddItem("Stone", 1);
... | 3 |
@Override
public void insertUpdate(DocumentEvent e) {
boolean haveNotEncounteredInvis = true;
char lastChar;
String fieldText = null;
Document doc = (Document)e.getDocument();
try {
fieldText =doc.getText(0, doc.getLength());
} catch (BadLocationException e1) {
e1.printStackTrace();
}
... | 6 |
public void checkPurchase()
{
if(BackerGS.storeVisible)
{
if(CurrencyCounter.currencyCollected < 150)
{
if(Greenfoot.mouseClicked(this))
{
NotEnoughMoney.fade = 200;
boop.play();
}
... | 8 |
public Deck getExpiredDeck()
{
if(crdsToRemove.size() == 0){return null;}
return new Deck(crdsToRemove);
} | 1 |
public void initializeDataBase(JList<String> log){
ArrayList<String> alstLog = new ArrayList<>();
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName + ";create=true";
alstLog.add("Connecting...");
log.setListData(alstLog.toArray(new String[0]));
Connectio... | 3 |
public boolean isEmpty() {
return heap.isEmpty();
} | 0 |
Class163(int i, int i_27_) {
if ((i_27_ ^ 0xffffffff) != (i ^ 0xffffffff)) {
int i_28_ = Class348_Sub1_Sub1.method2726(-21806, i, i_27_);
i /= i_28_;
i_27_ /= i_28_;
anIntArrayArray2163 = new int[i][14];
anInt2159 = i_27_;
anInt2164 = i;
for (int i_29_ = 0; (i ^ 0xffffffff) < (i_29_ ... | 7 |
private MouseListener mouseListener(){
return new MouseAdapter(){
@Override
public void mousePressed( MouseEvent e ) {
mousePressedPoint = e.getPoint();
}
@Override
public void mouseReleased( MouseEvent e ) {
if( moving ){
for( MoveableCapability item : items ){
item.endMoveAt( e... | 2 |
private static boolean isPrime(int n) {
boolean result = true; // assume true and try to prove otherwise
int i=2;
while ((i<n) && (result == true)) {
if ((n%i) == 0) {
result = false;
}
i++;
}
return result;
} | 3 |
private void consumeFutureUninterruptible( Future<?> f ) {
try {
boolean interrupted = false;
while ( true ) {
try {
f.get();
break;
} catch ( InterruptedException e ) {
interrupted = true;
}
}
if( interrupted )
Thread.currentThread().interrupt();
} catch ( ExecutionExcept... | 5 |
void readCdsFile() {
cdsByTrId = new HashMap<String, String>();
if (cdsFile.endsWith("txt") || cdsFile.endsWith("txt.gz")) readCdsFileTxt();
else readCdsFileFasta();
} | 2 |
public Board makeBoard() throws InterruptedException {
int x = -1, y = -1;
topLeft:
for(int h = 50; h < Img.getHeight(); h++){
for(int w= 50; w < Img.getWidth(); w++){
int c = Img.getRGB(w, h);
if(w < 50 || h < 50 || w > Img.getWidth()-50 || h > Img.getHeight()-50) //Ignore Bottom and Top
... | 7 |
public LineScore alphabeta_max(int currentDepth, int alpha, int beta, Tuple lastMove) {
if (currentDepth >= depth || board.legalMoves.isEmpty()) {
System.out.println("Board state before eval return:\n" + board);
int eval = board.eval(weights);
evals++;
System.out.println("Returning eval: " ... | 8 |
public void writeHops() {
// Name,Alpha,Cost,Stock,Units,Descr,Storage,Date,Modified
Debug.print("Write Hops to DB");
try {
PreparedStatement pStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WHERE name = ?;");
PreparedStatement rStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WH... | 4 |
public CheckResultMessage check16(int day) {
return checkReport.check16(day);
} | 0 |
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.