text
stringlengths
14
410k
label
int32
0
9
private boolean isStraight(ArrayList<Card> player) { ArrayList<Integer> sortedHand=sortHand(player); removeDuplicates(sortedHand); if (sortedHand.get(sortedHand.size()-1 ) == 14) //if the top value is an ace, use the method below if (isLowestRankingStraight(sortedHand)) return true; int straightCounter=0; f...
7
public static void main(String[] args) throws InterruptedException { HuntField field = new HuntField(21, 70); for (int i = 0; i < numberOfTrees; i++) { new Tree(field); } for (int i = 0; i < numberOfDucks; i++) { new Duck(field).start(); } for (int...
4
public void mouseClicked(int button, int x, int y, int clickCount) { if (fullScreenButton.getShape().contains(x, y)) { try { container.setFullscreen(!fullScreen); } catch (SlickException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (quit.getShape().contains(x, y)) { ...
3
public void setNewImage(String imgFileName) throws IOException { System.out.println("**** New Image ****"); ImageBlocker blocker = new ImageBlocker(imgFileName); System.out.println("New image loaded: " + imgFileName); ArrayList<HashSet<Block>> parsedShapes = blocker.getLargeConnectedComponents(0.10); int s...
7
private void sort(){ int indexFirstArray = 0; int indexSecondArray = 0; for(int i = 0; i<target.length; i++){ if(indexFirstArray<firstArray.length && indexSecondArray<secondArray.length &&(firstArray[indexFirstArray] < secondArray[indexSecondArray])) ...
9
private void correctCameraPosition() { Point2D camPos = gui.getController().getCameraPosition(); double x = camPos.getX(); double y = camPos.getY(); Map map = gui.getController().getMap(); if (getWidth() > map.getWidth() * TILE_SIZE) { x = (double) map.getWidth() / 2 - 0.5; } else if ((x + 0.5) * TILE_S...
6
private static void checkTargetsAndMyHills() { for (Target target : MyBot.oldTargets) { if (!target.getField().isVisible()) { if (target.getClass().equals(Food.class)) { MyBot.targets.add(new Food(target.getField())); } else { MyBot.targets.add(new EnemyHill(target.getField(), ((EnemyHill)...
5
@Override public void remoteConnectionDisconnectListener(ConnectionDisconnectListener listener) { connectionDisconnectListenerList.remove(ConnectionDisconnectListener.class, listener); }
0
public void setCurrentDockable(Dockable dockable) { int index = mDockables.indexOf(dockable); if (index != -1) { int wasCurrent = mCurrent; mCurrent = index; for (Dockable one : mDockables) { one.setVisible(dockable == one); } mHeader.revalidate(); repaint(); acquireFocus(); if (mActive ...
4
public IntTreeNode convert(int[] p_inputs, int p_start, int p_end) { IntTreeNode l_root = new IntTreeNode(p_inputs[p_end]); if (p_start == p_end) { return l_root; } int l_splitter = p_end - 1; for (; l_splitter >= p_start; l_splitter--) { if (p_inputs[l_...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair other = (Pair) obj; if (i0 != other.i0) return false; if (i1 != other.i1) return false; return true; }
5
public Builder name(String receivedName) { if (receivedName == null || receivedName.equals("")) { throw new IllegalArgumentException("Name must be not null. Received value =" + receivedName); } this.name = receivedName; return this; }
2
@SuppressWarnings("static-access") @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onMobDamage (EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); Entity damager = event.getDamager(); if (entity instanceof Skeleton) { final ...
3
public void play() { currentTime = getTime(); while(!Display.isCloseRequested()) { getFps(); Input.checkInput(stage); stage.update(); Camera.get().update(); Camera.get().draw(); if(Keybinds.EXIT.clicked()) { Mouse.setGrabbed(false); } } }
2
private void calcLoads() { Vector3D Fb = new Vector3D(); // stores the sum of forces Vector3D Mb = new Vector3D(); // stores the sum of moments Vector3D Thrust = new Vector3D(); // thrust vector // reset forces and moments: vForces.reset(); vMoment.reset(); // Define the thrust vector, which ac...
4
public void sendBlockRemoving(int var1, int var2, int var3, int var4) { if(this.isHittingBlock) { this.syncCurrentPlayItem(); if(this.blockHitDelay > 0) { --this.blockHitDelay; } else { if(var1 == this.currentBlockX && var2 == this.currentBlockY && var3 == this.c...
9
public void keyPressed(KeyEvent e) { // si se presiona spacebar, barra se mueve hacia la derecha if (e.getKeyCode() == KeyEvent.VK_RIGHT) { dirBarra = 1; } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { dirBarra = 2; } //si se acaba el juego, se re...
5
private void parseLandShape() throws FileNotFoundException, InvalidShapeFileException, IOException { try (FileInputStream is = new FileInputStream( "assets/shape/BestLandShape.shp")) { ValidationPreferences prefs = new ValidationPreferences(); prefs.setMaxNumberOfPointsPerShape(35529); ShapeFileReader...
3
private void applySelectionChange(BitSet newSel) { if (!newSel.equals(mSelection)) { selectionAboutToChange(); mSelection = newSel; selectionDidChange(); } }
1
public Boolean getHide(String block) { if (block.equalsIgnoreCase("break")) return _jobsdata.getShow(0); if (block.equalsIgnoreCase("place")) return _jobsdata.getShow(1); if (block.equalsIgnoreCase("defeat")) return _jobsdata.getShow(2); ...
8
public void setEmail(String email) { this.email = email; }
0
final void method4166(long l, byte[] bs, int i) { anInt4875++; int i_2_ = 0; if (i != -27938) { method4171((byte) -98); } int i_3_ = -(0x7 & (int) l) + 8 & 0x7; int i_4_ = anInt4891 & 0x7; long l_5_ = l; int i_6_ = 31; int i_7_ = 0; for (/**/; i_6_ >= 0; i_6_--) { i_7_ += (0xff & aByteArray488...
9
public void startApp() { InputStream is = getClass().getResourceAsStream(fileName); FileManager file = new FileManager(); double [] filter = new double [576]; for(int i = 0; i < filter.length; i++){ if( i <= 5 ) filter [i] = 1.0; ...
4
public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { if (this.averageGroundLevel < 0) { this.averageGroundLevel = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); if (this.averageGroundLevel < 0...
9
@Override public ProductB factoryB() { return new ProductB2(); }
0
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Park other = (Park) obj; if (code == null) { if (other.code != null) return false; } else if (!code.equals(other.code)) return false;...
6
@Override public void execute(HttpServletRequest request, HttpServletResponse response) { DaoFactory daoFactory = MySqlFactory.getDaoFactory(); OrderDao orderDao = daoFactory.getOrderDao(daoFactory.getConnection()); try { String[] checkedOrderIds = request.getParameterValues("che...
2
public RouterPacket GetInternalMemoryRouterPacket(int index) { return internalMemory.get(index); }
0
private boolean hasMatchingAttributGroupUsage( final DynamicObjectType toBeRegisteredType, final Set<AttributeGroup> specifiedAtgs, final Set<Aspect> specifiedAspects) { final List<AttributeGroup> attributeGroups = toBeRegisteredType.getDirectAttributeGroups(); for(AttributeGroup attributeGroup : attributeGroups...
7
public List<Effect> getEffects() { final List<Effect> effects = new ArrayList<Effect>(); for (Element element : elements) if (element instanceof Effect) effects.add((Effect) element); return effects; }
2
public static ArrayList<Bean> viewStudents() throws SQLException { ArrayList<Bean> list=new ArrayList<Bean>(); Bean bean=null; try{ String query="select count(schoolid),schoolid from awardstudent group by schoolid "; con=DBConnection.getConnection(); pt=con.prepareStatement(query); System.out.println...
3
public Leafage(String name) { this.name = name; }
0
private void print() { Runnable updateText = new Runnable() { public void run() { if ( serverVersion != null ) { int stat = serverVersion.getDataStatus() ; if ( stat == 0 ) { messageTextArea.append( "ok\n\nno infos available or undetected e...
6
private void attackPlaceRight(int position, char[] boardElements, int dimension) { if (isPossibleToPlaceRight(position, dimension)) { if (isPossibleToPlaceOnNextLine(boardElements, position + dimension) && isBoardElementEmpty(boardElements[positionRightBelow(position, dimension)]...
5
public static void killMC() { //if Mc is running if (LaunchFrame.MCRunning) { //open confirm dialog for closing MC YNDialog yn = new YNDialog("KILL_MC_MESSAGE", "KILL_MC_CONFIRM", "KILL_MC_TITLE"); yn.setVisible(true); yn.toFront(); if (yn.ready && ...
5
public void develop() { if (grammar.getGraph().getInputs().isEmpty()) { System.out.println("There are not input nodes - add some to develop a graph."); return; } grammar.getGraph().removeMassSpringNetwork(); currentPoint = grammar.getGraph().getInputs().get(0); ...
5
public List<Tarefa> getTarefas(String sql, Map<String, Object> parametros) { Query query = em.createNativeQuery(sql, Tarefa.class); if (!parametros.isEmpty()) { if (parametros.containsKey("colaborador")) { query.setParameter("colaborador", parametros.get("colaborador")); ...
4
@SuppressWarnings("deprecation") public synchronized static void NumForList(final String outerNum, final String flagHangup) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { if (butPanel.countComponents() == 10) butPanel.remove(9); JButton button = new JButton(); button.se...
6
@Test public void virheellinenFormaattiListaKonstruktoriTapausA() { ArrayList<Piste> p = new ArrayList(); p.add(new Piste(200, 200)); p.add(new Piste(100, 100)); Este s = new Este(p); Este r = new Este(100, 100, 200, 200); assertTrue("Este ei muuttanut kulmia oikeiks...
0
public static void main(String[] args) throws Throwable{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(int c = 0, C = parseInt(in.readLine().trim()); c++ < C; ){ StringTokenizer st = new StringTokenizer(in.readLine()); int t = parseInt(st.nextToken()), B = parseInt(st.nextToken...
8
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 MenuPause () { super(); try { setImg(ImageIO.read(new File("img/background/menu.jpg"))); } catch (IOException e) { e.printStackTrace(); } _title.setBounds(310, 25, 155, 50); _title.setFont(new Font("Arial", Font.BOLD, 45)); add(_title); _highScore.setSize(200, 45); _highScore.setFont...
8
@SuppressWarnings("unchecked") public void run() { try { while (!isInterrupted()) { Serializable data = getNextMessageFromQueue(); if (data instanceof KeepAliveMessage) { } else if(data instanceof ClientToClientMessage) { getIncomeClientMsglistener().massageReceived((ClientToClie...
7
public synchronized Weather retrieveWeather(final int cityId) throws IOException, ParserConfigurationException, SAXException { Weather result = new Weather(); InputStream inputStream = null; try { inputStream = YandexWeatherChecker.class.getResourceAsStream("/weatherExample.xml"); ...
7
public double test(int N1[], int N2[], double weight[]) { // Sanity checks if (N1.length != N2.length) throw new RuntimeException("Row length do not match: " + N1.length + " != " + N2.length); if (N1.length != weight.length) throw new RuntimeException("Weight length does not match data rows length: " + N1.length ...
2
public void DisplayPic(ArrayList<Block[][]> _rgbBlock, BufferedImage _buffImage) { for(int y = 0, ylocation=0; y < this.height/8; y++, ylocation +=8){ for(int x = 0, xlocation=0; x < this.width/8; x++, xlocation +=8) { DisplayBlock(_rgbBlock.get(0)[x][y],_rgbBlock.get...
2
public void setFrontRightTrim(int frontRightTrim) { this.frontRightTrim = frontRightTrim; if ( ccDialog != null ) { ccDialog.getTrim2().setText( Integer.toString(frontRightTrim) ); } }
1
private static RobotScore readRobotScore(XMLEventReader eventReader) throws XMLStreamException { String name = null; double score = 0; double rounds = 0; double survival = 0; double damage = 0; while (true) { XMLEvent event = eventReader.nextEvent(); if (event.isEndElement() ...
9
private void runWork(){ while(this.noStopRequested){ try{ this.idleWorkers.add(this); process(handoffBox.take());//接收数据进行处理 }catch(Exception e){ e.printStackTrace(); } } }
2
public void hideTooltip() { if (tooltip != null) { tooltip.remove(); if (hide == null || !hide.isScheduled()) { hide = new Task() { @Override public void run() { if (tooltip != null) { tooltip = null; } } }; Timer.schedule(hide, 1); } } }
4
public Accounting() throws IOException { logPath = "account.txt"; try { logWriter = new WriteFile(logPath, true); logFile = new ReadFile(logPath); logFileText = logFile.OpenFile(); if(logFile.readLastLine().isEmpty()){ ...
2
public Frame10() { try{ Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL,USER, PASS); statement = conn.createStatement(); }catch(SQLException se){ se.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } setTitle("Blok D, 74 - 116"); setDefaultCloseOperation(...
8
private void handleDownloadFinished(DownloadFinished df) throws Exception { String fileUID = df.getFileUID(); DFSException error = df.getError(); if(error != null) { agentPrintMessage("Download failed for file "+fileUID); agentPrintMessage(error); LinkedList<GetFile> list = currentDownloads.remove(...
8
public void renderPlayer(int xp, int yp, Sprite sprite){ xp -=xOffset; yp -=yOffset; for(int y=0; y < 64; y++){ int ya = y + yp; for(int x=0; x<64;x++){ int xa = x + xp; if(xa < -64|| xa >= width || ya < 0 || ya >= height) break; if(xa < 0) xa=0; int color = sprite.pixels[x + y * 6...
8
private List<Gate> getLayeredGates(List<List<Gate>> gates, int inputSize) { List<Gate> res = new ArrayList<Gate>(); // Init wireLayer map with input wires HashMap<Integer, Integer> wireLayers = new HashMap<Integer, Integer>(); for (int i = 0; i < inputSize; i++) { wireLayers.put(i, 0); } for (List<Gate...
8
public void giveCard(Card card, CardPile drawPile) { if (hand.size() >= MAX_CARDS) { return; } hand.add(card); if (component != null) { component.addCard(card, drawPile); } }
2
public static boolean validUserKeyField(JTextField userKeyTextField) { boolean valid = false; String userKey = userKeyTextField.getText(); if (userKey.matches(Constants.USERKEY_REGEX)) { Border greyBorder = BorderFactory.createLineBorder(Color.GRAY); userKeyTextField.setB...
1
private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed GUIControl.getInstanceOf().restoreAllOriginalTileColors(); if (this.getComponentCount() > 0) { GUIControl.getInstanceOf().iluminarPosicoesPossiveis(this); ...
6
public static String findSnzipExecutable() { for(File f : new File("bin").listFiles()) { if(f.getName().equals("snzip") || f.getName().startsWith("snzip.")) { return new File(new File("bin"), f.getName()).getAbsolutePath(); } } return null; }
3
public void keyPressed(KeyEvent e) { int key=e.getKeyCode(); if(key == KeyEvent.VK_UP) dy+=0.07; if(key == KeyEvent.VK_DOWN) dy-=0.09; if(key == KeyEvent.VK_LEFT){ if(vx>0) vx=0; dx-=0.3; ChangeTex(0); } if(key == KeyEvent.VK_RIGHT){ if(vx<0) vx=0; dx+=0.3; ChangeTex(2); } ...
6
@Override public void init() { //Platform independence for swing look and feel try { UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeel...
1
@Override public String toString() { String returnString = ""; int indexOfLessThan = label.indexOf("<"); String truncatedLabel = label; if (indexOfLessThan != -1) { truncatedLabel = label.substring(0, indexOfLessThan); } returnString += "CALL " + label + "...
3
public String formatVerbleibendeZeit() { int zeit = this.getVerbleibendeZeit(); int minuten = 0; if (zeit > 60) { minuten = zeit / 60; zeit = zeit - (minuten * 60); } StringBuilder builder = new StringBuilder(); builder.append((minuten >= 10) ? minuten : "0" + minuten); builder.append(":"); builde...
3
public static void main(String args[]) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int numberOfPeoples = sc.nextInt(); int totalBudget = sc.nextInt(); int numberOfHotels = sc.nextInt(); int numberOfWeeks = sc.nextInt(); ...
6
@Override public String toString() { StringBuilder sb = new StringBuilder(); try { appendLB(sb, getPackageName()); if(hasAnnotations()) for(JPAnnotation anno:getAnnotations()){ appendLB(sb, "@"+anno.getType()); for(Str...
9
@Override public void write(Fields fields) throws IOException { // Maps a PostingsFormat instance to the suffix it // should use Map<PostingsFormat,FieldsGroup> formatToGroups = new HashMap<>(); // Holds last suffix of each PostingFormat name Map<String,Integer> suffixes = new HashMa...
9
private static Node insertionSort(Node n){ Node h = null; while(n!=null){ Node next = n.next; if(h==null){ h = n; h.next = null; } else{ h = insertIntoList(h, n); } n=next; } return h; }
2
private String escapeXMLAttribute(String text) { text = StringTools.replace(text, "&", "&amp;"); text = StringTools.replace(text, "<", "&lt;"); text = StringTools.replace(text, "\"", "&quot;"); text = StringTools.replace(text, ">", "&gt;"); return text; }
0
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public void refreshTagData() { Thread t = new Thread() { public void run() { while (tagCount < list.size()) { list.get(tagCount).getData(); tagCount++; } } }; t.start(); }
1
private static void writeInterfaceNames(final ClassEditor ce, final DataOutputStream dos) throws IOException { // Sort interfaces by name final SortedSet sorted = new TreeSet(); final Type[] interfaces = ce.interfaces(); for (int i = 0; i < interfaces.length; i++) { sorted.add(interfaces[i].className()....
2
static void dfs(int u, int depth, int modifiedEven, int modifiedOdd){ if(depth%2==0){ if(modifiedEven%2==(label[u]==target[u]?1:0)){ result++; modifiedEven++; picked.add(u); } } else{ if(modifiedOdd%2==(label[u]==target[...
7
public void writeChar(char v) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("writeChar = " + v); } write(CFASL_CHARACTER); write(v); }
1
public Descriptor compile(SymbolTable table){ Descriptor d = null; if(type instanceof IdentNode){ String s = ((IdentNode) type).getIdentName(); if(s.equals("integer")){ d = new SimpleTypeDescriptor(Type.INTEGER); } else if(s.equals("boolean")){ d = new SimpleTypeDescriptor(Type.BOOLEAN); }...
4
public void destroyPortal(final int portal){ Location portalloc; if(portal == 1){ if(one == null) return; portalloc = one.clone(); one = null; } else if(portal == 2){ if(two == null) return; portalloc = two.clone(); two = null; }else throw new IllegalArgumentException("Portal number must be ...
5
private Location findFood() { Field field = getField(); List<Location> adjacent = field.adjacentLocations(getLocation()); Iterator<Location> it = adjacent.iterator(); while(it.hasNext()) { Location where = it.next(); Object actor = field.getObjectAt(where); ...
3
private int initFieldsFromClass(Class<?> initClass, Map<Integer, JsonFieldDeserializer> customEncoders, List<JsonFieldDeserializer> fieldsWithAnnotatoins, Map<Integer, JsonFieldDeserializer> idToFieldMap, Map<Integer, String> nameToFieldMap) { int maxFieldId = 0; if (...
9
private double makeSureSmaxIsntViolated(int i, double nextStake) { int sMaxI = road.getSmax(i); int sMax2 = road.getSmax(i-1); if (nextStake > sMaxI && nextStake > sMax2) { nextStake = sMaxI < sMax2 ? sMax2 : sMaxI; nextStake = lastStake() + nextStake; } return nextStake; }
3
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
private Object js_unescape(Object[] args) { String s = ScriptRuntime.toString(args, 0); int firstEscapePos = s.indexOf('%'); if (firstEscapePos >= 0) { int L = s.length(); char[] buf = s.toCharArray(); int destination = firstEscapePos; for (int...
8
@Override public void remove() { super.remove(); // If a player is removed and he was carrying a flag, the flag is // dropped on the square where the player was last alive. final PlayerFlag inventoryFlag = getInventory().findFlag(); if (inventoryFlag != null) { Position positionPlayer = getGrid().getEleme...
4
public JSONArray getJSONArray(int index) throws JSONException { Object object = this.get(index); if (object instanceof JSONArray) { return (JSONArray) object; } throw new JSONException("JSONArray[" + index + "] is not a JSONArray."); }
1
public void update(GameContainer gc) { gui.update(); inputHandler.update(gc.getInput()); boolean flagsenses = false; if (inputHandler.hasDirect()) { if (ActionHandler.attemptPlayerMove(inputHandler.getDirection())) { flagsenses = true; //Moveme...
4
@Override public void actionPerformed(ActionEvent e) { for (Ensemble ensemble : ShowGoDAO.getShowGo().getEnsembles()) { for (Person p : ensemble.getMembers()) { if (person == p) { JOptionPane.showMessageDialog(mainWindow, "Die Person " + person.getName() + " ist dem ensemble " + ensemble.getName() ...
6
@Override public boolean jouerCase(Case c) { int width = (300+this._partie.getParametre().getNbCaseX()+1)/this._partie.getParametre().getNbCaseX(); int height = (300+this._partie.getParametre().getNbCaseY()+1)/this._partie.getParametre().getNbCaseY(); ImageIcon bateauImage = null; ...
2
public ArrayList<ArrayList<String>> respuestaDeQueryAListas(ResultSet rs) { ArrayList<ArrayList<String>> arreglos = null; ArrayList<String> arregloColumnas = null; ArrayList<String> arregloValores = null; try { arreglos = new ArrayList<ArrayList<String>>(); arregloColumnas = new ArrayList<String>(); ar...
4
public String getSession(int i){ String hr, min; try{ hr = Integer.toString(session[i].get(11)); if (hr.length()==1) hr = "0" + hr; min = Integer.toString(session[i].get(12)); if (min.length()==1) min = "0" + min; return hr + ":" + min; } catch(NullPointerException e){ } return null; }
3
public void run() { if (DEBUG) log("Now running SubTaskAddition command"); if (taskViewToUpdate != null) { if (DEBUG) log("Get existing subTasks from TaskCommander"); ArrayList<SubTask> subTasks = TaskCommander.getSubTasks(); if (DEBUG) log("Add the subTask contained in this command to t...
6
private boolean r_un_accent() { int v_3; // (, line 215 // atleast, line 216 { int v_1 = 1; // atleast, line 216 replab0: while(true) { lab1: do { if (!(out_groupin...
8
@Override public boolean getControls(String control){ if(control == "Age"){ return true;} if(control == "Fade"){ return true;} if(control == "WolfRule"){ return true;} if(control == "Mat"){ return true;} if(control == "Orient"){ return true;} if(control == "Mirror"){ return true;} if(control == "Xf...
7
public void calculateGisModel(DwgFile dwgFile) { if (getVertices() == null) return; int flags = getFlag(); List pts = getVertices(); double[] bulges = getBulges(); List newPts = new ArrayList(); double[] newBulges = null; if(bulges != null){ newBulges = new double[bulges.length]; System.arraycopy...
9
@Override public String getWorkingDay() { return super.getWorkingDay(); }
0
public static int subtask1(CompositeText document) { List<TextComponent> sentences = listOfAllSentences(document); List<String> allWords; Set<String> uniqueWords; int count=0; for(int i=0;i<sentences.size();i++){ allWords = new ArrayList<String>(); uniqueWords = new HashSet<String>(); for(TextCompone...
7
public static ArrayList<Letter> extractLetters(ArrayList<Symbol> symbols) { ArrayList<Letter> letters = new ArrayList<Letter>(); int letterStart = 0; for (int i = 0; i < symbols.size(); i++) { if (symbols.get(i).type == SymbolType.PAUSE) { if (i > 0) { ...
7
@Override public GameState[] allActions(GameState state, Card card, int time) { GameState[] states = new GameState[1]; states[0] = state; if(time == Time.DAY) { //Do nothing } else if(time == Time.DUSK) { PickTreasure temp = new PickTreasure(); states = temp.allActions(new GameState(state), c...
3
public static Font load(String s) { GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); String[] fontFamilies = ge.getAvailableFontFamilyNames(); Print.say(fontFamilies.toString()); Font f; try { f = Font.createFont(Font.TRUETYPE_FONT, CustomFont.class.getResourceAsStre...
1
public Image get(String key) { // can be null if (key == null) { return null; } if (display != null) { /** * NOTE, for backwards compatibility the following images are supported * here, they should never be disposed, hence we ex...
9
private void writeAnimToXml(XmlWriter aXmlWriter, Animation aAnimation) throws IOException { aXmlWriter.writeEntity("anim"); aXmlWriter.writeAttribute("name", aAnimation.getName()); aXmlWriter.writeAttribute("loops", aAnimation.getLoops()); int backupIndex = aAnimation.getCurren...
7
public void checkPlayerCollision(Player player, boolean canKill) { if (!player.isAlive()) { return; } // check for player collision with other sprites Sprite collisionSprite = getSpriteCollision(player); if (collisionSprite instanceof PowerUp) { ...
4
final boolean method275(int i, int i_9_, int i_10_, int i_11_, int i_12_) { if (i_12_ != -1) return true; anInt272++; if (aClass206_284 == null || aClass262_292.isEnd((byte) 18)) return false; if ((i ^ 0xffffffff) != (anInt286 ^ 0xffffffff) || i_10_ != anInt275) { anInt286 = i; anInt275 = i_10_;...
7