text
stringlengths
14
410k
label
int32
0
9
private String calc(String input) { //Person 4 put your implementation here String output = ""; for (int i = 0; i < input.length(); i++) { char current = input.charAt(i); current ++; output = output + current; //fix } return output; ...
1
public final JPoclASTParser.expr1_return expr1() throws RecognitionException { JPoclASTParser.expr1_return retval = new JPoclASTParser.expr1_return(); retval.start = input.LT(1); TypeTree root_0 = null; Token set82=null; JPoclASTParser.expr2_return expr281 =null; JPoc...
9
public static void doButtonsActions() { if (b1.isClicked) { runMenu = false; } if (b3.isClicked) { tb1.closed = false; } if (b4.isClicked) { tb2.closed = false; } if (b5.isClicked) { tb3.closed = false; } if (b6.isClicked) { Engine.save(); } }
5
public static <E> FunctionExecutor<E> createPoll(final FeatureDefinition<? extends Property<? extends Queue<E>>> propertyDefinition) { return new FunctionExecutor<E>() { @Override public E invoke(FunctionInvocation<E> invocation, Object... arguments) throws ExecutorInvocationException ...
5
public int linearRegSlopeLookback( int optInTimePeriod ) { if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) ) optInTimePeriod = 14; else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) return -1; return optInTimePeriod-1; }
3
@EventHandler public void SlimeJump(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getSlimeConfig().getDouble("Slime.Jump.DodgeCha...
6
public void jarvisMarch(){ lines.clear(); currentHull.clear(); for (Point i : points){ i.usedYet = false; } Point max = new Point(0,0); Point next = new Point(0,0); int count = 0; double angle = 360; for(Point i : points){ if(i.getY()>max.getY()){ max = i; } } currentHull.add(new...
9
public void paint1(Graphics g) { if (oro != null){ if(instrucciones | pausa ) { //muestra la imagen de instrucciones, sino la de pausa if(instrucciones) g.drawImage(background_instr, 0, 0, ANCHO, ALTO, this); else ...
5
@Override public int hashCode() { return playersName != null ? Arrays.hashCode(playersName) : 0; }
1
private int readAnnotationValues(int v, final char[] buf, final boolean named, final AnnotationVisitor av) { int i = readUnsignedShort(v); v += 2; if (named) { for (; i > 0; --i) { v = readAnnotationValue(v + 2, buf, readUTF8(v, buf), av); } ...
4
public void calculateZoomFrom(Set<GeoPosition> positions) { // u.p("calculating a zoom based on: "); // u.p(positions); if (positions.size() < 2) { return; } int zoom = getZoom(); Rectangle2D rect = generateBoundingRect(positions, zoom); // Rectangle2D viewport = map.getViewportBounds(); int coun...
5
public void testPut() { Client client = new ClientImpl(TEST_HOST, TEST_PORT); long jobId = client.put(65536, 0, 120, "testPut".getBytes()); assertTrue(jobId > 0); client.delete(jobId); // invalid priority try { jobId = client.put(-1, 0, 120, "testPutNegativePriority".getBytes()); client.delete(jobId...
6
public static Boolean ToggleQuestionValidation(int QDbId, boolean isValid) { String statement = String.format("Update question set isValidated = %s where QuestionID = %d", isValid ? "TRUE" : "FALSE", QDbId); return runStatement(statement); }
1
@Override public double getHig() { return hight; }
0
protected static void passThrough( ZipFile zip, String fin, String fout ) throws IOException { try { java.io.File outfile = new java.io.File( fout ); // clean it up outfile.deleteOnExit(); File dirs = outfile.getParentFile(); if( (dirs != null) && !dirs.exists() ) { dirs.mkdirs(); dirs.d...
4
public int parseTerm() throws IOException { Element localRoot = IRT.createElement(String.valueOf(Tags.TERM)); curRootElement.appendChild(localRoot); curRootElement = localRoot; int result = parseFactor(); //curToken = lexer.getToken(); while (curToken.type == DIVIDE || ...
4
public static synchronized void sayString(String str){ if(null == str || str.isEmpty()){ System.out.println("String Error"); } else { try { URL word = new URL("http://translate.google.com/translate_tts?ie=utf-8&tl=en&q="+str); HttpURLConnection connection = (HttpURLConnection) word.openConnection(); ...
3
public void save() { String title = Tools.getLocalizedString(ActionType.SAVE.name() + ".Name"); String fonctions = program.getMainPanel().getTextField().getText(); try { if (fileName == null) { String file = Tools.showSaveDialog(title).getAbsolutePath(); if (!file.endsWith(".ks")) file += ".ks...
5
public void setSeqID(String seqID) { this.seqID = seqID; }
0
private List<Class<? extends IFilter>> getConfiguredFilters() { //hardcode LinkedList<Class<? extends IFilter>> filterClasses = new LinkedList<Class<? extends IFilter>>(); filterClasses.add(AFilter.class); filterClasses.add(BFilter.class); return filterClasses; }
3
private void removeAll(final boolean mark) { if (mark) { AbstractInsnNode insn = first; while (insn != null) { AbstractInsnNode next = insn.next; insn.index = -1; // insn no longer belongs to an InsnList insn.prev = null; insn.next = null; insn = next; } } size = 0; first = null; ...
2
public void initialize() throws SQLException { if (conn != null) { dropTable("crmcorporationuserconnection"); dropTable("crmcorporations"); dropTable("crmavailabilities"); dropTable("crminterests"); dropTable("crmusers"); Statement stmt = conn.createStatement(); stmt.execute("CREATE TAB...
1
public void skladanie(){ dysk = fabrykaPodzespolowLaptop.produkujemyDysk().dawajDysk(); grafika = fabrykaPodzespolowLaptop.produkujemyGrafike().dawajGrafike(); procesor = fabrykaPodzespolowLaptop.produkujemyProcesor().dawajProcesor(); ram = fabrykaPodzespolowLaptop.produkujemyRam().dawajRam(); chlodzenie = fa...
0
private List<String> getPatterns(String string) { if (isValid(string)) { List<String> patternList = new ArrayList<String>(); for (int i=0; i<string.length()-1; i++) { if (string.charAt(i) == Pattern.ANY_CHAR && string.charAt(i+1) == Pattern.ANY_CHAR) { String candidateString = string.substring(...
5
public synchronized boolean testarConexao(Connection con) throws SQLException{ boolean status = false; boolean conectado = false; if(KEEP_ALIVE){ ResultSet rs = con.createStatement().executeQuery("select 1 from crlv"); if(rs.next()){ status = true...
4
private Location spawnAt(int width){ int currentx, currenty, tempx, tempy; int length = 0; currentx = tempx = getLocation().getCol(); currenty = tempy = getLocation().getRow(); while(!meetsSpawningCondition(currentx, currenty, width)){ length++; for(int k = 1; k<=length; k++){ tempx=currentx-k; ...
9
public boolean isFinished() { if(!canStillMoveToAPlace(getActivePlayer(), getGrid())) return true; for (Player p : players) { for (Player p2 : players) { if (p2 != p && p.getPosition().equals(p2.getBeginPosition())) return true; } } return false; }
5
public static void synchroniser(JCellule[][] grid, JLabel lblGeneration, JButton btnProchaineGeneration) { double[][] opacites = ControllerGrille.grid.getOpacites(); for (int i = 0; i < grid.length; i++) { for (int j = 0; j < grid[0].length; j++) { grid[i][j].setOpacite(opac...
3
@Override public void move(final Doodle.Coordinates coordinates) throws GameEndedException { final int iterations; final double iterationVelocity; final int hvCopy = hVelocity; iterations = Math.abs(hVelocity); iterationVelocity = (double) hVelocity / iterations; f...
8
public static void main(String[] args) { HereditaryProperty[][] bases = new HereditaryProperty[s.length][]; for (int i = 0; i < s.length; i++) { bases[i] = new HereditaryProperty[s[i].length]; for (int j = 0; j < bases[i].length; j++) { bases[i][j] = PermUtilities...
9
private void updateAllAQ() { int c = movie.getCapacity(); for (int i = 0; i < numberOfAtoms; i++) { try { atom[i].updateAQ(); } catch (Exception e) { atom[i].initializeAQ(c); atom[i].updateAQ(); } } if (obstacles != null && !obstacles.isEmpty()) { RectangularObstacle obs = null; synch...
7
public static void drawHorizontalLineAlpha(int x, int y, int width, int colour, int alpha) { if (x < topY || x >= bottomY) return; if (y < topX) { width -= topX - y; y = topX; } if (y + width > bottomX) width = bottomX - y; int opacity = 256 - alpha; int r = (colour >> 16 & 0xff) * alpha; int ...
5
public void uimsg(String msg, Object... args) { synchronized (ui) { if (msg == "passwd") { clear(); cur = new Pwbox((String) args[0], (Boolean) args[1]); mklogin(); } else if (msg == "token") { clear(); cur = new Tokenbox((String) args[0]); mklogin(); } else if (msg == "error") { ...
4
public static List<Integer> postorderTraversal(TreeNode root) { List<TreeNode> stack = new ArrayList<TreeNode>(); List<Integer> res = new ArrayList<Integer>(); Map<TreeNode, Boolean> isFirstTraversal = new HashMap<TreeNode, Boolean>(); TreeNode node = root; while (null != node || 0 != stack.size()) { while...
5
public void nextQueens(String[] board,int row,int n){ if(row >= n){ list.add(copy(board)); return ; } char[] crow = board[row].toCharArray(); for(int col=0; col< n;col++){ if(ok(board,row,col,n)){ crow[col] ='Q'; board[r...
3
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { Raster source = sources[0]; Rectangle srcRect = mapDestRect(destRect, 0); int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest); ...
9
private int jjMoveStringLiteralDfa2_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return 2; try { curChar = input_stream.readChar(); } catch (java.io.IOException e) { return 2; } switch (curChar) { case 93: if ((active0 & 0x80000L) != 0L) return jjStopAtPos(2, 19); break; ...
4
protected void save(Path path) { LinkedList<String> strings = new LinkedList<>(); String separator = System.getProperty("line.separator"); String entry = this.name + separator; strings.add(SkinPreview.NAME.name() + SkinConstants.SPLIT + entry); entry = this.author == null ? sep...
2
private boolean castlingFieldsInCheck(Field from, Field to, Player player) { if (this.window.board.inCheck(player)) { return true; } else { boolean castlingFieldInCheck = false; Field castlingField = this.window.board.getField(from.file < to.file ? 'e' : 'c', from.rank); Piece tempPiece = new King(playe...
3
void sendRawLine(String line) { OutputThread.sendRawLine(_bot, _bwriter, line); }
0
public void act(){ HashMap<String, String> exits = context.getCurrentRoom(currentRoom).getExits(); Set<String> exitSet = exits.keySet(); int exitNum = 0; String exit = null; Random r = new Random(); boolean valid = false; while(!valid){ exitNum = r.nextInt(exitSet.size()); ...
5
protected double offset(double p1, double p2, double a1, double a2, double b1, double b2) { double d = 0; if (b1 <= p1 || p1 + a1 <= 0) { return 0; } double t = b1 * a2 - a1 * b2; if (t > 0) { if (p1 < 0) { double s = p1 * a2; d = s / a1 - p2; } else if (p1 > 0) { doub...
8
@Override public boolean containsKey(K key) { for (Entry<K, V> entry : this.array) { if (entry == null) { continue; } if (entry.next == null) { if (entry.key.equals(key)) { return true; } } el...
6
private void setCheckboxes(int right, JCheckBox cr, JCheckBox cw, JCheckBox cx) { switch (right) { case 0: cx.setSelected(false); cw.setSelected(false); cr.setSelected(false); break; case 1: cx.setSelected(true); cw.setSelected(false); cr.setSelected(false); break; case 2: cx.setSelec...
8
@EventHandler public void onPlayerFireProjectile(ProjectileLaunchEvent e){ Projectile bullet = e.getEntity(); LivingEntity shooterLE = bullet.getShooter(); if(shooterLE instanceof Player == false) return; Player shooter = (Player) shooterLE; ItemStack item = shooter.getItemInHand(); Material m; if(item =...
2
private void AddUniform(String uniformName, String uniformType, HashMap<String, ArrayList<GLSLStruct>> structs) { boolean addThis = true; ArrayList<GLSLStruct> structComponents = structs.get(uniformType); if(structComponents != null) { addThis = false; for(GLSLStruct struct : structComponents) { ...
4
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; WithTooManyParameters that = (WithTooManyParameters) o; if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return fals...
5
public String getProperty(String propKey) throws ServiceException { if(propKey.isEmpty()) return ""; if(!initialized) { theLogger.log(Level.SEVERE, "Configuration Manager not yet Initialized"); throw new ServiceException("Configuration Manager not yet Initialized"...
8
@SuppressWarnings("unchecked") @Override public double getScore(Object userAnswer) { if (userAnswer == null) return 0; ArrayList<String> ans = (ArrayList<String>) userAnswer; ArrayList<String> trueAns = (ArrayList<String>) answer; ArrayList<String> ques = (ArrayList<String>) question; int matches = 0;...
4
@SuppressWarnings("unchecked") public FastHashTable(final int n, final int m, int k, final int w, final int word, final int bits) { this.n = n; this.m = Calc.m_fht(this.n) >> m; this.w = w; this.word = word; k = k==0 ? Calc.k_bf(this.n, this.m) : k; cbf = new CountingBloomFilter(this.m); hash = new Uhash...
2
@Override public void run() { try { while(!Thread.interrupted()) { synchronized(this) { while(restaurant.meal != null) { wait(); // ... for the meal to be taken } } if(++count == 10) {...
4
public static void main(String[] args) { Display display = new Display(); Shell shell = new AdvancedGraphics().open(display); while (shell != null && !shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
3
public void calculateDiagonals() { super.modelHeight = 0; diagonal2DAboveOrigin = 0; maxY = 0; for (int vertex = 0; vertex < vertexCount; vertex++) { int x = verticesX[vertex]; int y = verticesY[vertex]; int z = verticesZ[vertex]; if (-y > super.modelHeight) super.modelHeight = -y; if (y > ma...
4
String getFragment(int startPos, int endPos, String fileName) throws FileNotFoundException, IOException{ String docFragment = ""; RandomAccessFile doc = new RandomAccessFile(fileName, "r"); int aByte = 0; doc.seek(startPos); if(startPos != 0){ doc.seek(startP...
9
public String toString() { String pixlimage = ""; for (int j = 0; j < height; ++j) { for (int i = 0; i < width; ++i) { pixlimage += pixel[j][i].red; pixlimage += pixel[j][i].green; pixlimage += pixel[j][i].blue; pixlimage += '\t'; } pixlimage += '\n'; } return pixlimage; }
2
public void init() { for (int d=0; d<3; d++){ pos[d] = (int) Math.abs(Math.random() * 10); } System.out.format("Aircraft is at %s\n", IOGeneric.intListToString(pos)); }
1
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BauteilNr that = (BauteilNr) o; if (n != null ? !n.equals(that.n) : that.n != null) return false; return true; }
5
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JWeb jWeb = (JWeb) o; if (getId() != null ? !getId().equals(jWeb.getId()) : jWeb.getId() != null) return false; if (getUrl() != null ? !getUrl(...
7
private boolean acceptDrag(DropTargetDragEvent event) { int allowed = getPanel().getAllowedRowDropTypes(); if ((allowed & event.getDropAction()) == 0) { if ((allowed & DnDConstants.ACTION_MOVE) != 0) { event.acceptDrag(DnDConstants.ACTION_MOVE); } else if ((allowed & DnDConstants.ACTION_COPY) != 0) { ...
3
public MethodNode method(MethodID id) { ClassNode c = classes.get(id.owner); if (c != null) { for (Object mo : c.methods) { MethodNode m = (MethodNode) mo; if (m.name.equals(id.name) && m.desc.equals(id.desc)) { return m; } } } return null; }
4
@Override protected Integer doInBackground() throws Exception { publish("State 1 of 5: Collect files and directories! "); for (int i=0; i<pathArray.length; i++){ find(pathArray[i]); } switch (searchMethod){ case SEARCH_ALL_DUP: compareDirectories(); compareFiles(); break; case SEARCH_DIR_D...
5
@Override public void actionPerformed(ActionEvent e) { JComponent source = (JComponent) (e.getSource()); if (source == (JComponent) interpolationmodeBox) { plotComponent.setInterpolationMethod(interpolationmodeBox.getSelectedIndex()); } else if(source == (JComponent) functionsBox) { plotComponent.setF...
5
private void rotateTicker() { int barsCount = 11; Area tempOuter = tickerOuter[0]; Area tempInner = tickerInner[barsCount - 1]; for (int i = 0; i < barsCount - 1; ++i) { tickerOuter[i] = tickerOuter[i + 1]; tickerInner[barsCount - (i + 1)] = tickerInner[barsCount - (i + 2)]; } tickerOuter[barsCount - ...
1
public static void main(String[] args) { // Working with Queue's Queue<String> line = new LinkedList<String>(); line.add("Person 1"); line.add("Person 2"); line.add("Person 3"); String person1 = line.remove(); String person2 = line.remove(); System.out.println(person1); System.out.println(...
0
public ArrayList<Vector2> getSolidTiles(){ ArrayList<Vector2> result = new ArrayList<Vector2>(); for(int y = 0; y < worldHeight; y++){ for(int x = 0; x < worldWidth; x++){ Tile tile = Tile.getTileById(mapData.get((y * worldHeight) + x)); if(tile.isSolid){ result.add(new Vector2(x * tileSize,...
3
public void paintComponent(Graphics g) { Graphics g2 = g.create(); Dimension d = getSize(); CPArtwork artwork = controller.getArtwork(); Object[] layers = artwork.getLayers(); g2.setColor(new Color(0x606060)); g2.fillRect(0, 0, d.width, d.height - layers.length * layerH); g2.setColor(Color.black...
5
public int selectToEnd(boolean extend) { if (mSize > 0) { if (extend && !isEmpty()) { if (mAnchor < 0) { mAnchor = firstSelectedIndex(); } select(mAnchor, mSize - 1, true); } else { select(mSize - 1, false); } return mSize - 1; } return -1; }
4
public static String inet_ntop(long longValue) { StringBuffer ip = new StringBuffer(); if (longValue<0) { longValue=(long)(longValue+Math.pow(2, 32)); } for (int i=3;i>=0;i--) { ip.append((int)(longValue / Math.pow(256,i))); longValue -= (int)(longValue / Math.pow(256,i))*Math.pow(256,i); if (i>...
3
public void setMACMethod(MACMethodType value) { this.macMethod = value; }
0
private Location secureLocation(Location oldLocation, Player player) { World world = oldLocation.getWorld(); int x = oldLocation.getBlockX(), y = oldLocation.getBlockY(), z = oldLocation .getBlockZ(); // Block for feet Block blockOnY = world.getBlockAt(x, y, z); // Block for head Block blockOnY2 = wor...
5
static public void main(String[] args) { // check command line arguments if (args.length != 1) { System.err.println("USAGE: java GameImageRecorder <directory>"); System.exit(1); } if (!(new File(args[0])).isDirectory()) { System.err.println("ERROR: di...
9
public String getRequestMessage(){ if(byteDatas.size() == 1){// 如果长度为1的话 this.message = CoderUtils.decode(ByteBuffer.wrap(byteDatas.get(0)));// 直接处理返回 }else if(byteDatas.size() > 1){ ByteBuffer buffer = null;// 缓冲区 if(this.dataPosition > BUFFER_LIMIT){// 收到的数据超过大小 buffer = ByteBuffer.allocateDirect(I...
4
@Test public final void testUpdate() { // Test that the update function can move a paddle. Robot robot; try { robot = new Robot(); Field paddleField, directionField; Paddle paddle; // Check that direction starts at 0 { ...
4
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 >= ...
8
public MyUTMPoint toUTMPoint(double lat, double lon) { if (lat < -80 || lat > 84) { System.out.println("Latitude (" + lat + ") falls outside the UTM grid."); } if (lon == 180.0) { lon = -180.0; } double UTM_F0 = 0.9996; double a = 6378137.0; double eSquared = 0.006694380004260827; double l...
4
@Test public void testStraight(){ Hand FiveHigh = new Hand(new Card[]{new Card(Suit.DIAMONDS,14), new Card(Suit.SPADES,2), new Card(Suit.HEARTS,3), new Card(Suit.CLUBS,4), new Card(Suit.DIAMONDS,5)}); assertEquals(HandType.STRAIGHT,FiveHigh.getType()); Set<Hand> previous = new HashSet<Hand>(); previous.add(Fi...
4
public static int[][] insertZero(int a[][]) { int[] row= new int[a.length]; int[] col= new int[a[0].length]; for(int i=0;i<a.length;i++) { for(int j=0;j<a[0].length;j++) { if(a[i][j]==0) { row[i]=1; col[j]=1; } } } for(int i=0;i<a.length;i++) { for(int j=0;j<a[0]....
6
public void setItemId(int itemId) { this.itemId = itemId; }
0
public static void main(String[] args) { double startLat = 41.82967; // constants double startLong = -71.40210; String ways; String nodes; String index; String hostname; int trafficport; int serverport; BackendWorker backend = null; Map<String,Double> trafficData = null; Server server...
7
public int search(int[] A, int target) { if (A == null || A.length == 0) return -1; int last = A.length - 1; int start = 0, end = last; int mid; while (start <= end) { mid = (start + end) / 2; if (target == A[mid]) { return mid; } else if (target < A[mid]) { if (A[mid] > A[last] && A[0]...
9
public void moveLEFT() { x -= Bullet_SPEED; if (x > 1800 || x<1 || y>900 || y<1){ //explode(); visible = false; if(x > 1351 && y>396 && y<600){ GameArea.scoreamount++; } } }
7
static void SWAPK(int k, int k_max, BigInteger [][] b, BigInteger [][] H, boolean []f, BigInteger [] d, BigInteger [][] lambda) // the SWAPK procedure of algorithm 2.7.2 { // System.out.println("SWAPK:"); // exchange H[k] and H[k-1] // This can be done efficiently by swapping pointers...
8
public boolean allVehiclesAreLegal(){ for(int row = 0; row < this.gridSize; row++){ for(int column = 0; column < this.gridSize; column++){ char current = this.grid[row][column]; //System.out.println("Current character: " + current + ", and current position: [" + row + ", " + column + "]"); int[] positi...
5
private boolean jj_3_75() { if (jj_scan_token(NOT)) return true; return false; }
1
@Override public boolean move(short steps, Board gameBoard, short sid){ short gbSize = gameBoard.getBoardSize(); gbSize = (short)(gbSize*gbSize); short currentSoldierStandingPoint; short currentSoldierEndingPoint; int chosenI = 0; short distanceBetwee...
9
public String asString() throws WeiboException{ if(null == responseAsString){ BufferedReader br; try { InputStream stream = asStream(); if (null == stream) { return null; } br = new BufferedReader(new Inp...
6
@Override public void playbackStarted(PlaybackEvent playbackEvent) { try { if (fadeTime > 0.0f && fadeIn == null) { stopFadeIn(); stopFadeOut(); setVolume(getMinGain()); if(gamePlayList != null) { if(gamePlayList...
5
private void setInputsEnabled(Boolean enabled) { inputTextArea.setEnabled(enabled); sendButton.setEnabled(enabled); statusOnline = enabled; refreshTitle(); }
0
public void displayPage(String URL){ //String URL = "../../pages/help3.html"; try { instructionPane.setPage(getClass().getResource(URL)); } catch (IOException ex) { Logger.getLogger(HelpPanel.class.getName()).log(Level.SEVERE, null, ex); } }
1
public static void main(String[] args) { if (args.length != 1) { System.out.println("Invalid parameters number"); System.out.println("Usage:"); System.out.println("java ru.compscicenter.db.tolmachev.nosqldb.server.httpprotocol.DataBaseHttpServer <database server port>"); ...
4
public void update(){ if(!isDead()){ if(getHealth() > 0){ if(isHostile && detectedPlayer){ moveToPlayer(); }else{ moveRandom(); } }else{ die(); } } }
4
public void setIdPosControlSaldos(int idPosControlSaldos) { this.idPosControlSaldos = idPosControlSaldos; }
0
public void saveAdminPositions(){ if (customConfigurationFile == null) { customConfigurationFile = new File(plugin.getDataFolder(), "blocklocations.yml"); } customConfig = new YamlConfiguration(); List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (Location blockLoc : plugin.a...
5
public static ArrayList<EntityXML> inverseConvert(String fileName) { ArrayList<EntityXML> entities = new ArrayList<EntityXML>(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); Document doc; try { DocumentBuilder builder = factory.newDocumentBuilder(); doc = builder.parse(new Fi...
9
@Override public boolean validateAndStartFilePromote(PromotionFile pPromotionFile) { FilePromoteStatus lFilePromoteStatus = getFilePromoteStatus(pPromotionFile, getDatabaseConnection().getLoggingConnection()); String lHashDifference = lFilePromoteStatus.mPreviousHash.equals(pPromotionFile.getFileHas...
3
private boolean doitPrendrePassager(Passager p) { /*int min = this.ascenseur.getNumEtageLePlusBas(); int max = this.ascenseur.getNumEtageLePlusHaut(); int etageTraite = this.getEtage().getNumero(); int etagePassager = p.getEtageDestination().getNumero(); return (etageTraite...
8
@Override public void set(final LedColor... colors) { int red = 0, green = 0, blue = 0; for (final LedColor ledColor : colors) { switch (ledColor) { case RED: red = 64; break; case YELLOW: red = 64; g...
8
public void calculatePositions(Container target) { if (rows.size() == 0) { return; } //If we already calculated based on this target size then just return if (lastTargetDim != null && target.getWidth() > 0 && target.getHeight() > 0) { if (target.getWidth() == la...
7
public void initializeClauses() { splitStrings = splitter.splitClauses(this); for (int i = 0; i < splitStrings.size(); i += 2) { if (identifier.isClause(splitStrings.get(i), splitStrings.get(i + 1))) { ArrayList<ArrayList<String>> clauseBundle = new ArrayList<>(); ...
2
public List<SkillRating> getRequiredSkillRatings() { return requiredSkillRatings; }
0