text
stringlengths
14
410k
label
int32
0
9
private int jjMoveStringLiteralDfa4_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(2, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0); return 4; } switch(curChar) { case 71: ...
9
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; i...
8
@Test public void testQueryTransactions() { System.out.println("############################################################3"); System.out.println("############################################################3"); System.out.println("##########################################################...
4
public void actionPerformed(ActionEvent event) { // Variables String name = "UNFILLED"; String expertise = "UNFILLED"; String type = "UNFILLED"; Speaker speaker = null; // Text fields name = textName.getText(); expertise = textExpert.getText(); type...
2
public BigBedDataBlock(SeekableStream fis, RPTreeLeafNodeItem leafHitItem, HashMap<Integer, String> chromosomeMap, boolean isLowToHigh, int uncompressBufSize){ this.fis = fis; this.leafHitItem = leafHitItem; this.chromosomeMap = chromosomeMap; this.isLowToHigh = isLowToHigh; ...
3
public Graphics drawBox(Box tempBox ,Graphics g, boolean cursors)//draw the square for normal squares { int [] topLeft = tempBox.getTopLeft(); int [] topRight = tempBox.getTopRight(); int [] bottomLeft = tempBox.getBottomLeft(); int [] bottomRight = tempBox.getBottomRight(); g.setColor(Color.black); if ...
6
public void write (Connection connection, ByteBuffer buffer, Object object) { byteBufferOutputStream.setByteBuffer(buffer); int start = buffer.position(); try { json.writeValue(object, Object.class, null); writer.flush(); } catch (Exception ex) { throw new JsonException("Error writing object: " + objec...
5
public AngelBodyArmor() { this.name = Constants.ANGEL_BODY_ARMOR; this.defenseScore = 10; this.money = 300; this.paybackMoney = this.money /2 ; }
0
private void mouseMotionEvent(int xCoordinate, int yCoordinate){ if(this.currentSelectedBlock!=null){ if(Coordinate.isValidX(xCoordinate, Coordinate.minX, Coordinate.maxX) && Coordinate.isValidY(yCoordinate, Coordinate.minY, Coordinate.maxY)){ // System.out.println("Coordinate MAX: ("+Coordinate.minX+","+C...
5
@Test public void testCombatDestroyingCreatures() { decks.add(activeCreatures); decks.add(activeCreatures); game.makePlayers(decks); game.initializeGame(); // By setting the players' life to something obscenely high, I ensure // that there will always eventually be an instance of one creature // blocking...
2
public void setPWResetFontcolor(int[] fontcolor) { if ((fontcolor == null) || (fontcolor.length != 4)) { this.pwResetFontColor = UIFontInits.PWRESET.getColor(); } else { this.pwResetFontColor = fontcolor; } somethingChanged(); }
2
public void wdgmsg(Widget sender, String msg, Object... args) { int ep; if ((ep = epoints.indexOf(sender)) != -1) { if (msg == "drop") { wdgmsg("drop", ep); return; } else if (msg == "xfer") { return; } } ...
8
public static HashMap<String,Integer> count( String subject, String body){ HashMap<String,Integer> tokenFreq = new HashMap(); String[] stokens = subject.split("\\s"); String[] btokens = body.split("\\s"); for(String s : stokens){ if(s.length()>1){ s = "subject*" + s; s = s.toLowerCase(); if(...
6
public ClientHandler(String addr, int port) { try { client_socket = new Socket(addr, port); os = new PrintStream(client_socket.getOutputStream()); is = new DataInputStream(client_socket.getInputStream()); inputLine = new DataInputStream(new BufferedInputStream(Sys...
2
public ArrayList<String> findFiles() { ArrayList<String> validFiles = new ArrayList<String>(); File dir = new File(database + "SpeakerFile_files/"); // array of strings for file names String[] children = dir.list(); //if there is no files in directory if (children == null...
3
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Physical target=(givenTarget!=null)?givenTarget:mob.location(); if(target.fetchEffect(ID())!=null) { mob.tell(L("Decoys have already been set here.")); return false; } if(mob.isInCo...
7
public static ArrayList<Move> king(Board b, int color) { ArrayList<Move> moves = new ArrayList<Move>(); int piece = (color == Board.white) ? Board.whiteKing : Board.blackKing; ArrayList<Position> pieces = findPieces(b, piece); int opponentColor = Board.opponentColor(color); for (Position p : pieces) { // ...
2
public KeyPackageType createKeyPackageType() { return new KeyPackageType(); }
0
public void endElement(String namespaceURI, String localName, String rawName) throws SAXException { if (rawName.equals("author") || rawName.equals("editor")) { Person p; if ((p = Person.searchPerson(Value)) == null) { p = new Person(Value)...
7
@Override public void createTeam(Team team) { checkDataSource(); validate(team); if (team.getId() != null) { throw new IllegalArgumentException("Team aleready exists" + team.toString()); } try (Connection conn = dataSource.getConnection(); Prepare...
4
public void playRandomMusicIfReady() { if (loaded && this.options.musicVolume != 0.0F) { if (!sndSystem.playing("BgMusic") && !sndSystem.playing("streaming")) { if (this.ticksBeforeMusic > 0) { --this.ticksBeforeMusic; ...
6
protected static Ptg calcCorrel( Ptg[] operands ) throws CalculationException { // get the covariance PtgNumber pnum = (PtgNumber) calcCovar( operands ); double covar = pnum.getVal(); Ptg[] xPtg = new Ptg[1]; xPtg[0] = operands[0]; Ptg[] yPtg = new Ptg[1]; yPtg[0] = operands[1]; pnum = (PtgNumber) calc...
4
public boolean isHuwelijkOp(Calendar datum) { //todo opgave 1 if (this.huwelijksdatum == null) return false; else if (datum == null) return false; else if (this.huwelijksdatum == datum) return true; else if (this.huwelijksdatum.before(datum)) ...
4
private boolean reachableRejectBridge(Transition t) { return (t.source.production != null && t.source.production.reachable && t.target.production != null && t.target.production.reject) || (t.target.production != null && t.target.production.reachable && t.source.production != null && t.source.production.reject);...
7
@Override public String toString(){ PolyNode current = firstNode; String str = ""; if(isEmpty()) return "The polynomial is empty!"; while(current != null){ if(current == firstNode) str += current.getCoefficient();...
9
public void travelTo(int zoneId, int districtNumber) throws IOException { long start = System.currentTimeMillis(); this.initMapLoad(); this.zoneMap(zoneId, districtNumber); int status = -1; boolean secondStatusCheck = false; do { try { Thread...
5
public void scoreGoal(Player p){ //might need to add stuff to Player.scoreGoal() so that this works correctly if(p == null) return; float x = p.getXLeft(); float y = p.getYTop(); if(getTeamWithBall() == team1){ float x2 = team2.getPlayers().get(0).getXLeft(); float y2 = team2.getPlayers().get(0).ge...
7
public void hit(ArrayList<Tank> tanks){ for(Tank tank:tanks){ if(tank.inside(this) && tank.getId()!=id && tank.isAlive() ){ this.setAlive(false); } } }
4
public static void sort(int[] array) { printArray(array); int tmp, index; for (int i = 0; i < array.length - 1; i++) { tmp = array[i + 1]; for (index = i; index >= 0; index--) { if(array[index] > tmp) { array[index + 1] = array[index]; } else { break; ...
3
private void go() { if (offenseArmy.isEmpty() || defenseArmy.isEmpty()) { throw new IllegalStateException("shouldnt be doing this with empty armies.."); } BattleStats attackStats = new BattleStats(); BattleStats defenseStats = new BattleStats(); for (Warrior w : offenseArmy) {attackStats.computeFriendly(w)...
8
static void testAllH() { Scanner in = new Scanner(System.in); final Board b = Board.readBoard(in); ArrayList<Integer> nextPiece = new ArrayList<Integer>(); while(in.hasNextInt()) nextPiece.add(in.nextInt()); Heuristic hAll [] = { //new BoardScore(), //new BoardScoreNormalised(), //new Em...
3
static public void main( String args[] ) throws Exception { if (args.length!=1) { System.err.println( "Usage: java UseScatterGather port" ); System.exit( 1 ); } int port = Integer.parseInt( args[0] ); ServerSocketChannel ssc = ServerSocketChannel.open(); InetSocketAddress address = new...
7
int hamming(Genotipo a, Genotipo b) { if(a.getSize()!=b.getSize()) { System.err.println("Los genotipos deben ser de igual longitud"); System.exit(1); } int ret = 0; int tam = a.getSize(); for(int i=0; i<tam; i++) { if(a.getGen(...
3
int rmUsr(String id, String userName) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection(url, dbUser, dbPass); Statement stm = con.createStatement(); ...
1
@Override public void actionPerformed(ActionEvent e) { if( e.getSource() == boton_alta_venta){ Controlador.getInstance().accion(EventoNegocio.GUI_ALTA_VENTA, GUIPrincipal_Venta.this); } else if( e.getSource() == boton_devolver_producto){ ...
4
@Override public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark { //Find the row. int boardPositionRow = boardPosition / columns; //Find the column. int boardPositionColumn = boardPosition % columns; ...
3
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s; ArrayList<Double> l2 = new ArrayList(); ArrayList<Double> l3 = new ArrayList(); ArrayList<Integer> lf = new ArrayList(); for (in...
9
public boolean hasHIV(String player) { String query = "SELECT * FROM nosecandy WHERE hiv='1';"; ResultSet result = null; result = this.sqlite.query(query); boolean hiv = false; try { if (result != null && result.next()) { hiv = result.getBoolean(Column.HIV.getName()); } result.close(); } catch ...
3
public void readData(boolean binaryFeatures) { try { File imgFile = new File("digitdata"+File.separator+"trainingimages"); BufferedReader imgInput = new BufferedReader(new FileReader(imgFile)); File labelFile = new File("digitdata"+File.separator+"traininglabels"); BufferedReader labelInput = new Buffered...
9
public static void main(String[] args) { //First, let's check the OS and set the Look and Feel based on that OsCheck.OSType ostype = OsCheck.getOperatingSystemType(); switch(ostype) { case Windows: try { sys...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SpecificationSubModel other = (SpecificationSubModel) obj; if (featureSpecSet == null) { if (other.featureSpecSet != null) return false; ...
9
public void init() { if (tower == null && towerId != 0) { tower = towerService.findTower(towerId); } else if (tower == null && towerId == 0) { tower = new Tower(); } if (tower == null) { try { FacesContext.getCurrentInstance().getExtern...
6
public World(List<Entity> entities, List<Tile> map, List<PickUpObject> pickUps, Player player){ this.map = map; this.entities = entities; this.pickups = pickUps; this.player = player; everything = new ArrayList<>(); everything.addAll(map); everything.addAll(entities); everything.addAll(pickUps); for(...
1
@Override public void run() { Website2EbookmakerApplication app = ((Website2EbookmakerApplication)StartModalWindow.this.getApplication()); app.getWebScraper().setRoot(url); app.getWebScraper().scrape(); if (!url.startsWith("http://")) { url = "http://...
3
public JSONArray toJSONArray(JSONArray names) throws JSONException { if (names == null || names.length() == 0) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } re...
3
public void actionPerformed(ActionEvent e) { Grammar g = environment.getGrammar(UnrestrictedGrammar.class); myGrammar=g; if (g == null) return; if (g.getTerminals().length==0) { JOptionPane.showMessageDialog(environment, "Error : This grammar does not accept any Strings. ", "Cannot Proceed wit...
3
public boolean moveOrganism(int orgID, int directionCode){ boolean moved = false; // North or south if(directionCode == 1 || directionCode == 2){ int y = org.getY(orgID); if (directionCode == 1){ // North moved = moveLogic(orgID, org.getX(orgID), y-1, f...
8
public Token expr() throws OperazioneNonValidaException, ParentesiParsingException { Token x = molDivMod(); if(!(point>text.size()-1)) { while(peek().ritornaTipoToken().equals(Tok.PIU)||peek().ritornaTipoToken().equals(Tok.MENO)) { Token op = peek(); consume(); Token y = molDivMod(); int n1 = ...
5
protected static Ptg calcPPMT( Ptg[] operands ) { if( operands.length < 4 ) { return new PtgErr( PtgErr.ERROR_NULL ); } debugOperands( operands, "calcPPMT" ); double rate = operands[0].getDoubleVal(); int per = operands[1].getIntVal(); int nper = operands[2].getIntVal(); double pv = operands[3].get...
5
public void connectPuls(){ // try { // DefaultHttpClient client = new DefaultHttpClient(); // HttpPost post = new HttpPost("https://puls.uni-potsdam.de/qisserver/rds?state=user&type=1&asdf=jbernoth&fdsa=bl4bl411&category=auth.login&startpage=portal.vm"); // HttpResponse res = client.execute(post); // System.ou...
2
public static TriCubicSpline zero(int nP, int mP, int lP){ if(nP<3 || mP<3 || lP<3)throw new IllegalArgumentException("A minimum of three x three x three data points is needed"); TriCubicSpline aa = new TriCubicSpline(nP, mP, lP); return aa; }
3
private int getTotalHeuresAccumulees() { Set<String> listeCategories = heuresAccumulees.keySet(); Iterator it = listeCategories.iterator(); int heures = 0; while (it.hasNext()) { String categorie = (String)it.next(); heures += heuresAccumulees.get(categorie); ...
1
public void loadFile(String path) throws IOException { String thisLine; // variable to read each line. BufferedReader myInput = null; try { FileInputStream fin = new FileInputStream(new File(path)); myInput = new BufferedReader(new InputStreamReader(fin)); // for each line until the end of the file wh...
7
public void playersTurns(Board board, Player player1, Player player2) throws IOException{ char response; boolean match = false; int totalMatchesMade = 0; numCards = board.totalCards; String name; int counter = 1; while (totalMatchesMade < board.totalMatc...
8
@SuppressWarnings("unchecked") // use runtime checks to guarantee that 'T' is what it is private <T> ObjectConstructor<T> newDefaultImplementationConstructor(Type type, Class<? super T> rawType) { if (Collection.class.isAssignableFrom(rawType)) { if (SortedSet.class.isAssignableFrom(rawType)) { return new Ob...
9
public static ClientType clientTypeOf(String role) { if (role == null) { return ClientType.GUEST; } try { return ClientType.valueOf(role); } catch (IllegalArgumentException ex) { return ClientType.GUEST; } }
2
public void step(boolean blockStep) { Configuration[] configs = configurations.getValidConfigurations(); ArrayList list = new ArrayList(); HashSet reject = new HashSet(); // Clear out old states. configurations.clearThawed(); if (!blockStep){ //for ordinary automaton for (int i = 0; i < ...
9
public int getX() { boolean test = false; if (test || m_test) { System.out.println("Coordinate :: getX() BEGIN"); } if (test || m_test) { System.out.println("Coordinate :: getX() END"); } return m_X; }
4
public static void loadFiles(String path) { File folder = new File(path); File[] listOfFiles = folder.listFiles(); //load all files in folder if (listOfFiles != null && listOfFiles.length > 0) { for(File file:listOfFiles) { //if (file.isFile()) //is file? (not folder) //{ String filename ...
6
private void drawHeadIcon() { if (anInt855 != 2) { return; } getEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938); if (spriteDrawX > -1 && Client.loopCycle % 20 < 10) { hintIcon[0].drawSprite(spriteDrawX - 12, sp...
3
@Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { if (par1World.isRemote) { return; } // 既に光っていればなにもしない if (isLighting) { return; } // エンティティが矢であり、かつ刺さった状態であれば if ((par5Entity != null) && (par5Entity instanceof EntityArrow)) { /...
5
public static void main(String[] args) { try { bundle = ResourceBundle.getBundle("net/sourceforge/jfilecrypt/translations/jfilecrypt", Locale.getDefault()); } catch(MissingResourceException resEx) { bundle = ResourceBundle.getBundle("net/sourceforge/jfilecrypt/translations/jfilec...
4
static <FieldDescriptorType extends FieldSet.FieldDescriptorLite<FieldDescriptorType>> SmallSortedMap<FieldDescriptorType, Object> newFieldMap(int arraySize) { return new SmallSortedMap<FieldDescriptorType, Object>(arraySize) { @Override @SuppressWarnings("unchecked") public void makeI...
5
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 static InferenceWorkerSuspendReason fromCycSymbol(final CycSymbol symbol) { final InferenceWorkerSuspendReason reason = SYMBOL_MAP.get(symbol); if (reason != null) { return reason; } else if (symbol == null) { return UNKNOWN; } else { throw new IllegalArgumentException("Unable t...
2
public Enduro(String[] args) { String cfg = "config.properties"; if(args.length == 1){ cfg = args[0]; } if (args.length == 0 || args.length == 1) { Properties configFile = new Properties(); genCon = new GenerateConfig(configFile); try { configFile.load(new FileInputStream(cfg)); if(genCon.ch...
8
public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException { //remove blank rows at the bottom boolean done = false; int i; for(i = lines.size() - 1; !done; i--){ StringBuffer row = lines.get(i); if(!StringUtils.isBlank(row.toString())...
8
public static Object conv(Object inpValue, Class<?> fieldType) { Class inpType = inpValue.getClass(); if (inpType == String.class && fieldType != String.class) { inpValue = Conversions.convert((String) inpValue, fieldType); } else if (inpType == BigDecimal.class && fieldType != BigDe...
6
protected static String numberToString(Number number) { if (number == null) { return "null"; } if (!testValidity(number)) { throw new RuntimeException("Can't convert number: " + number); } // Shave off trailing zeros and decimal point, if possible. String string = n...
7
public static void startupSessions() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/HTTP", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEXT$, ((Modu...
7
public static void printMap(Map map,String prefix){ for(Map.Entry entry : (Set<Map.Entry>)map.entrySet()){ if(entry.getValue() instanceof Map){ System.out.println(prefix+"map:"+entry.getKey()); printMap((Map)entry.getValue(),prefix+"--"); }else{ ...
2
public boolean enviarMail(String email, String passw, boolean envio) throws MessagingException { boolean ret = false; abrirBase(); LazyList<Email> emailsModel = Email.findAll(); if (!emailsModel.isEmpty() || !envio) { if (envio) { abrirBase(); ...
9
protected int getMaxAge() { return MAX_AGE; }
0
public int getNewPoints(){ int returnValue = 0; if(plusminus > 13) returnValue = 9; else if(plusminus > 9 ) returnValue = 7; else if(plusminus > 5) returnValue = 5; else if(plusminus > 2) returnValue = 3; else if(plusminus > -3) returnValue = returnValue; else if(...
8
public void checkbox(boolean rdbtn_lavagem, boolean rdbtn_otimizacao, boolean rdbtn_produto) throws TiposSelecionadosException{ TiposSelecionadosException e = new TiposSelecionadosException(); if(rdbtn_lavagem && rdbtn_otimizacao){ throw e; }else if(rdbtn_lavagem && rdbtn_produto){ throw e; }else if(rdbtn...
9
public static CauseTypeEnum fromValue(String v) { for (CauseTypeEnum c: CauseTypeEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
2
public void amplifyPix(ImageFrame if1, Point p, int intensity) { int pixArr[] = new int[4]; if1.getBum().getData().getPixel(p.x, p.y, pixArr); Color col = new Color(pixArr[0], pixArr[1], pixArr[2]); for(int i=0; i<intensity; i++) { try { if1.getBum().setRGB(p.x+i, p.y, col.getRGB()); } catch(ArrayInde...
9
public void restoreBackup(String backupSourcePath) throws SQLException { String backupTempDirectory = Controller.getProperty(ApplicationProperties.APPLICATION_PATH); try { ZipFile zipFile = new ZipFile(backupSourcePath); zipFile.extractAll(backupTempDirectory); backupTempDirectory += File.separator + (n...
3
public static void addAbility(Unit owner, Ability ability) { if (owner != null && ability != null) { // check if ability already has an owner -> if so then remove the ability from the current unit if (ability.getOwner() != null) GameLogic.INSTANCE.removeAbility(ability.getOwner(), ability); // add abili...
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EVDistribution other = (EVDistribution) obj; if (def != other.def) return false; if (hp != other.hp) return false; if (nature == null) ...
9
public String toString() { return "[" + getCurrentState().toString() + "]"; }
0
@Override public String toString() { String result = "Subject: " + this.getSubject() + " Description: " + this.getDescription() + " AuthorID: " + this.getAuthor() + " CommentIDs: "; for (Integer comment : this.getComments()) { result += com...
2
LRParseTableChooserPane getParseTableView() { return tableView; }
0
public static void main(String args[]) { AboutBox box = new AboutBox(); box.displayBox(); }
0
public Map<String, Integer> getTerms(SQLconnection sqLconnection,int paperID) { String query = "select term from terminvertedindex where paperID="+ paperID; ResultSet terms=sqLconnection.Query(query); Map<String, Integer> termcountMap=new HashMap<>(); try { while(terms.next()) { String term=terms.getS...
3
public void setNbOfMinesTouched(int nbOfMines) { this.nbOfMinesTouched = nbOfMines; switch (nbOfMinesTouched) { case 0: type = CellType.EMPTY; break; case 1: type = CellType.ONE; break; case 2: type = CellType.TWO; break; case 3: type = CellType.THREE; break; case 4: type = Cell...
9
@Override public void start() throws Exception { logger.info(getName() + " start execute."); remoteServerCall.start(); logger.info(getName() + " start success."); }
0
public String toString() { if (type == null) return super.toString(); else if (type.equals("flex.messaging.io.ArrayCollection")) { StringBuilder sb = new StringBuilder(); Object[] data = (Object[])get("array"); sb.append("ArrayCollection:["); for (int i = 0; i < data.length; i++) { sb.appen...
4
public void sendMessage(ChannelMessage message) { for (Player player : players) { player.sendMessage(message); } }
1
public boolean hasFlag(int flags, int flag) { System.out.println("Total flags: " + Integer.toBinaryString(flags) + " " + Integer.toBinaryString(flag) + " " + flag); boolean hasFlag = false; boolean finished = false; int waarde = 2048; int newFlag = flags; while (!finished...
6
public void makeSHButtonActionPerformed(ActionEvent evt) { String name = "Stakeholder " + (this.stakeholders.size()); boolean a,b,c,d,e; a=b=c=d=e=false; int random = (int) (Math.random()*32); System.out.println(random); if(random >= 16){a = true;random -= 16;} ...
5
public void updatePosition() { if (xPos < xDestination) xPos++; else if (xPos > xDestination) xPos--; if (yPos < yDestination) yPos++; else if (yPos > yDestination) ...
8
public boolean initialize( URL url ) { initialized( SET, false ); cleanup(); if( url == null ) { errorMessage( "url null in method 'initialize'" ); cleanup(); return false; } try { myAudioInputStream = ...
3
public static void main(String[] args) { new Main().execute(args); }
0
public Query newQuery(String script0, Object ...args) throws ParseException { HashMap<String,Integer> vars = new HashMap<>(); String script = ""; for (int i = 0; i < script0.length(); ) { int j = script0.indexOf('%', i); if (j == -1) { script += script0.substring(i); break; } script += script0...
8
@Override public void paint( Graphics g ) { int screenWidth = getWidth(); int screenHeight = getHeight(); int screenCenterX = screenWidth/2; int screenCenterY = screenHeight/2; g.setColor( Color.BLACK ); g.fillRect( 0, 0, screenWidth, screenHeight ); for( BackgroundArea area : vws.visibleBackground...
9
private int[] mergeSort(int[] a) { if(a.length == 1) return a; int leftLen = a.length / 2; int rightLen = a.length - leftLen; int[] left = new int[leftLen]; int[] right = new int[rightLen]; System.arraycopy(a, 0, left, 0, leftLen); System.arraycopy(a, leftLen, r...
1
private boolean openWorkspace(File openFile){ WorkspaceData openData; try{ FileInputStream inputStream = new FileInputStream(openFile); ObjectInputStream objectInputStream = new ObjectInputStream(inputStream); openData = (WorkspaceData) objectInputStream.readObject()...
1
private static void cutInputValidator() { while (!validInput) { try { System.out.print("You selected to search by cut. Please enter a cut: "); cutInput = actionInput.next(); cutInput.toUpperCase(); System.out.println("You entered: " + cutInput); validInput = true; if(data1.isEmpty()) { ...
3
@Override public void execute(CommandSender sender, String worldName, List<String> args) { this.sender = sender; if (worldName == null) { error("No world given."); reply("Usage: /gworld suppresshealthregain <worldname> <true|false>"); } else if (!hasWorld(worldName)) { reply("World not found: " + wor...
5