method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
02b6d0ce-674f-4064-b9a4-907f30518e44
1
public Constant newUTF8(final String value) { key1.set('s', value, null, null); Constant result = get(key1); if (result == null) { result = new Constant(key1); put(result); } return result; }
e64140f1-3915-4998-a9fa-c31b92088f21
7
private static void requestAndParseAllMeasurementsBelongingToExactGSMCells() { String fileName = "/Users/Johan/Documents/CellTowers/cell_towers_GSM_exact.csv"; try(BufferedReader br = new BufferedReader(new FileReader(fileName));){ String line = ""; int totalCount = 0; int count = 0; JSONFile jsonFile...
89763307-ff7e-4807-88bd-7362f3a55320
3
public Command recv (long timeout_) { Command cmd_ = null; // Try to get the command straight away. if (active) { cmd_ = cpipe.read (); if (cmd_ != null) { return cmd_; } // If there are no more commands avai...
a7566a6b-622f-408e-b0cb-cdad642ec60e
0
private Set<Card> sevenFlush() { return convertToCardSet("2S,6S,8S,3S,9S,KS,JS"); }
2eeeeb7a-1e56-4ae6-94d5-6f0ffbe59f2a
7
public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs == null){ createBufferStrategy(3); return; } int xOffset = player.x-screen.width/2; int yOffset = player.y-screen.height/2; level.renderTiles(screen, xOffset, yOffset); for(int x=0; x<level.width;x++){ int color = Colors.get(...
4f80eacc-bf81-48f3-a121-9e82dd8a618f
7
public void prepare(Dish dish) { LinkedList<Material> materials = dish.getMaterials(); for (Material tmp : materials) { for (StorageAdapter storage : storageList) { if (tmp.getName().equals(storage.getName())) { storage.setAmount(storage.getAmount() - tmp.getAmount()); } } } LinkedList<Ingr...
847b12e2-9a0f-4f63-866c-786527e295ee
9
public void getInput() { while (Keyboard.next()) { //if(!chatMode){ if(getStats().isAlive()) { if(Keyboard.isKeyDown(Keyboard.KEY_A)) { movx = MOVE_LEFT; spr.setAnimation(1)...
27aef7a7-e633-4248-8194-b1a129a4ef46
7
public static boolean testPropertyP(Stella_Object self, Surrogate relation) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_TEST_PROPERT...
4d1a8577-f623-424c-a0aa-8a4e42c69f48
9
private void searchGoodWord(List<String> words) { if(words != null && !words.isEmpty()) { List<Keyword> keywordList = dictionary.getKeywordList(); int priority = -1; float distance = 1; int elementId = -1; int elementIdRegardingDistance = 0; for(int i = 0; i < words.size(); i++) { String[] p...
272c6ee8-3911-4bac-8201-e8e1692f8424
7
public void move() throws Exception { rightPressed = false; View.count++; int timer = 100; int result = 0; int divider = 0; System.out.println("Dragged method running"); OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0); grabber.start(); //Create canvas frame for displaying we...
2f41cedd-9876-4572-8278-f8722809179e
5
public Instruction findMatchingPop() { int poppush[] = new int[2]; getStackPopPush(poppush); int count = poppush[1]; Instruction instr = this; while (true) { if (instr.succs != null || instr.doesAlwaysJump()) return null; instr = instr.nextByAddr; if (instr.preds != null) return null; in...
875671cf-ef0c-4a37-9be9-8bf231ff82f2
9
public int compareTo(Object b) { if (getClass() == b.getClass()) { EventModel a = (EventModel) b; if (year > a.year) { return 1; } if (year < a.year) { return -1; } if (mon...
e345be4c-fb66-423a-8ce3-1a9df5855944
9
private TransformNode createNode(String className) throws ClassNotFoundException { TransformNode tr = null; if (ConnectNode.class.getName().equals(className)) { tr = soundProcessor.createConnectNode(); } else if (EchoNode.class.getName().equals(className)) { tr = soundProcessor.createEchoNode(); } else...
ffb6b2e2-74b4-4ec6-8165-6a85551d4063
8
public static void main(String[] args) { boolean timeToExit = false; do { System.out.println("Выберите действие: "); System.out.println("1. Create"); System.out.println("2. Link"); System.out.println("3. Unlink"); System.out.println("4. Message...
accd44f6-e3c5-4ad8-ac9d-2734c604fe39
3
public static boolean checkRoot(String filename) { File[] roots = File.listRoots(); for (File root : roots) { try { String canonicalRoot = root.getCanonicalPath().toLowerCase(); if (filename.toLowerCase().startsWith(canonicalRoot)) { retur...
f61a14c4-2dbd-40f2-906b-59db244b2c81
0
public static void main(String... args) { ConstructorReferenceSAM<ConstructorReference> constructorReference = ConstructorReference::new; System.out.println(constructorReference.whatEverMethodIs().getContent()); ConstructorReferenceSAMWithArgs<ConstructorReference,String> constructorRefere...
54e3c17a-9bd6-48ef-9a9b-139ac788967a
5
private boolean isEnpassant(Position checkedPos, Position beside) { if(!(isValidPos(checkedPos)||isEmptyPlace(checkedPos))) return false; if(!isEmptyPlace(beside)&&!isSameTeam(beside)&&Board.chessBoard.get(beside).moveCount==1) return true; return false; }
973b0fd8-fe88-4e04-ab9d-469e42c1678a
5
public static String generateCard() { String temp = new String(); String newCard = new String(); int tmp; Random rand = new Random(); int cardDigits[] = new int[16]; // For AmericanExpress 1st digit is always 3, 2nd digit is 7 cardDigits[0] = 3; cardDigits[1] = 4+3*rand.nextInt(2); newCard += cardDi...
5595c679-f819-47f6-9fa5-a3415c9e6c6d
2
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page = ConfigurationManager.getProperty("path.page.hotels"); String prevPage = (String) request.getSessionAttribute(JSP_PAGE); resaveParamsShowHotel(request); formHotelList(r...
202fb4f4-f66f-4f92-99a1-b00b03a747e0
5
public MainFrame() { this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); User user = Service.getCurrentUser(); this.setTitle("Carletti Production Manager - " + user.getUsername() + " (" + user.getGroup() + ")"); this.setResizable(true); this.setSize(600, 500); this.setMinimumSize(new Dimension(500, 450...
96d0c64c-4913-4fe4-92dd-3117ca5725ee
4
public boolean getGenericPortMappingEntry(int index, final PortMappingEntry portMappingEntry) throws IOException, SAXException { Map<String, String> args = new HashMap<String, String>(); args.put("NewPortMappingIndex", Integer.toString(index)); ...
1f7b7722-44cb-470c-9e82-9f38b7b13781
1
public void addToStart(String value) throws AlreadyExist { ListElement current = new ListElement(value); if (count == 0) { head = current; tail = current; } else { current.connectNext(head); head = current; } count++; }
0f1f4ff7-19ef-43e7-982c-95f7e1426afc
2
public static void main(String[] args) { // wap to take input from user and display the pattern according to value /* 2 ** 3 *** 9 ********* 1 * */ int[] arInt=new int[]{2,7,9,11}; for (int j = 0; j < arInt.length; j++) { ...
aae5cbc8-2063-4980-a161-e05d2a0df1c0
8
protected void loadAllManufacturers() { final String filename=getManufacturersFilename(); CMFile xmlFile=new CMFile(filename, null, CMFile.FLAG_FORCEALLOW); if((!xmlFile.exists())||(!xmlFile.canRead())) xmlFile=new CMFile("/resources/examples/manufacturers.xml", null, CMFile.FLAG_FORCEALLOW); manufacturers....
b3555791-3ba4-4013-b820-9aafdacbe124
3
@Override public void run() { while (n < 2000) { try { // this will load the MySQL driver, each DB has its own driver Class.forName("com.mysql.jdbc.Driver"); // setup the connection with the DB. connect = DriverManager.getConnec...
94c2c8b4-ed41-4170-836e-8ec04930c363
8
public RockEntity(double x, double y, double dx, double dy, int width, int height, int size, int type, double gridSize, double spawnTimer) { this.x = x; this.y = y; this.dx = dx; this.dy = dy; this.width = width; this.height = height; this.size = size; thi...
413500cb-56bc-45e1-9863-de0eb9a84bfe
1
private static boolean canSearch(Object o) { return o != null && !(o instanceof Reference); }
7407eebb-3eb1-4621-aee9-02c8ee5b1c87
3
private void writeOut(String output) { String myName = dir.getName(); File out = new File(output + File.separator + myName); if (!out.exists()) { out.mkdir(); } for (DirManager manager : subDirs) { manager.writeOut(output + File.separator + myName); } for (Clazz clazz : classes.values()) { clazz....
62d2928d-3b1b-4684-a4e7-5102e2a8803b
0
String getSlip() { return id; }
a5e967e2-1f21-4aae-950b-837e97c2918d
6
private Set<TKey<?, ?>> setupPortalKeys() { Set<TKey<?, ?>> portalKeys = new LinkedHashSet<>(); portalKeys.add(ProviderKeys.PORTAL_STATUS); portalKeys.add(ProviderKeys.COORDINATE); portalKeys.add(ProviderKeys.LINK); validQualifiers.put(ProviderKeys.LINK, new LinkedHashSet<Class...
f6fe2d91-0e61-43bf-a233-96ef8c3d6bf8
0
public String getPostalCode() { return Address.getPostalCode(); }
59af6cc7-4250-4435-b4c9-91e000deb02c
9
@Override public void setMiscText(String text) { super.setMiscText(""); slots = new Item[0]; slotProps = new Ability[0]; String itemXml = ""; int x=text.indexOf(';'); if(x >=0) { itemXml = text.substring(x+1).trim(); text = text.substring(0,x).trim(); } int numSlots = CMParms.getParmInt(text,...
d9706069-1ea0-42e0-bc6c-bf9eac1e0b16
6
private void loadState() throws IOException { try { String path = CA_PERSISTENCE_PATH + File.separator + CA_ID; File nodeFile = new File(path); ObjectInputStream ois = new ObjectInputStream(new FileInputStream(nodeFile)); CA ca = (CA) ois.readObject(); if (ca.getUserId() != null && ca.getSecurityAge...
53e6686b-a3c0-4b28-baf9-eb98c04a7a93
9
public void renderAddonsTile() { for(Interactable i: addons) { if(i.isVisible()) { int [] image = i.getCurrentPixelArray(); for(int xx=0;xx<i.getWidth();xx++) { for(int yy=0;yy<i.getHeight();yy++) { if(i.getY()+yy>=0 && i.getY()+yy<height && i.getX()+xx>=0 && i.getX()+xx<width && ...
29570b3c-13f5-432b-b23e-5dda583cb46f
5
@Override public O train(I input) throws Exception { Object i = input; for(final Processor p : processors){ p.setContext(context); context.getProgressReporter().reportProgress(p.getClass().getSimpleName() + " train: ", 0); long t0 = System.currentTimeMillis(); ...
25b3239a-80c4-420b-b824-c85a8e15fdd9
6
private boolean isPassableFromTo(int fromx,int fromy, int tox,int toy) { int tileFrom = mapSteps[fromx][fromy]; int tileTo= mapSteps[tox][toy]; int curTileSet = curGb.readMemory(curGb.pokemon.curTilesetAddress); for(int c = curGb.pokemon.tilePairCollisionsLandAddress; memory[c] != 0xFF; c+=3) { if(memory[c] ...
40ca29dc-1f5b-41bb-8940-c2b1c3225359
2
public void readResults() { String saveFile = saveFileName + ".xrsbxl2x"; ReadFile read = new ReadFile("./Results/" + saveFile); List<String> readLines = new ArrayList<>(); try { Collections.addAll(readLines, read.OpenFile()); } catch (IOException ex) { Sy...
28f9ac34-7e31-4e3e-984d-b6bfbf07c47a
4
public synchronized static String inputNotation(int move) { // Gather the information from the move int int fromIndex = fromIndex(move); int toIndex = toIndex(move); int moveType = moveType(move); StringBuilder inputNotation = new StringBuilder(); positionToString(fromIndex, inputNotation); positionToSt...
81c3e1be-dbc1-4385-85e3-6c0c54e221fc
8
@Override public void valueChanged(TreeSelectionEvent arg0) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (node.isLeaf()) { if (prevNode != null) { detectChange(); } tabbedPane.removeAll(); listOfColumns.clear(); G...
a1e15c01-7e11-459f-869d-ee78dd986649
8
public void moveEnemy(int x, int y, Point enemyToMove) { Point newLocation = new Point((int) (enemyToMove.getX() + x), (int) (enemyToMove.getY() + y)); GridSpace gs = grid.get(enemyToMove); GridSpace gs2 = grid.get(newLocation); if (gs.returnLivingThings().get(0).isFrozen()) { return; } // if (this.chara...
ac32b488-f10c-40ae-8b14-e24667afbbc2
5
@Override public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3 && label.getOnCanvas()) { label.erase(canvas.getCurrentLayer()); } else if (e.getButton() == MouseEvent.BUTTON1 && label.getOnCanvas()) { label.drawTile(canvas.getCurrentTile(), canvas....
f5f085e6-33cb-4f8f-907e-15a3133bd795
0
public Environment(Strategy strategy){ this.strategy = strategy; }
7f86015e-0924-431a-9ce3-e0c424cd5d0c
7
public int getBonusScore (int numOfFrame){ int bonusFirst; int bonusSecond; if(numOfFrame==currentFrame-1) return 0; if(scoreBoard[numOfFrame].checkStrike()){ if(numOfFrame==currentFrame-2 && currentRoll%2==1) return 0; bonusFirst = scoreBoard[numOfFrame+1].getFirstPoint(); if(bonu...
0724efa2-4a5c-46b3-9be6-2384a95fd40e
7
private boolean blockBlocksFlow(World par1World, int par2, int par3, int par4) { int var5 = par1World.getBlockId(par2, par3, par4); if (var5 != Block.doorWood.blockID && var5 != Block.doorSteel.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) ...
28a4b755-32d6-4a7d-87d8-8ef02540dcaa
9
private void parser(final Element e) { // Extract the information according to the question's type switch ((String) e.getAttributeValue("type")) { case "truefalse": TrueFalse tf = new TrueFalse(e.getChild("name") .getChildText("text"), e.getChild("questiontext") .getChildText("text"), e.getChild("que...
47ab3b40-0742-4f10-96ff-2d7fcc9cf87b
6
public void update(double deltaTime){ // If the display has been resized, move all elements belonging to this CompositeElement into the same relative position. // i.e. if CompositeElement is at bottom right of screen, after resizing will still be at bottom right of screen. if(Display.wasResized()){ for (GUIEle...
3aa00820-0feb-4338-8faa-23b25ec684eb
7
private void initialize() { gameFrame = new JFrame(); gameFrame.setTitle("Hand and Foot"); gameFrame.setBounds(0, 0, 800, 500); gameFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); gameFrame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { exit(...
ae8bc026-8db1-43cf-946e-56a660f86289
4
protected static void addFileNameToList(DocumentInfo docInfo) { // check to see if this file is in frameInfoList int position = NOT_THERE; String filename = PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PATH); for (int i = 0, limit = frameInfoList.size(); i < limit; i++) { if (Pr...
eee7f3d7-e30f-48a4-b9d3-3e60d8e5bf9d
7
private JMenuItem getPatternLengthItem() { if (patternLengthItem == null) { patternLengthItem = new JMenuItem(); patternLengthItem.setText("Set Pattern Length..."); patternLengthItem.setMnemonic(KeyEvent.VK_L); patternLengthItem.addActionListener(new java.awt.event.ActionListener() { public void actio...
5d515f9c-9f08-4553-8e54-ff89e2a5da0b
0
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
5aa411fd-5978-4dcb-9810-69c615efd8f2
1
@Override public void execute(VirtualMachine vm) { for (int i = 0; i < levelsOfStackToPop; i++) { vm.popRunTimeStack(); } }
adcf3514-6801-45b2-b54a-907e63847c30
7
private static int[] readHeuristics(int h, String fileName) { // Our corners heuristics array will have 88179840 // elements, but not all of them will have a value // as we only calculated heuristics for valid corner // positions starting at the goal state rather than // all possible permutations of corners. ...
6bdaae51-ea0f-457c-868e-5b30966057e2
9
@SuppressWarnings("unchecked") void setLineBits(float dx, float dy) { slope = (dx != 0 ? dy / dx : dy >= 0 ? Float.MAX_VALUE : -Float.MAX_VALUE); lineTypeX = (slope <=1 && slope >= -1); lineDirection = (slope < 0 ? -1 : 1); if (getCachedLine()) return; nBits = (lineTypeX ? g3d.width : g3...
52f15359-ec4e-4c2c-996c-5251af4cfacb
1
public void inicio(FonteFinanciamento fontefinanciamento) throws Exception { salvar = new JButton("Salvar"); id = new JTextInt(fontefinanciamento.getId()); id.setEditable(false); id.setEnabled(false); nome = new JTextField(fontefinanciamento.getNome() == null ? "" : fontefinanciamento.getNome()); JPan...
0341f3ee-c7a6-4910-91d4-6942d25f48ea
3
public void kill() { if (killState.compareAndSet(false, true)) { try { socket.close(); } catch (IOException e) {/*NOP*/} threadGroup.interrupt(); try { deathQueue.put(name); } catch (InterruptedException e) {/*NOP*/} ...
4c32d466-8acb-43b7-bbc4-c91d1288ef97
7
public void show() { int choice; boolean tryAgain; do{ System.out.print("Enter Username: "); username = ConsoleReader.readString(); System.out.print("Enter Password: "); password = ConsoleReader.readString(); tryAgain = !staffBL.isValid(username, password); if(tryAgain) { System....
0b8567af-bfad-44eb-8f76-4dfa028cbf8e
3
private static void setLookAndFeel() { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { // Windows javax.swing.UIManager.setLookAndFeel(info.getClassName());...
23064690-d209-4279-bbcf-247f3e77979a
4
@Override public void update() { yy++; if(yy < 60) { y += 0.2632; } else if(yy > 60 && yy < 120) { y -= 0.2632; } if(yy > 120) { yy = 0; } }
b56a1e08-93fe-4cf9-b1d0-734fe2e55251
8
private static SAMFileHeader mergeHeaders(List<RecordSource> sources) { SAMFileHeader header = new SAMFileHeader(); for (RecordSource source : sources) { SAMFileHeader h = source.reader.getFileHeader(); for (SAMSequenceRecord seq : h.getSequenceDictionary().getSequences()) { if (header.getSequenceDiction...
447e784c-46a8-44a3-8da3-759303e25726
4
private static int toIndex(Direction dir) { switch(dir) { case SOUTH: return 0; case NORTH: return 1; case WEST: return 2; case EAST: return 3; } return 0; }
04e06ff9-028e-4e17-9daf-aa864f60d390
4
public boolean equals(Object obj) { if (obj == this) return true; if (obj != null && obj instanceof Reference) { Reference tmp = (Reference) obj; return (tmp.objf == objf) && (tmp.genf == genf); } return false; }
b419a724-9cca-485a-a9c3-17335a17ced2
0
public Capture nextCapture (Position position){ FactoryOfCapturingsForCpuForPiece factory = new FactoryOfCapturingsForCpuForPiece(position,this,largestCapture); return (Capture) factory.getBest(); }
6705cbb7-6c1e-4730-a92c-93feab05ee04
3
public void reset() { try { // reseting non cached byte stream if (byteArrayInputStream != null) { byteArrayInputStream.reset(); } // reseting cached byte stream if (fileInputStream != null) { fileInputStream.close(); ...
1a74032b-ffb2-4e26-a5b5-de76f6ea84a9
0
public OpenFileMenuItem(FileProtocol protocol) { setProtocol(protocol); addActionListener(this); }
1ff016d9-2a9b-40f1-8bfd-e2227124038e
4
public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative"); if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative"); double xs = s...
ae64e4cc-2aa6-4f17-b5dd-4672618d360e
7
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){ try { Object o1 = session.getAttribute("UserID"); Object o2 = session.getAttribute("UserRights"); boolean bRedirect = false; ...
db1f9eec-06c8-4f0a-9e4b-58bf862fd3b8
8
private void setPrecision() { int firstPos = pos; precisionSet = false; if (pos<fmt.length()&&fmt.charAt(pos)=='.') { pos++; if ((pos < fmt.length()) && (fmt.charAt(pos)=='*')) { pos++; if (!setPrecisionArgPosition()) { variablePrecision = true; ...
f59573fd-6783-4ccb-85e2-2c89c2456299
5
public static void main(String[] args) throws RemoteException { if (System.getSecurityManager() == null) { System.setSecurityManager(new SecurityManager()); } System.out.println("Hello World! salut didier\n"); // EntityManager em = Persistence.createEntityManagerFacto...
f7368d1f-4e89-4a67-a605-cb0a5cedaed7
1
private void initMenu() { JPanel titlePanel = new JPanel(); this.add(titlePanel); JLabel title = new JLabel("Card Counting Training"); titlePanel.add(title); JPanel inputPanel = new JPanel(); this.add(inputPanel); input = new JTextField(2); input.setT...
614502f5-1337-4544-9a32-b7f84f3ef8c8
0
public void ajoutNiemeListeMetadonnee(int n, Metadonnee m) { listeMetaDonnees.add(n, m); }
49b552c4-6fab-4027-9437-f100de482eb8
7
private boolean r_case_other() { int among_var; // (, line 123 // [, line 124 ket = cursor; // substring, line 124 among_var = find_among_b(a_6, 6); if (among_var == 0) { return false; } // ], line 124 bra = cursor; // call R1, line 124 if (!r_R1()) { return false; } switch (among_var)...
6aa5c890-57d5-43a1-b00f-b8d4f4282292
3
private void createSysTrayIcon() { sysTrayIconVisible=true; //Check the SystemTray is supported if (!SystemTray.isSupported()) { log("SystemTray is not supported."); //$NON-NLS-1$ return; } try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e1) { e1.p...
70241c54-f20b-49ac-a224-add6167af08a
2
public static synchronized boolean allowcateUser(Object instance, Object[] users) { for (int i = 0; i < users.length; i++) { if (users[i] == null) { users[i] = instance; return true; } } // could not allocate space for user return false; }
0410053e-0e76-4088-b1c9-845adcfcca1f
8
public static void main(String[] args) { RandomSearchInitialisation starter = new RandomSearchInitialisation(); starter.initLanguage(new char[] { 'a', 'b' }, 10, "[ab]*abab"); int solutionFoundCounter = 0; int noSolutionFound = 0; List<Long> cycleCount = new LinkedList<Long>(); long tmpCycle; long timeSt...
de60dd9d-251a-4d14-93d5-8d75a780df26
8
@Subscribe public void logout(PlayerDisconnectEvent event) throws SQLException { if(!plugin.chatEnabled)return; String name = event.getPlayer().getName(); if(name==null){ for(String data:plugin.onlinePlayers.keySet()){ if(plugin.getProxy().getPlayer(data)==null){ plugin.onlinePlayers.remove(data); ...
ac2a413a-aef5-4e90-90bc-5dcff36a4b45
6
protected ChunkManager(Plots p) { this.p = p; chunkFile = new File(p.getDataFolder(), File.separator+"chunks.yml"); memberFile = new File(p.getDataFolder(), File.separator+"member.yml"); if(!chunkFile.exists()) { try { if(!chunkFile.cre...
c59d8ce2-bdfd-4afe-b33f-bbf2271e7c5c
6
static public String encode(final byte[] bytes) { int i = 0, index = 0, digit = 0; int currByte, nextByte; StringBuffer base32 = new StringBuffer((bytes.length + 7) * 8 / 5); while (i < bytes.length) { currByte = (bytes[i] >= 0) ? bytes[i] : (bytes[i] + 256); // unsign ...
7c0f075a-1804-4d1d-ae55-c89d0e790019
0
public employee(String id) { super(id); }
596b1462-7dc7-4dd7-ba89-a322f742b39e
5
public JSONObject increment(String key) throws JSONException { Object value = this.opt(key); if (value == null) { this.put(key, 1); } else if (value instanceof Integer) { this.put(key, ((Integer) value).intValue() + 1); } else if (value instanceof Long) { this.put(key, ((Long) value).longValue() + 1); ...
b468aa1a-229b-4a40-a485-c735f703a6c2
6
public void title() { switch(titleMenu.select()) { case(-1): break; // Starting a new game case(0): if(Theater.saveFile.matches("New")) { Theater.get().loadStage(); } else { System.out.println("This shoudn't happen"); } closeMenu(); titleMenu = null; break; // Loading a previous s...
04913278-705d-4b8c-bc2b-a8e702c4d62c
1
public boolean canHaveAsCreditLimit(BigInteger creditLimit) { return (creditLimit != null) && (creditLimit.compareTo(BigInteger.ZERO) <= 0); }
cc160c31-ca96-4bef-b22d-6d9edef0801d
4
public BulkAdd(java.awt.Frame parent, String currVersion, List<String> versions, String currCategory) { super(parent); initComponents(); files = new ArrayList<File>(); new FileDrop(jList1, new FileDrop.Listener() { public void filesDropped(File[] f ) { for(in...
3b2a7116-a61f-4fc9-bd2a-6c1c985b2fdf
2
public static int floatAlphaToIntAlpha(float alpha) { if(alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("alpha must be between 0f and 1f. value: " + alpha); } return (int) (255 * alpha); }
c3d09681-c877-4e96-b7ee-bdb57e8b278b
8
private void fileTransfertServer() { Socket l_newClient = null; this.ctrl_fileServerActivation = true; while( this.ctrl_fileServerActivation ) { try { l_newClient = this.ctrl_srvSock.accept(); l_newClient.setSoTimeout( (int) this.ctrl_tcpTransfertTimeout ); ctrl_downloader.ReS...
6d73b8f2-f56a-4be5-8ea1-5c87637e4a32
7
public boolean loadFixMessage( String aFixMessage ) { logger.debug("Loading FIX string " + aFixMessage); if ( ( getAtdl4jOptions().getInputAndFilterData() != null ) && ( getAtdl4jOptions().getInputAndFilterData().getInputSelectStrategyName() != null ) ) { logger.debug("getAtdl4jOptions().getInputAndF...
008d53a5-5d36-4e0c-bb94-40c3e2712f80
9
@Test public void testInstance() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer ac = sp.parseSmiles("Nc1ccccc1"); IAtomContainer g1 = new AtomContainer(ac); AdjacencyList adj = new AdjacencyList(); List<Node> no...
7a34048d-f7c4-4b28-abe4-1cae82adafb8
4
public void checkForUpdate() throws IOException { new Thread(new Runnable() { @Override public void run() { try { int retval = updater.DownloadUrlPool("Files/Version/Serverversion", "Serverversion", null); if (retval == 1) { ...
3031e200-5c20-43d6-8df2-3ec0e6839c4b
7
@Override public V put(K key, V value) { int code=key.hashCode(); int hash =hash(code); hash &=mask; int hash2 =hash2(code); hash2 &=mask; int hash3 =hash3(code); hash3 &=mask; Object tk =table[hash]; if (key.equals(tk)) { V old =(V) table[hash + 1]; table[hash + 1] =value; return old; ...
e483d438-7caa-4316-81dd-152a37814fde
8
public CLIController() { Action exitAction = new Action() { @Override public void execute(ArgSet args) { stopped = true; } }; Action debugAction = new Action() { @Override public void execute(ArgSet args) { int i = args.fetchInteger(); Debugger.setLevel(i); } }; ...
559d1e69-26a7-4dfd-ae65-1b3f93e53395
2
public void renameAndHide() { CPArtwork artwork = controller.getArtwork(); if (layerNb >= 0 && layerNb < artwork.getLayersNb()) { artwork.setLayerName(layerNb, getText()); } layerNb = -1; setVisible(false); setEnabled(false); }
6b51f36a-76d5-4f5f-b3fb-19eeb4b79c45
2
public JSONObject putOpt(String key, Object value) throws JSONException { if (key != null && value != null) { this.put(key, value); } return this; }
127c5cf3-6a03-4a2e-b027-1c93932a78fa
4
public static int recuClimbStairs(int n){ if(n==1) return 1; if(n==2) return 2; int left = 0, right = 0; if(tmpResult[n-1] == 0) tmpResult[n-1] = recuClimbStairs(n-1); left = tmpResult[n-1]; if(tmpResult[n-2] == 0) tmpResult[n-2] = recuClimbStairs(n-2); right = tmpResult[n-2]; return left + ...
dfdc4c92-2249-43c8-973d-00e85e5ae0ad
9
private double calculateScore(ArrayList<seed> seedlist) { double total = 0.0; for (int i = 0; i < seedlist.size(); i++) { double score = 0.0; double chance = 0.0; double totaldis = 0.0; double difdis = 0.0; for (int j = 0; j < seedlist.size(); j++) { if (j != i) { totaldis = totaldis ...
f308f7da-3838-49bc-985e-dc083f2b7120
4
@Override public void mouseDragged(MouseEvent e) { Graphics graphics = d.getGraphics(); if(this.p.getCurrentTool() == -1){ if(working_layer != -1){ if(now_resizing){ p.resizeFigureUsingCorner(working_layer, active_corner, e.getX(), e.getY()); }else{ p.moveFiguresOnLayer(this.working_layer, e.g...
2e4d4c50-0f25-4884-b09e-07ce5bb31463
6
public void update(double time) { switch (enemyState) { case MOVING: updateMovement(time); break; case SHOOTING: break; case SEARCHING: updateSearch(time); break; } if (Collision.canEnemySeePlayer(this)) { enterSightMode(); lastKnownPlayerLoc = Game.getWorld().getPlayer().location; } ...
91061795-922e-4822-8e2b-cbd077b15ab1
2
public static boolean needsUpdate(EntityType type) { boolean b = false; switch (type) { case OBJ_TREE: break; case OBJ_DOOR_WOOD: break; } return b; }
62e7c378-6739-4ffd-bf9d-aaba66c1b419
5
public static void main(String[] args) throws IOException, NumberFormatException { if (args.length < 1) { System.out.println("Please use command \n" +"java -jar yc173.jar \"tilepuzyc173\" \"tilepuzinput.txt\"\n" +"or\n" +"java -jar yc173.jar \"queensyc173\" n \n" +"to run the jar file"); r...
8b9824f9-0665-44b1-bb51-34a32e6a2240
2
public static Punktbewegung findPunktbewegungById(ArrayList<Punktbewegung> punktbewegungs, int id) { for(Punktbewegung punktbewegung:punktbewegungs) { if(punktbewegung.getId()==id) { return punktbewegung; } } return new Punktbewegung(); }
806c50ae-d81f-4751-b4d6-e975ad78eda8
8
public void setData(String title, String yleg, final TimeSeriesCollection tsc) { JFreeChart chart = ChartFactory.createTimeSeriesChart( title, "Date", yleg, tsc, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(){ private stat...
77ac706a-45b0-4ec9-b54f-09da1b53e653
0
@Test public void testReadField_protected() { Assert.assertEquals( "protected", ReflectUtils.readField(new Bean(), "_field3") ); }