method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
2c3494f9-818c-4cf4-895b-5e20076e9465
1
protected void processInput() { /*================================================================== * PROCESS INPUT HERE *===================================================================*/ if(board.keyDownOnce(KeyEvent.VK_ESCAPE)) { System.exit(0); } //==========================================...
809e1ae2-e08d-4afd-bc2e-e0642f3d9e90
5
void mergeSuccessors(FlowBlock succ) { /* * Merge the successors from the successing flow block */ Iterator iter = succ.successors.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); FlowBlock dest = (FlowBlock) entry.getKey(); SuccessorInfo hisInfo = (Success...
9a7dd1b0-347f-4e00-bb12-c624d1a75cc3
5
void getPersonList(ArrayList<Person> sendingList) { Date today = new Date(); String name, zodiac; int age; // DefaultTableModel dtModel = new DefaultTableModel(); // Object[] convertedObjects = new Object[4]; // Object[] columnNames = new Object[4]; Object[] con...
f9eac2ed-8ccb-4167-8765-e3483538c851
4
public String generate() { String error = "No errors."; if (details) System.out.println("Biomes flags: PRODUCE="+ioflags.PRODUCE+", SAVE="+ioflags.SAVE+", LOAD="+ioflags.LOAD); if (Utils.flagsCheck(ioflags) != 0) { System.out.println("ERROR: IOFlags object is corrupted, error: "+Utils.flagsCheck(iofla...
c19d6352-c430-48fe-8719-4bccaf85a06a
8
public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); boolean[] self = new boolean[1000001]; for (int i = 1; i <= 1000000; i++) { int tot = 0, x = i; while (x / 10 > 0) { tot += x % 10; x /= 10; ...
2586cc69-96b5-4389-ada6-5fbcd0b203f3
4
public void Unload() { currentlyReading = true; if(hashTable) hashtable.clear(); else if(hashList) hashlist.clear(); else if(binaryTree) binarytree.clear(); else if(naryTree) narytree.clear(); System.gc(); currentlyReading = false; }
78f0166c-6cb2-4f37-b3c0-ddacf5628f39
2
public MenuThing(){ super(); if (System.getProperty("os.name").contains("Mac")) { System.out.println("The game knows that it is running on Mac OS."); System.setProperty("apple.laf.useScreenMenuBar", "true"); //make JMenuBars appear at the top in Mac OS X } else if (System.getProperty("...
adfa7701-9eba-4e9a-aab0-c989fdcacf60
3
public static Integer[] graySuccessor(Integer[] e) { Integer[] copy = Arrays.copyOf(e, e.length); if (hammingDist(copy) % 2 == 0) { copy[0] = 1 - copy[0]; return copy; } else { for (int i = 0; i <= e.length - 2; i++) { if (copy[i] != 0) { ...
15fa902a-79ee-4a09-91e6-beec54ae4d50
1
private List<T> getResults(ResultSet rs) throws SQLException { List<T> results = new ArrayList<T>(); while (rs.next()) { T t = fillFrom(rs); //a.setId(rs.getInt("id")); //a.setDescr(rs.getString("descr")); //a.setCh(rs.getInt("ch")); results.add(t); } ...
d69df00d-383a-4278-a719-4237f87483d2
6
private Rule renameVariables(Rule rule) { int uniqueVariableId = variableIdGenerator.incrementAndGet(); Set<Variable> variables = new HashSet<Variable>(); // At first I'll get a list of all variables that appear in the head of the rule. for (Term term : rule.getHead().getArgs()) { ...
7f7e639c-da22-4467-bc19-6825f45fc8c9
8
public String extend(String s, int l, int r){ if(l == r){ for(;l-1 >= 0 && r+1 < s.length(); --l, ++r){ if(s.charAt(l-1) != s.charAt(r+1)) break; } return s.substring(l, r+1); }else{ for(; l >= 0 && r < s.length(); --l, ++r){ ...
217ad895-70ff-4aec-88f4-7c096172f2e3
9
private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, String> parms, Map<String, String> headers) throws ResponseException { try { // Read the request line String inLine = in.readLine(); if (inLine == null) { ...
46cc2cb6-78f1-49d5-8299-dbe5b7dd0545
6
public void menuPanelUpdate() { playerHealth.setText("Health: " + theGame.getPlayer(0).getHealth()); money.setText("Moneys: $" + theGame.getPlayer(0).getMoney()); time.setText("Time: " + theGame.getTime() + "\n Round: " + theGame.getCurrentMap().getCurrentLevel()); if (theGame.getCurrentTowerInfo() != null) { ...
7d25ec4a-8337-4cef-bb3f-1d2fcf91fc9a
0
@Override public String getName() { return NAME; }
5c35bd20-b37c-48a2-abdf-3a4cc4b011e2
0
private Object readBigInteger() { byte[] longintBytes = new byte[8]; longintBytes[0] = bytes[streamPosition++]; longintBytes[1] = bytes[streamPosition++]; longintBytes[2] = bytes[streamPosition++]; longintBytes[3] = bytes[streamPosition++]; longintBytes[4] = bytes[streamPosition++]; longintBytes[5] = byte...
b725b7b7-14b8-4204-a15f-fed643defd0b
9
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) { this.setSize(0.6F, 1.8F); this.resetHeight(); ChunkCoordinates var4 = this.playerLocation; ChunkCoordinates var5 = this.playerLocation; Block block = (var4 == null ? null : Block.blocksList[worldObj.getBlock...
7a0aff83-b087-4a15-aeba-984563a09e62
8
public Set<Map.Entry<Byte,Long>> entrySet() { return new AbstractSet<Map.Entry<Byte,Long>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteLongMapDecorator.this.isEmpty(); } public ...
bbae716e-42c9-4bdd-9b1e-084faaf137d6
0
public Equivalence deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { return this.getEquivalence(json.getAsJsonArray().get(0)); }
163cf911-160b-40d7-9c4c-32f392b66bd8
1
@Override public Container getCurrentContainer() { if (containerStack.size() > 0) { return (Container) containerStack.get(containerStack.size() - 1); } else { return this; } }
ca0aba4c-c808-486d-9adc-a00b5b614aff
0
public CheckResultMessage check10(int day) { return checkReport.check10(day); }
8fd9186d-dd64-4d77-a924-04cb7aa21d40
6
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileRights other = (FileRights) obj; if (!Arrays...
3c4433f3-682f-48f9-8e16-958061e75011
4
private Enemy createRandomEnemy() { int random = new Random().nextInt(4); switch (random) { case 0: return new Dwarf(this); case 1: return new Elf(this); case 2: return new Hobbit(this); case 3: return new Human(this); } return null; }
1ec93074-59d3-49da-83ed-2d7e787d44d1
2
@RequestMapping(value = {"/SucursalBancaria/{idSucursalBancaria}"}, method = RequestMethod.DELETE) public void delete(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idSucursalBancaria") int idSucursalBancaria) { try { sucursalBancariaDAO.delete(idSucursal...
a2828474-82b4-4dda-832a-671efd5446a7
8
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof OFPortMod)) { return false; } OFPortMod other = (OFPortMod) obj; if (adve...
f27aa4d5-e2a8-49a3-897b-3b61b66a3b5c
0
public EmptyStringCharacterAction() { //super("Test Turing Machines", null); super("Set the Empty String Character", null); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_P, MAIN_MENU_MASK)); this.fileChooser = Universe.CHOOSER; }
a30955f5-73e3-4937-aa2c-1668db50f8d0
8
public boolean isPalindrome(String s) { if (s.length() == 0) { return true; } s = s.toLowerCase(); int start = 0; int end = s.length() - 1; while (start <= end) { while (start < s.length() && !isCharNum(s.charAt(start))) { start++; ...
65afd9a4-3927-401f-8d86-2d31fce5887c
6
public static void main(String[] args) { // test divide by zero - should print an error and exit new Fraction(1, 0); // test multiply Fraction f = new Fraction(3,10); Fraction g = new Fraction(1,2); Fraction h = new Fraction(3,5); if (!f.equals(g.multiply(h))) System.out.println("Multiply f...
35a6e030-615d-4604-9d30-bdf8d575eee2
2
protected void doTestCycAccess10(CycAccess cycAccess) { long startMilliseconds = System.currentTimeMillis(); try { // demonstrate quoted strings //cycAccess.traceOn(); StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("a"); stringBuffer.append('"'); stringB...
189ed6f1-6189-424d-884c-5544dcd7ff00
4
public Rating addRatings(HashMap<String, Object> rat) { @SuppressWarnings("unchecked") HashMap<String, String> holder = (HashMap<String, String>)rat.get("rating"); if(holder.containsKey("authorsId")) this.authorsId = holder.get("authorsId"); if(holder.containsKey("comment")) this.comment = holder.get("comment")...
e703a7a5-a0a1-491c-ad5d-f3f09774d623
1
public static User findOneAdmin() { try { return User.findOne("isAdmin", "1"); } catch (SQLException e) { e.printStackTrace(); return null; } }
b815c995-7a9b-4c88-a753-ac0af5b02912
0
public HospitalFacade() { super(Hospital.class); }
e99500c7-8c68-4225-8b31-0bc472848951
8
public IndexedModel toIndexedModel() { IndexedModel result = new IndexedModel(); IndexedModel normalModel = new IndexedModel(); HashMap<OBJIndex, Integer> resultIndexMap = new HashMap<OBJIndex, Integer>(); HashMap<Integer, Integer> normalIndexMap = new HashMap<Integer, Integer>(); HashMap<Integer, Integer> i...
82961bc9-6dd9-470c-815f-5f36c9bf37f0
4
private void logout() { try { sendToServer(Packet.getLogoutPacket()); PacketManager.readPacketFromStream(in); } catch(Exception e) {} try { out.close(); } catch(Exception e) {} try { in.close(); } catch(Exception e) {} ...
a7916d9e-d2ca-4547-ade3-0fd91fa00975
8
public static Description coerceToDescription(Stella_Object self, Stella_Object original) { if (original == null) { original = self; } if (self == null) { System.out.println("Can't find a description for the object `" + original + "'."); return (null); } { Surrogate testValue000 = ...
90446eb2-1fe7-4223-b108-f1ea62a0aae0
5
private static boolean isNoneHexChar(char c) { // make sure the char is the following return !(((c >= 48) && (c <= 57)) || // 0-9 ((c >= 65) && (c <= 70)) || // A-F ((c >= 97) && (c <= 102))); // a-f }
9681dd4d-b6a0-45af-9046-d5a2cb7698f9
6
public SelectTaskXmlDriver(String xmlStr) throws DocumentException, XmlTypeErrorException { super(); if (!isSelectTaskXml(xmlStr)) { throw new XmlTypeErrorException("not a valid selectTask Xml"); } document = DocumentHelper.parseText(xmlStr); timestamp = d...
bf6b3026-c42d-45d9-aeae-28283b311cda
5
private void compareFrames() { int r, g, b, refDataInt, inDataInt, ip = 0, op = 0, x = 0, y = 0; byte result; while (ip < refData.length) { refDataInt = (int) refData[ip] & 255; inDataInt = (int) this.inData[ip++] & 255; ...
aac28bc7-e196-4ad0-a062-ec04407159ff
1
private ClusterList beginBottomUp() { Cluster newCluster; ClusterList firstClusterList = new ClusterList(); for (int i = 0; i < this.instances.numInstances(); i++) { newCluster = new Cluster(this.instances.instance(i)); firstClusterList.add(newCluster); } return firstClusterList; }
dfa423e8-532f-4bdc-847d-ad202635b1de
3
public void pad(int width) throws IOException { int gap = (int) this.nrBits % width; if (gap < 0) { gap += width; } if (gap != 0) { int padding = width - gap; while (padding > 0) { this.zero(); padding -= 1; ...
48587e0b-db27-4e02-b622-f73328645abf
1
public List<String> getLinks() { Pattern pattern = Pattern.compile("(?i)(?s)<\\s*?iframe.*?href=\"(.*?)\".*?>"); Matcher matcher = pattern.matcher(content); List<String> list = new ArrayList<String>(); while (matcher.find()) { list.add(matcher.group(1)); } return list; }
f951900e-cc05-4146-ad40-a41ff1eb30d0
8
public String isInteresting(String x){ int n = x.length(); boolean[] visited = new boolean[n]; for(int i=0; i<n-1; i++){ if(!visited[i]){ visited[i]=true; boolean found=false; for(int j=i+1; j<n; j++){ if(!visited[j]...
841ce4ab-2ff7-406d-8ae6-04b4096e8634
1
public boolean[] getMarkers(boolean colour) { if (colour) { return markersBlack; } else { return markersRed; } }
b23b1acf-528d-4f25-b0fd-2f3287cfe21a
7
@Override public String niceCommaList(List<?> V, boolean andTOrF) { String id=""; for(int v=0;v<V.size();v++) { String s=null; if(V.get(v) instanceof Environmental) s=((Environmental)V.get(v)).name(); else if(V.get(v) instanceof String) s=(String)V.get(v); else continue; if(V.size(...
963d79f9-ee13-4124-9b0a-c753fec27a49
3
@Override public ExecutionContext run(ExecutionContext context) throws InterpretationException { int x = DrawingZone.turtle.getPosX(); int y = DrawingZone.turtle.getPosY(); Value value = ((AbsValueNode) this.getChildAt(0)).evaluate(context); if (value.getType() == VariableType.NUMBE...
85632511-908e-499f-9f3e-be8ced9a31c3
0
@Test public void testLoadFile() { // String ergebnisstring1 = ""; // String ergebnisstring2 = "Hallo, ich bin ein\nZeilenumbruch "; // String ergebnisstring3 = "Gesperrtes File"; // // // String ergebnisstring4 = // // // "D�ner mit So�e & einer b�rigen t�rkischen Bananen & Co KG"; // // // assertEquals(...
1a04fd77-5625-49a2-9ff9-ca83c81c068f
1
public void setFrontLeftThrottle(int frontLeftThrottle) { this.frontLeftThrottle = frontLeftThrottle; if ( ccDialog != null ) { ccDialog.getThrottle1().setText(Integer.toString(frontLeftThrottle) ); } }
81d13c9d-b83b-4e33-accc-454eddac405f
7
@Override public void run() { ClientHandler c; stop = false; if (!isConnected()) throw new IllegalStateException("Service not connected!"); pool = Executors.newCachedThreadPool(new ClientThreadFactory( getUncaughtExceptionHandler())); try { try { while (!stop) { c = new ClientHandler(ns...
0812396f-f1db-487f-b58b-8c787aa1e4e2
7
private void move() { xa = 0; ya = 0; List<Player> players = level.getPlayers(this, 50); if (players.size() > -0) { Player player = players.get(0); if (x < player.getX()) xa += speed; if (x > player.getX()) xa -= speed; if (y < player.getY()) ya += speed; if (y > player.getY()) ya -= speed; } ...
bc8027d4-a229-4466-9466-40914590f40a
2
public boolean subst(ASTree newObj, ASTree oldObj) { for (ASTList list = this; list != null; list = list.right) if (list.left == oldObj) { list.left = newObj; return true; } return false; }
f828dfbe-9630-43eb-ae0a-28b86c12a04d
6
@EventHandler public void MagmaCubeRegeneration(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.getMagmaCubeConfig().getDouble("Mag...
89c286f7-29d6-4cd0-91a3-42cba593068a
5
public HandlerQueue buildHandlerQueue (Class<? extends IEvent> event) { // create handler queue HandlerQueue queue = new HandlerQueue (); // append queues if (this.handlerMap.containsKey (event)) queue.addAll (this.handlerMap.get (event)); // search for child if (event.getSuperclass () != null) { Class...
56401375-6e76-439f-8e55-0c5fd4488b52
1
public static void ShowEnumSet(EnumSet<FontConstant> enumset) { for(Iterator<FontConstant> iter = enumset.iterator();iter.hasNext();) { System.out.println(iter.next()); } }
237fd7c3-3caa-4e2e-b314-4c4730fac32d
6
public void train(StringWrapperIterator i0) { SourcedStringWrapperIterator i = (SourcedStringWrapperIterator)i0; Set seenTokens = new HashSet(); while (i.hasNext()) { BagOfSourcedTokens bag = asBagOfSourcedTokens(i.nextSourcedStringWrapper()); seenTo...
fbac97c5-9fb7-4afd-bc3a-87c997d8ce05
8
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof User)) return false; User user = (User) o; if (!creationdate.equals(user.creationdate)) return false; if (!email.equals(user.email)) return false; if (!id.equals(user.id)) ret...
484be49a-c8f6-4dee-9f74-16bb30547c95
7
public void terminate() { // If we have any branches which should not be taken, // we need to create a failure handler for if they were taken. if (generateGlobalNotTaken) { // XXX: In the future, if we want to set specific flags here, // can add more instructions after th...
af9563d0-7f7a-45b7-bcee-e250df9f0df0
0
public Address getIndirizzo() { return indirizzo; }
6ae22a40-4768-42df-a9e6-9a2fd5db0961
4
public void getBusiness() throws IOException{ while (true) { String line = reader1.readLine(); if (line==null) break; try{ JSONObject business = new JSONObject(line); String b_id = business.getString("business_id"); List<String> categories = new ArrayList<String>(); JSONArray rawcategories = ...
dd9c01c3-094f-4e94-804b-f78bb7593ff5
3
public static void copyFile(File inF, File outF) throws IOException { // TODO Auto-generated method stub //System.out.println("Copying"); @SuppressWarnings("resource") FileChannel inChannel = new FileInputStream(inF).getChannel(); @SuppressWarnings("resource") FileChannel...
5336d533-5cf0-4aa6-b82c-e4593aa68b35
9
public int uniquePathsWithObstacles(int[][] obstacleGrid) { if (obstacleGrid == null || obstacleGrid.length == 0) return 0; int row = obstacleGrid.length, col = obstacleGrid[0].length; int hash[][] = new int[row][col]; for (int i = 0; i < col; i++) { if (obstacleGrid[0][i] ==...
68510a18-9809-45bd-8bfa-906dfc1fd98d
4
public static Hand getBestHand(Card[] hole, Card[] communalCards) { assert hole.length == 2; assert communalCards.length == 5; Hand[] allHands = new Hand[21]; Card[] available = new Card[]{hole[0],hole[1],communalCards[0], communalCards[1],communalCards[2],communalCards[3],communalCards[4]}; int counter = 0;...
5ed5cf77-8d18-4ca7-9d2a-0082771b0a68
3
public static Boolean readFile(ByteBuffer buffer, FileTransfer fileReceiver){ ByteBuffer readBuffer = buffer.asReadOnlyBuffer(); buffer.limit(50);// 读取50个字节,解析获取内容的长度,内容长度最大为4个FFFF(4个字节),再加上2个字节\r\n String msg = CoderUtils.decode(buffer); if(!MyStringUtil.isBlank(msg)){// 上传文件的请求头 if(fileReceiver.isReadH...
d65ffa95-f5c9-4817-8e25-f15fc9849c29
2
public void tagVirts() { for (Clazz clazz : classes.values()) { clazz.tagVirts(this); } for (DirManager dir : subDirs) { dir.tagVirts(); } }
cd45a245-7796-493f-98da-b768bb96bd99
0
public void setCoef(String coef) { this.coef = coef; }
e3a25d5c-cd8a-4595-a0d3-f689e4d4aea1
0
@Override public String toString() { return this.nodeString(0); }
a3e434fa-4c52-488b-8a71-813926cdb053
3
public void alertNext() { scenesCounter++; if(scenesCounter<scenePics.size()){ scene=scenePics.get(scenesCounter); }else{ if(nextLevel.startsWith("b")){ getKarpfenGame().setLvl(new BossLevel(nextLevel, getKarpfenGame())); }else if(nextLevel.startsWith("s")){ getKarpfenGame().setStory(new Storyli...
550a3264-282e-4fc3-b67b-b2b447e00810
7
public void showValues() { String attribute; ArffSortedTableModel model; ArffTable table; HashSet values; Vector items; Iterator iter; ListSelectorDialog dialog; int i; int ...
d2825779-6727-453e-8f12-1c21dc070d19
4
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof FilterSet)) return false; FilterSet filterSet = (FilterSet) o; if (filters != null ? !filters.equals(filterSet.filters) : filterSet.filters != null) return false; return true; ...
34b5ced8-2ad0-45d9-aa31-d7677bf05989
2
public boolean instanceOf(Object obj, String className) throws InterpreterException { Class clazz; try { clazz = Class.forName(className); } catch (ClassNotFoundException ex) { throw new InterpreterException("Class " + ex.getMessage() + " not found"); } return obj != null && clazz.isInstance(obj...
ec2e4230-0d5b-4478-99c3-05b986e5352f
9
private void addListener() { final MainViewController mainViewController = this; mainView.setAboutMenuListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new AboutPanel(); } }); mainView.setServerConfigMenuListener(new ActionListener() { @Override public vo...
ff7e4dc1-0605-456b-b62b-54ca0d40be2b
5
@Override public void executeCurrentTasks() { System.out.println("Thread: " + threadId + " is executing a task"); setThreadState(THREAD_STATE.RUNNING); // System.out.println("Task list size: " + taskList.size()); for (int i = 0; i < taskList.size(); i++) { Task task = taskList.remove(i); // System.out...
f942ab2b-de93-4647-a246-d669dd5dffa2
2
static void maybeDebugWarn(final String message, final boolean force) { if (DEBUG_ALL || force) { System.err.println(getTimestamp() + " " + message); } }
52485aab-a12a-4965-b594-b05f536cdfed
2
public void closePanel(String chan) { int index = indexOfTab(chan); if (index != -1) { tabs.removeTabAt(index); if (index <= lastChanIndex) lastChanIndex--; } setSelectedTab(); tabs.revalidate(); }
c7e34b68-dde0-4a9a-9f1e-d946f215228f
3
@Before public void setUp() throws Exception { words = Lists.newArrayList(); for (int i = 0; i < 10; i++) { words.add("Eric"); } for (int i = 0; i < 30; i++) { words.add(String.valueOf(i)); } for (int i = 0; i < 50; i++) { words....
2942471e-a475-4016-ac10-ff203cfc72f9
0
public void setPersonId(int personId) { this.personId = personId; }
5c3b0f7f-d6e2-4b76-8d02-0c8a3a600343
4
private void initGui(Stage primaryStage) { this.stage = primaryStage; // splitPaneHoriz = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, splitPaneVerti); // splitPaneHoriz.setResizeWeight(0); // splitPaneHoriz.setDividerLocation(250); // splitPaneHoriz.addPropertyChangeListener(JSplitPane.DIVIDE...
cb81f730-089a-462c-8ff8-9a37b73bbfaf
6
private void humanMove(int playerNumber){ boolean setCell = false; while (true){ int x = 0,y = 0; while (!setCell) { x = GetData.GetXCoordinateOfCell(field); y = GetData.GetYCoordinateOfCell(field); if (playerNumber == FIRST_PLAYER...
5050c551-5c26-4556-8747-551c6b5f1c3a
9
public String [] getOptions() { String [] options = new String [16]; int current = 0; if (m_noCleanup) { options[current++] = "-L"; } if (!m_collapseTree) { options[current++] = "-O"; } if (m_unpruned) { options[current++] = "-U"; } else { if (!m_subtreeRaising)...
cac5202f-5416-4e7e-92cf-8c555a45ef9f
4
private void logErrorsFile(byte[] data) throws IOException { if (ProduceCSV.produceLog) { if (errorsFile.size() == 0) { return; } if (fileErrorLog == null) { openErrorLogFile(); } fileErrorLog.println("------"); ...
8efa2cf2-a382-4284-a8a3-37d5af831373
6
private Boolean potEqual(Table table) { boolean allEqual = true; int max = 0; for (Player player : table.getPlayers()) { if (player == null) { continue; } System.out.println("player : " + player.getName() + " : status : " + player....
94e69fbe-aafe-4eb8-a58b-5f047b06b23b
9
public void buttonListener(int cell){ switch (cell){ case 1: _x = 1; _y = 1; break; case 2: _x = 2; _y = 1; break; case 3: _x = 3; _y = 1; break; case 4: _x = 1; _y = 2; break; case 5: _x = 2; _y = 2; break; case 6: _x = 3; _y = 2; break; ...
0ac5e684-0b45-4e28-9b12-2ccdbcf4861e
1
public byte[] toByteArray() { return cw == null ? null : cw.toByteArray(); }
3cbb5dd3-3287-4dda-9e3b-5f093263ca34
6
public static void main(String[] args) { logger.setLevel(Level.SEVERE); ConsoleHandler handler = new ConsoleHandler(); handler.setLevel(Level.SEVERE); logger.addHandler(handler); if (args.length == 0) { logger.warning("Invalid arguments count."); return; ...
5ee828c3-34fe-43ca-a4ad-0dc4a56bc568
8
public Object nextValue() throws JSONException { char c = nextClean(); String s; switch (c) { case '"': case '\'': return nextString(c); case '{': back(); return new JSONObject(this); case '[': ...
c190945c-7306-42ed-962c-ee0ef7d055e1
2
public static void omniData(Object m){ rover = head; while(rover != null){ if(rover.status == 1){ rover.sendObject(m); } rover = rover.next; } }
8a131d97-87bf-4134-88fb-fb58ffb1821a
7
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(true); request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); session.removeAttribute("error...
1a1fc045-5d76-4b8f-9367-980c5aa984dc
7
long largestPrimeFactor(long number){ ArrayList<Integer> list=new ArrayList<Integer>(); for(int i=2;i<number;i++){ boolean isPrime=false; for(Integer prime:list){ if(i%prime==0){ isPrime=true; break; } } if(isPrime) continue; list.add(i); if(number%i==0){ while(number...
419ca885-ecac-4be1-865c-a65e0c53df85
2
public void openRd(String filename) { try { this.close(); this.filename = filename; inf = true; file = new File(this.filename); sc = new Scanner(file); } catch (FileNotFoundException e) { ExceptionLog.println("Ошибка открытия файла ...
ab00e93e-78fa-4c58-85bb-5b799498e4ca
2
private void connect() throws Exception { // // 创建SSLContext对象,并使用我们指定的信任管理器初始化 // TrustManager[] tm = { new MyX509TrustManager() }; // SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); // sslContext.init(null, tm, new java.security.SecureRandom()); // // 从上述SSLContext对象中...
64b09af0-1c20-4590-a396-742bc447f2f6
6
public boolean treeContains(CoreInterface ci){ if(ci.getClass() == Dvd.class){ if(dvdTree.contains(ci)){ return true; } return false; }else if(ci.getClass() == Location.class){ if(locationTree.contains(ci)){ return true; } return false; }else if(ci.getClass() == Genre.class){ if(genre...
90ae3be9-0685-4df6-b58b-3f9d81182558
4
private boolean isLocationInPicture(final int x, final int y) { boolean result = false; // the default is false if ((x >= 0) && (x < this.picture.getWidth()) && (y >= 0) && (y < this.picture.getHeight())) { result = true; } return result; }
9cdec8cc-64d9-4f26-952d-2aa8eaab0944
7
@EventHandler public void WitherMiningFatigue(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.getZombieConfig().getDouble("Wither.M...
41e00e17-7b1d-47cc-bb77-77f5a96e23f9
5
public void configQuickstart(Object args[]) { // // final TerrainGen TG = new TerrainGen( 64, 0.0f, Habitat.ESTUARY, 0.15f, Habitat.MEADOW , 0.35f, Habitat.BARRENS, 0.35f, Habitat.DUNE , 0.15f ) ; final World world = new World(TG.generateTerrain()) ; TG.setupMi...
f75b4a75-fb31-41dc-869b-864e88f8d504
4
public boolean sabotiere( int auswahl ) { boolean erfolgreich = false; switch ( auswahl ) { case 1: erfolgreich = goldStehlen(); break; case 2: erfolgreich = gebaeudeZerstoeren(); break; case 3: erfolgreich = kornVergiften(); break; case 4: erfolgreich = zufriedenheitVerri...
adb2847c-ac80-4db6-9540-68c59e170180
9
public String prepareURL(String method, HashMap<String, String> params) throws IllegalArgumentException { String ret = Connection.baseURL + method + "?"; boolean first = true; boolean illegalMethod = true; // Validate given method is a supported method for (final String s : Connection.method...
7d132ad9-824c-4eca-9f9e-1cc782070a4e
4
public static void continueDealing(long currentTime) { if (!isDealing) { return; } if (numCardsDealt >= Game.NUM_INITIAL_CARDS) { Game.linkedGet().flipCard(); isDealing = false; return; } if (currentTime - initialTime >= DEAL_DELA...
4ad5c5a8-8983-48ff-8d5a-a7b4ece578bb
5
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; // Draw the ghost Tetromino g2d.setColor(Color.LIGHT_GRAY); for (Point p : myWorld.generateGhostBlockCoordinates()) { g2d.drawRect(p.x * blockSize + 3, p.y * blockSize + 3, blockSize - 6, blockSize - 6)...
94d70868-b527-4db2-bf5f-791aa7dca975
7
private void startup() { HSSettings settings = HSSettings.getInstance(); // The channel store loads its current set of channels. If no channel // list is found then a default set of channels will be loaded into the // list. channelStore.setItemHistory(itemHistory); chann...
11a670ba-6471-4b5e-ab5d-d44454e9ac02
7
private static void removeEmptyComments(File directory) throws IOException { for (File file : directory.listFiles()) { if (file.isDirectory()) { removeEmptyComments(file); } else { for (String currentEnding : CONFIG.getFileEndingsToCheck()) { ...
e5329b78-c296-4fc4-a363-94e32375da3a
1
public String mapMethodName(String owner, String name, String desc) { String s = map(owner + '.' + name + desc); return s == null ? name : s; }
6f1c6969-5d5c-4878-a7aa-348e00a0c23d
2
public Key delMin() { if (isEmpty()) throw new java.util.NoSuchElementException(); Key min = pq[1]; exch(1, N--); sink(1); pq[N + 1] = null; if (N == pq.length / 4) resize(pq.length / 2); return min; }