method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
7570afd3-bf2b-4851-bd96-b5510bfc0530
2
@Override public void selectionAboutToChange() { if (mNotifyOfSelections) { OutlineModelListener[] listeners = getCurrentListeners(); for (OutlineModelListener element : listeners) { element.selectionWillChange(this); } } }
765602b9-26e4-411d-b71e-61f6c0719b98
0
private static Point middle(Point left,Point right){ return new Point((left.x+right.x)/2,(left.y+right.y)/2); }
65fe7b35-5fa5-4ed7-b895-9df2d62daf72
9
public void tampilkanDaftarPembeli(){ if (!daftarPembeli.isVisible()){ DaftarPembeli.listPembeli = pembeli.bacaDaftar(); daftarPembeli = new DaftarPembeli(null, true); daftarPembeli.setVisible(true); if (!DaftarPembeli.no_beliDipilih.equals("")) { ...
b2685d44-8011-44f7-9e8a-5e62968c0e17
2
public PowerRankingStrategy(int index, AGGRESSIVITY aggressivity) { playerID = index; this.aggressivity = aggressivity; thresholds = new CardPower[AGGRESSIVITY.values().length][]; for (int i = 0; i < thresholds.length; i++) { thresholds[i] = new CardPower[raiseIndex+1]; for (int j = 0; j < thresholds[i].l...
eb4d9742-7955-4ad7-989e-7f284ae16e5e
7
public Matrix rref() { Double[][] mat = new Double[row][col]; matrixCopy(matrix, mat); int j = 0; for (int i = 0; i < row && j < col; i++) { for (; j < col; j++) { if (mat[i][j] == 0) // pivot can't be 0 { int swap = determineRowSwap(mat, i, j); if (swap == -1) // no pivot in this ...
b87f23af-c52b-47c9-8474-6c5302a786cd
2
private void generateJSCoverFiles(File destDir, String version, boolean isServer) { if (!destDir.exists()) destDir.mkdirs(); copyResourceToDir("jscoverage.css", destDir); String reportHTML = generateJSCoverageHtml(version); ioUtils.copy(reportHTML, new File(destDir, "jscove...
9b14ca08-6b27-459b-9fd6-4750b33fcd70
2
private void relax(EdgeWeightedDigraph G, int v) { for (WeightedDirectedEdge e : G.adj(v)) { int w = e.to(); if (distTo[w] > distTo[v] + e.weight()) { distTo[w] = distTo[v] + e.weight(); edgeTo[w] = e; } } }
8542d738-dca3-4cfc-9aaa-23eb329272c5
2
public int getCursor(MouseEvent me) { Component c = me.getComponent(); int w = c.getWidth(); int h = c.getHeight(); for (int i = 0; i < locations.length; i++) { Rectangle rect = getRectangle(0, 0, w, h, locations[i]); if (rect.contains(me.getPoint())) return cursors[i]; } return Cursor.MOVE_CUR...
89c38e6e-4072-4e10-94b1-2482e40c1b2e
6
public int Update(ArrayList<QueryCriteria> criteria, HashMap<String, String> fields) { this.DBConn = new DBHelper(); String whereClause = "", fieldsStr = "", QueryStr; for (int i = 0; i < criteria.size(); i++) { if (!whereClause.equals("")) { whereClause += "and"; ...
d2c6bf5f-a4f5-4430-8ba6-c2013f8ed3fc
8
public void bigBet(int bet, int... num) { for (int num1 : num) { if ((money > 0 && bet <= money && bet >= 0) && (num1 == 6 || num1 == 8)) { if (combinedRoll == 7) { player.loseMoney(bet); info.updateMoney(); } else if (combinedRoll == num1) { player.addMoney(bet); info.updateMoney(...
ac3252ef-deb1-4403-ac13-4f1dc3fd1e94
2
public boolean isPackage() { return (!isPublic() && !isPrivate() && !isProtected()); }
205290e0-9c2e-4121-b616-408dcea012c8
2
public boolean isFinished(){ for(String s : neededItems){ if(s!=null)return false; } return true; }
29084329-5200-47b4-b352-ffdd1eb7c99e
8
public static int[][] read() throws IOException { List<int[]> board = new ArrayList<int[]>(); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(System.in)); String line; while ((line = bufferedReader.readLine()) != null) { String[] places = line.split(" "); int[] row = new i...
8548b71c-98ef-4a7b-b279-bf6321a5a53e
0
public InvalidFrameNumberException(Exception e, String name){ super(e, name); }
644bf690-995a-449e-8173-092cc9621ba9
9
@Override public SimpleNode getPeer(final SimpleNode from) { /* Build probability array if it does not already exist. * * Find normalizing constant for this node - sum distance probabilities so that they * they are in non-decreasing order and may be searched through to find the closest link. * Note that ...
e7644908-e374-46de-8ebe-78394ccca24d
2
private static String readFile(File archivo) throws IOException { String resultado = null; BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(archivo))); resultado = reader.readLine(); } finally { if (reader != null){ try { reader.close(...
2bdd624b-a702-40d8-9607-8b7d5a67b512
2
private static ArrayList<String> getFilenames(String newFilePath) { File folder = new File(newFilePath); File[] shit = folder.listFiles(); ArrayList<String> returnList = new ArrayList<String>(); if(!newFilePath.equals("")) { for(int i = 0; i < shit.length; i ++) { ...
c77cfe46-f473-4f2b-893f-1830878428de
5
public String stFacebookSharingVerification(int dataId,int ExpVal,String flow ) { int actVal=1000; String returnVal=null; hm.clear(); hm=STFunctionLibrary.stMakeData(dataId, "Post"); String url = hm.get("URL"); String newwindowtitle = hm.get("NewWindowTitle"); String sharingtitle = hm.get("Sh...
8c0915c4-8dc5-4039-bac1-05ca2d8691d2
9
Handle init(int sampleCount, int minimumBuffers, int preferredBuffers) throws InterruptedException { if (sampleCount < 1) { throw new IllegalStateException("Sample count should be at least one"); } if (minimumBuffers < 1) { throw new IllegalArgumentException("Minimum buffers must be at least 1"); } if (...
82500364-0125-451f-9618-c2a3e5e9623e
2
public String getLine(int index) { if (index < 0 || index >= this.pic.length) { return null; } return this.pic[index]; }
21927ce4-741c-4978-80cd-c0a65f5c0dab
1
* * @throws IOException if a communications error occurs * @throws UnknownHostException if the Cyc server cannot be found * @throws CycApiException if the Cyc server returns an error */ public CycConstant getKnownConstantByName(String constantName) throws UnknownHostException, IOException, CycAp...
d08e4965-9418-42e0-a1e5-1fa10a7fd8cd
2
public void setGraphicalDetailLevel(int detailLevel) { if (detailLevel < 0 || detailLevel > 2) { throw new IllegalArgumentException("Graphical detail level must be set to an integer between 0 and 2, inclusive!"); } notifyListeners(new PropertyChangeEvent(this, "graphicalDeta...
fe8c39f4-b33e-4c91-b02e-825665eaecea
9
@SuppressWarnings("unchecked") public float read(float[] leftBuf, float[] rightBuf, int readRate) { if (buf.length != leftBuf.length) buf = new float[leftBuf.length]; if (sounds.size() > maxChannels) { Collections.sort(sounds); } Arrays.fill(leftBuf, 0); ...
89d3107d-cfae-4555-a1e7-1167febb2653
8
private void botaoConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoConsultarActionPerformed try { idoso = (Idoso) comboBoxIdoso.getSelectedItem(); if(idoso != null) { habilitado(true); campoCPFEdicao.setText(idoso.getCpf());...
16535e6c-382c-4e58-b29b-52cc10b98abc
1
public boolean canHaveAsBalance(BigInteger balance) { return (balance != null) && (balance.compareTo(this.getCreditLimit()) >= 0); }
063c3cdb-a230-4903-95d6-551e94e34e55
3
public int getLineLength(int row) { int count = 0; while (count < grid[row].length) { if (grid[row][count].getCharacter() == 0x0a || grid[row][count].getCharacter() == DataGridCel.NullChar) { break; } count++; } retu...
66261f69-b60e-41e6-b029-2b7ab7154f3b
9
public void win(int mode) { removeItem(); int factor = getBossesTotalLevel() * (mode == CLIMBER ? 100 : 10); progress++; if (mode == CLIMBER) { if (progress > maxFloorClimber) maxFloorClimber = progress; } else if (mode == ENDURANCE) { if (progress > maxFloorEndurance) maxFloorEndurance = progre...
bba8fed2-c600-4a40-a251-ab2f329b8d5d
3
public int countLineMineVertical(Board board, char token, int column) { int line = board.getTopPosition(column); int count = 0; while (line >= 0 && board.get(column, line) != opponent) { if (line + 3 <= board.getHeight()) count++; line--; } return count; }
bc76c409-81be-4fe0-b843-c120d5993c0c
6
public void onMouseEvent(int mx, int my, int buttonPressed, boolean released) { if(buttonPressed == -1) { amountScrolled+=Mouse.getEventDWheel()/10; } if(slots != null) { int slotIndex = 0; float slotX = x; float slotY = y-amountScrolled; for(int i = slots.length-1;i>=0;i--) { UISlot sl...
0f48a57e-46f1-4bc2-9c44-e039ba147376
2
public static int getOffsetX(int direction) { if((direction & WEST) != 0) { return -1; } if((direction & EAST) != 0) { return 1; } return 0; }
4e93f558-7a4e-45af-82f0-0ae462213da6
9
public final NiklausParser.declaration_return declaration() throws RecognitionException { NiklausParser.declaration_return retval = new NiklausParser.declaration_return(); retval.start = input.LT(1); CommonTree root_0 = null; NiklausParser.constantdeclaration_return constantdeclaratio...
36d6356e-cc82-4228-a8c7-fae47018aeda
2
@Override public String getId(String strTabla, String strCampo, String strValor) throws Exception { Statement oStatement; ResultSet oResultSet; try { oStatement = (Statement) oConexionMySQL.createStatement(); String strSQL = "SELECT id FROM " + strTabla + " WHERE " + ...
e8f7c94a-9f0e-4e32-bc10-b83f1ab816fe
8
@Override public Figur waehleFigur(String[][] spielfeld) { Figur[] figurenArray = getFigurenArray(); int[][] besterZugJederFigur = new int[figurenArray.length][2]; for (int i = 0; i < figurenArray.length; i++) { ArrayList<int[]> moeglicheZuege = new ArrayList<int[]>(); moeglicheZuege.addAll(figurenArray[i]...
4ba51729-4010-484e-8649-661bb7ed724c
5
@SuppressWarnings("deprecation") public StudentScreen(String name, DB_Init db_table) { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(10, 10, 745, 485); contentPane = new JPanel(); contentPane.setBackground(Color.DARK_GRAY); contentPane.setBorder(UIManager.getBorder("FileChooser.listViewBorder"...
9eb40ccd-1b4e-4308-b1e3-8fe8c858b1ff
9
@Override public void unInvoke() { if(canBeUninvoked()) if((affected!=null)&&(affected instanceof Item)) { final Item item=(Item)affected; if((item.owner()!=null) &&(item.owner() instanceof MOB) &&(((MOB)item.owner()).isMine(item))) { final MOB mob=(MOB)item.owner(); mob.tell(L("@x1 grows...
05470cf7-dbbe-4ea7-af6e-391a9c4828d0
1
public void addNode(int pos, long nodeId){ if (nodes.size()>pos) nodes.get(pos).add(nodeId); }
66313ad1-535b-49ab-8532-684de5f023ee
5
public void testPeriodic() { if (oi.getGunS() > 0.5) { drive.TimerMove(0.3, 0.75); drive.TimerMove(-0.3, 0.75); } long milis = (long)(1.5 * 1000); long time = System.currentTimeMillis(); while (System.currentTimeMillis() < time + milis) conveyor.setConveyor(1); time = System.currentTimeMi...
765e4646-5e43-47c0-ae84-834061158313
5
private int[][] getPixelData() { final byte[] pixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData(); final int width = image.getWidth(); final int height = image.getHeight(); final boolean hasAlphaChannel = image.getAlphaRaster() != null; int[][] result = new int[height][width]; if (hasAl...
f3adcd44-861f-480a-9f42-57b6ad5d9f18
3
public void sendHandshake() { // Commence the handshaking recieved_message = new byte[68]; try { to_peer.write(Message.handshake(info_hash, my_id)); to_peer.flush(); } catch (IOException e) { // TODO Auto-generated catch block System.err.println("peer(" + peer_ip + ")" + e.getMessage()); e.printS...
3ca2877a-1888-431b-9e6e-31bef12cdd2a
6
public UserVO getOperator(UserVO userVO) throws LibraryManagementException { ConnectionFactory connectionFactory = new ConnectionFactory(); Connection connection; try { connection = connectionFactory.getConnection(); } catch (LibraryManagementException e) { throw e; } ResultSet resultSet = null; ...
2056341a-1e0b-41d6-87dd-d0ed220903a6
0
public GameServerSocket() { }
363cb638-7bd0-4acc-b2b9-d6ca4974b976
9
public final Model getModel(String var1) { return (Model)(var1.equals("humanoid")?this.human:(var1.equals("humanoid.armor")?this.armoredHuman:(var1.equals("creeper")?this.creeper:(var1.equals("skeleton")?this.skeleton:(var1.equals("zombie")?this.zombie:(var1.equals("pig")?this.pig:(var1.equals("sheep")?this.sheep...
eb71b0d7-814f-47d4-9c64-3a9671e1a38d
2
public static void disposeFonts() { // clear fonts for (Font font : m_fontMap.values()) { font.dispose(); } m_fontMap.clear(); // clear bold fonts for (Font font : m_fontToBoldFontMap.values()) { font.dispose(); } m_fontToBoldFontMap.clear(); }
e2628367-1849-48fe-afcd-042572067094
9
public static Moves getNeededMovesToKeepExpansionGoing(BotState state, SuperRegion superRegion) { Moves out = new Moves(); // Calculate the region with the highest amount of idle armies. Region biggestStackRegion = null; int biggestIdleStack = 0; for (Region neutralRegion : superRegion.getNeutralSubRegions(st...
1f9d3d68-0679-4336-8676-2f62778a2138
8
public static Stella_Object accessClassificationCacheSlotValue(ClassificationCache self, Symbol slotname, Stella_Object value, boolean setvalueP) { if (slotname == Logic.SYM_LOGIC_INFERABLE_DIRECT_SUBDESCRIPTIONS) { if (setvalueP) { self.inferableDirectSubdescriptions = ((List)(value)); } ...
5a0536a4-d53b-489c-960a-70a9f0e12923
4
@Override public boolean importData(TransferSupport support) { boolean accept = false; if (canImport(support)) { try { Transferable t = support.getTransferable(); Object value = t.getTransferData(RosterTransferComponent.ROSTER_COMPONENT_DATA_FLAVOR); ...
45f5498a-e13b-4558-bf00-6ade45d04102
0
public int getComboYear() { return combo1.getSelectedIndex() + 1900; }
2dcafaba-659f-416d-8b4d-229aed709f10
6
public int compareTo(Version arg) { final long minNums = Math.min(nums.length, arg.getVersionNumbers().length); int diff = 0; for (int i = 0; i < minNums; i++) { if (nums[i] > arg.getVersionNumbers()[i]) { diff++; ...
eeeb722b-07d8-4d39-9c92-b7a18ba6af0f
3
public static Entity createEntity(int var0, World var1) { Entity var2 = null; try { Class var3 = (Class) IDtoClassMapping.get(Integer.valueOf(var0)); if (var3 != null) { var2 = (Entity) var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1})...
876934d2-4868-4697-9c85-9e342d8f14a0
8
@Override public LegalWarrant getCopkiller(Area A, LegalBehavior behav, MOB mob) { final String[] copKillerInfo=basicCrimes().get("MURDER"); if(copKillerInfo!=null) { for(int i=0;i<warrants.size();i++) { final LegalWarrant W=warrants.elementAt(i); if((W.criminal()==mob) &&(W.crime().equals(cop...
f6dedc27-73cc-4cd8-a1e8-c02267c3e428
0
public GyroTurn(double goal, double turnSpeed){ _goal = goal; _turnSpeed = turnSpeed; requires(Robot.driveTrain); }
12bebce2-ec52-496c-bbfd-78d087a05188
9
private Token getAtom(int chr) throws IOException, ParseException { String val = ""; // 単体でアトムを構成 if (",!|".indexOf(chr) != -1) { return new Token( ATOM_STR, String.valueOf((char) chr) ); } // アルファベットのみで構成されるアトムか変数 if (isJavaIdentifierStart(chr)) { do { val += (char) chr; } while (isJavaIdentifierPart...
445dfd27-46ed-480d-aa45-f7a1e5e08897
5
public static boolean isValid(long number) { boolean validity = false; int total; int singleDigitPrefix = (int) getPrefix(number, 1); int doubleDigitPrefix = (int) getPrefix(number, 2); if (prefixMatched(number, singleDigitPrefix) || prefixMatched(number, doubleDigitPrefix)) { if (getSize(number) >= 13...
b29f79fb-a493-4a9a-b3a6-74984595531f
6
@Override public int compareTo(MyNumber o) { if(o instanceof MyInteger) { int num = ((MyInteger)o).getIntegerValue(); if(myFloat > num) return 1; else if(myFloat == num) return 0; else return -1; } else if(o instanceof MyFloat) { double num = ((MyFloat)o).getDoubleValue(); if(myFloat...
7133f2bd-137e-4ea1-a26a-7257e39447dc
5
public omaArrayList<Aim> getMovableDirections(Tile tile) { Tile newTile; omaArrayList<Aim> table = new omaArrayList<Aim>(); Aim[] directions = { Aim.NORTH, Aim.EAST, Aim.SOUTH, Aim.WEST }; for (int i = 0; i < directions.length; i++) { newTile = game.getTile(tile, directions[i]); if (!isTileBlocked(newTile...
7d33d582-71b0-47bc-b241-ed3b42afc8fc
3
public boolean isPointWithin(float x, float y) { return x >= 0 && y >= 0 && (int) x < width && (int) y < height; }
0ea010a3-9f30-40bf-b298-26092cb38fbd
5
private String[] parseJoins() { int startIndex = content.indexOf(WHERE) + WHERE.length(); int endIndex = content.indexOf(GROUP_BY); String[] filters = content.substring(startIndex, endIndex).trim().split(AND); String join = ""; for (String filter : filters) { filter = filter.trim(); for (String op : OP)...
2fdcbe8a-58d9-4508-b561-8532604eda43
2
public static double gammaStandDev(double mu, double beta, double gamma) { if (beta <= 0.0D) throw new IllegalArgumentException("The scale parameter, " + beta + "must be greater than zero"); if (gamma <= 0.0D) throw new IllegalArgumentException("The shape parameter, " + gamma + "must be greater than zero"); retur...
d64237d4-c5f0-4094-a34a-9e818eccdd65
6
private List<ColumnConceptMappingDTO> checkRequiredMapping(final List<ColumnConceptMappingDTO> mappingList, final int verb) throws SitoolsException { final int nbConceptToMap = SimpleSpectralAccessProtocolLibrary.REQUIRED_UCD_CONCEPTS.size(); int nbConcept = 0; final List<ColumnConceptMappi...
bbbab235-5776-419d-aff3-30230f268ab4
2
public static synchronized String getSettingsOption(String opt) { Actions.addAction(new Action(ActionType.LOG, "Setting Requested: " + opt + ".")); if(settings == null) { try { loadSettings(); } catch(SQLException sqle) { sqle.printStackTrace(); } } return settings.get(opt); }
942d77d8-5e34-4b83-9bda-12b8b181d5a0
6
public boolean cadastrarTema(int matriculaAluno, String usuarioProfessor, String decricao) { List<Professor> professoresEncontrados; List<Aluno> alunosEncontrados; Aluno aluno = null; Professor professor = null; Tema tema = new Tema(); professoresEncontrados = (List<Prof...
8f5c0122-bccb-4256-afbc-a78cac6e6049
7
@SuppressWarnings({"unchecked"}) public static <T> Class<? extends T>[] getAllClassesExtending(JarFile jarFile, Class<T> sCls) throws ClassNotFoundException { notNull(jarFile, "JarFile jarFile"); notNull(sCls, "Class<T> sCls"); ArrayList<Class<? extends T>> classes = new ArrayList<Class<? e...
23debdcd-620c-4a71-a2d2-27c038d69c3d
8
@Override public String buscarDocumentoPorFechaEmision(String fechaemi1, String fechaemi2) { ArrayList<Compra> geResult= new ArrayList<Compra>(); ArrayList<Compra> dbCompras = tablaCompras(); String result=""; Date xfechaemi1; Date xfechaemi2; Date f; ...
09a9d629-bfa2-49cd-8734-1f5ba37119d9
6
public static void save(String filename, double[] input) { // assumes 44,100 samples per second // use 16-bit audio, mono, signed PCM, little Endian AudioFormat format = new AudioFormat(SAMPLE_RATE, 16, 1, true, false); byte[] data = new byte[2 * input.length]; for (int i = 0; i...
8bea8060-c561-4ad6-9f33-91e88b83b228
0
public static Filter isStrict() { return new IsStrict(); }
32923429-204c-4a44-80d1-3891d5997993
5
@Override protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { BufferedImage background; BufferedImage end; Graphics2D g2d = (Graphics2D)g; ...
3eb34f23-776c-4c45-a6ed-07e8a3e7f85d
8
@Test public void calculatorIllegalArgs() { IEasyCalculator target = createInstacne(); try { target.calculate("", "1", Operator.ADD); fail("No IllegalArgumentException"); } catch (IllegalArgumentException e) { System.out.println("success"); } catc...
a672b921-d51d-4d62-a929-22d77d6522e1
7
@Override public void run() { if (scores.equals("Null:00")) { scores.getHighscore(); } gui.setup(); gui.getFrame().toFront(); p.setAsteroidAmount(asteroidAmount); p.setGameSpeed(gameSpeed); p.spawnAsteroids(); while (p.getShip().getAlive(...
4b6bc333-6626-48c1-987c-eca037e56a91
4
private void processCountDroppedPkts() { /********************************* System.out.println(super.get_name() + ": COUNT_DROPPED_PKTS event arrived. Clock: " + GridSim.clock() + "Next event will be in (delay) " + (GridSimTags.SCHEDULE_NOW + 3600)); ...
280373aa-1436-4644-a468-836efdb75b0e
9
@Cmd("select") Task select(final @Arg("tree|string:*|Volume and and/or tree specification") String tstring, final @Arg("_flag|r|Regular expression") boolean r) throws Exception { return new Task() { @Override public void runTask() throws Exception { _cu...
c7cda293-1b68-44d2-ac93-f6248b4a42b6
9
private void TryToShipOrder(IncomingOrder incomingOrder, Map<String, Integer> inventoryList) { boolean partialOrder = false; print("the market is now trying to ship the order"); Map<String, Integer> groceryList = incomingOrder.incomingList; Map<String, Integer> outgoingList = groceryList; synchronized(grocer...
2b8117f4-5ec8-4942-9363-b3372396012c
4
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { if(var5 > 0 && Block.blocksList[var5].canProvidePower()) { boolean var6 = var1.isBlockGettingPowered(var2, var3, var4); TileEntityNote var7 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); ...
780ced0c-5763-4b1c-ac36-df90b3c128c6
6
public void writePresentAbsenceDataForR( File file) throws Exception { BufferedWriter writer = new BufferedWriter(new FileWriter(file)); for( int x=0; x < getSampleNames().size(); x++) writer.write( getSampleNames().get(x) + (x < getSampleNames().size()-1 ? "\t" : "\n") ); for( int y=0; y < getOtuNames(...
9ef9a607-2d42-4994-87a5-fcb81e040199
1
public void campaign1Clicked() { WindowStack ws = WindowStack.getLastInstance(); System.out.println(ws); if (ws != null) { WindowCampaign campaign = new WindowCampaign(1); ws.push(campaign); } }
7bae01ae-3b67-4510-b12d-7699579855b9
7
public void testValueCollectionRemoveAllArray() { int element_count = 20; String[] keys = new String[element_count]; int[] vals = new int[element_count]; TObjectIntMap<String> map = new TObjectIntHashMap<String>(); for ( int i = 0; i < element_count; i++ ) { keys[i] ...
d6251ae2-276a-447a-b1a2-ff5b3b5d3379
4
public synchronized void closePath() { // Don't double close path. if ((numSeg != 0) && (types[numSeg - 1] == PathIterator.SEG_CLOSE)) return; // Only close path if the previous command wasn't a moveto if ((numSeg != 0) && (types[numSeg - 1] != PathIterator.SEG_MOVETO)) path.closePath(); makeRoom(0);...
d87ebd47-feb3-44db-ab34-ed486d0ec40f
0
public String getCompanyLab() { return companyLab; }
b778813f-2483-4939-a602-1bd69b778646
0
public double getY2Coordinate() { return y2Coordinate; }
bdc653a8-d131-4382-b5a3-60a22548d27b
9
private void updateS() { int maxIndex = -1; int minIndex = -1; int minValue = S.getActualDuration(); int minWait = S.getWaitDuration(); int minDuration = Integer.MAX_VALUE; //find min value and minimum value grater then S for (int i = 0; i < Sn.length; i++) { if (Sn[i].getActualDuration() < minVa...
76fb9d1e-5f04-4e08-aeb7-a8464600b319
2
public void emitData() { if (Definitions.emitPermission) { byte[] array = new byte[Definitions.byteArraySize]; for (int i = 0; i < Definitions.enemyCounterList.size(); i++) { int x = Integer.parseInt(Definitions.enemyCounterList.get(i).getText()); array[i] = (byte) x; } array[Definitions.byteArray...
ae943e36-dd8f-4f71-a952-e3d4c2eef095
9
public static void main (String args[]) { String[] reprocessData; String[][] reprocessCapData; DataWriter ReprocessCapacity = new DataWriter(); reprocessData = ReprocessCapacity.getReprocessingCapacity(); String temp[] = reprocessData[0].split("\t"); reprocessCapData = new String[reprocessData.length][t...
12410d68-6fe2-4781-89b3-89b7e62b28ee
5
public static boolean hasAngleBetween(double leftAngle, double rightAngle, double testAngle) { if (leftAngle <= rightAngle) { if (testAngle > leftAngle && testAngle < rightAngle) return true; } else { if (testAngle < rightAngle || testA...
ad178878-193b-4129-bdd4-cba3ebd506da
5
public static void main(String[] args) throws Exception { init(); errorLog = new FileWriter("errorLog.txt"); Thread printerThread = new Thread(new Runnable() { @Override public void run() { try { printCnt(); } catch (IOException e) { // TODO Auto-generated catch block e.printStack...
82d21a6c-b7f1-4334-afdd-a83678d4440b
9
public static Color string2Color(String s) throws Exception { ColorCode code = string2ColorCode(s); switch (code) { case Red: return Color.RED; case Blue: return Color.BLUE; case Green: return Color.GREEN; case Orange: return new Color(0xff4800); case Yellow: return Color.YELLOW; case Cya...
2469eb85-c59e-412e-a4fc-59877cb61642
5
public void act(Environment enviro){ applyVelocity(); int entityAmount = enviro.getEntityAmount(); for(int i = 0; i < entityAmount; i++){ Entity indexedEnt = enviro.getEntity(i); if(!(indexedEnt instanceof Bullet) && this != indexedEnt){ if(isCollidedWith(indexedEnt)){ System.out.println(name + " h...
b9117762-6334-402c-b7af-8dce0c35a69c
9
private void parseTorrentsListings(String responce) { Pattern titleFinder = Pattern.compile("<dl[^>]*>(.*?)</dl>", Pattern.DOTALL | Pattern.CASE_INSENSITIVE); Matcher regexMatcher = titleFinder.matcher(responce); StringBuilder xml = new StringBuilder( "<?xml version=\"1.0\" encoding=\"utf-8\"?><data>"); ...
3d56d6e9-da96-4593-ac06-ae2b9412c0d6
4
@Override public Node encode(mxCodec enc, Object obj) { Element node = enc.document.createElement(getName()); if (obj instanceof mxStylesheet) { mxStylesheet stylesheet = (mxStylesheet) obj; Iterator<Map.Entry<String, Map<String, Object>>> it = stylesheet .getStyles().entrySet().iterator(); whil...
f04e96d7-48b7-42ce-bab0-0daca7ef61c9
5
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { config = plugin.getConfig(); if (args.length == 0){ if (sender instanceof Player) { Player player = (Player) sender; if (player.hasPermission("darkcommand.cry")){ if (commandLabel.equalsIgnoreCase("cry"...
469615b5-44a3-4f06-b876-fb01eb3906c0
8
static final Class348_Sub51 method247(int i) { anInt8632++; FileOnDisk class234 = null; Class348_Sub51 class348_sub51 = new Class348_Sub51(Class348_Sub42_Sub8_Sub2.gameType, 0); try { SignlinkRequest class144 = Class348_Sub23_Sub1.signlink.method2233((byte) -46, "", true); while (class144.s...
67b49524-367b-4848-84bf-7bc7fbdcddb8
1
@SuppressWarnings({ "rawtypes", "unchecked" }) public JList getFontFamilyList() { if (fontNameList == null) { fontNameList = new JList(getFontFamilies()); fontNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); fontNameList.addListSelectionListener( ...
b1ebb3b7-4658-4769-83d8-df3e39abd9b3
5
public void setAnimationMode(int newAnimationMode) { if (gui != null) { // enter NO_DISPLAY_CHANGES if (newAnimationMode == HackController.NO_DISPLAY_CHANGES && animationMode != HackController.NO_DISPLAY_CHANGES) { inputPins.disableUserInput(); ...
c17e4c71-ba6f-4b10-a985-2d24ee8b8f7a
9
public static void pressKey(MoveType t) { try { switch (t) { case UP: type(KeyEvent.VK_UP); break; case DOWN: type(KeyEvent.VK_DOWN); break; case LEFT: type(KeyEvent.VK_LEFT); break; case RIGHT: type(KeyEvent.VK_RIGHT); bre...
72068ac3-43ec-4b8f-a111-033d87e8d794
4
void radf5(int ido, int l1, final double cc[], double ch[], final double wtable[], int offset) { final double tr11=0.309016994374947D; final double ti11=0.951056516295154D; final double tr12=-0.809016994374947D; final double ti12=0.587785252292473D; ...
1c0a5627-c481-4176-8e10-cb5b5398c7be
2
private int countCall(final Status status) { int count = 0; for (final CallReport callReport : callReports) { if(status.equals(callReport.getStatus())) { count++; } } return count; }
33eccfc9-5248-4693-a2eb-dd9b6dd0d652
6
@Override public Object getValueAt(int rowIndex, int columnIndex) { Rent rent = rents.get(rowIndex); switch (COLUMNS.values()[columnIndex]) { case ID: return rent.getId(); case CUSTOMER: return rent.getCustomer(); case CAR: ...
b4c136c0-9715-429b-bbbd-01c459846285
1
public UserDao getUserDao(){ if(userDao == null) userDao = new UserDaoImpl(); return userDao; }
6a69ca48-ea31-453b-9cd2-127e6611fc85
7
public boolean check2(int[][] a, int row, int col) { int i = 0; int j = 0; boolean flag = true; while (i < row) { if (a[i++][col] == 1) { flag = false; break; } } while (j < col) { if (a[row][j++] == 1) { flag = false; break; } } while (row >= 0 && col >= 0) { if (a[row--]...
9a85d09a-4314-4b8c-861b-11119162a55c
7
private void jButton1ActionPerformed(ActionEvent evt) { boolean isHuman; int selectedPlayerType = controllerCombo.getSelectedIndex(); if(selectedPlayerType == 0) isHuman = true; else isHuman = false; player = Game.getInstance().createNewPlayer(nameBox.getText(), isHuman); if (player.getName().eq...
718e5022-56eb-4047-9973-149b611b2fd1
9
public void logTaskEnd(final Task<?> task) { if (_planLogger.isTraceEnabled()) { _planLogger.trace(END_TASK_TRACE_FORMAT, new Object[]{_planId, task.getName(), elapsedMillis(task), ResultType.fromTask(task), stringValue(task)}); } else if (_planLogger.isDebu...
92f7e6db-b979-44bd-817c-606d01bd91c5
6
public static void showExceptions(Component parent, Throwable theExc) { Throwable next = null; do { String className = theExc.getClass().getName(); String message = className; if (theExc instanceof SQLException) { SQLException sexc = (SQLException)t...