method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
0569fa3e-4688-4ce7-bbda-406473225f6e
8
protected void processStyleBlocks(List<String> styleBlocks) { if(generateStatistics) { for(String block : styleBlocks) { statistics.getOriginalMetrics().setInlineStyleSize(statistics.getOriginalMetrics().getInlineStyleSize() + block.length()); } } if(compressCss) { for(int i = 0; i < styleBlock...
0d9789e3-e02f-402a-a590-e441a7f2bd9d
4
public static boolean endsWithIgnoreCase(String str, String suffix) { if (str == null || suffix == null) { return false; } if (str.endsWith(suffix)) { return true; } if (str.length() < suffix.length()) { return false; } String lcStr = str.substring(str.length() - suffix.length()).toLowerCase(); ...
9c1a8a90-787a-41ab-bc7c-360f0fea5475
7
private void parseMaskAndAdjustmentData(PsdInputStream stream) throws IOException { int size = stream.readInt(); assert size == 0 || size == 20 || size == 36; if (size > 0) { Mask mask = new Mask(); mask.top = stream.readInt(); mask.left = stream.readInt(); ...
6c824c97-0eec-4615-ac7c-a48323020e72
2
@SuppressWarnings("unchecked") private void sendEndGameMove(){ check(isMyTurn() && currentMove == VERIFY); String winnerId = coderId; List<String> feedbackHistory = (List<String>) state.get(FEEDBACKHISTORY); String lastFeedback = feedbackHistory.get(feedbackHistory.size()-1); if (lastFeedback.equa...
05383b11-e90e-41bc-9808-fd044d255862
0
public int getGraphZ() { return graphZ; }
a22dabbc-4b3e-4a91-bcf0-1908d201bfe0
6
* @param itemSlot The itemSlot * @param newItemId The new item After Drinking * @param healType The type of poison it heals */ public void potionPoisonHeal(int itemId, int itemSlot, int newItemId, int healType) { c.attackTimer = c.getCombat().getAttackDelay(c.getItems().getItemName(c.playerEquipment[c.playerWe...
f5b4727e-d7a7-4be5-9063-5856b9083fd8
7
static private String stripControlCharacters(String s) { StringBuffer sb = new StringBuffer(s.length() + 1); for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch > 256 || ch == '\n' || ch == '\t' || ch == '\r' || ch == 226) { sb.append(' '); ...
81e2b6b4-be5b-489a-8c00-e1244e37a37f
7
static final int method1760(int i, int j, int k) { if (k == -2) { return 0xbc614e; } if (k == -1) { if (i >= 2) { if (i > 126) { i = 126; } } else { i = 2; } return i; ...
f3144655-db92-49a9-825a-6ef4af5f5676
0
protected void end() {}
ab08353a-caad-474b-a29d-ad92aa6e22c0
3
public void trimData( int maxLength ) { if( audioData == null || maxLength == 0 ) audioData = null; else if( audioData.length > maxLength ) { byte[] trimmedArray = new byte[maxLength]; System.arraycopy( audioData, 0, trimmedArray, 0, ...
ee4eca6e-74cc-45ea-a237-fabaf60a06cd
2
public String getCode(){ String str = ""; String itemCode = item.getCode(); if(itemCode != ""){ String nextTemp = Tree.getNextTemp(); str = item.getCode() + this.printLineNumber(true) + nextTemp + " := " + item.place + "\n" + this.printLineNumber(true) + "push := " + nextTemp + "\n"; } ...
ad0200bc-5814-490e-9125-7fa51b1547e2
6
private synchronized void resize(int newSizeColumns, int newSizeRows) { TerminalCharacter [][]newCharacterMap = new TerminalCharacter[newSizeRows][newSizeColumns]; for(int y = 0; y < newSizeRows; y++) for(int x = 0; x < newSizeColumns; x++) newCharacterMap[y][x] = new Ter...
49a8b890-1c27-4cd3-a271-610cc7a5691f
8
@Override public Map<String, String> validateForCreate(Map<String, Object> properties) throws Exception { Connection conn = ConnectionManager.getInstance().getConnection(); Map<String, String> erros = new HashMap<String, String>(); if (properties != null) { Long viag...
1fef9d5f-ee75-418e-a932-22c0f3dd333c
1
public void cleanup() { Collection windows = configurationToTraceWindow.values(); Iterator it = windows.iterator(); while (it.hasNext()) ((TraceWindow) it.next()).dispose(); configurationToTraceWindow.clear(); }
b92ea0e9-064e-42ae-9ee3-3154b7682ecb
1
public void setMaxSpeed(double maxSpeed) { if(_negated) { _minSpeed = maxSpeed; } else { _maxSpeed = maxSpeed; } }
ebb5548f-c6e9-4f21-a52d-c825f0d90b0c
8
@Override public synchronized int compare(Integer i1, Integer i2) { Queue<PutTask> putQueue1 = putMap.get(i1); Queue<GetTask> getQueue1 = getMap.get(i1); Queue<PutTask> putQueue2 = putMap.get(i2); Queue<GetTask> getQueue2 = getMap.get(i2); Long time1 = timerMap.get(i1); Long time2 = timerMap....
0f663cde-b15c-4bff-a376-960225638fa3
6
public void LItemClothesAll(String folder) throws Exception { SPProgressBarPlug.setStatus("Adding clothes to pool"); NumberFormat formatter = new DecimalFormat("000"); LVLI LItemClothesAll = (LVLI) SkyProcStarter.merger.getLeveledItems().get(new FormID("106662Skyrim.esm")); OTFT FarmClot...
1d46ee01-6cb8-4a57-91ac-002a755e069b
2
public static void main(String[] args) { int[][] data = new int[2][2]; int[][] data2 = new int[2][2]; data[0][0] = 1; data[0][1] = 3; data[1][0] = 2; data[1][1] = 4; data2[0][0] = 0; data2[0][1] = 1; data2[1][0] = 5; data2[1][1] = 6; ...
c7ecc146-f625-46bc-832c-be61cc6452fb
7
public void ascend(){ eraseCenter(); for(int col = 0; col < board.getWidth(); col++){ int[] values = new int[board.getLength()]; for(int i = 0; i < values.length; i++){ values[i] = -2; } for(int row = 0; row < board.getLength();row++){ if(board.getValue(row, col) != -2){ if(board.isVali...
a847a2f2-6708-48dc-aab6-beda02d00d25
9
public void update(float deltaTimeElapsedMs) { // Moves character or scrolls background accordingly if (speedX < 0) { centerX += Util.factorByElapsedTimeMs(speedX, deltaTimeElapsedMs); } if (speedX == 0 || speedX < 0) { bg1.setSpeedX(0); bg2.setSpeedX(0); } if (centerX <= 200 && speedX > 0) { ...
4333a6a5-0526-4a69-a6f7-c51524b4bfd1
7
Class286_Sub4(OpenGlToolkit var_ha_Sub2, Class83 class83) { super(var_ha_Sub2); aBoolean6233 = false; do { try { aClass83_6242 = class83; if (((Class83) aClass83_6242).aClass258_Sub1_1443 == null || !(((OpenGlToolkit) ((Class286) this).aHa_Sub2_3684) .aBoolean7791) || !(((OpenGlToolkit) ((Cl...
5a62c3a6-c22f-4097-9229-15c50e5d47d7
4
public BufferedImage crop(int x, int y, int height, int width) { //Outside of image if (x > img.getWidth() || y > img.getHeight()) return null; if (height + y > img.getHeight()) height = img.getHeight() - y; if (width + x > img.getWidth()) width = im...
dfba209d-78af-4337-b13f-4d17278e7910
6
static public void release() { if (!injected) return; try { // Define boolean fa; boolean ff; Field flagsList; Field flagsListMod; // Get: fields required for reflection flagsList = DefaultFlag.class.getDeclaredField("flagsList"); flagsListMod = Field.class.getDeclaredField("modifiers...
477ba30c-5441-4512-9001-1e37500c1a9b
8
public Object readMap(AbstractHessianInput in) throws IOException { String name = null; String type = null; String description = null; boolean isRead = false; boolean isWrite = false; boolean isIs = false; while (! in.isEnd()) { String key = in.readString(); if ("name...
6e6a89ff-1109-42df-86b4-634918721d5b
4
public static boolean isBlank(String str){ if(str==null){ return true; } if(str.trim().length()<1){ return true; } if(str.trim().equals("")){ return true; } if(str.trim().toLowerCase().equals("null")){ return true; } return false; }
305f9e5c-0917-4222-ad22-4f0d88c98904
9
@Override public final boolean incrementToken() throws java.io.IOException { if (!input.incrementToken()) { return false; } char[] buffer = termAtt.termBuffer(); final int bufferLength = termAtt.termLength(); final String type = typeAtt.type(); if (type == APOSTROPHE_TYPE && // re...
df9a9309-5d0e-4f38-a3ee-8f3db962d3b2
3
private void deleteClienteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteClienteButtonActionPerformed if(tablaClientes.getSelectedRow() >= 0){ askWind a = new askWind(new javax.swing.JFrame(),true,"Seguro que desea eliminar este cliente?"); a.setLocationRe...
5a422b93-9dc5-4106-bb6e-9bd4bd30fda3
6
public double classifierData(List<Feat> classifiers) throws IOException{ Features f = new Features(0, 0); f.integralImages(f.FACES, f.numbFaces, f.integralFaces); System.out.println(new Date() + "--- Integralfaces. Done"); f.integralImages(f.NONFACES, f.numbNonFaces, f.integralNonFaces); System.out.println(ne...
6df2573c-b66d-48c0-ae26-df1d8b4a256a
3
public char nextClean() throws JSONException { for (;;) { char c = this.next(); if (c == 0 || c > ' ') { return c; } } }
75109ff1-d28a-49ce-9830-fbafa2d3b4af
4
private static String validateSong(String artist, String title) { HashMap<String, String> songList = DataManager.getSongMap().get(artist); for(String songFromMap : songList.keySet()) { int levDist = StringUtils.getLevenshteinDistance(songFromMap.toUpperCase(), title.toUpperCase()); double ratio = (songFromMap...
cf53d5c6-9d70-4642-9b50-692bc695bf53
6
public DayTimeDurationAttribute(boolean negative, long days, long hours, long minutes, long seconds, int nanoseconds) throws IllegalArgumentException { super(identifierURI); this.negative = negative; this.days = day...
4c83c4c3-9168-431c-963f-c05aad9b681f
1
public static void asm_iorwf(Integer befehl, Prozessor cpu) { Integer w = cpu.getW(); Integer f = getOpcodeFromToBit(befehl, 0, 6); Integer erg = w | cpu.getSpeicherzellenWert(f); if(getOpcodeFromToBit(befehl, 7, 7) == 1) { cpu.setSpeicherzellenWert(f, erg, true); } else { cpu.setW(erg, true); } ...
a6c0adf7-8a54-48c8-bdd5-c3cdcaad66ed
0
public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; }
632d602c-2c12-4041-8b37-57a7731055c4
2
public void sendMail(String mailServer, String from, String[] to, String subject, String messageBody, String attachmentPath, String attachmentName) throws MessagingException, AddressException { boolean debug = false; Properties props = new Properties(); props.put("mail.smtp.starttls.enable", "true"); props.put...
f4cd90a9-0e1a-4d8f-8f92-b606be6d3903
6
public double getWinningOdds(int a, int d) { attackers = a; defenders = d; outcome = new double[attackers + 1][defenders + 1]; for (int i = 0; i < attackers + 1; i++) for (int j = 0; j < defenders + 1; j++) outcome[i][j] = -1.0; outcome[attackers][defenders] = 1.0; double winOdds = 0.0; double l...
2d14357f-89d5-460a-815f-18fdbcc880b8
0
@Override public void actionPerformed(ActionEvent e) { quit(); }
5dfe2800-8ae1-4d9d-b00a-87b4610e1140
5
public static void main(String[] args) throws IOException { // TODO Auto-generated method stub String name = ""; String host = ""; int port = 0; int i = 0; int money; try//name, host, and then port -- lines 43-73 checks the args[] for info { name = args[i]; i++; } catch(ArrayIndexOutOfBoun...
d8fbfaf2-84bf-4567-90d3-b748c226b211
6
public boolean hit(PlayerState param,Mario mario){ // TODO :: IMPLEMENT PROJECTILE INFO FOR THE KOOPA mario.rebound(); if(flying){ flying=false; if(getDy()<0) setDy(0); return false; }else if(!shell){ shell=true; if(getDy()<0) setDy(0); setDx(0); ...
f3916ded-4d91-4c74-8660-061ead12a5ea
9
public void keyPressed(KeyEvent e) { switch(e.getExtendedKeyCode()) { case KeyEvent.VK_LEFT: //System.out.println("lewo"); action = "right"; Pang.game.ihLudzik.currentFrame=4; if (x_ > 0)...
5dc3ae59-59e8-4f86-93e3-9e4f1fb64207
6
private void playBoard() { do { playGame(); this.tryAgain = false; while(this.tryAgain == false) { System.out.print("\n Play again (Y/N): "); this.theUsersInput = this.someInput.next(); System.out.p...
5f3222f4-239f-4022-85a4-bb8c237178a9
3
private boolean playerStartPositionsHasNoTeleporter(Grid grid) { List<Teleporter> teleporters = getTeleportersOfGrid(grid); for (Player p : grid.getAllPlayersOnGrid()) for (Teleporter teleport : teleporters) if (grid.getElementPosition(teleport).equals(p.getBeginPosition())) return false; return...
171ca4ae-21f7-4399-b697-4d138e85ad8c
7
private void dumpMemory(int address, int size) { String tmp = ""; String tmp2 = ""; String t; System.out.println("Dumping memory: " + address); for (int i = 0; i < size; i++) { t = Integer.toString(memory[i + address] & 0xff, 16); if (t.length() < 2) t = "0" + t; tmp = tmp + t + "...
6f7482a0-f46f-40bc-a130-325053ca3433
9
private boolean verifierChamps(){ String erreurMsg = ""; boolean result = true; if (nomTF.getText().length() < 3) { erreurMsg += "Le nom doit au moins avoir trois caracteres.\n"; result = false; } if (prenomTF.getText().length() <...
93aa445d-e7d1-4f58-8077-f7bf34ab63b1
2
private void ouvrirLecture(){ if(tamponSocket == null) { try{ tamponSocket = new BufferedReader(new InputStreamReader(socket.getInputStream())); } catch(IOException io){ io.printStackTrace(); } } }
7b6749a1-038f-48f5-ab41-195053e92cdd
4
protected void createBuffers( SSLSession session ) { int appBufferMax = session.getApplicationBufferSize(); int netBufferMax = session.getPacketBufferSize(); if( inData == null ) { inData = ByteBuffer.allocate( appBufferMax ); outCrypt = ByteBuffer.allocate( netBufferMax ); inCrypt = ByteBuffer.allocate...
98378344-45d9-46b5-be0d-eb07ee0a90c8
8
public void getCommitter() { networkController.SendMessage("getPromotion#" + clientId + "," + clientType + "," + userCommitter + "," + userName); clientType = userCommitter; committer = true; cleanLabels(); if(observer) getObserver.setVisible(true); if(contributor) getContributor.setVisible(true...
d18200ad-5619-432b-ba27-640c27aa688e
6
protected Account ReadAccount(String accountFile, String id) throws ClassNotFoundException{ ArrayList<Account> accs = new ArrayList<Account>(); Account acc = null; Object temp = null; try { obji = new ObjectInputStream(new FileInputStream(accountFile)); try { temp = obji.readObject(); } catch (...
424fd820-432f-46be-8b03-9bccbdc37597
6
@Override public String getColumnName(int column){ String name = "??"; switch (column){ case 0: name ="produktId"; break; case 1: name ="produktNavn"; break; case 2: name ="fareNiveau"; break; case 3: name ="salgsPris"; break; case 4: name ="kostPris"; break;...
8fb8c14d-5129-406c-b21f-7405607e15ba
8
private void setSizes(Container parent) { int count = parent.getComponentCount(); Insets insets = parent.getInsets(); if (parent instanceof JPanel) { insets = new Insets(0, 0, 0, 0); } int insetWidth = 0; int insetHeight = 0; if (insets != null) { insetWidth = insets.left + insets.right; insetHei...
f7667e1b-fd81-4e94-b7cb-c0a76aecb244
0
public String getItemName() { return this.itemName; }
9a2a00c5-efa9-4f82-8386-edf4b15bb59d
6
private RandomGenerator createRandomGenerator(long seed, Class<? extends RandomGenerator> randGenClass, RandomGenerator... params) { try { Constructor<? extends RandomGenerator> constructor ; if ( params == null || params.length == 0 ) { constructor = null ; } else { constructor = randGenCl...
7e6db21d-0435-43ad-99c7-6ef7e9f71220
6
public int lengthOfLastWord(String s) { if (s == null) return 0; int j = s.length() -1; while (j>=0 && s.charAt(j) == ' ') j --; if (j == -1) return 0; int i = j; while (i >= 0 && s.charAt(i) != ' ') i --; return j -i; }
bc738a05-a1b2-4e32-a44e-3c75022c36b9
6
public MergeIterators(Comparator<E> comp, Iterator<E>[] itList, E[] nextContainer) { if (itList == null) throw new IllegalArgumentException("Null array of iterators"); if (comp == null) throw new IllegalArgumentException("Null comparator"); if (nextContainer == null) throw new IllegalArgumentException...
687a7fbc-bb08-4197-a62e-889f6cba95ce
3
public static void notEmpty(Collection<?> collection, String message) { if (collection == null || collection.isEmpty()) { throw new IllegalArgumentException(message); } }
864dfc57-ca6d-432d-b049-35b49ca7d418
6
public static boolean check(Serializable object) { // TODO Auto-generated method stub if (object instanceof Grammar) { Grammar g=(Grammar) object; Production[] p=g.getProductions(); //check first 3 productions to make sure this grammar is from conversion int count=0; if (p.length < 3) return...
2468e695-755f-4b65-ba42-7d0455fc80ce
5
final FEMValue _compileArrayAsValue_() throws IllegalArgumentException { if (!this._arrayEnabled_) throw this._illegal_(null, " Wertlisten sind nicht zulässig."); final List<FEMValue> result = new ArrayList<>(); this.skip(); if (this._compileType_() == ']') { this.skip(); return FEMArray.EMPTY; } whil...
2cb52919-e09a-4ba6-a525-9a72ba0992f2
5
@Override public void actionPerformed(ActionEvent e) { if( e.getSource() == boton_alta_turno ){ Controlador.getInstance().accion(EventoNegocio.GUI_ALTA_TURNO,GUIPrincipal_Turno.this); } else if( e.getSource() == boton_baja_turno){ Cont...
56e133ca-d4d9-4d86-95e3-d3de024097db
4
static private void validateDirectory (File aDirectory) throws FileNotFoundException { if (aDirectory == null) { throw new IllegalArgumentException("Directory should not be null."); } if (!aDirectory.exists()) { throw new FileNotFoundException("Directory does not exist: " + aDirectory); } ...
e208b866-3a5c-4881-b911-d390ae5e0581
4
public Trajectory<TobiiFrame> getClosestTrajectoryTo(long timestamp) { Trajectory<TobiiFrame> bestTraj = null; long bestDelta = Long.MAX_VALUE; for(Trajectory<TobiiFrame> traj : trajectories.values()) { Map.Entry<Long, TobiiFrame> startFrame = traj.getFrameEqualHigher(0L); if(null == startFrame) {...
d54f3325-450e-441b-b840-cfc52b3e7a4b
5
private boolean supressImport(JClass clazz, JClass c) { if (clazz instanceof JNarrowedClass) { clazz = clazz.erasure(); } if (clazz instanceof JAnonymousClass) { clazz = clazz._extends(); } if(clazz._package().isUnnamed()) return t...
23b9ed23-a19c-4ad3-8e30-8edb170e0e88
9
public static String getPath(int startX, int startY, int endX, int endY, TileGrid grid) { String out = ""; openList = new ArrayList<Node>(); closedList = new ArrayList<Node>(); openList.add(new Node(grid.getTile(startX, startY),null)); Pathfinder.endX = endX; Pathfinder.endY = endY; Node goalNode = new...
e041a81a-d7c7-49da-91cc-7c35e7ce0744
2
private void miAddDiscActionPerformed(ActionEvent e) { if (Manager.getInstance().getCurrentProfile() == null) { JOptionPane.showMessageDialog(null, "No profile has been selected."); return; } Object[] discNames = Manager.getInstance().getDiscNames().toArray(); String selectedDisc = (Str...
14141407-7163-4f94-a5e4-8b3eeb14e276
6
private static boolean loadIntoSubSystem() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bos); } catch (Exception e) { return false; } try { oos.writeObject(m_tmp); } catch (Exception e) { return false; } try { ...
96be73a3-8dde-48db-b86b-d91fe37a9ad2
4
public void nextStep(){ MyHex current = nexts.pollLast(); current.visit(); ArrayList<MyHex> k = m.getNeighbors(current).getAllTrimmed(); for(MyHex h : k) if(!h.hasBeenVisited() && !nexts.contains(h)) nexts.push(h); //canvas.paintOne(geo, m, current.x(), current.y()); canvas.paintAll(geo, m); if(nex...
2d685c2c-2d43-43ac-887c-e6dffe1e3580
1
private void addSprite(TileMap map, Sprite hostSprite, int tileX, int tileY) { if (hostSprite != null) { // clone the sprite from the "host" Sprite sprite = (Sprite)hostSprite.clone(); // center the sprite sprite.setX( TileMapRenderer....
fae13e40-74a7-42cd-9e0f-e1984a7f35d6
0
public void setState(State state) { this.state = state; }
b68aecf0-c202-463d-9686-b5445696a56f
3
public void run() { // Get config data ConfigManager cm = new ConfigManager(); // Connect to server through RMI port 1099. Rmi rmi = null; try { Registry registry = LocateRegistry.getRegistry( cm.getServerIp(), 1099); rmi = (Rmi) registry.lookup("pcs"); } catch (RemoteException | NotBoun...
d2aa75e7-9056-4277-878a-98a777159000
2
@Override public OutputStream getOutputStream() throws IOException { switch (failValue) { case 0: return new OutputStream() { @Override public void write(int b) throws IOException { } };...
a935b37a-7d2d-4de4-ae37-20637a6af2dd
4
public static void addTile(Tile t) { if(allTiles != null) { for(int i=0;i<allTiles.length;i++) { if(allTiles[i]==null) { allTiles[i] = t; return; } else { if(allTiles[i].getTileId().equalsIgnoreCase(t.getTileId())) { return; } } } } }
02809aee-f6e3-4ded-b6ca-6a8d0f484dd1
9
public double computeDynamicCutoff() { { IncrementalPartialMatch self = this; { IncrementalPartialMatch parent = ((IncrementalPartialMatch)(self.parent)); double cutoff = 0.0; if (parent != null) { if (parent.kind == Logic.KWD_AND) { { double pcutoff = parent.dynamicCut...
e622ed71-fe52-4093-8f68-0e6cdd469fa6
6
private void putResize (K key, int value) { // Check for empty buckets. int hashCode = key.hashCode(); int index1 = hashCode & mask; K key1 = keyTable[index1]; if (key1 == null) { keyTable[index1] = key; valueTable[index1] = value; if (size++ >= threshold) resize(capacity << 1); return; } int...
546e31fd-f0de-46c4-8042-0926e2762ac5
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; StorySkeleton other = (StorySkeleton) obj; return ID == other.ID; }
805a8e7d-c1b4-4bcf-aab6-942c31a2792c
8
HideToSystemTray(){ super("SystemTray test"); System.out.println("creating instance"); try{ System.out.println("setting look and feel"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }catch(Exception e){ System.out.println("Unabl...
b1d96d26-fc36-4e95-af12-a4411abf92bd
9
public void logic(){ //̹ƶ if( clientTank.getType()==Tank.BLACK_TANK ){ clientTank.active(selectKey, tankSpeed+BLACK_BUFF,SCREEN_WIDTH,SCREEN_HEIGHT); } else{ clientTank.active(selectKey, tankSpeed,SCREEN_WIDTH,SCREEN_HEIGHT); } // if( fire==true ){ clientTank.fire(); fire = false; } //...
4d01e434-8c84-4271-b24b-e79a4b48d38b
1
private String getPassword() { JPanel panel = new JPanel(new BorderLayout()); JLabel label = new JLabel(AutoAppro.messages.getString("bar2auto_passwd_content")); JPasswordField pass = new JPasswordField(); panel.add(label, BorderLayout.PAGE_START); panel.add(pass, BorderLayout.CENTER); int valid = JOptionP...
d47a1ec1-61ee-49a3-8360-71e59c53c2a4
7
@Override public void actionPerformed(ActionEvent e) { enableApply.setEnabled(false); disableApply.setEnabled(false); button.setEnabled(false); if(e.getSource().equals(enableApply)) { new Thread(new Runnable() { @Override public void run() { try { AdminClient.client.enableGPS(); ...
27fc2240-9372-4d64-9519-18e0474fa100
5
public static double[] MethodNewton(double y[]) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); double[] x = new double[func.length]; x = Arrays.copyOf(y, y.length); //Количество итераций int k = 10; //Точность //...
f3aee664-9968-402f-8971-ac4f61978fc6
2
public void placeUnits(Player player, Dimension minimumRange, Dimension maximumRange) { for (Unit unit : player.getUnits()) { int x, y; do { x = MathUtil.randomInteger(minimumRange.width, maximumRange.width); y = MathUtil.randomInteger(minimumRange.height, maximumRange.height); } while(!grid[x][y].i...
bfc3200a-f4aa-4a73-b301-9b921854c03a
0
public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { return new MonitoredDiskFileItem(fieldName, contentType, isFormField, fileName, getSizeThreshold(), getRepository(), listener); }
60dca688-fdfe-4308-9dbd-29440fdc97f9
4
private void endCircle(String to) { if (to.equals("slide")) slide.addEntity(circle); else if (to.equals("quizslide")) quizSlide.addEntity(image); else if (to.equals("scrollpane")) scrollPane.addEntity(image); else if (to.equals("feedback")) quizSlide.addFeedback(image); }
29b1369d-2ff7-4540-9542-a1c4f036fa9a
5
final public CycList andForm(boolean requireEOF) throws ParseException, java.io.IOException, UnsupportedVocabularyException { CycList sentences = null; CycList val = new CycList(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AND_CONSTANT: jj_consume_token(AND_CONSTANT); break; case AND_GUID...
3791a486-6d93-4089-bed8-2dfce78ab1b0
9
@Override public String List_file_url3(String id) { String texto_html = ""; try { this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE); String sql = "SELECT NO_ARCHIVO,NO_ARCHIVO_ORIGINAL FROM RHTV_CONTRATO_ADJUNTO where ID_CONTRATO='" + id.trim() + "'"; ...
20265824-deb2-4157-9ab4-87acb3a78b36
2
public void setMass(double m) { if(getMass() == Log.MASS && m != Log.MASS) {System.out.println("ERROR: Attempted to change mass of log " + getName() + ".");} super.setMass(Log.MASS); }
779af648-108a-4ad4-9c9d-66053254a6b2
6
private void actionPanel(JPanel panel) { actionsPanel = new JPanel(); actionsPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); actionsPanel.setBounds(520, 279, 320, 103); panel.add(actionsPanel); actionsPanel.setLayout(null); actionsPanel.setVisible(false); final JLabel x1Label = new J...
e2cacc2b-2634-4c19-9ead-f0fde37877e6
0
public TMBruteParsePane(GrammarEnvironment environment, Grammar orig, Grammar trim, HashMap<String, String> map, InputTableModel model) { super(environment, orig); this.treePanel = new UnrestrictedTreePanel(this, map); initView(); myTrimmedGrammar=trim; myTrimmedGrammar.setStartVariable("S"); myModel = mode...
61e9028c-4e23-4635-b845-45ad32f60e01
4
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8"); @SuppressWarnings("unchecked") ...
de709164-fda2-482b-be98-45fbdc4a70d1
0
public RegExFindFileContentsHandler(String regex, String lineEnding) { super(lineEnding); setRegEx(regex); }
4d7fff2d-cd8e-4969-b47c-2143c25dda4e
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 fe...
da44476f-9038-4190-ab99-710bf558cf93
5
private static ClassType parseClassType2(String sig, Cursor c, ClassType parent) throws BadBytecode { int start = ++c.position; char t; do { t = sig.charAt(c.position++); } while (t != '$' && t != '<' && t != ';'); int end = c.position - 1; TypeArg...
54653267-6055-42a2-b212-edad0c1d438c
9
public static java.util.Calendar[] toArrayOfCalendar(Collection collection) { if(collection == null || collection.size() == 0) return new java.util.Calendar[0]; java.util.Calendar[] aResult = new java.util.Calendar[collection.size()]; int i = 0; Iterator iterator = collection.iterator(); while(iterator.hasN...
8967c321-3e7b-424e-b975-71f330c08f83
5
public void setResource( boolean _shape, boolean _color, boolean _size, boolean _weight, boolean _healthy ){ int ONES_MASK = (0xFFFFFFFF); int color = _color?ONES_MASK:~(1<<6); int shape = _shape?ONES_MASK:~(1<<7); int size = _size?ONES_MASK:~(1<<8); int weight = _weight?O...
ed2b4c1c-7e11-44aa-a8f7-1271410dd3aa
0
private boolean annotationMatches(Annotation antFromMethod, String antFromUser) { String justAnnotationNameFromUserInput = extractAnnotationNameFromUserInput(antFromUser); String justAnnotationNameFromMethod = extractAnnotationNameFromMethod(antFromMethod); return justAnnotationNameFromMethod.equalsIgnoreCa...
1bdc3822-4f72-4c2c-9fe7-b33d499162a9
5
public boolean isPassed() { Calendar cal = Calendar.getInstance(); int currY = cal.get(Calendar.YEAR); int currMo = cal.get(Calendar.MONTH) + 1; int currD = cal.get(Calendar.DAY_OF_MONTH); int currH = cal.get(Calendar.HOUR_OF_DAY); int currMi = cal.get(Calendar.MINUTE); int y = ...
831d9c70-1dcc-4e14-97c9-d226d7912dda
2
public SessionKey unserializeSessionKey(String keyFilename) { SessionKey sessionKey = null; try { File f = new File(keyFilename); f.createNewFile(); InputStream file = new FileInputStream(keyFilename); InputStream buffer = new BufferedInputStream(file); ObjectInput input = new ObjectInputStream(bu...
3c1934f6-2284-4879-b614-a80771ea91b2
0
public void setMimeType(String mimeType) { this.mimeType = mimeType; }
fc1b583b-97f1-45ca-af49-29518fca017e
4
private void createProjectControlPanel() { Vector<JButton> cb = createCustomButtons(); if(cb.size() == 0) { return; // no buttons to be displayed } projectControlContent.removeAll(); JButton minimizeButton; if(appConfig.guiControlPanelShowProjectControl) { minimizeButton = createFrameworkIconButto...
2f78973f-92fd-44d5-9e07-86030ae2ab10
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical target, boolean auto, int asLevel) { if(target==null) { final PresenceReaction A=(PresenceReaction)mob.fetchEffect(ID()); if(A!=null) A.shutdownPresence(mob); if(affected==mob) shutdownPresence(mob); return A!=null; } ...
1798e5cd-b9f5-42f3-9f6b-b72fbad0f61e
1
private void showLog_settingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showLog_settingsButtonActionPerformed if (debug) logger.log(Level.DEBUG, "Setting preference \"showLog\" from " + settings.showLog() + " to " + showLog_settingsButton.isSelected()); ...
febf2137-f214-454d-b962-d87693e07a7d
0
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed modificar.setVisible(false); }//GEN-LAST:event_jButton2ActionPerformed
902b1982-524b-42a2-948c-bfab79ab727b
8
public int AddInstanceToBestCluster(Instance inst) { double delta; double deltamax; int clustermax = -1; if (clusters.size() > 0) { int tempS = 0; int tempW = 0; if (inst instanceof SparseInstance) { for (int i = 0; i < inst.numValues(); i++) { tempS++; tempW++; } } else...