method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
cfe4e2f6-04f3-4276-b3af-1f7d09d4cb1f
8
public static void main(String[] args) { // TODO code application logic here int Sum = 0; for (int i = 2; i < 1000; i++) { if ((i % 3 == 0) || (i % 5 == 0)) { Sum += i; } } double Su = 0.15 * 25 + 0.5 * 22 + 0.35 * 8; double[][] P1 ...
fbbd4d79-face-4f45-9e7d-ac6907779a75
8
private void btonaceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btonaceptarActionPerformed // Ingreso de Registro if(opcion == 1) { try { String vedoreg = "A"...
f02162ce-b372-4178-af1a-c84acb07d797
1
public boolean setCommandButtonMinHeight(int minHeight) { boolean ret = true; if (minHeight <= 0) { this.buttonCom_MinHeight = UISizeInits.COM_BTN.getHeight(); ret = false; } else { this.buttonCom_MinHeight = minHeight; } somethingChanged(); ...
23d15c35-0dc5-4c34-af35-30c82afb6fab
0
static void printBinaryInt(String s, int i) { System.out.println(s + ", int: " + i + ", binary:\n " + Integer.toBinaryString(i)); }
552429f0-6edf-4f83-b3fc-8ce5cb862db5
9
private void buyTicket(CommandSender sender, String[] args){ if(Perms.hasPerm(sender, Perms.BUY)){ if(BBLottery.economy.getBalance(sender.getName())>=plugin.getManager().getPrice()){ if(plugin.getManager().getRange()!=-1&&args.length>1&&args[1].matches("\\d+")){ int ticketNum=Integer.parseInt(args[1]); ...
276ee1bc-0625-4269-ba9e-751f1dbc5040
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IndividualNetworkAgent other = (IndividualNetworkAgent) obj; if (this.idnumber != other.idnumber) { ...
249e9af8-b3e5-443a-8932-a56553190ded
8
protected static Ptg calcFrequency( Ptg[] operands ) throws CalculationException { Ptg[] firstArr = PtgCalculator.getAllComponents( operands[0] ); Ptg[] secondArr = PtgCalculator.getAllComponents( operands[1] ); CompatibleVector t = new CompatibleVector(); for( Ptg p : secondArr ) { try { Double d ...
00668179-c094-4ae5-a654-8612db4d1aaf
5
public boolean login() { try { String page = ""; final URL url = new URL("http://www.fluid.com/repo/sec/login.php?username=" + username + "&password=" + password); String cookie = getCookie(new URL(url.toString())); URLConnection conn = url.openConnection(); ...
a490b892-4bc4-4a5b-9f04-3526a35c92ba
9
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String pzn = request.getParameter("med"); String anzahl = request.getParameter("anzahl"); String action = request.getParameter("action"); if("remove".equals(action)) { boolean success = fa...
5385eace-e2c8-4eb7-9f0f-680793edac23
5
public static void UpdateGeneratorName(String profile, String oldgenername, String newgenername) { File file = new File(profile); if (file.exists()) { try { // Create a factory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); ...
ff8e7626-e3c6-4490-a20f-bcf0e00b6724
0
public static void main(String[] args) { Bank bank = Bank.getInstance(); System.out.println(bank); System.out.println("-------------------"); Bank bank1 = Bank.getInstance(); System.out.println(bank1); System.out.println("---------====----------"); Bank1 bak1 = Bank1.getInstance(); ...
96b39bc3-7f52-4137-98a5-3d29abad16c4
3
private void carregaProdutos(){ ProdutoDAO daoProduto = new ProdutoDAO(); try { listaProdutos = daoProduto.listarTodos(); } catch (ErroValidacaoException ex) { Logger.getLogger(frmVenda.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialo...
7760a101-1b7e-44bc-9eb9-92f4e3cadbb8
0
public Vector2f setY(float y) { this.y = y; return this; }
c73ab137-2063-407e-a6ec-d41d79982211
8
@Override public void unInvoke() { if(canBeUninvoked()) { if((affected!=null)&&(affected instanceof MOB)&&(!aborted)&&(!helping)) { final MOB mob=(MOB)affected; if(writing.length()==0) commonTell(mob,L("You mess up your engraving.")); else { String desc=found.description(); fi...
0e53542f-44b4-44ce-afe7-b31b17d30340
5
private static int Phi2(int n, List<Integer> primes) { ArrayList<Integer> dividers = new ArrayList<Integer>(); for (Integer prime : primes) { if (n < prime) { break; } if (n % prime == 0) { dividers.add(prime); } } ...
1ea3654b-0a06-4429-afdb-741e95cd5308
9
@Override public int attack(NPC npc, Entity target) { final NPCCombatDefinitions defs = npc.getCombatDefinitions(); int distanceX = target.getX() - npc.getX(); int distanceY = target.getY() - npc.getY(); boolean distant = false; int size = npc.getSize(); Familiar familiar = (Familiar) npc; boolean usingS...
a5426dd2-a9f3-4903-8dee-2f25f90f30dd
3
private int insert(Usuario u) throws SQLException { Connection con = null; PreparedStatement pstm = null; int retorno = -1; try { con = ConnectionFactory.getConnection(); pstm = con.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS); pstm.setStr...
18b2d9ee-42a1-43c7-981a-b1c9b9a0d377
3
protected static InputStream getStream(File file, int flags) throws IOException { InputStream input = new FileInputStream(file); if ((flags & NBTSerializer.BUFFERED) != 0) { input = new BufferedInputStream(input); } if ((flags & NBTSerializer.COMPRESSED) != 0) { input = new GZIPInputStream(input); ...
28dd5903-ac4a-40f7-b4e1-b414d6de0561
1
public int[] generate(int nplayers, int bowlsize) { int nfruits = nplayers * bowlsize; int[] dist = new int[12]; int unit = nfruits / 12; dist[0] = nfruits - unit * 11; for (int i = 1; i < 12; i++) dist[i] = unit; return dist; }
9cf01fea-1e3c-4b30-9e4c-1fc6f8bc6ae8
1
private static Appointment createOneFromResultSet(ResultSet resultSet) throws SQLException { Appointment rtn = new Appointment(); rtn.id = resultSet.getLong("id"); rtn.name = resultSet.getString("name"); rtn.initiatorId = resultSet.getLong("initiatorId"); rtn.venueId = resultSet.getLong("venueId"); rtn.s...
40f1ec47-4232-44c9-ad03-463f8666f096
6
@SuppressWarnings("rawtypes") public SolutionState solve(int timeLimit, int bound) { int n = graph.getNbVertices(); int minCost = graph.getMinArcCost(); int maxCost = graph.getMaxArcCost(); int[][] cost = graph.getCost(); next = new int[n]; Solver solver = new Solver(); ...
ed7d42b9-5d7e-4c37-bbf1-06bf69aedfe3
0
public boolean getColor(){ return color; }
53400f01-e817-4d0a-9586-41d083815697
4
@Override public void run() { // System.out.println("File Listener"); int len = 1; String s = null; while ( true && !isClose ) { try { s = br.readLine(); } catch (IOException e) { e.printStackTrace(); } if ( s != null ) { System.out.println(s); this.writable.write(s); } e...
1ffda07e-822b-4c41-b281-ea1e61445fce
0
public void setAddress(String address) { this.address = address; }
814f078d-36b8-4fab-b7df-0b435bdb79a5
2
public void removePlayer(ServerClientThread player) { players.remove(player); for (actor.Actor a: actors) if (a.getId().getPlayerId() == player.getPlayer().getPlayerId()) actors.remove(a); }
c5002227-c693-4371-a68b-7f03dfee2751
4
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { UserManager UM = new UserManager(ds); String path = req.getRequestURI(); String[] pathComponents = path.split("/"); boolean querySuccess = false; if(pathComponents.length < 3) { resp.setS...
d2ed7336-3bca-4401-9b52-aa3b7a0da3c4
9
public int allocMemory(int blockSize) { //aloca mem�ria sequencialmente. int i = 0, pointer; while (true) { for (; i < size && cell[i] != 0; i++) ; //System.out.println("Found available pointer at " + i); int available = 0; for (; i < size && available < ...
ae7ebcd8-eeb6-42a8-ac12-c2be6bb13e9b
8
public void sampleCustomer(int type, int table) { double d = discount.doubleVal(); double c = concentration.doubleVal(); int[] tsa = tableMap.get(type); int tt = 0; int tc = -1; int zeroInd = -1; for (int i = 0; i < tsa.length; i++) { tc += tsa[i]; ...
0dbeaa80-004b-47c9-a6f0-7970d2442c4f
0
public StatType getType() { return type; }
9290c25e-3a76-4530-b42a-a7c1f9a9025b
7
@Override public void onCommand(String[] preArgs, String[] args) { if(args.length > 0) { showUsage(); return; } int amountOfLeopards = 1; if(preArgs.length > 0 && !(preArgs[0].equals("leopard") || preArgs[0].equals("leopards"))) { try { amountOfLeopards = Integer.parseInt(preArgs[0]); ...
c549ddb4-9a04-4349-9a97-11f57d164c40
9
private void cargarSetPrueba(){ DefaultTableModel temp = (DefaultTableModel) this.tablaSetPruebas.getModel(); String csvFile = "dataset/diabetes_prueba.csv"; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; try { double maximo0 = normalizacion.obtenerMaximo(0, csvFile); doubl...
752cd38e-ad7f-45eb-8f78-3ca3ed7c497f
1
public static void printArray(int array[]){ int i; for (i = 0; i < array.length; i++) { System.out.print(array[i] + " "); } System.out.println(); }
ffbcc786-e214-446a-8335-6b904e32033f
6
protected void checkBits( long value, long bitMask, boolean signed ) throws IOException { if( !signed ) { // Simple, see if we've exceeded the bits if( value != (value & bitMask) ) { error("Number overflow", lastPosition()); } } else if( value > 0 ) { ...
917fcd1f-db29-4a74-950e-9b050b0e6d40
2
static void dfs(int node, ArrayList<ArrayList<Integer>> g, boolean[] visited){ if(visited[node]) return; System.out.printf("StartTime for Node: %d -- %d\n", node, timer++); visited[node]=true; for(int neighbor: g.get(node)){ dfs(neighbor, g, visited); } System.out.printf("FinishTime for Node: %d -- %d\n"...
6d3cd06a-8e63-4c0e-9e28-6842a9c14582
2
private void ifproc(){ mustbe(TK.IF); gcprint("if("); expression(); gcprint(")"); mustbe(TK.THEN); block(); while( is(TK.ELSIF) ) { scan(); gcprint("else if("); expression(); gcprint(")"); mustbe(TK.THEN)...
f50e382e-29be-4022-9d24-320668c7e123
1
public void save(Record transientInstance) { log.debug("saving Record instance"); try { Session session = getSession(); Transaction tr = session.beginTransaction(); session.save(transientInstance); tr.commit(); session.flush(); session.close(); log.debug("save successful"); } catch (RuntimeEx...
15796e8e-9580-461d-b323-8348dfaf7a4d
6
@EventHandler public void PigZombieWeakness(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.getPigZombieConfig().getDouble("PigZomb...
f5be68ed-e003-495d-baa5-7b57b5310a6c
1
public PacketIOException(IOException e, Packet packet) { super("IOException sending packet" + (e == null ? "." : "--" + e.getMessage()), packet); wrappedException = e; }
35795843-69de-4711-bb65-4d786621671c
1
@Override public final void run() { mResizePending = false; setHeaderAndContentSize(getPreferredHeaderSize(), getPreferredContentSize()); if (mResizeRow != null) { scrollContentToY(getRowBounds(mResizeRow).y); mResizeRow = null; } }
9b43cc3b-b466-45ae-9956-35562b4d9c96
0
public void setFatherUrl(String fatherUrl) { this.fatherUrl = fatherUrl; }
787dbe37-56d2-42fd-b582-42b230ed71f1
5
public static int genericAsyncAPICall(String region, String service, String operation, Object[] args) { //Retrieve client for the specified region LoLRTMPSClient client = null; //Set the ID to be assigned to the result value final int localID = ids++; try { client = LoadBalancer.returnClient(region); ...
a61c8819-1cf9-4103-b85f-fbd5949ecf70
6
@EventHandler public void BlazeSlow(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.Slow.DodgeCha...
11f964b8-4774-42fb-82b1-1c9f2fa67e19
1
@Test() public void voidPayment() throws BeanstreamApiException { CardPaymentRequest paymentRequest = getCreditCardPaymentRequest( getRandomOrderId("PEDRO"), "90.00"); PaymentResponse response = beanstream.payments().makePayment( paymentRequest); if (response.isApproved()) { response = beanstream.p...
9ee0ad6b-a31c-40f2-bf3e-a1a942962531
5
public void maxHeapify(int[] array, int i, int heapSize) { int left = leftChild(i); int right = rightChild(i); int largest; //left less than length of array minus 1 //compare current node and two child nodes if (left < heapSize && array[left] > array[i]) { largest = left; } else { largest = i; } ...
2e72742e-59c1-4908-b2b2-16f9e36f1ca1
3
public static String addStencilShape(EditorPalette palette, String nodeXml, String path) { // Some editors place a 3 byte BOM at the start of files // Ensure the first char is a "<" int lessthanIndex = nodeXml.indexOf("<"); nodeXml = nodeXml.substring(lessthanIndex); mxStencilShape newShape = new ...
b4a1f2c4-f566-4c99-87dd-bd32460b94c7
4
private static GameStats populateGameStats(String fileName) throws IOException { Scanner file = new Scanner(new File(fileName)); GameStats gs = null; boolean processPlayerLine = false; int numGames = 0; while (file.hasNextLine()) { String line = file.nextLine(); if (!line.startsWith(COM...
4ba07107-7f93-4f97-af02-94670a503cb3
8
public void run() { while( active && ! board.isGameOver() ) { //get the players move. Player player = getCurrentPlayer(); Move move = player.getMove((Board) board.clone()); if(move == null) { //ignore null moves continue; } //if we are still active, make ...
f25baa7f-5864-417e-a191-0747a8cac4db
8
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!super.okMessage(myHost,msg)) return false; if(!(affected instanceof MOB)) return true; final MOB mob=(MOB)affected; if((msg.amITarget(mob)) &&(msg.targetMinor()==CMMsg.TYP_DAMAGE) &&((msg.tool()==null) ||(!(m...
6c9cbe87-288e-4fa4-b8e3-6b22bb00d00d
2
void checkBounds(int index) { if (index < 0 || index >= types.size()) { throw new IndexOutOfBoundsException("index out of bounds!"); } }
78e5d5a0-7dc7-4d34-b785-719ace125d89
0
@Override public String toString() { return QuestName; }
6af81d4b-421f-4fde-becd-a522da578d6c
7
public boolean eq(Matrix3D B) { Matrix3D A = this; if (B.M != A.M || B.N != A.N || B.K != A.K) throw new RuntimeException("Illegal matrix dimensions."); for (int i = 0; i < M; i++) for (int j = 0; j < N; j++) for (int l = 0; l < K; l++) if (A.data[i][j][l] ...
b899e26a-ee0e-402c-acd4-78f67130c3ac
1
public ClassIdentifier getClassIdentifier(String name) { if (clazzCache.containsKey(name)) return (ClassIdentifier) clazzCache.get(name); ClassIdentifier ident = (ClassIdentifier) basePackage .getIdentifier(name); clazzCache.put(name, ident); return ident; }
3e939668-4a0d-4ab7-af1e-bb3569b31bba
4
public void playerLeave(Player player, String reason) { if (players.contains(player)) { plugin.sendtoplayer(player, reason + " Ӿ˳"); removeplayer(player); if (player == boss) { Hero h = plugin.getHero(player); h.setHeroClass(oldclass, false); if (bossliving) { bossliving = false; endGam...
bc4e37ca-7d31-4210-b2d8-acd46243f6b8
1
private Transformer newTransformer() throws TransformerConfigurationException { if(transformerFactory==null) transformerFactory = TransformerFactory.newInstance(); return transformerFactory.newTransformer(); }
1619dd8f-b4dd-4ea4-87e9-566b2c83d23c
1
@Override protected void readCacheSelf(Element e) throws ProblemsReadingDocumentException{ try { coverUrl = resolveLink(e.getAttributeValue("coverUrl")); } catch (MalformedURLException e1) { throw new ProblemsReadingDocumentException(e1); } // moreInfo = e.getAttributeValue("moreInfo"); }
e3df3d15-123b-424e-8fe0-f5cde1819a6e
4
public void keyReleased(KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.VK_W: up = false; break; case KeyEvent.VK_S: down = false; break; case KeyEvent.VK_A: left = false; ...
80d2830a-e834-4d78-92da-eff2643714fb
2
public static Production[] getProductionsWithVariable(String variable, Grammar grammar) { ArrayList list = new ArrayList(); ProductionChecker pc = new ProductionChecker(); Production[] productions = grammar.getProductions(); for (int k = 0; k < productions.length; k++) { if (ProductionChecker.isVariableIn...
303a64cc-6206-4bda-9bc2-69bac8b1422b
4
Vector getLineDashPattern() { Vector dashPattern = null; Number dashPhase = new Float(0f); float[] dashArray = null; if (entries.containsKey("D")) { try { Vector dashData = (Vector) entries.get("D"); // pop dashPhase off the stack ...
ae53359f-d2a8-4e6f-a780-f251c83ce75f
8
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(mob.isMonster()) { if(mob.location().numInhabitants()<2) return Ability.QUALITY_INDIFFERENT; } final Room R=mob.location(); if(R!=null) { if(!R.getArea().getClimateObj().canSeeTheMoon(R,null)) re...
364363ed-55ff-49e5-9c69-6d81f7dba3d9
0
@Override public void use() { }
678b6dc9-96ae-4bf6-b3c2-78bc4d4dc591
7
public void export(Rectangle boundingBox, PositionTransformation pt) throws ExportException{ JFileChooser fc = new JFileChooser(AppConfig.getAppConfig().getLastSelectedFileDirectory()); fc.setDialogTitle("Choose file and type to export"); // install the file filters SingleFileFilter psFf = new EPSFileFilter(); ...
0eff05b9-b4bd-4fd6-aef5-5bd784c51417
1
private void quitProgram() { int dialogResult = JOptionPane.showConfirmDialog(chatGui, settings.getLanguage().getLabel("quit_msg_description"), settings.getLanguage().getLabel("quit_msg_title"), JOptionPane.YES_NO_OPTION); if(dialogResult == JOptionPane.YES_OPTION){ System.exit(0); } ...
35ae878c-ab89-4e90-8c69-08a1c37095cf
2
public int[] getDccPorts() { if (_dccPorts == null || _dccPorts.length == 0) { return null; } // Clone the array to prevent external modification. return (int[]) _dccPorts.clone(); }
27fb6d9f-6d2b-47d3-8abd-2122d173b96f
3
public static boolean isPythagTriple(int a, int b, int c) { if( (a < b) && (b < c) ){ if( (a * a) + (b * b) == (c * c) ) { return true; } } return false; }
d9571c01-4da5-45cf-8989-1d3c62f7ffab
3
private static void startClients(Client[] clients) { for (int i = 0; i < clients.length; i++) { clients[i].run(); } try { Thread.sleep(5000 + 1000 * clients.length); } catch (InterruptedException e) { e.printStackTrace(); } for (int i = 0; i < clients.length; i++) { clients[i].interru...
44a79a67-004c-41b1-8dbe-d42371f8809a
5
private boolean versionCheck(String title) { if (this.type != UpdateType.NO_VERSION_CHECK) { final String version = this.plugin.getDescription().getVersion(); if (title.split(" v").length == 2) { final String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get the ...
9b2d5301-fc4a-403d-b092-6ceb85c506d5
9
public boolean sameValueAs(LiteralLabel other) { if (other == null) return false; if (!wellformed || !other.wellformed) { if (!other.wellformed) { // Need to support this comparison in order for the WG tests on ill formed // literals to be testable using isIsomorphic to return lexicalForm.equals(other...
e0b5dfea-cf34-47eb-86d9-2667e7d80a5f
1
public static void main(String[] args) { // TODO Auto-generated method stub int repeat = Integer.parseInt(args[1]); Gson gson = new Gson(); String filePath = args[0]; JsonGen app = new JsonGen(filePath); for(int i= 0;i < repeat; i++){ System.out.println(app.generate()); } }
831f57fe-229f-4102-b11f-1426626619e8
2
public List<T> listAll() { //Устанавливаем соединение с базой conn = getConnection(); try { //Получение всех обьектов из базы Statement statement = conn.createStatement(); //Получаем результат ResultSet result = statement.executeQuery(getAllQuery()...
f10ea484-663a-4efa-81b5-fbc714d0ab7d
4
public static String parseResponse(HttpResponse httpResponse, List bandListArray) throws ParseException, IOException { JSONArray response = new JSONArray(); JSONParser jsonparser = new JSONParser(); try { response = (JSONArray) jsonparser.parse(httpResponse .parseAsString()); System.out.println(res...
adc33e6f-8a63-445f-ae88-32a03d07ad1f
6
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...
fe65ae9f-d2a0-49b9-a590-198572c23bde
2
public void print(String str){ JEditorPane transcript = new JEditorPane("text/html", ""); transcript.setText(str); try { boolean complete = transcript.print(); if (complete) { JOptionPane.showMessageDialog(null,"Done Printing!","Information",JOptionPane.INFORMATION_MESSAGE); } else { ...
f8643106-b371-4306-9cde-6035f21a4663
3
public void refuel(int amount) { if((amount > 0) && ((amount + fuelLevel) <= fuelCapacity) && !infinite) { fuelLevel += amount; } }
70ee0e8d-657d-484a-bb3f-713c104dbc34
9
public String ProcessSpecialTags(String strText) throws XPathExpressionException { logger.entering(getClass().getName(), "ProcessSpecialTags"); // first step: get positions where additional strings need to be inserted to TreeSet<TagSpecialHandler.Pair> insertList = new Tree...
521f9305-bc3b-467c-83a6-c6e5e20dc5c6
5
private static List<String> split(String str) { List<String> result = new ArrayList<String>(); int genericCount = 0; int startPos = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == ',' && genericCount == 0) { result.add(str.substring(startPos, ...
106b3d24-ac80-49cd-85e0-bb0071b78a5a
1
public void addNode(int pos, long nodeId){ if (poligons.size()>pos) nodes.get(pos).add(nodeId); }
ffee5c6a-d4b1-4a32-9155-324002702740
3
@Override public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args){ //help command if(args.length == 0 || args[0].equals("help")){ getExecutor("help").onCommand(sender, cmd, label, args); return true; } //other commands if(exists(args[0])){ getExecu...
12e0503c-93dc-4e91-84b8-6ca40dc56789
0
public void setRNC(String rNC) { RNC = rNC; }
089f8a85-41d2-47f8-a4da-e1fb4fb42126
7
private void createThumbnailPegboards(BufferedImage source, BeadPallete pallete, float text_size) throws IOException { // Delete already existing temp from the pegboards ArrayList. for(File board: this.board_pattern){ if (board != null) { board.delete(); } } for(File thumbnail: this.pegboard_thum...
27490eeb-9a30-4eba-8c80-64ae2f3c3bda
9
static final void method2840(int i) { if (i == 0) { if (Class22.anInt427 == 2) { GraphicsToolkit.aClass33Array1549[0].method364(Class364.aClass273Array4513[0]); GraphicsToolkit.aClass33Array1549[1].method364(Class364.aClass273Array4513[1]); } else if (Class22.anInt427 == 3) { GraphicsToolkit.aClass3...
53a95579-eccc-439e-935e-1dd1292b0ae0
0
@Override public String toString() { return this.value; }
69aa8a46-99a5-40e1-a53d-58e32177fdaa
8
protected void updateA( int w ) { // much of the code below is equivalent to the rank1Update function // however, since &tau; has already been computed there is no need to // recompute it, saving a few multiplication operations // for( int i = w+1; i < numCols; i++ ) { // d...
386e0314-cea4-4c5d-ba43-e513e654ed8f
0
public void setDisplayName(String displayName) { this.displayName = displayName; }
ba401a80-6a7a-4db4-a381-936ba20117b0
2
public static <K, V extends Comparable<? super V>> Map<K,V> shuffle(Map<K, V> map, Random random) { List<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>( map.entrySet() ); Collections.shuffle(list, random); Map<K, V> result = new LinkedHashMap<K, V>(); for (Map.Entry<...
9d278ca3-0645-4dd5-9f9e-7aac3cf1c0e4
4
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == register){ contentPanelLayout.show(panel, "registration"); } if(e.getSource() == logOff){ frameRef.setContentPane(new Login(frameRef)); } if(e.getSource() == searchBooks){ contentPanelLayout.show(panel, "searchBooks"); } ...
250304e6-3dc0-49d5-998c-b2e31be8afe9
2
public void SetAngles(){ //gettin the Yaw Angle (left/right rotation) float DeltaX = X_Target - X_Position; float DeltaZ = Z_Target - Z_Position; float Angle = (float) Math.toDegrees(Math.atan2(DeltaX, DeltaZ)); while(Angle < 0){Angle += 360;} YawAngle = Angle; //gettin the Pitch Angle (up/down...
7e0d7c06-f710-4b37-8b49-6e24291bde67
8
private static StringBuilder getResponseStr( Collection<Parameter> parameters, HttpURLConnection connection) throws IOException { StringBuilder responseStr = new StringBuilder(""); OutputStream out = connection.getOutputStream(); if(parameters!=null&&parameters.size()>0){ try { out.write(buil...
35fc1380-b8f6-49e1-8380-2fe4c19523dd
0
public void add(Codec codec) { addEncoder(codec); addDecoder(codec); }
f4fe95d3-1cf2-484b-9ea7-6fa83f25ef2b
6
public int parseByNumbers(String str) { if (str == null || str.isEmpty()) { return 0; } int total = 0; int strLen = str.length(); StringBuilder tmpStr = new StringBuilder(); for (int i = 0; i < strLen; i++) { char ch = str.charAt(i); ...
0db6d21b-7d53-4fb1-aeb2-68cf0f2be435
5
public void run() { abrirBase(); EnvioEmailControlador enviar = new EnvioEmailControlador(); LazyList<Envio> list = Envio.findAll(); if (!list.isEmpty()) { Envio fechaUltEnvio = (Envio) Envio.findAll().get(0); Date fechaEnviado = fechaUltEnvio.getDate("fecha"); ...
8b01b8ce-48c7-4cf1-b907-f6e35af777fd
9
public void traverse(TreeNode tr ,TreeNode tgt1,TreeNode tgt2, LinkedList<TreeNode> tgtParents){ tgtParents.add(tr); if(tr.val == tgt1.val){ //get target p1s = (LinkedList<TreeNode>) tgtParents.clone(); if(log) { System.out.println("find node 1 " + tr...
163c706c-c4da-4113-9275-0d81fe9ca30d
9
public static Type widerType(Type lh, Type rh) { int cmp = rh.compare(lh); if (cmp > 0) { if (lh == Type.nullType && rh instanceof PrimType) { return ((PrimType) rh).boxedType(); } else { return rh; } } else if (cmp == 0) { if (rh instanceof ClassType) { return rh; } return lh; } ...
fea85e10-6481-4f8f-9a12-f240eb086e31
8
public SofSegment(int markerId) { super(markerId); if ((markerId < FIRST1_MARKERID || markerId > LAST1_MARKERID) && (markerId < FIRST2_MARKERID || markerId > LAST2_MARKERID) && (markerId < FIRST3_MARKERID || markerId > LAST3_MARKERID) && (markerId < FIRST4_MARKERID || markerId > LAST4_MARKERID)) { thro...
70eec6d4-944d-41bc-b68b-c332bed7383f
3
private void updateSpielerPanels(JPanel spielFeld) { List<JPanel> panels = new ArrayList<JPanel>(); for (int i = 9; i >= 0; i--) { for (int j = 0; j < 10; j++) { JPanel panel = new JPanel(); panel.setBackground(spieler.getSpielfeld().getElements()[j][i] .getElementColor()); panels.add(panel); ...
f364d880-8e45-4e1b-a516-4645563301a9
5
private boolean one_byte_size_ready() { // First byte of size is read. If it is 0xff(-1 for java byte) read 8-byte size. // Otherwise allocate the buffer for message data and read the // message data into it. byte first = tmpbuf[0]; if (first == -1) { next_step (tm...
fe5811a4-c7fb-4875-9e00-5f6bc88e8c1f
3
public void listen(final int port) { try { // Create FridgeMagnets and place on Fridge for (int i = 0; i < MAGNETSCOUNT; i++) { // Source: http://webcache.googleusercontent.com/a/5202888 Random r = new Random(); char...
4ad90164-72c9-4689-9092-47542799795f
4
public void activateWaypoint(Player player) { if(playerMessage != null) { String message = playerMessage.replace("-p", player.getName()); String[] messages = StringUtils.split(message,"\n"); for(String m : messages) player.sendMessage(m); } if(globalMessage != null) { String message = glo...
927bcd8c-5456-44ed-aecb-2b236ef68371
8
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Equipment> list = service.getEquipmentList(); request.setAttribute("equipments", list); String action = request.getParameter("action"); if ("view".equals(action)) { Equipmen...
032a9e20-731e-4922-a933-a46a5d9ede82
9
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { Player player = null; if (sender instanceof Player) { player = (Player) sender; } if (args.length == 0) { if (player == null) { sender.sendMessage(ChatColor.RED+"This command can o...
f0a91d68-fff2-4dd7-8419-1eff961dfb48
6
public static String escape(String string) { StringBuffer sb = new StringBuffer(); for (int i = 0, length = string.length(); i < length; i++) { char c = string.charAt(i); switch (c) { case '&': sb.append("&amp;"); break; cas...