text
stringlengths
14
410k
label
int32
0
9
private Feature getRandomFeature(Rarity rarity) { double whichFeature = (Math.random() * 4); // System.out.println("which feature " + whichFeature); if (whichFeature >= 0 && whichFeature < 1) { return itemBuilder.getRandomItem(rarity); } // creatures are more likely if (whichFeature >= 1 && whichFeature ...
9
public static HSSFCellStyle getStyle(HSSFWorkbook wb,HSSFCellStyle style, Style htmlStyle,String [][]attr) { for(int x=0;x<attr.length;x++) { if("id".equals(attr[x][0])&&(!"".equals(attr[x][1]))) { String[][] idstyle = htmlStyle.getStyleMap().get("#"+...
4
public JPanel makeSelector(){ JPanel selectorPane = new JPanel(new BorderLayout()); selectorPane.add(new JLabel("")); String[] names; switch(source){ case "editArtist": names = new String[IO.getInstance().getFestival().getArtists().size()]; for(int i = 0; i < names.length; i++){ names[i] = IO.getIns...
9
public Object revealRandomProductions() { Iterator it = objectToProduction.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); Object key = entry.getKey(); if (alreadyDone.contains(key)) continue; Production[] p = (Production[]) objectToProduction.get(key); addP...
2
public void toggleKey(int keyCode, boolean isPressed) { if (keyCode == KeyEvent.VK_W || keyCode == KeyEvent.VK_UP) { up.toggle(isPressed); } if (keyCode == KeyEvent.VK_S || keyCode == KeyEvent.VK_DOWN) { down.toggle(isPressed); } if (keyCode == KeyEven...
8
public ImageAlgebraicOperations(String s, final PunctualOperationsMenu menu) { super(s); this.menu = menu; this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Panel panel = (((Window) menu.getTopLevelAncestor()).getPanel()); if (panel.getImage() == null) { ...
6
@Override public void run() { //System.err.println("going!"); try { client = new Socket(targetIP, port); //open connection InputStream reader = client.getInputStream(); byte[] headerBuff = new byte[4]; byte[] buff = null; boolean header = true; int dataLength = 0; while (client.isConnected()) ...
8
private void applyPatch(SinglePatch patch, boolean dryRun) throws IOException, PatchException { lastPatchedLine = 1; List<String> target; patch.targetFile = computeTargetFile(patch); if (patch.targetFile.exists() && !patch.binary) { target = readFile(patch.targetFile); ...
7
@Override protected void done() { //when it have finish downloading try { errorCode=process.waitFor(); get(); } catch (InterruptedException e) { } catch (ExecutionException e) { } catch (CancellationException e){ errorCode=-1; } switch(errorCode){ case -1://cancel button //Help...
9
@Override public void paintComponent(Graphics g){ super.paintComponent(g); setBackground(Color.black); if (bflag == 1) { for (int i = 0; i < bullet.size(); i++) { bullet.get(i).draw(g); } } square.draw(g); ufo.draw(g); for (int i = 0; i < shipr0.size(); i++) { shipr0.get(i).draw(g); ...
9
public static ArrayList<Tuple> correct(String input) throws FileNotFoundException { // System.out.println("TestData -- " + input); StringTokenizer tokenizer = new StringTokenizer(input, " !?.;,"); String misSpelt = ""; String misSpeltPPOS = ""; ArrayList<String> contextWord = new ArrayList<String>(); A...
9
private void copyRGBtoABGR(ByteBuffer buffer, byte[] curLine) { if(transPixel != null) { byte tr = transPixel[1]; byte tg = transPixel[3]; byte tb = transPixel[5]; for(int i=1,n=curLine.length ; i<n ; i+=3) { byte r = curLine[i]; by...
6
public String stSendOrCancelEmail1(int dataId,int ExpVal,String flow ) { int actVal=1000; String returnVal=null; hm.clear(); hm=STFunctionLibrary.stMakeData(dataId, "Email"); String action = hm.get("Action"); String widgetType=hm.get("WidgetType"); STCommonLibrary comLib=new STCommonLibrar...
8
@Override public void actionPerformed(ActionEvent a) { if(a.getSource() == TypeSel){ Clear(); switch(TypeSel.getSelectedIndex()){ case posCartLine: initCartesianLine(); break; case posVecLine: initVectorLine(); break; case posCartPlane: initCartesian(); break; case posVecPla...
5
public Timestamp getBooktimeByOrdernumber(Statement statement,String ordernumber)//根据订单号获取下单时间 { Timestamp result = null; sql = "select booktime from ParkRelation where ordernumber = '" + ordernumber +"'"; try { ResultSet rs = statement.executeQuery(sql); while (rs.next()) { result = rs.getTimestamp...
2
public void Init(boolean solid) { if (!solid) { _streamPos = 0; _pos = 0; } }
1
public boolean equals(PixImage image) { int width = getWidth(); int height = getHeight(); if (image == null || width != image.getWidth() || height != image.getHeight()) { return false; } for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (! (getRed(...
8
private void sendCmdOutToAll(String data) throws TimeoutException { PooledBlockingClient pbc[] = blockingClientPool.getOneBlockingClientForAllActiveHosts(); if (pbc == null) { throw new TimeoutException("we do not have any client array [pbc] to connect to server!"); } for (int i = 0; i < pbc.length; i++) { ...
5
private Position getTertiaryPowerFailurePosition() { // Calculate T1 Position final int directionInt = parentPowerFailure.getDirectionInt(); final Direction direction = Direction.values()[directionInt]; final Position squareOne = direction.newPosition(parentPowerFailure.pos); // Calculate T2 Position fin...
2
public void using(int usingTimeMillis) throws ParkingException { try { TimeUnit.MILLISECONDS.sleep(usingTimeMillis); } catch (InterruptedException e) { throw new ParkingException(e); } }
1
@SuppressWarnings("static-access") void setupOutgoingCommand(OutgoingCommand command) throws EnetException { Channel channel = this.channels.get(command.command.channelID()); this.outgoingDataTotal += command.command.length() + (command.fragmentLength & 0xFFFF); if (command.command.chann...
7
* @return the meeting with the requested ID, or null if it there is none. */ public Meeting getMeeting(int id) { if(id >= meetingList.size()) { return null; } return meetingList.get(id); }
1
public Missiletab(ConsoleApp theApplication, String launcherId, List<WarUIEventsListener> allListeners) { this.theApplication = theApplication; this.allListener = allListeners; this.launcherID=launcherId; missileID = new TextField(); destination = new TextField(); damage = new TextField(); flytime = new TextFiel...
5
public void save()throws IOException{ props.store(new FileOutputStream(file), des); }
0
public static void main(String[] args) { SortVector sv = new SortVector(new StringCompare()); // Open the file which contains the words you want to add try { FileInputStream fstream = new FileInputStream("newoutput1.txt"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fst...
6
private static void printUsage() { System.out.println("FlowDroid (c) Secure Software Engineering Group @ EC SPRIDE"); System.out.println(); System.out.println("Incorrect arguments: [0] = apk-file, [1] = android-jar-directory"); System.out.println("Optional further parameters:"); System.out.println("\t--TIMEOU...
0
public void notify(int ack, String fileName) { switch (ack) { case Global.READACK: masterLogger.logMessage("===> done reading " + fileName); break; case Global.WRITEACK: masterLogger.logMessage("===> done writing " + fileName + "in primary replica"); break; case Global.BROADCASTSTARTACK: mas...
4
private void readConstantPool(final DataInputStream in) throws IOException { final int count = in.readUnsignedShort(); constants = new ArrayList(count); // The first constant is reserved for internal use by the JVM. constants.add(0, null); // Read the constants. for (int i = 1; i < count; i++) { const...
3
public static void main(String[] args) { try { String name = "MASTER"; if (args.length >= 1) { name = args[0]; } new MessagingNode(name); } catch (Exception e) { log.fatal("Toal failure to open a socket connection.", e); } }
2
public void selectionChanged() { NSRelation or; int i, oc; SObjectTableModel tm; oc = 0; for (i = 0; i < this.M.getSize(); i++) { if (this.M.getObjectAt(i).isSelected()) { oc++; this.o = (NSObject) this.M.getObjectAt(i); } ...
9
@Override protected void parseInternal(Method method, Map<String, Integer> paramIndexes, Map<String, Integer> batchParamIndexes) throws DaoGenerateException { super.parseInternal(method, paramIndexes, batchParamIndexes); MongoUpdate updateShell = method.getAnnotation(MongoUpdate.class); upsert = updateShell....
1
public int searchNumber(int search,String option) { int start = 0; int position = -1; int end = array.length - 1; while (start <= end) { int mid = (start + end) / 2; if (search == array[mid]) { position = mid; if(option.equalsIgnoreCase("first")){ end = mid-1; } else...
5
private String isHyperlink(Point p) { if (getDocument() instanceof HTMLDocument) { int pos = viewToModel(p); if (pos >= 0) { try { HTMLDocument doc = (HTMLDocument) getDocument(); if (doc != null) { Element elem = doc.getCharacterElement(pos); if (elem != null) { AttributeSet a ...
8
private HashMap<AbstractComponent, Integer> getWordMap( AbstractComponent component, HashMap<AbstractComponent, Integer> map) throws BookException { if (component.getType() == EComponentType.WORD) { Integer count = map.get(component); map.put(component, count == null ? 1 : ++count); } else if (component...
5
private void drawAlign(int x, int y, int w, int _h, Graphics2D g, String _type) { int N = _h / 2; int i; int stepH = (_h / N); int indent = (int) (w * 0.1); int rw = w - indent; if (stepH <= 1) { stepH = 1; } int h = y + (stepH / 2 + 1); int type; if (_type.equals("left")) { type = 0; }...
9
@Override protected void fireActionPerformed(ActionEvent event) { Container w = getWindow(); if (isSelected()) { adjustWindow(w); w.setVisible(true); w.requestFocus(); } else { w.setVisible(false); } }
1
public final LogoParser.assignment_return assignment() throws RecognitionException { LogoParser.assignment_return retval = new LogoParser.assignment_return(); retval.start = input.LT(1); Object root_0 = null; Token MAKE30=null; Token ID31=null; LogoParser.expression_re...
3
public void setPaused(boolean paused) { if(paused) { if(!this.paused) { for(final String key : currentClips.keySet()) { currentClips.get(key).stop(); } this.paused = true; } } else { if(this.paused) { for(final String key : currentClips.keySet()) { currentClips.get(key).start();...
5
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { stack.push(qName); for(int i = 0; i < attributes.getLength(); i ++) { String attrname = attributes.getQName(i); String attrvalue = attributes.getValue(i); System.out.printl...
1
@Override public boolean equals(Object object) { if (object instanceof Contact){ Contact contact = (Contact) object; return contact.id == id; } return false; }
1
public static List<Currency> formatOutputs(JSONArray results) { final List<Currency> ret = new ArrayList<Currency>(); for (int i = 0; i < results.length(); i++) { JSONObject r = null; if (results.get(i) instanceof JSONObject) r = (JSONObject) results.get(i); if (r != null) { final Currency c = new...
4
private void checkForPath(){ CollisionResults [] results = new CollisionResults [4]; for(int i = 0; i < results.length; i++){ results[i] = new CollisionResults(); } getStageNode().getChild("TerrainNode").collideWith(new Ray(Vector3f.ZERO, Vector3f.UNIT_X), r...
7
static void addTab(final JTabbedPane tabPane) { if (!SwingUtilities.isEventDispatchThread()) { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { addTab(tabPane); } }); } catch (InvocationTargetException | InterruptedException e1) { } return; ...
7
@Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { String myCmd = cmd.getName().toLowerCase(); Commands c = new Commands((Player) sender); boolean ret = true; if (myCmd.equals("pmhelp")) { c.Help(); } else...
7
@Override public Sentence_tree bfs_function(String function){ LinkedList<Sentence_tree> queue = new LinkedList<Sentence_tree>(); queue.add(this); while(!queue.isEmpty()){ Sentence_tree current = queue.pop(); if(current.root.function.equals(function)){ return current; } for(int index = 0; index < ...
3
public static Thread transformMissionTriggerThread(final String currentLang, final String outputPath, final String fileName, final String[][] commonContent) { Thread currentThread = new Thread(new Runnable() { @Override public void run() { StringBuilder allContent = new S...
7
public void setDir(String d) { dir = new File(d); if (!dir.exists()) { dir.mkdirs(); } if (!dir.isDirectory()) { throw new IllegalArgumentException("Not a directory " + dir); } }
2
private int parseTimeStamps() throws MpegDecodeException, IOException { Statistics.startLog(PARSE_TIME_STAMPS); int pktLength = 0; long pts = -1, dts = -1; while( m_ioTool.nextBits( 0xFF, 8 ) ) { m_ioTool.skipBits(8); pktL...
8
private void gameLoop() { try { init(); checkGLError("init"); resized(); checkGLError("resized"); long lastTime, lastFPS; lastTime = lastFPS = System.nanoTime(); int frames = 0; while (!Display.isCloseRequested() && !shouldStop()) { long deltaTime = System.nanoTime() - lastTime; l...
7
public void doTransformations() { if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0) GlobalOptions.err.println("before Transformation: " + this); while (lastModified instanceof SequentialBlock) { if (lastModified.getSubBlocks()[0].doTransformations()) continue; lastModified = lastModi...
5
public boolean deleteMaster(String filename, int resID) { // check for errors first if (resID == -1 || filename == null) { return false; } Object[] packet = new Object[2]; packet[0] = filename; packet[1] = myID_; // send the event super.s...
4
private void inviteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inviteActionPerformed // TODO add your handling code here: JComboBox cb = (JComboBox) evt.getSource(); String name = (String)cb.getSelectedItem(); if ( name.equals("invite") ) { //TO...
4
public static Vector add(Vector op1, Vector op2) throws DimensionMismatchException { if (op1.getDimension() != op2.getDimension()) { throw new DimensionMismatchException(); } Vector result = new Vector(op1.getDimension()); for (int i = 0; i < result.getDimension(); i++){ result.setComponent(i, op1.getComp...
2
public boolean testFr(LinkedList<String> dico, int[] alphabet, String test, String mot){ int bInf, bSup; ListIterator<String> i; if(!(test.length()!=7 || test.charAt(0)!=mot.charAt(0))){ bInf=alphabet[test.charAt(0)-'a']; bSup=dico.size(); if(test.charAt(0)!='z') bSup=alphabet[test.charAt(0)-('a'-1)...
5
int depth() { if (parent != null) { return 1 + parent.depth(); } return 1; }
1
public void actionPerformed(ActionEvent e) { //this. }
0
public Widget createWidget(Composite parent, int style) { String tooltip = getTooltip(); GridData controlGD = new GridData( SWT.FILL, SWT.CENTER, false, false ); // label if ( control.getLabel() != null ) { label = new Label( parent, SWT.NONE ); label.setText( control.getLabel() ); if ( tooltip != ...
7
@Override public String toString() { StringBuilder string = new StringBuilder(); string.append(super.toString()); if (this.journal != null) string.append("Journal: ").append(this.journal).append("\n"); if (this.volume != null) string.append("Volume: ").append(this.volume).append("\n...
4
public static boolean isCompressedPath(String path) { path = path.trim().toLowerCase(); return path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION) || path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION_OLD) || path.endsWith(DataConstants.GAME_SYST...
6
public void render(Graphics g) { g.setColor(Color.red); g.drawString(currentPlayer.name+"'s Turn", 30, 30); g.setColor(Color.blue); g.drawString("Playing State: "+playingStateNames[playingState], 30, 50); //g.drawString("Change State\nM = Moving\nS = Shooting\nB = Buying", 30, 50); // for (int x = 7; x < Ma...
6
XmlWriter writeEntity(String name) throws IOException { closeOpeningTag(true); this.closed = false; for (int tabIndex = 0; tabIndex < stack.size() + indentingOffset; tabIndex++) this.writer.write(INDENT_STRING); this.writer.write("<"); this.writer.write(name); ...
1
public void mouseMoved(int x, int y) { if ((x >= theComponent.getX()) && ((x <= (theComponent.getX() + buttonWidth)))) { if ((y >= theComponent.getY()) && (y <= (theComponent.getY() + buttonHeight))) { if ((y > theComponent.getY()) && (y < (theComponent.getY() + buttonHeight))) { ...
6
@Override public final IoBuffer compact() { int remaining = remaining(); int capacity = capacity(); if (capacity == 0) { return this; } if (isAutoShrink() && remaining <= capacity >>> 2 && capacity > minimumCapacity) { int newCapacity...
8
public void setName(String name) { Name = name; }
0
public void loadXML ( ) { JFileChooser chooser = new JFileChooser(); chooser.setFileSelectionMode( JFileChooser.FILES_ONLY ); chooser.setAcceptAllFileFilterUsed( false ); chooser.addChoosableFileFilter( new XMLFileFilter() ); int option = chooser.showOpenDialog( MenuApp.getFrame() ); if ( option == JFileCho...
7
public static void postorder(TreeNode root) { if (root == null) return; Stack<TreeNode> S = new Stack<TreeNode>(); S.push(root); TreeNode previous = null; while (!S.empty()) { //get the current node from the stack TreeNode current = S.peek(); //going down the tree if (previous == n...
9
private void gameThread() { running = true; try { long beginTime = System.nanoTime(); double previousDelta = 0.0; boolean runningSlowly = false; while(running) { if(interval <= 0) throw new Error("GameTimer interval must be >= 0."); long frameStartTime = System.nanoTime(); double gi...
7
public static void main(String args[]){ String objectListPath = "/u/ml/mindseye/nlg_lm/LM/lesk_syns_purdue.txt"; int no_objects = readObjectList(objectListPath); String outputMatrixPath = "/u/ml/mindseye/nlg_lm/LM/object_count.txt"; int[] object_counts = new int[no_objects]; String ldcCorpusPath = "/scratc...
9
private static void readFragmentsEnc(Stream buffer) { Censor.anIntArray620 = new int[buffer.getInt()]; for (int i = 0; i < Censor.anIntArray620.length; i++) { Censor.anIntArray620[i] = buffer.getUnsignedShort(); } }
1
public void tick(Input input, double delta) { if (isReady[0] && !isReady[1]) { delta = 0; isReady[1] = true; } physicHandler.tick(input, delta); for (int i = 0; i < entities.size(); i++) { AbstractEntity e = entities.get(i); for (int j = 0; j < entities.size() && e.isInteractsWithWorld() && ...
9
public void drawCollidableObjects(){ for(collidableObject tempObj : listWrecks){ tempObj.display(); } }
1
@SuppressWarnings("serial") public MyTable() { data = new Object[30][5]; for (int i = 0; i < 30; i++) { data[i][0] = new Boolean(false); data[i][1] = "Column " + i; data[i][2] = (Math.random() > 0.5) ? new ImageIcon( JTableRenderer.class.getResource(IMAGE_PATH + "preferences.gif")...
4
public void cmdQuote(CommandSender sender, String[] args) { if(args.length != 3) { sender.sendMessage(Conf.colorMain + "Usage:"); sender.sendMessage(Conf.colorAccent + "/ee quote <quantity> <material name>"); return; } int quantity = 0; Material material; try { quantity = Integer.parseInt...
8
public void click(int mouseX, int mouseY) { for (MenuItem item : this.itemList) { if (item.check(mouseX, mouseY)) { item.action(); return; } } }
2
public void setOccupant(Peuple occupant) { this.occupant = occupant; int tour = Partie.getInstance().getTourEnCours(); List<Peuple> ls; if (tour < this.prisesDuTerritoire.size()) { ls = this.prisesDuTerritoire.get(tour); } else { ls = new ArrayList<Peuple>(); int s = this.prisesDuTerritoi...
2
public void keyReleased(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { dx = 0; } if (key == KeyEvent.VK_RIGHT) { dx = 0; } if (key == KeyEvent.VK_UP) { dy = 0; } if (key == KeyEvent.VK_DOWN) {...
4
public static void render( float scale, float rotation, Vec3D offset, FloatBuffer vertBuffer, FloatBuffer normBuffer, FloatBuffer textBuffer, int numFacets ) { GL11.glMatrixMode(GL11.GL_MODELVIEW) ; GL11.glLoadIdentity() ; if (numFacets < 1) numFacets = vertBuffer.capacity() / ...
4
public void testNullForkStack() throws Exception { fc1=new ForkChannel(a, "stack", "fc1"); fc2=new ForkChannel(a, "stack", "fc2"); MyReceiver<Integer> r1=new MyReceiver<>(), r2=new MyReceiver<>(); fc1.setReceiver(r1); fc2.setReceiver(r2); a.connect(CLUSTER); fc1.connect("...
7
public void setMaxFailedAttempts(Long value) { this.maxFailedAttempts = value; }
0
protected void rotateTurn() { if (currentTurn < playerCount) { currentTurn += 1; PrimaryController.generateNotification("Switching to Player " + currentTurn, 0); turnTimer.setRepeats(true); percent = 0; turnTimer.start(); } else { for (int r = 0; r < unitsP1.length; r++) { for (int c = 0; c ...
7
@Override public void actionPerformed(ActionEvent e) { OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(); OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode()); if (textArea == null) { return; } Node node = textArea.n...
3
public void SetTicks(int ticks) { this.ticks = ticks; }
0
private void add(Method method) { // Check for annotation ICallbackEnum message = getMethodMessage(method); if(message == null) return; // Check Parameters Class<?>[] params = method.getParameterTypes(); Class<?> metaClass = message.getMetadataClass(); if(metaClass == null) metaClass = IJeTTSession.cl...
8
public static double sum(double[] vals) { double sum = 0; for (double v : vals) { sum = sum + v; } return sum; }
1
public Transition<ET, ?> nextChainedTransition(State<ET> inputState, Event<?> event, ET entity) throws FiniteStateException { if (!initialized) throw new FiniteStateException( "State map not yet initialized through call to build() method"); State matching...
9
@Override public void validate() { if (platform == null) { addActionError("Please Select Platorm"); } if (location == null) { addActionError("Please Select Location"); } if (iphone.equals("Please select")) { addActionError("Please Sele...
5
public double[][] getComponents() { double[][] values = new double[3][3]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) values[i][j] = m[i][j]; return values; }
2
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Product product = (Product) o; return number == product.number && !(name != null ? !name.equals(product.name) : product.name != null); }
5
private void log( Level level, String msg, Throwable ex ) { if( getLogger().isLoggable(level) ) { LogRecord record = new LogRecord(level, msg); if( !classAndMethodFound ) { getClassAndMethod(); } record.setSourceClassName(sourceClassName); ...
3
public static void loadPreset_HelpMenu_ComparePins(final Container mainFrame) { ArtAssets art = ArtAssets.getInstance(); PinLoader pinLoader = PinLoader.getInstance(); BackgroundPanel pane = new BackgroundPanel(art.getAsset(ArtAssets.IN_GAME_BACKGROUND)); //Set up the m...
3
public String getName() { return name; }
0
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == logOff){ frameRef.setContentPane(new Login(frameRef)); } if(e.getSource() == searchItems){ contentPanelLayout.show(panel, "searchItems"); } if(e.getSource() == searchBooks){ contentPanelLayout.show(panel, "searchBooks"); } ...
7
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed String frek=jTextField8.getText(); String put="C:\\Users\\vhailor\\Documents\\NetBeansProjects\\JavaApplication10\\"; DecimalFormat f = new DecimalFormat("##"); ...
7
private boolean uhattuOikealta(int pelaajaNumero, int x, int y) { int i = 1; while(y+i < 8 && kentta[x][y+i].onTyhja()) i++; if(y+i == 8) return false; if(kentta[x][y+i].getNappula().omistajanPelinumero() != pelaajaNumero) { if(i == 1 && kentta[x][y+i].getNa...
8
@Test public void test() { Imagem img; ImagemIterator iterator = new SuperiorDiagonalIterator(); // Teste com largura maior i = 0; img = new Imagem(4, 3); iterator.iterate(img, new ImageIteratorCallback() { @Override public void callback(int x,...
8
public void extractFeature(List<Article> artList, boolean isTraining) { HashMap<Article, SentencePOS[]> allPos = new HashMap<Article, MophoFeatureExtractor.SentencePOS[]>(); // load all short article POS tags with article id for (int i = 0; i < artList.size(); i++) { System.out.println(i); Article art = a...
7
private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { String eol = System.getProperty("line.separator", "\n"); StringBuffer expected = new StringBuffer(); int maxSize = 0; for (int i = 0; i < expe...
8
private void processInventory() { ArrayList<InventoryListObject> inventoryLists; Iterator<InventoryListObject> inventoryListObjectsIter; InventoryListObject inventoryListObject; ArrayList<InventoryItemObject> inventoryItemList; String listName; InventoryPanel ...
3
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof DefaultSettings)) return false; DefaultSettings that = (DefaultSettings) o; if (!age.equals(that.age)) return false; if (!email.equals(that.email)) return false; if (!name.equ...
5
public void pushWeights(Map<Object, Integer> weightedItems) { for (Map.Entry<Object, Integer> weightedItem : weightedItems.entrySet()) { String key = createKey(weightedItem.getKey()); if (sharedWeights.containsKey(key)) { // could add another heur...
3