method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
7179573a-2651-443c-833d-1da354bfb619
0
public boolean transitionsFromTuringFinalStateAllowed() { return transTuringFinal; }
9257c707-40a8-4999-858e-a0d1e957150c
5
public void jsFunction_waitCraft(String wnd, int timeout) { deprecated(); int cur = 0; while (true) { if(cur > timeout) break; if (UI.instance.make_window != null) if ((UI.instance.make_window.is_ready) && (UI.instance.make_window.craft_name.equals(wnd))) return; Sleep(...
7d5ee693-a539-4a26-8789-90ca0bca9e7c
7
public static void getSubString(String input){ HashSet<String> usedset = new HashSet<String>(); HashSet<String> validSet = new HashSet<String>(); for(int i=1; i<=input.length();i++){ for(int j= 0; j+i<= input.length();j++){ String sub = input....
b67a8ead-f143-41e5-b3f1-ad05c56412b8
4
public String getMove() { switch(move){ case 1: return "up"; case 2: return "down"; case 3: return "left"; case 4: return "right"; } return ""; }
cdf29887-715b-454a-aaa8-091bf6f6728f
7
public boolean isSymmetric(TreeNode root) { if (root == null) { return true; } Stack<TreeNode> leftStack = new Stack<>(); Stack<TreeNode> rightStack = new Stack<>(); leftStack.add(root.left); rightStack.add(root.right); while (!le...
ad9b4fe5-5e88-4dd2-949a-e60ccb0ff4b1
6
public static BufferedImage fsDithering(BufferedImage input, int numberOfRedHues, int numberOfGreenHues, int numberOfBlueHues) { BufferedImage result = new BufferedImage(input...
fc9248c7-f986-4c40-aa13-9a6cab77f9d6
5
public static Object invokeMethodWithString(Object o, String methodName, String value) { if (o == null) return null; if (Functions.isEmpty(methodName)) return null; Object retObj; try { Class<?> c = o.getClass(); if (c == null) return null; Method m = c.getMethod(methodName); Object arglist...
3282e37f-d5dc-4c79-a260-79b3d675e2e3
0
private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed System.exit(0); }//GEN-LAST:event_btnSalirActionPerformed
9c551954-dec5-4d51-90bb-643a58a0ab71
4
public Tile getTile(int x, int y) { if(x >= width || x < 0 || y >= height || y < 0) return null; return World.tiles[map[x][y]]; }
e0d5e5cb-6f47-4f0e-93c3-d1d04bdea690
0
public void setIdPrueba(Integer idPrueba) { this.idPrueba = idPrueba; }
ac7e43ba-6245-4939-8847-9dc7cd9352a1
1
public List<ExtensionsType> getExtensions() { if (extensions == null) { extensions = new ArrayList<ExtensionsType>(); } return this.extensions; }
be85c257-fb64-44c3-8e95-8877a5a617db
1
@Override public void actionPerformed(ActionEvent event) { try { Desktop.getDesktop().open(mFile); } catch (IOException exception) { WindowUtils.showError(null, exception.getMessage()); } }
0648df09-3480-4722-964e-730161110c7a
5
@Test public void testRollbackSucceededState() throws ProcessExecutionException, ProcessRollbackException { IProcessComponent<?> comp = TestUtil.executionSuccessComponent(true); // use reflection to set internal process state TestUtil.setState(comp, ProcessState.ROLLBACK_SUCCEEDED); assertTrue(comp.getState(...
f05f71f3-df2f-466c-a65d-d748019ca375
0
protected String[] getViewChoices() { return new String[] { "Noninverted Tree", "Derivation Table" }; }
0622c5ac-1794-4998-a4e2-e5fe5d3c64a7
0
public String getDirFilterExclude() { return this.dirFilterExclude; }
641f4226-7060-4c53-9dce-ba3f0f368209
4
protected static void mult_BYTE_COMP_Data(WritableRaster wr) { // System.out.println("Multiply Int: " + wr); ComponentSampleModel csm; csm = (ComponentSampleModel) wr.getSampleModel(); final int width = wr.getWidth(); final int scanStride = csm.getScanlineStride(); fin...
b4093bd4-cb92-4fe0-96c8-517e616a8c3e
0
public void setBoxDate(Date boxDate) { this.boxDate = boxDate; }
e7322389-54cb-432d-a837-cdd74503499a
8
@Override public void paintComponent(Graphics g) { BufferedImage bufferedImage = new BufferedImage( this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB ); Graphics tmpG = bufferedImage.createGraphics(); super.paintComponent( tmpG ); tmpG.setColor( Color.green ); ...
8f7b300d-47d6-4cb7-8f0a-69ded55da2a0
0
public List tools(AutomatonPane view, AutomatonDrawer drawer) { List list = new java.util.ArrayList(); list.add(new MooreArrowTool(view, drawer)); list.add(new MooreStateTool(view, drawer)); list.add(new TransitionTool(view, drawer)); list.add(new DeleteTool(view, drawer)); ...
5d251909-d04b-401a-8b43-921d94f02d9c
3
private String processStringValues(String rawValue, HashSet<String> stopHash){ if(rawValue.equals("")){ return rawValue; } StringBuilder sb = new StringBuilder(); rawValue = rawValue.toLowerCase(); String[] strArray = rawValue.split(" "); Arrays.sort(strArray); for(String str : strArray){ if(stopHas...
9dfd84d7-1cb0-4d98-9482-c03e5a65db16
4
@SuppressWarnings("rawtypes") @Override public boolean equals(Object o) { if (o instanceof Entry) { Entry other = (Entry) o; return (key == null ? other.getKey() == null : key.equals(other.getKey())) && (value == null ? other.getValue() == null : value.equals(other.getValue())); ...
dc015a82-c5e3-4974-be5c-be8fd1833632
9
private void evaluateNFATransition(Transition transition, ExecutionState candidate, String candidateWord, List<ExecutionState> worklist) { // Add to the worklist any state according to the current state // and the position reached into the candidate word. s...
0102a7d7-b91f-4997-987f-1c269ee21683
2
final void send(ByteBuffer buffer) { mLastActivity = System.currentTimeMillis(); if (isSecure()) { try { mSSLSupport.processOutput(buffer); } catch (Throwable throwable) { Log.error(this, throwable); } } else { mServer.send(mChannel, buffer); } }
fd8af293-3d31-4308-923c-1deabd1c9a6e
2
public HotKeyFlags setKey(String k) { if (k != null && !k.equals("")) low = keysr.get(k); return this; }
99581a96-7bdb-4d2a-8f33-9716ea2bb885
7
public String longestPrefixOf(String s) { if (s == null || s.length() == 0) return null; int length = 0; Node x = root; int i = 0; while (x != null && i < s.length()) { char c = s.charAt(i); if (c < x.c) x = x.left; else if (c > x.c) x = x...
9929374c-57dd-4cf4-a663-ca1affb57458
5
public ChatRmiClient () { client = new Client(); client.start(); // Register the classes that will be sent over the network. Network.register(client); // Get the Player on the other end of the connection. // This allows the client to call methods on the server. player = ObjectSpace.getRemoteObject(clien...
e1d58602-9029-407f-8602-b7b07b0fc6d2
0
@Test public void findDuplicateTypeHand_whenNoPairExists_returnsHighCardHand() { Hand hand = findDuplicateTypeHand(kingQueenNineSixFourThreeTwo()); assertEquals(HandRank.HighCard, hand.handRank); assertEquals(Rank.King, hand.ranks.get(0)); assertEquals(Rank.Queen, hand.ranks.get(1)); assertEquals(Rank.Nine, ...
a51ffde0-5d6b-4b60-b148-3135e91b8529
5
private void registerPermissions () { this.getServer().getScheduler() .scheduleSyncDelayedTask(this, new Runnable() { public void run () { PluginManager pm = instance.getServer().getPluginManager(); Map<Str...
dd4353fa-7493-40ea-a59e-9b2159ec24a7
4
public static String readParamInXmlFile(String paramName, String fileName){ ArrayList<String> params = new ArrayList<String>(); try{ File fXmlFile = new File(fileName); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBu...
ade0865d-8223-4c90-95ff-11a214384c2d
3
public static void modifierSujet(Sujet sujet, String nouveauSujet, String nouveauMessage, Utilisateur utilisateur) throws ChampInvalideException, ChampVideException { if (!sujet.peutModifier(utilisateur)) throw new InterditException("Vous n'avez pas les droits requis pour modifier cette ...
b3189a47-0164-4941-b5a7-fc8cec5a0b49
0
public void setAllProducts(List<Product> allProducts) { this.allProducts = allProducts; }
b155a207-8ff1-4a0e-b1e5-96737053ba8c
0
public void setMemory(Integer memory) { this.memory = memory; }
62f63e12-0fb8-4c32-a1db-74b9f5ed0923
1
public static DbHelper getDbHelper() { if(dbHelper == null){ dbHelper = new DbHelper(); } return dbHelper; }
fe0f87bd-f069-4c0a-beef-5fa3401ef0ff
0
public SimpleDateFormat getFormatter() { return formatter; }
6f192adf-3d3a-41a5-9c04-f0cff3c65d35
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Tipo other = (Tipo) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (n...
ca7a2146-8d29-4f61-8788-81e7450b25d3
1
public Class<?> getColumnClass(int col) { return getValueAt(0, col).getClass(); }
72978ecb-bec5-488f-a7df-7aa7dc062372
0
public static void main(String[] args) { int[] A = {3,4,5,1,4,2}; int[] B = {9,9,9}; int[] C = {1,2}; int target = 6; Solution sl = new Solution(); //int[] result = sl.twoSum(A, target); // int[] result = sl.PlusOne(A); // for(int i=0;i<result.length;i++){ // System.out.println(result[i]); // } // //...
d53366bc-fc79-4db4-9b65-d64dcb1635ff
0
public Set entrySet() { accessTimes.clear(); // we're redoing everything so we might as well touch(map.keySet()); return map.entrySet(); }//entrySet
87bf1183-d7a5-4716-af59-a3b73f034119
8
public static String encodeURI (String argString) { StringBuilder uri = new StringBuilder(); // Encoded URL char[] chars = argString.toCharArray(); for (char c : chars) { if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || mark.indexOf(c) != -1) { ...
33827d6f-ed80-4c22-9d77-23aa0230b71d
3
@Override public void characters( char[] ch, int start, int length ) throws SAXException { if( length > 0 ){ String value = new String( ch, start, length ); String old = stack.getFirst().getValue(); if( old != null && old.length() > 0 ){ ...
7de40c3b-dff7-47b4-9f50-a6a0e63a0ee2
7
private void setVoltageMode() { if (!m_voltageMode) { if(m_robotDrive != null) { m_robotDrive.setMaxOutput(12); } try { if (_leftFrontMotor != null) { _leftFrontMotor.changeControlMode(CANJaguar.Con...
03e285cf-a3f0-4fab-bce1-6923e89d1c0b
4
public boolean isValidField(char row, byte column) { if(row >= 97 && row <= 104 && column <= 7 && column >= 0) { return true; } return false; }
625a6c0f-14d5-4279-a1a9-b8f92254624f
8
public void getRoutes(IntTreeNode p_root, int p_currentSum) { // TreeNode l_cloned = new TreeNode(p_root.getValue()); int l_sumForSubTree = p_currentSum - p_root.getValue(); if (l_sumForSubTree == 0 && p_root.getLeft() == null && p_root.getRight() == null) { for (int l_i = 0; l_i <...
cf3261c1-dda1-4d0d-a50f-2cac0e0d118c
2
@Override public void mouseDragged(MouseEvent event) { if (isEnabled()) { boolean wasPressed = mPressed; mPressed = isOver(event.getX(), event.getY()); if (mPressed != wasPressed) { repaint(); } } }
4c000e98-e318-4db0-8557-789fad57d076
0
public String getId() { return id; }
1f0d113a-518e-4c87-b845-78f0ddfe8030
7
public void keyPressed(int k) { if(k == KeyEvent.VK_LEFT) player.setLeft(true); if(k == KeyEvent.VK_RIGHT) player.setRight(true); if(k == KeyEvent.VK_UP) player.setUp(true); if(k == KeyEvent.VK_DOWN) player.setDown(true); if(k == KeyEvent.VK_W) player.setJumping(true); if(k == KeyEvent.VK_R) player.setScrat...
173bba14-837e-4f3b-984f-9e56c6ddf0d3
9
public static boolean Read(String hostname) { try { BufferedReader prefixes = new BufferedReader(new FileReader(PrefixesFile)); String line; while((line = prefixes.readLine()) != null) { System.out.println("prefixes - readli...
aa9de987-d26b-4bb9-93ee-5cd5d6c1e44a
2
protected JTable createTable(Transition transition) { JTable table = super.createTable(transition); if (!blockTransition) { TableColumn directionColumn = table.getColumnModel().getColumn(2); directionColumn.setCellEditor(new DefaultCellEditor(BOX) { public Component getTableCellEditorComponent(JTable tabl...
7b57d965-9045-451f-814c-4816f546513d
3
@Override public void dataModificationStateChanged(Object obj, boolean modified) { if (modified) { setIcon(StdImage.MODIFIED_MARKER); setToolTipText(MODIFIED); } else { setIcon(StdImage.NOT_MODIFIED_MARKER); setToolTipText(NOT_MODIFIED); } repaint(); JRootPane rootPane = getRootPane(); if (root...
8cc1e25b-f797-47cc-897e-c3d1a2806483
0
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { performTask(request, response); }
829d10ba-60e3-44a6-ac6a-b141ec89461e
2
public double distance(Color color, int mode) { if (mode == RGB_DISTANCE) { int red = this.getRed()-color.getRed(); int green = this.getGreen()-color.getGreen(); int blue = this.getBlue()-color.getBlue(); return Math.sqrt(red*red + green*green + blue*blue); } else if (mode == HSV_DISTANCE) { return...
a979b5b5-6110-4ca9-910a-818929d163ec
8
private static Object[] compare(Scanner testOutputScanner, Scanner correctFileScanner, boolean hadError) { StringBuilder correctOutputStrBldr = new StringBuilder(); StringBuilder testOutputStrBldr = new StringBuilder(); boolean correct = true; while (testOutputScanner.hasNextLine()) { String correctLine = c...
bf8df9b0-d6a3-46d4-8eb4-31c5e2241a29
2
private void relaxLength(Edge e, Node prevNode) { Node nextNode; if (prevNode.equals(e.getFromNode())) { nextNode = e.getToNode(); } else { nextNode = e.getFromNode(); } double g_Score = prevNode.getDistTo() + e.getLength(); if (g_Score < nextNode.getDistTo()) { edgeTo.put(nextNode, e); ...
b173c27a-21aa-4d78-81a6-7065abc0dcd1
9
static Point2D interseccionSq(Line2D l1,Line2D l2){ Point2D p=interseccionLn(l1, l2);if(p==null)return null; double p1x=l1.getX1(),p1y=l1.getY1(),p2x=l1.getX2(),p2y=l1.getY2(),q1x=l2.getX1(), q1y=l2.getY1(),q2x=l2.getX2(),q2y=l2.getY2(),px=p.getX(),py=p.getY(); if(px<=Math.max(p1x,p2x)&&px>=Math.min(p1x,p2x)&&p...
bbb5532a-adfc-4891-81bb-bf0cefa3dd41
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...
e80af5a9-8a00-4f5b-8203-be7565a58a29
8
public boolean incrementIndexes() { if ( fixedRow && fixedColumn || !fixedRow && rowIndex >= maxSize - 1 || !fixedColumn && columnIndex >= maxSize - 1 ) { return false; } if ( !fixedRow ) { rowIndex++; } if ( !fixedColumn ) { columnIndex++; ...
1e88bd80-33f5-425f-804c-350dd8f43c29
9
AddRecord (MainWindow p) { parent = p; textFields = new ArrayList<JTextField>(0); String[] months = { "January","February","March","April","May","June", "July","August","September","October","November","December" }; int currentYear = Calendar.getInstance().get(Calendar.YEAR); int currentMonth = ...
25c5aea9-babf-4ab0-ab8d-88a6344f700a
6
private void kingTopPossibleMove(Piece piece, Position position) { int x1 = position.getPositionX(); int y1 = position.getPositionY(); if((x1 >= 0 && y1 >= 0) && (x1 < maxWidth && y1 <= 6)) { if(board.getChessBoardSquare(x1, y1+1).getPiece().getPieceType() != board.getBlankPiece().getPieceType()) { ...
bb38d984-2202-4f7a-87f6-6909c69e2b02
4
CtNewClass(String name, ClassPool cp, boolean isInterface, CtClass superclass) { super(name, cp); wasChanged = true; String superName; if (isInterface || superclass == null) superName = null; else superName = superclass.getName(); c...
1e7d7553-e00a-4d06-bdc5-dd547c62b111
8
private int compareFuncSanitise(int func) { switch (func) { case NEVER: return 0; case LESS: return 1; case LEQUAL: return 2; case GREATER: return 3; case GEQUAL: return 4; case EQUAL: return 5; case NOTEQUAL: return 6; case ALWAYS: return 7; default: th...
93711322-013b-4a45-a2ca-f24f512ae706
3
@Override public void setAccounting(Accounting accounting) { setAccountTypes(accounting == null ? null : accounting.getAccountTypes()); setAccounts(accounting == null ? null : accounting.getAccounts()); // could be popup.setAccounting() with constructor call in this.constructor popu...
d808e9a3-4ec0-4301-81c8-3a7b98dc76d6
7
public void studentCategorySubscribe(String userid, String categoryName){ int catId = CategoryDao.getCategoryIdByName(categoryName); int id = PersonDao.fetchPersonId(userid); //deleteSubscribedCategories(id); ResultSet rs=null; Connection con=null; PreparedStatement ps=null; try{ String sql="INSERT ...
cae88a5f-e598-43e5-930e-a01bf095efb9
3
public Entity findEntityGlobal(int ID) { for (Layer L : gameLayers) { for (Entity e : L.getEntList() ) { if (e.getID() == ID) { return e; } } } return new Entity(-1); }
06c6d760-dd93-4bf7-b6a3-de07ad6cadbb
7
@Override public void run() { Type type = game.getType(); Player player = game.getPlayer(); String name = type.getName(); Double cost = type.getCost(); Double won = 0.0; Stat stat; ArrayList<Reward> results = getResults(); if(!results.isEmpty()) { // Send the rewards for(Reward rewar...
0f81ce0a-1e81-46f5-b85b-f846350a3d3e
0
@Override public String getCity() { return super.getCity(); }
924790c4-90a7-451d-beb1-82647e105cb4
8
public void doExplosionB(boolean par1) { this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); this.worldObj.spawnParticle("hugeexplosion", this.explosionX, t...
90aab372-1ee6-44bf-b856-508ca990444a
0
@Override public void simpleRender(RenderManager rm) { }
484d5e37-8770-4fce-9b7d-eaec9b9aa038
7
public static void UpdateGeneratorPath(String profile, String genername, String generpath) { File file = new File(profile); if (file.exists()) { try { // Create a factory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // Use ...
03a055ae-05e8-4d02-a703-931a984d9cf1
6
public List<Book> getBooksByBookCategory(int branch_id, int [] bookcategory_id) { List<Book> list = new ArrayList<>(); Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); ...
6d96c938-a77c-42d3-8f6d-09787fe92205
5
private void bellmanFord(int source, int[] dist, HashMap<Integer, HashMap<Integer, Integer>> g){ dist[source]=0; for(int i=1;i<dist.length;i++){ for(int j=1;j<dist.length;j++){ if(dist[j]<Integer.MAX_VALUE){ for(int neighbor:g.get(j).keySet()){ if(dist[neighbor] > dist[j]+g.get(j).get(neighbor)){ ...
364f5f16-0ded-4383-877e-2a405bc93729
1
@Before public void putDataCountingSort(){ a = new int[MAX]; for(int i = 0; i < MAX; ++i){ a[i] = i + 1; } shuffleIntArray(a); }
0be4a3cf-6f97-49e5-904c-051d95ee6041
4
public void executeSetMethod(Object instance, Method method, Object value) { if(method == null) return; try { method.invoke(instance, value); } catch (IllegalArgumentException e) { System.err.println("<ClassInspect> Failed to execute SET Method <" + method.getName() + ">. Arguments passed to method is wr...
24dc6a1d-f2c3-4c98-bef3-60c832c8575a
2
private JMenuBar createMainMenu(ActionListener listener) { JMenuBar menuBar = new JMenuBar(); JMenu menu, submenu; JMenuItem menuItem; // // File Menu // menu = new JMenu(language.getString("menu_file")); menu.setMnemonic(KeyEvent.VK_F); menuBar.add(menu); if (controller.isRunningAsApplet()) { ...
0484cb4c-aed4-402a-b77c-0939622a8d5a
9
public void clickBlock(int par1, int par2, int par3, int par4) { if (this.creativeMode) { this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); PlayerControllerCreative.clickBlockCreative(this.mc, this, par1, par2, par3, par4); thi...
1b5c186a-01ed-41f1-aa25-aa4530527ee0
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Facility)) { return false; } Facility other = (Facility) object; if ((this.facilityID == null && other.facility...
9a108027-85fa-4852-8156-58a56a8ed819
6
public void testSetText() { try { ISOChronology.getInstanceUTC().year().set(0, null, java.util.Locale.US); fail(); } catch (IllegalFieldValueException e) { assertEquals(DateTimeFieldType.year(), e.getDateTimeFieldType()); assertEquals(null, e.getDurationFi...
5aa1af6a-d64d-423d-a5e1-e30430278fd2
9
@Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String name = method.getName(); if (name.equals("close")) { boolean previouslyClosed = closed.getAndSet(true); if (config.isEnabled(Check.RESULT_SET_DOU...
543c289b-356d-4d63-8d1a-bad4e589a617
9
public void onLivingUpdate() { if (!this.worldObj.isRemote) { if (this.isWet()) { this.attackEntityFrom(DamageSource.drown, 1); } --this.heightOffsetUpdateTime; if (this.heightOffsetUpdateTime <= 0) { ...
d4dee6c6-5773-4d52-b8e5-165fc23aaa75
9
public int getsockopt(int option_) { if (ctx_terminated) { ZError.errno(ZError.ETERM); return -1; } if (option_ == ZMQ.ZMQ_RCVMORE) { return rcvmore ? 1 : 0; } if (option_ == ZMQ.ZMQ_EVENTS) { boolean rc = process_...
64b78910-c511-4e7f-bc81-b2065045233d
7
Type constantType(int id){ Object o = constants.nth(id); Class c = o.getClass(); if(Modifier.isPublic(c.getModifiers())) { //can't emit derived fn types due to visibility if(LazySeq.class.isAssignableFrom(c)) return Type.getType(ISeq.class); else if(c == Keyword.class) return Type.getType(Keyw...
97a9fd55-626e-4bb9-9772-a6aa224a7a97
4
public static double[] erlangCresources(double nonZeroDelayProbability, double totalTraffic) { double[] ret = new double[8]; long counter = 1; double lastProb = Double.NaN; double prob = Double.NaN; boolean test = true; while (test) { prob = Stat.erlangCprobability(totalTraffic, counter); if (prob <=...
3422618b-250d-4edf-b729-caad1ecaaa29
8
public void buildClassifier(Instances insts) throws Exception { m_Filter = null; if (!isPresent()) throw new Exception("libsvm classes not in CLASSPATH!"); // remove instances with missing class insts = new Instances(insts); insts.deleteWithMissingClass(); if (!getDoNotReplaceMi...
aa48b755-e27b-4f41-935a-9fee85c66fb6
2
private static void printFileReaders(String prefix, Map<String, FileReadingMessageSource> fileReaders) { Assert.notNull(fileReaders, "Mandatory argument missing."); for (String key : fileReaders.keySet()) { FileReadingMessageSource readTarget = fileReaders.get(key); File inDire...
ea07d701-12f5-4e7c-9117-b9908a03a4b1
5
private ParserResult limitConditionAmount(boolean limited, ParserResult result, SyntaxAnalyser analyser) throws GrammarCheckException { result = this.replaceNick(result, analyser); boolean conditionsIsOk = result.getConditions().size() == result .getDimensionLevelInfo().size(); if (!conditionsIsOk) { ...
b4302026-19eb-4d5d-a9bc-fe582c6cfa8f
1
public StageWelcome(StageManager stageManager, Map<String, String> data) { super(stageManager, data); try { welcome = ImageIO.read(getClass().getResourceAsStream("/graphics/loading/Welcome.png")); } catch (IOException e) { e.printStackTrace(); } }
1aa8ae42-e3b7-40c6-9280-db4aa594d7da
4
public void startMoving(Direction dir) { move(dir); int last = queuedMoveDirectionPreferences.length - 1; int dirIndex = last; for(int i = 0; i < last && dirIndex == last; i++) if(queuedMoveDirectionPreferences[i] == dir) dirIndex = i; for(int i = dirIndex; i >= 1; i--) queuedMoveDirectionPreference...
9b6a89af-bb8e-4e14-adfe-c7bc669be59d
0
protected void onChannelInfo(String channel, int userCount, String topic) {}
c3f9d381-c40b-4240-84a8-22e51fce4b5c
2
public Connection getConnection(String dbname){ PropertiesReader p = PropertiesReader.getInstance(); // 驱动程序名 String driver = p.getValue("mysql.driver",R.Constants.mysql_driver); // URL指向要访问的数据库名scutcs String url = p.getValue("mysql.url"); url = url.replaceAll("\\$\\{d...
ab6f976d-a8b8-4a27-b880-bc4173af3158
0
public String getLocation_id() { return location_id; }
734408e0-650b-4290-bac8-c43a62d8c8fb
8
public void moveCharacters() { for (Character character : characters.values()) { ArrayList<Room> neighboursList = character.getLocation().getNeighbours(); boolean found = false; // if character's hostile, stay if player's in the same room. If not, sense if player's in a nearb...
1fc3a83f-1964-48ce-8ea3-ec7cd642a9e1
7
public static void readStrings (String [] strings, String file) { BufferedReader bufferedReader=null; try { bufferedReader = new BufferedReader (new FileReader(file)); } catch (FileNotFoundException e) { System.out.print(e+"\n"); } ...
e664f23d-38bb-427a-a7e5-f39e072c4206
5
@Override public void marshal(Object o, HierarchicalStreamWriter writer, MarshallingContext mc) { if (normal == true) { for (Field f : mInfo.getAllFields()) { writer.startNode(f.getName()); if (treatAsReferences.contains(f.getType())) ...
47761df4-3274-4127-95f6-ca67698cbaec
1
/** @return The default configuration. */ public String getDefaultConfig() { if (mDefaultConfig == null) { mDefaultConfig = getConfig(); } return mDefaultConfig; }
ea80e60e-8db4-488f-bda3-31e6c0e0c3a0
8
private void parseStatus(String status, Map<String, Object> pageVariables) { switch (status) { case ExceptionMessages.EMPTY_DATA: case ExceptionMessages.FAILED_AUTH: case ExceptionMessages.NO_SUCH_USER_FOUND: case ExceptionMessages.SQL_ERROR: case Exce...
c9b1e342-2584-430c-91a6-8e5fb7a40dce
3
public void addIfaces(Collection result, ClassIdentifier ancestor) { ClassInfo[] ifaceInfos = ancestor.info.getInterfaces(); for (int i = 0; i < ifaceInfos.length; i++) { ClassIdentifier ifaceident = Main.getClassBundle() .getClassIdentifier(ifaceInfos[i].getName()); if (ifaceident != null && !ifaceident...
45001d6f-1a02-412f-81d1-b3be42ae82de
9
public void optimize(ArrayList<House> houses) { if (created) { int start = (int) System.currentTimeMillis(); Optimum opt = new Optimum(this, houses); this.grid = opt.getBestSolution().getGrid(); this.mapObjects = opt.getBestSolution().getMapObjects(); int area = 0; for (int i = 0; i < grid.length...
0a42e832-87aa-448a-b3da-71691c40df98
9
public static void init() { int count = 0; String s; try { BufferedReader in = new BufferedReader(new FileReader("../word-values.txt")); while ((s = in.readLine()) != null) { words[count] = s.trim(); count++; } in.close(); } catch (Exception e) { e.printStackTrace(); } int total...
fb19000d-51d6-48e1-bf75-c35145f30ccd
1
public Node getNode(String expression, Object context) throws XPathExpressionException { assert(expression != null); if(context == null) { assert(document != null); context = document; } return (Node) xpath.evaluate(expression, context...
3816095a-8a00-433a-8a80-9c889cbc2098
6
private void broadSearch(int maxdepth, Vector<Integer> Row) { //Warteschlange die die Knoten bereithaelt LinkedList<Vector<Integer>> Queue = new LinkedList<Vector<Integer>>(); //Startknoten beginnen Queue.add(Row); //Loop sucht nach dem Ziel while(!Queue.isEmpty()) { //Begrenzung der Suchtiefe...
7ec89747-d672-4aee-a9ab-e0885287e070
5
public void filterPacks() { packPanels.clear(); packs.removeAll(); currentPacks.clear(); packMapping.clear(); int counter = 0; selectedPack = 0; packInfo.setText(""); // all removed, repaint packs.repaint(); // not really needed //m...