text
stringlengths
14
410k
label
int32
0
9
public Integer monthIndex(String candidateMonth) { if (candidateMonth == null) { return null; } candidateMonth = candidateMonth.toUpperCase(); // First, try for an exact match Integer monthIndex = monthMap.get(candidateMonth); // If no match, try an abbrev of ...
5
public Persistence() { // AQUI LOS RECUPERO (usarlo cuando abres la iu) try { FileInputStream fis = new FileInputStream(pathDB); ObjectInputStream ois = new ObjectInputStream(fis); Database database = (Database) ois.readObject(); activityService.setActivities(database.getActivities()); bookingService...
3
public static void handleEvent(int eventId) { if(eventId == 1) { System.out.println("Exit load game menu selected"); Main.loadGameMenu.setVisible(false); Main.loadGameMenu.setEnabled(false); Main.loadGameMenu.setFocusable(false); Main.mainFrame.remove(Main.loadGameMenu); Main.mainFrame.ad...
5
public boolean exist(char[][] board, String word) { if (board == null || board.length == 0 || word == null || word.length() == 0) { return false; } for (int i = 0; i < board.length; i++) { char[] rowArray = board[i]; for (int j = 0; j < rowArray.length; j++)...
7
@Override public void run() { if(animationStage == 1) { //System.out.println("Animation stage updated to 2!"); animationStage = 2; } else { //System.out.println("Animation stage updated to 1!"); animationStage = 1; } }
1
public static void main(String[] args) { boolean displayConsole = true; if (args.length > 0) { // it has arguments if (args.length == 1 && args[0].equalsIgnoreCase(Main.help)) { System.out.println("Starts the KOI server"); System.out.println("\nArguments:"); System.out.println(Main.noConsoleArg +...
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GrowthRate that = (GrowthRate) o; if (Double.compare(that.rate, rate) != 0) return false; return true; }
4
public Ticker(int tickrateMS) { rate = tickrateMS; s2 = Ticker.getTime(); }
0
private static final String unescapeHTML(String s, int start) { int i, j, k, l; i = s.indexOf("&", start); start = i + 1; if (i > -1) { j = s.indexOf(";", i); /* we don't want to start from the beginning the next time, to handle the case o...
5
@Override public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { if(command.getName().equalsIgnoreCase("mb")) { if(args.length == 0){ // TODO show plugin help getLogger().info("Plugin help coming soon!"); ...
8
public boolean isValidSudoku(char[][] board) { if ((board == null) || (board.length % 3 != 0) || (board.length != board[0].length)) return false; for (int y = 0; y < board.length; y++) { for (int x = 0; x < board.length; x++) { if (board[y][x] == '.') { continue; } if (isValidInRow(x, y, boar...
9
public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; }
0
private static int partition(int data[], int left, int right){ // pre: left <= right // post: data[left] placed in the correct (returned) location while (true){ // move right "pointer" toward left while (left < right && data[left] < data[right]) right--; if (left < ri...
7
public DatagramURL(String url) throws MalformedURLException { if (url == null) { throw new MalformedURLException("URL is null"); } if (!url.startsWith("udp://")) { throw new MalformedURLException("URL is not using the udp protocol"); } int portSep = url.indexOf(':', 6); if (portSep == -1) { t...
6
public void setAttribute(String nazwa, String wartosc) { DataRow parametry = new DataRow(); parametry.setTableName(nazwa); parametry.addAttribute("name", wartosc); for(AbstractAttribute atrybut : attributes) { if(atrybut.getType().equals(nazwa)) { ...
3
public static void main(String [] args) { boolean done = false; for (int a = 1; a < 1001 && !done; a++) { for (int b = 1; b < 1001 && !done; b++) { for (int c = 1; c < 1001 && !done; c++) { if (a+b+c == 1000 && (a*a + b*b == c*c)) { System.out.println(a*b*c); System.out.println("a,b,c" + a +...
8
private static void rsaEncGenKeysText(CryptobyConsole console) { scanner = new Scanner(System.in); String privateKey; String publicKey; // Set Default Key Size keySize = 1024; do { System.out.println("\n"); System.out.println("Choose Key Size in ...
7
public void writeError(String toWrite, Boolean severe) { if (severe) { if (toWrite != null) { this.log.severe(Assignment.logPrefix + toWrite); } } else { if (toWrite != null) { this.log.warning(Assignment.logPrefix + toWrite); } } }
3
public static void main(String[] args) { // TODO code application logic here long startTime = 0, elapsedTime = 0; // Parses the command line arguments and collects all data in memory Util sudoku = new Util(args); // Constructs Sudoku Boards and stores them in an array Sudoku...
5
public static List<Article> selectArtcile() { String query = null; List<Article> listearticle = new ArrayList<Article>(); ResultSet resultat; try { query = "SELECT * from ARTICLE "; PreparedStatement pStatement = (PreparedStatement) ConnectionBDD.getInstance().ge...
2
private String scan(OCRImage image, String identifier, boolean spaces, int spaceDistance, int brightness, double tolerance) { ArrayList<CharacterDataMap> temp = getCharacterArray(image, brightness, spaces, spaceDistance); ArrayList<CharacterDataMap> characters = characterMap.get(identifier); String str = ""; fo...
8
public void setResteAFaire(double resteAFaire) throws IllegalArgumentException{ // La user story est modifiée uniquement si son statut est planifié et que le resteAFaire est > 0 if(this.getEtatUserStory() == EtatUserStory.PLANIFIEE && resteAFaire>=0){ this.resteAFaire = resteAFaire; this.setChanged(); ...
3
public static boolean inAWTEventThread() { try { return javax.swing.SwingUtilities.isEventDispatchThread(); } catch (Throwable e) { return false; } }
1
private synchronized void processOutputs() { try { // write status - this has the highest transmission priority, thus it is executed first if thread gets interrupted early hmi.dataOut.writeInt(Command.OUT_STATUS.ordinal()); hmi.dataOut.writeInt(GuidanceAT.getCurrentStatus().ordinal()); hmi.dataOut.f...
6
private boolean clickedOnAcePile(MouseEvent e) { return e.getX() >= X_BOARD_OFFSET + CARD_WIDTH * 6 + CARD_X_GAP * 6 && e.getX() <= X_BOARD_OFFSET + CARD_WIDTH * 7 + CARD_X_GAP * 6 && e.getY() >= Y_BOARD_OFFSET && e.getY() < Y_BOARD_OFFSET + CARD_HEIGHT * 4 + CARD_Y_GAP * 3; }
3
private void checkCollision(){ for (int i= 0; i < 4; i++){ int pX= this.player.getX(); int pY= this.player.getY(); int gX= this.ghosts[i].getX(); int gY= this.ghosts[i].getY(); if ((pX == gX) && (pY == gY)){ if (this.ghosts[i].isEatenBy(this.player)) killGhost(i); else { this.isDead= ...
4
public void performSaveAsCommand() { JFileChooser fileChooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter( "Timeflecks Database Files", "db"); fileChooser.setFileFilter(filter); boolean success = false; do { int returnVal = fileChooser.showSaveDialog(menu); ...
6
public static int RentsPerMonth(String monthYear) { try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } int x =0; //ophalen van de data uit de db....
5
private void dropClient() { if (anInt1011 > 0) { processLogout(); return; } gameScreenCanvas.initDrawingArea(); aFont_1271.drawANCText(0, "Connection lost", 144, 257); aFont_1271.drawANCText(0xffffff, "Connection lost", 143, 256); aFont_1271.drawAN...
3
@Override public final double days(final GregorianCalendar from, final GregorianCalendar to) { if (0 < from.compareTo(to)) return -this.days(to, from); final GregorianCalendar f = this._Adjust(from); final GregorianCalendar t = this._Adjust(to); double difference = Time...
5
public Map<Integer, Restaurant> readCSVFile(String csvFile) { Map<Integer, Restaurant> restMap = new ConcurrentHashMap<Integer, Restaurant>(); BufferedReader br = null; String line; try { br = new BufferedReader(new FileReader(csvFile)); while ((line = br.readLine()) != null) { String[] csvLine = line...
6
public BusStop(int busStopNumber) { //initialize the bus stop busStop = new PriorityQueue<Person>(); //set the initial priority at stop priority = 0; //set the bus stop number this.busStopNumber = busStopNumber; //set minimum passenger this.minimumPass...
0
public int getWidth() { return width; }
0
public void build () throws ExceptionInvalidParam { if (upperAngleBound <= lowerAngleBound || upperHeightBound <= lowerHeightBound || destWidth <= 0 || destHeight <= 0 || sourceModule == null || destNoiseMap == null) throw new ExceptionInval...
8
public void sendServerMessage(String message) { for (int i = clients.size() - 1; i >= 0; i--) { clients.get(i).getWriter().println("伺服器公告:" + message + "(廣播)"); clients.get(i).getWriter().flush(); } }
1
@Override public State nextState(Random random) { State newState; int value = random.nextInt(100); if (Utils.isBetween(value, 0, P_NM)) { newState = new Modified(); } else if (Utils.isBetween(value, P_NM, P_NU)) { newState = new Unmodified(); } else { newState = new Deleted(); } retu...
2
public String getQuote(){ String quote = null; try { crs = qb.selectFrom("qotd").all().executeQuery(); if(crs.next()) { quote = crs.getString("qotd"); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crs.close(); } catch (SQLException e) { e.printStackTrace(); ...
3
public static List<Tag> constructTags(Response res) throws WeiboException { try { JSONArray list = res.asJSONArray(); int size = list.length(); List<Tag> tags = new ArrayList<Tag>(size); for (int i = 0; i < size; i++) { tags.add(new Tag(list.getJSONObject(i))); } return tags; } catch (JSONExce...
3
@EventHandler public void onPlayerDamage(EntityDamageByEntityEvent e) { if (invulnerable) if (e.getEntity().getType() == EntityType.PLAYER) if (this.getPlayers().contains(e.getEntity())) e.setCancelled(true); }
3
@Override public void mouseClicked(MouseEvent e) { if(e.getButton() == MouseEvent.BUTTON3) ColorUsedPanel.this.model.setColor(c); else if(e.getButton() == MouseEvent.BUTTON1){ AlienFXProfile profile = profileModel.getProfile(); Color changedColor = c; if(profile != null){ for(AlienFXProfile...
7
@Override public boolean accept(File file) { if (this.isExtension) return file.getName().toLowerCase().endsWith(this.keyword); return (file.getName().toLowerCase().indexOf(this.keyword) >= 0); }
1
protected BufferedImage getScaledUpInstance(BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean higherQuality) { int type = BufferedImage.TYPE_INT_ARGB; BufferedImage ret = (BufferedImage) img; int w, h; if (higherQuality) { // Use multi-step technique: start with original size...
9
public String[] dataCacheToArray(ArrayList <String> dataCache, String dataField){ /* * @param: (ArrayList <String> dataCache, "link" || "seed" || "leech" || "size") * example (BuildDataCache(String[] foo), "size")) will return all the torrent sizes in a string array. * Parses the SizeStats ArrayList into...
6
public Polygon2D deleteVertexBefore(int k) { int n = vertex.length; if (n < 4) return this; float[] x = new float[n - 1]; float[] y = new float[n - 1]; if (k > 0 && k < n) { for (int i = 0; i < k; i++) { x[i] = vertex[i].x; y[i] = vertex[i].y; } for (int i = k + 1; i < n; i++) { x[i - ...
7
protected static void extractComments(Metadata metadata, XHTMLContentHandler xhtml, VorbisStyleComments comments) throws TikaException, SAXException { // Get the specific know comments metadata.set(TikaCoreProperties.TITLE, comments.getTitle()); metadata.set(TikaCoreProperties.CREATO...
6
private List<RouteLeg> createRoute(String string) { List<RouteLeg> route = new ArrayList<RouteLeg>(); for (int index = 1; index < string.length(); index++) { route.add(new RouteLeg(string.substring(index-1, index), string.substring(index, index+1))); } return route; }
1
public void input(ArrayList<Action> history, int handStrength) { int numRaises = 0; for(Action a : history) { if(a == Action.RAISE) { numRaises++; } } int ahs = adjustedHandStrength(handStrength); if(historyToHandStrength.get(numRaises) == null) { int[] histogram = new int[] {0,0,0,0,0,0,0,0,0...
4
public void rebondProjectilesStructures(Projectiles proj, Structures struc) { if (proj.getPosition().getX() + proj.getBound().getX() > struc.getPosition().getX() && proj.getPosition().getX() < (struc.getPosition().getX() + struc.getBound().getX()) && proj.getPosition().getY() + proj.getBound().getY() > struc.getPosit...
6
private static EnumOS2 getOS() { String s = System.getProperty("os.name").toLowerCase(); if (s.contains("win")) { return EnumOS2.windows; } if (s.contains("mac")) { return EnumOS2.macos; } if (s.contains("solaris")) { return EnumOS2....
6
private void objectString(J_PositionTrackingPushbackReader var1, J_JsonListener var2) throws J_InvalidSyntaxException, IOException { char var3 = (char)this.readNextNonWhitespaceChar(var1); if(var3 != 123) { throw new J_InvalidSyntaxException("Expected object to start with { but got [" + var3 + "]."...
5
private InterfaceCommand getCommand(DebuggerVirtualMachine dvm) { UserInterface.print(": "); StringTokenizer tokenizer = null; InterfaceCommand command = null; try { tokenizer = new StringTokenizer((new BufferedReader(new InputStreamReader( ...
5
protected int setArmorModel(EntityPlayer par1EntityPlayer, int par2, float par3) { ItemStack var4 = par1EntityPlayer.inventory.armorItemInSlot(3 - par2); if (var4 != null) { Item var5 = var4.getItem(); if (var5 instanceof ItemArmor) { Ite...
9
private void sortEntitiesToMap() { // Iterate the entities that need rendered and check if they're // visible for (Entity entity : entityList) { Spatial entitySpatial = entity.getComponent(Spatial.class); // I'll obviously offer an overloaded contains method for // spatials in the future (potentially) ...
2
@Override public Long getSocialId() { return socialId; }
0
@EventHandler public void BlazeRegeneration(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.getBlazeConfig().getDouble("Blaze.Regen...
6
public Map<String, Link> makeLinkMap(Map<String, Mass> massMap){ Map<String, Link> linkMap = new HashMap<String, Link>(); NodeList[] linkArray = {springs, muscles}; for (NodeList linkType: linkArray){ for (int i = 0; i < linkType.getLength(); i++) { Node node = linkType.item(i); if (node.getNodeType...
4
public void setCurrentLine(int lineNumber) { environmentStack.peek().setCurrentLineNumber(lineNumber); }
0
@EventHandler public void onInteract(PlayerInteractEvent e){ Player p = e.getPlayer(); if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && p.getWorld().getName().equalsIgnoreCase("kitpvp") && e.getClickedBlock().getState() instanceof Sign){ Sign sign = (Sign) e.getClickedBlock().getState(); if(sign.getLine(...
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Activity other = (Activity) obj; if (project == null) { if (other.project != null) return false; } else if (!project.equals(other.projec...
9
public static final void copyDirectory(File source, File destination) throws IOException { if (!source.isDirectory()) { throw new IllegalArgumentException("Source (" + source.getPath() + ") must be a directory."); } if (!source.exists()) { throw new IllegalArgumentException("Source directory (" + sour...
5
public static GetProjects_Result getProjects(Database database, GetProjects_Param params) { Logger.getLogger(API.class.getName()).log(Level.FINE, "Entering API.getProjects()"); GetProjects_Result result; try { ValidateUser_Result vResult = validateUser(database, new Validate...
5
public static void main(String[] args) { //Define loop to go through each number for (int i = 2; i <= 69; i++) { //if i is less than 20 and divisible by 2 if (i <= 20 && i % 2 == 0) { //output number System.out.println(i); //if i is between 21 and 41, and has been incremented by 3 } else if (i ...
9
public static void swapWords(Text text) { log.trace("Subtask N5"); LinkedList<Sentence> allElements = (LinkedList<Sentence>) text.getAllElements(); for (Sentence sentenceOrListing : allElements) { if (sentenceOrListing.getClass() != Listing.class) { int indexFirst = 0...
6
public JSONObject countMetadataColors(JSONObject[] countMetadata, Color[] colors, float[] weights) throws TinEyeServiceException { MultipartEntity postEntity = new MultipartEntity(); JSONObject responseJSON = null; if (weights.length > 0 && colors.length != weights.length) ...
6
public void actionPerformed(ActionEvent e) { String nick = GUIMain.userList.getSelectedValue().toString(); if (nick.startsWith("@")) { nick = nick.replace("@", ""); } else if (nick.startsWith("$")) { nick = nick.replace("$",...
5
private void updateBalance(TextField operation, BigDecimal value) throws IOException{ if(operation.equals(addField)){ balance = balance.add(value); } else if(operation.equals(subtractField)){ balance = balance.subtract(value); } balance = balance.setS...
2
public static void ConstructBox(int side) { for (int i = 1; i <= side; i++) { if (i == 1 || i == side) { for (int j = 1; j <= side; j++) { System.out.print("$ "); } } else if (i != 1 || i != side) { for (int k = 1; k <= side; k++) { if (k == 1 || k == side) { ...
9
public float calculate(List<Book> liste) { float result = 0f; try { List<BundleBook> listBundleBook = new ArrayList<BundleBook>(); for (Book bookActu : liste) { boolean inserted = false; for (BundleBook bundleActu : listBundleBook) { if (!bundleActu.contains(bookActu)) { bundleActu.addBoo...
6
public void setjScrollPane1(JScrollPane jScrollPane1) { this.jScrollPane1 = jScrollPane1; }
0
public IToken nextToken() { if (m_currentOffset >= (m_docOffset + m_docLength)) { return Token.EOF; } IToken result = Token.UNDEFINED; int startOffset = m_currentOffset; int length = 0; try { // Get line information IRegion lineRegion ...
9
public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and fe...
6
public void setFrame(int frameNum, byte[] theFrame) throws SoundException { if(frameNum >= getAudioFileFormat().getFrameLength()) { printError("That frame, number "+frameNum+", does not exist. "+ "The last valid frame number is " + (getAudioFileFormat().getFrameLength(...
3
public byte[] encrypt(byte[] input) { int kl = key.length, il = input.length; int iterations = il / kl; if(il % kl > 0) iterations++; for(int i = 0; i < iterations; i++) { byte[] keystream = new byte[kl]; salsa20.crypto_stream(keystream, kl, nonce, 0, key); int lim = (i+1) * kl; // In the la...
4
private List<SpriteInfoBlock> parseMetadata(String data) throws IOException { // Prepare a "syntax tree" to return List<SpriteInfoBlock> nodes = new ArrayList<SpriteInfoBlock>(); // Split the metadata into individual lines and parse them individually String[] lines = data.split("\n"); for(String line :...
4
public ArrayList<DonneeArgos> getPositions() { return positions; }
0
public void updateTimePanel () { panelStartTime.removeAll(); JPanel tripComponentPanel = new JPanel (new GridBagLayout ()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; for (Object o: tripListModel.toArray()) { TripComponent tc = ...
1
@Override public boolean equals(Object obj) { Point p = (Point)obj; if(this.type== p.type && Math.abs(this.x - p.x) < 0.00001 && Math.abs(this.y - p.y) <0.00001 && this.a.id == p.a.id){ if(this.b != null && p.b != null) { return (this.b.id == p.b.id)?true:false; } else if(thi...
9
public void start() { ticks=System.currentTimeMillis(); }
0
public Object nextContent() throws JSONException { char c; StringBuilder sb; do { c = next(); } while (Character.isWhitespace(c)); if (c == 0) { return null; } if (c == '<') { return XML.LT; } sb = new StringBuil...
7
public static boolean checkSumUsingHash(int[] A, int x) { // Time complexity - O(n) if(A == null || A.length < 2) return false; int i, flag = 0; Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for(i = 0; i < A.length; i++) map.put(A[i], i); for(i = 0; i < A.length; i++) { if(map.get(x - ...
7
private void start() { try { System.out.println("Accepting connections."); while (true) { // recieve new connections net = new Network(this, ssocket.accept()); Thread t = new Thread(net); t.start(); } } c...
2
Node applyExtensionRule2( Node node, int edgeLabelBegin, int edgeLabelEnd, int pathPos, int edgePos, Rule2Type type ) throws MVDException { Node newLeaf,newInternal,son; // newSon if ( type == Rule2Type.newSon ) { if ( debug ) System.out.println("rule...
5
@Override public void Lands (Player P) { //If nobody owns it if (Owner == -1) { //Ask if you want to buy. Game.requestBuy(P, this); } //If you land on enemy players shipping line else if (Owner != Game.players.indexOf(P)) { ...
7
public static boolean isSimilarDel(String a, String b, int similarityAcceptError) { a = Normalizer.normalize(a, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").toUpperCase(); b = Normalizer.normalize(b, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").toUpperCase(); if (a.equals(b)) return true; retur...
1
@Override public String toString(){ return "CellCreature("+ID+")"; }
0
private static boolean loadConfig() { File file = new File(configFilename); serverList = defaultServerList; port = defaultPort; authList = new HashMap<String, String>(defaultAuthList); if (file.exists()) { System.out.print("Load config ... "); Document doc = null; try { DocumentBuilderFactory fac...
5
public double outputValue(boolean calculate) { if (Double.isNaN(m_unitValue) && calculate) { if (m_input) { if (m_currentInstance.isMissing(m_link)) { m_unitValue = 0; } else { m_unitValue = m_currentInstance.value(m_link); } } else { //node is an output. m_unitValue = 0...
7
public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter number of rows for a matrix operation"); int rows = Integer.parseInt(reader.readLine()); System.out.println("Please enter number of columns f...
8
final void method3940(int i) { if (anIDirect3DVertexShader9794 == null && ((((DirectxToolkit) this).aClass251Array8113 [((DirectxToolkit) this).anInt8175]) != Class348_Sub42_Sub18.aClass251_9685)) { if (Class239_Sub18.aClass251_6030 == (((DirectxToolkit) this).aClass251Array8113 [((Dire...
5
public String batchSubscribe(final BatchSubscription batchSubscription) throws MailChimpException { return post("/lists/batch-subscribe", batchSubscription, new Function<BatchSubscription, String>() { @Override public String apply(BatchSubscription input) { return gson.toJson(input); } }); ...
0
public int getResult() { sqrs.add(1); sqrs.add(4); for (int sum = 6; ; sum++) { if (sum % 300 == 0) { System.out.println(sum + " debug "); System.out.println(sqrs.size() + " siize "); } for (int i = sum - 3; i > sum / 2; i--) { ...
8
@Override public boolean hasNext() { if(current!=null){ return current.getNext()!=null; }else{ return false; } }
1
public void run() { for(;;) { try { ++x; if(x==(wd)) x=0; repaint(); Thread.sleep(20); if(stopflag) break; }catch(Exception ee){} } }
4
@Override public JSONObject main(Map<String, String> params, Session session) throws Exception { JSONObject rtn = new JSONObject(); try { JSONArray jaUserId = new JSONArray(params.get("aUserId")); long[] aUserId = new long[jaUserId.length()]; for(int i=0;i<jaUserId.length();i++) { aUserId[i] = ja...
2
public static double dist(Mat src1, Mat src2, NormType normType) { assert(src1.cols == src2.cols && src1.rows == src2.rows); if (src1.isEmpty()) { // is this proper way? return norm(src2, normType); // if src1 is empty , return norm of src2 } if (src2.isEmpty()) { ...
8
public void visitTypeInsn(final int opcode, final String type) { buf.setLength(0); buf.append(tab2).append(OPCODES[opcode]).append(' '); appendDescriptor(INTERNAL_NAME, type); buf.append('\n'); text.add(buf.toString()); if (mv != null) { mv.visitTypeInsn(opcode, type); } }
1
@Override public void startSetup(Attributes atts) { super.startSetup(atts); addActionListener(this); }
0
@Override public void mouseClicked(MouseEvent e) { if(isEmpty()) { return; } for(UIElement ui : uiElements) { if(e.isConsumed()) { return; } if(ui.getBoundsAsRect().contains(((MouseEvent) e).getPosition())) { ui.fireEvent(e); } } e.consume(); }
4
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TestIntervalCategoryDataset)) { return false; } TestIntervalCategoryDataset that = (TestIntervalCategoryDataset) obj; if (!getRowKeys().equals(...
9
private void print() { if ( ( getCurrentTreePanel() == null ) || ( getCurrentTreePanel().getPhylogeny() == null ) || getCurrentTreePanel().getPhylogeny().isEmpty() ) { return; } if ( !getOptions().isPrintUsingActualSize() ) { getCurrentTreePanel().setParam...
9