method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
9034c1bb-47a0-4250-8aa9-25f1ee1f5e71
7
private void method289(Object5 class28) { for(int j = class28.anInt523; j <= class28.anInt524; j++) { for(int k = class28.anInt525; k <= class28.anInt526; k++) { Ground class30_sub3 = groundArray[class28.anInt517][j][k]; if(class30_sub3 != null) { for(int l = 0; l < class30_sub3.anInt1317; l...
d8168fb4-7be4-4c98-8d90-8377902896b8
0
public void setEcho(boolean echoToConsole) {this.echoToConsole = echoToConsole;}
229f6ab8-d453-477a-9564-d904918fbcbe
5
public String multiply(String num1, String num2) { int[] num = new int[num1.length() + num2.length()]; for (int i = 0; i < num1.length(); i++) { int carry = 0; int a = num1.charAt(num1.length() - 1 - i) - '0'; for (int j = 0; j < num2.length(); j++) { ...
b341df56-c5f8-4d69-a909-c6a577c48d26
7
public void EndTurn() { players.Base ply = Game.player.get(currentplayer); for (units.Base unit : Game.units) { unit.acted=false; unit.moved=false; } currentplayer++; if (currentplayer>=totalplayers) {currentplayer=0;day++;} ply = Game.player.get(currentplayer); if (day!=1) { ply.money+=buildingm...
a1155250-80f5-4182-a108-268460255d6a
1
@Override public int getScale(final RoundingContext context) { final Integer decimalPlaces = map.get(SampleRoundingContext.narrow(context)); if (decimalPlaces == null) { return defaultDecimalPlaces; } else { return decimalPlaces; } }
d1622453-1cdb-4aaf-88fd-a1cc0c0f6331
6
SS_translation find_translation(String pref_lang_locale, String format) { String loc = pref_lang_locale; do { // System.out.println("==locale=" + loc + " format=" + format); /* see if this format string exists in the transsets */ SS_translationset ts = trans_by_lang.get(loc); // System.out.printl...
18d8abc9-f9a4-414b-8a57-a40bb8f066b4
4
private Stmt parseStatement() { //System.out.println("parseStatement"); Stmt node = null; switch (showNext().getKind()) { case "ident": Identifier id = new Identifier(acceptIt()); Selector sel = parseSelector(); if (nextIs("assign")) { node = parseAssignment(id,sel); } else { node = parsePro...
0ee3afa3-147d-4d45-878f-5d19d03f4c85
4
public T NextLargest2(T key) throws InvalidPositionException, EmptyTreeException { BTPosition<T> current = checkPosition(root()); Stack<BTPosition<T>> s = new Stack<>(); while (!s.isEmpty() || current != null) { if (current != null) { s.push(current); current = current.getLeft(); } else { ...
0fb0800e-a7cc-4050-ac8a-0c95280c5296
7
@Override public void validate() { super.validate(); if (SUBMIT.equals(getSubmit())) { if (StringUtils.isBlank(bookVO.getBookName()) || !(StringUtils.isAlphaSpace(bookVO.getBookName()))) { addFieldError("bookVO.bookName", "Please enter valid book name"); } if (StringUtils.isBlank(bookVO.getPublis...
cd684338-b464-4c1e-80bd-65fd63385edf
7
private void processObject(Object o){ try { MethodTransfer mt=(MethodTransfer)o; //System.out.println ("method transfer"); MethodDetails md=mt.getMethodDetails(); Class<?> c=couple.getReceiver().getClass(); try { Method m=c.getDeclaredMethod(md.getName(),md.getArgumentTypes()); Object ob=m....
edab2c92-48f8-4165-ae14-d5ec5b29d98f
1
public String getState() { if(isValidState(this.state)){ return this.state; } return null; }
b8167de2-fbd9-478b-b076-5be6ccc8a747
1
public InnerClassInfo[] getExtraClasses() { if ((status & INNERCLASSES) == 0) loadInfo(INNERCLASSES); return extraClasses; }
a4fffb30-2213-4832-86c8-0b31606ceb42
5
public void relayerMessage(String user, long mesID){ int index = getMessageIndexFromID(recentMessages, mesID); if(index != -1 ){ recentMessages.get(index).addAuthors(user); } else { int i = 0; List<Message> old = null; while(index == -1 && i < logs.size()){ old = loadLog(logs.get(i)); inde...
7bfacab2-42d5-4540-ab96-4e7bbab8f44b
8
public void compExecTime() { double newExeTime; double newCost; dEval = 0; dTime = 0; dCost = 0; for (int i = 0; i < iClass; i++) { newExeTime = 0; // System.out.print("Cost[" + i + "]"); for (int j = 0; j < iSite; j++) { if (dmAlloc[i][j] != -1) { if (dmAlloc[i][j] < 1) { newExeTime...
0887cc9b-2aee-4a7e-aab9-923cdd0e9f7e
6
private void setInvisibility(boolean invisible) { Geometry geo = (Geometry)spatial; MatParam param = geo.getMaterial().getParam("Diffuse"); ColorRGBA c; if(param != null) { c = (ColorRGBA)param.getValue(); } else { c = ColorRGBA.White; ...
b729c1e0-a5d2-490c-896e-aecf4af2caba
1
public void reload() { if (!new File(plugin.getDataFolder(), "config.yml").exists()) { plugin.saveDefaultConfig(); } plugin.reloadConfig(); configLoader = (YamlConfiguration) plugin.getConfig(); }
1a04203f-be93-4f26-ad0a-dae02f80b689
1
public DbHelper() throws ClassNotFoundException { Class.forName("org.sqlite.JDBC"); try { // create a database connection connection = DriverManager.getConnection("jdbc:sqlite:" + DATABASE_NAME); Statement statement = connection.createStatement(); statement.setQueryTimeout(30)...
fa6cd402-dd76-4823-b490-55ac9ae9a21c
7
void drawChip(Graphics g) { int i; Font f = new Font("SansSerif", 0, 10 * csize); g.setFont(f); FontMetrics fm = g.getFontMetrics(); for (i = 0; i != getPostCount(); i++) { Pin p = pins[i]; setVoltageColor(g, volts[i]); Point a = p.post; ...
bd23033f-dac8-4738-9d7d-c67673d44065
4
public void analyze(String source) { int originalSize = source.length(); HtmlCompressor compressor = getCleanCompressor(); String compResult = compressor.compress(source); printHeader(); System.out.println(formatLine("Compression disabled", originalSize, originalSize, originalSize)); int prevSize =...
0dc1b318-d356-4893-9a2d-186ec278b9cd
0
public void setSomeList(List<String> someList) { this.someList = someList; }
e1f8599e-e655-4b2c-b6cc-27dfc4037e5f
7
public int[] searchRange(int[] nums, int target) { int[] pos = new int[]{-1, -1}; int start = 0, end = nums.length-1; while(start < end) { int mid = start + (end-start)/2; if(nums[mid] < target) { start = mid + 1; } else { en...
2b0538af-da04-4394-96af-8cf2f24bbdd4
8
public void update(int delta, boolean beat, int bpm) { this.bpm = bpm; if (beat) { altBeat++; if (game.getCurrentLevel().getLevelNumber() > 0) { xPosition++; } if (altBeat % 4 == 0) setupLavaGlow = true; } ArrayList<TileEffect> toRemove = new ArrayList<TileEffect>(); for (TileEffect t ...
46978bff-5d41-45de-aeaa-a0992dff9adb
3
public static Boolean[] wordsTrusts(boolean[] trusts, Boolean[] boundaries) { if (boundaries.length == 0) { // Trust anything with no boundaries return new Boolean[] {true}; } else { List<Boolean> wordsTrusts = new LinkedList<Boolean>(); for (int i = 0; i < boundaries.length; i++) { // Every time ...
7f27aabd-30dd-4424-b07d-d4045f4424d6
6
public void keyPressed(KeyEvent e) { switch(e.getKeyCode()) { case KeyEvent.VK_LEFT: Kontroller.left = true; break; case KeyEvent.VK_RIGHT: Kontroller.right = true; break; case KeyEvent.VK_UP...
392a4cbc-c290-4c92-9b50-e488c52588da
8
@Override public Class<?> getColumnClass(int columnIndex) { switch (columnIndex) { case 0: return String.class; case 1: return Integer.class; case 2: return Integer.class; case 3: return Integer.c...
f635b7e1-b62a-4085-aea2-50ee5373a6b4
7
@Override public List<CommandEntity> findCommandByLawnMowerIndex(LawnInformationVO information, int index) { if (information instanceof TextFileLawnInformationVO) { TextFileLawnInformationVO textFileInformation = (TextFileLawnInformationVO) information; // Reading from file setFileToRead(Paths.get(textFile...
518d58e7-4b8c-4b90-87e2-535478e1b25b
6
public String nextCDATA() throws JSONException { char c; int i; StringBuffer sb = new StringBuffer(); for (;;) { c = next(); if (end()) { throw syntaxError("Unclosed CDATA"); } sb.append(c); i = ...
45e27844-1c44-42fe-87f3-9397876c8537
6
private Vector<String> createRankcapVector(int rank) { Vector<String> rankcapVector = new Vector<String>(); if (rank<4) { rankcapVector.add("11"); rankcapVector.add("10"); rankcapVector.add("9"); rankcapVector.add("6"); rankcapVector.add("3"); } else if (rank<7) { rankcapVector.add("11"); ...
1add7979-a049-48d3-aea4-5762a02979a4
8
public PrimitiveOperator combineMidNLeftOnLeft(PrimitiveOperator other) { boolean[] newTruthTable = new boolean[8]; // the other gate is on the left side - on the MSB newTruthTable[0] = truthTable[((other.truthTable[0]) ? 4 : 0) | 0]; //000 newTruthTable[1] = truthTable[((other.truthTable[0]) ? 4 : 0) ...
6f2d7f0e-09c6-4711-8819-038e03c18fc8
9
@Override public String toString(){ switch(status){ case 0: return "["+formatDate(new Date())+"]" +"[Unapproved]"+getSender().getName() +": /"+getCommand(); case 1: if(getOverseer() != null && getCompletionTime() != null) return "["+formatDate(getCompletionTime())+"]" +"[Approved: "+getO...
72f28656-a34e-45c8-8f74-2582c90302bb
1
private static ArrayList<int[]> readOrWriteNextRLE(RunLengthEncoding rle) throws IOException, ClassNotFoundException { if (WRITE_MODE) { encodeRLE(rle, os); return rleToList(rle); } else { return decodeRLE(is); } }
4c74d11b-00e3-4d32-9d19-4d27078d4c9c
8
public boolean getBoolean(){ String value = this.value.trim().toLowerCase(); if( "true".equals( value )) return true; if( "on".equals( value )) return true; if( "1".equals( value )) return true; if( "yes".equals( value )) r...
cdc68291-1409-4bec-937b-b70e3f11320a
5
int sizeOfNextSubPiece(String content) { if (content.charAt(0) != openingBracket) return -1; int openBrackets = 0; char c; char[] chars = content.toCharArray(); for (int i = 1; i < chars.length; i++) { c = chars[i]; if (c == openingBracket) ...
c6fd929f-4389-4997-b16d-a699b0e782a6
3
public int getMostEast() { for (int c = matrix.length - 1; c >= 0; c--) { for (int r = 0; r < matrix.length; r++) { if (checkSlot(r, c)) return c; } } return -1; }
94391a0b-3f1f-45c9-8b8f-5472cdec7cb3
8
private Rectangle2D createShadow(RectangularShape bar, double xOffset, double yOffset, RectangleEdge base, boolean pegShadow) { double x0 = bar.getMinX(); double x1 = bar.getMaxX(); double y0 = bar.getMinY(); double y1 = bar.getMaxY(); if (base == RectangleEdge.TOP) {...
05cea51b-815a-45c9-99e7-327575e710cb
3
public static void init() throws IOException { for (int i = 0; i < runAnimationLeft.length; i++) { runAnimationLeft[i] = ((BufferedImage) image).getSubimage(i * 143, 0, 143, 178); runAnimationRight[i] = ((BufferedImage) image).getSubimage(i * 143, 0, 143, 178); } image = ...
9f84d20b-6320-4d73-ad40-3a7e1721c3ae
6
@EventHandler public void playerMove(PlayerMoveEvent event) { PigTeam team = null; for (CTFTeam t : Teams) { if (t.inTeam( CTFPlugin.getTeamPlayer(event.getPlayer()) )) { team = (PigTeam) t; break; } } if (team == null){ return; } Goal goal = team.getGoal(); if (goal ...
7ac0cb22-3dab-40ce-a6d8-ae0d3e247146
1
public int specialHash(){ // EDebug.print(myAutoPoint.hashCode() + getText().hashCode()); return myAutoPoint == null? -1 : myAutoPoint.hashCode() + this.getText().hashCode(); }
8468f127-3497-4d3c-bc35-275eb5baa551
1
public static void main(String[] args) { List<String> list = new ArrayList<String>( Arrays.asList("cat", "dog", "horse") ); System.out.println(list); Iterator<String> it = list.iterator(); while (it.hasNext()) { System.out.println(it.next()); it.remove(); System.out.println(list); } }
3d62cc85-949f-4289-8344-ce87648022cb
7
public void addClassDoc(ClassDoc classdoc) { if (classdoc == null) { return; } addClass(classdoc, allClasses); if (classdoc.isOrdinaryClass()) { addClass(classdoc, ordinaryClasses); } else if (classdoc.isException()) { addClass(classdoc, except...
e73120e6-fd26-46ca-ae4b-0ef4cc204d33
5
private boolean add() throws UnsupportedEncodingException { if(addStoreName == null || addStoreName.isEmpty()) return false ; if(addStoreAddr == null || addStoreAddr.isEmpty()) return false ; String tempName = new String(addStoreName.getBytes("ISO-8859-1"),"UTF-8") ; String tempAddr = new String(addSto...
5bba3706-10aa-46c4-8446-f7829a520ef7
0
IA(Parametre param){ this.listePossibles = new ListeCombinaison(param); this.derniereCombiJouee = null; }
b5dfe166-db0a-4070-8512-68fad6ca8a0f
6
public void makePersistentHumanProp() { try { this.humanProp = (HumanProp) cache.get("humanProp"); LinkedHashMap<String, LinkedHashMap<String, String>> lhm = humanProp .getRootMap(); Element root = new Element("root"); for (String key : lhm.keySet()) { if (key == null || lhm.get(key) == null ...
0a2c9426-2fb0-43bf-81c3-0179cec773d7
1
public Player getOppositePlayer(Player player) { return player == this.playerWhite ? this.playerBlack : this.playerWhite; }
0f2a7369-a551-460f-b7b5-b9ce21f69211
9
protected double updateAll(CorefInput input, CorefOutput outputCorrect, CorefOutput outputPredicted, double learningRate) { double loss = 0d; // Update all false positive and all false negative edges. for (int rightMention = 0; rightMention < input.getNumberOfTokens(); ++rightMention) { int correctClusterOf...
b8f949e8-6dde-46e2-b3ac-b484637c1126
9
private MoveEvalScore minimax(BoardMove node, int depth, int hole) { //if depth = 0 or node is a terminal node if(depth == 0 || Kalah.gameOver(node.getBoard())) { //heuristic value of node return new MoveEvalScore(hole,evalFunc.compareScoringWells(node, initialDepth % 2 == 0 ?node.getNextSide(...
60b70ab3-6cb0-4a50-bc3a-770908b45c63
9
@SuppressWarnings("empty-statement") public void Show(String uname) { User moves = new User(); ASCII_Art a = new ASCII_Art(); ASCII_Tiles t = new ASCII_Tiles(); //Display EQ delayASC(a.getEq(), 250); Options o = new Options(); t.setTilePairs(o.getTilePairs...
ab0b47fa-2d77-44a1-86ef-431e130f9e50
8
private static int merge(Candidate[] K, int k, int i, int[] equvalenceLines, boolean[] equivalence, int p) { int r = 0; Candidate c = K[0]; do { int j = equvalenceLines[p]; int s = binarySearch(K, j, r, k); if (s >= 0) { ...
633e8ea8-76e5-49e2-9804-17df476ee399
5
public void tick() { if (this.currentScene == null) return; synchronized (this.appletRef.getPaintLock()) { Enumeration localEnumeration = this.currentScene.getActors().elements(); while (localEnumeration.hasMoreElements()) { Actor localActor = (Actor)localEnumeration.nextElement...
999eeecc-385e-4702-88dd-b9aa8b1c4411
0
public Node<K> getRight() { return right; }
20f728c1-fc63-49b7-90ec-361fd6c5578b
1
protected HttpClient getHttpClient() { if (this.caHTTPClient == null) { this.caHTTPClient = createHttpClient(); } return this.caHTTPClient; }
ef9380d8-2dd4-471a-98a7-e8b94fffa1ad
3
private void compareButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_compareButtonActionPerformed if (compareFile == null) { JOptionPane.showMessageDialog(this, "Compare file hasn't been set."); return; } if (baseFile == null) { JOption...
5c176b8d-685d-4be3-aca2-d66bd7978ba8
3
public static TreeMap<String,ArrayList<Integer>> SplitAttribute(Table table, String attribute) { int attrSize = table.RowSize(); int attrIndex = table.GetAttributeIndex(attribute); if (attrIndex==-1) return null; // treemap contains subsets of Attribute splitted by TargetAttribute TreeMap<String,ArrayList<In...
3a9f4005-1b0a-449d-8d03-b14f282d7ce9
3
public boolean check(int px, int py) { return px > this.x && px < (this.x + this.w) && py > this.y && py < (this.y + this.h); }
3a4f83d6-599e-4f0b-b916-12256c007260
3
public static void saveChannels() { if (Channels == null || ChannelsFile == null) { return; } try { getChannels().save(ChannelsFile); } catch (IOException ex) { Messenger.severe("Could not save config to " + ChannelsFile); } }
fb67fc5e-758e-46de-982b-f7653788a513
5
private File toFile(final Properties azotProperties, final String key, final String defaultValue) { File file = null; if (azotProperties.getProperty(key) != null) { try { final String fileName = azotProperties.getProperty(key); if(fileName != null) { file = new File(fileName); if(!file.exists()...
962ad0b1-8ba4-4863-bdc5-7af52b4691a1
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...
f7e11633-b1a5-4982-9177-1919a5951011
5
public Component getEditorComponent(final PropertyEditor editor) { String[] tags = editor.getTags(); String text = editor.getAsText(); if (editor.supportsCustomEditor()) { return editor.getCustomEditor(); } else if (tags != null) { // m...
dabba128-7149-4b96-9856-077d1e4d756c
9
private boolean r_Step_4() { int among_var; int v_1; // (, line 140 // [, line 141 ket = cursor; // substring, line 141 among_var = find_among_b(a_7, 18); if (among_var == 0) ...
57ad02ca-1431-4859-a17e-dcfe3177445d
1
public static PropertyResource getInstance(String propPath) { if (PROPERTY_RESOURCE == null) { PROPERTY_RESOURCE = new PropertyResource(propPath); } return PROPERTY_RESOURCE; }
f883764a-bee8-471a-8c11-e23122f39eea
4
public void initEdge(){ for(Node n : this.getNodes()){ int x = Integer.parseInt(n.name.split(":")[0]); int y = Integer.parseInt(n.name.split(":")[1]); if(n.name.split(":")[2].equals("void")){ Node otherNode = this.getNode(x-1 + " : " + y );...
c97e7632-ed78-4830-8ccf-cc4328e4bbf9
4
void incrementalThreadStart() { incrementalEvents = new Vector<ImageLoaderEvent>(); incrementalThread = new Thread("Incremental") { public void run() { // Draw the first ImageData increment. while (incrementalEvents != null) { // Synchronize so we don't try to remove when the vector is null. sy...
ed44a553-8d65-42d0-b623-465c4722cbe0
7
public static void main(String[] args) { int distinct = 0, words = 0, processed = 0; int minlen = Integer.parseInt(args[0]); String lastWordInserted = null; String filename = args[1]; BinarySearchST<String, Integer> st = new BinarySearchST<String, Integer>( 10000); try { BufferedReader input = ne...
b6f385f4-1e37-4ada-ab9f-160a9087cde1
2
@Override public void mouseWheelMoved(MouseWheelEvent event) { if (event.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) { int amt = event.getUnitsToScroll(); JScrollBar bar = event.isShiftDown() ? mHSB : mVSB; bar.setValue(bar.getValue() + amt * bar.getUnitIncrement()); } }
c0e0a0fb-0b78-42bc-a5fc-87c21a113302
9
@Override public DataBuffers getFileData(HTTPRequest request) throws HTTPException { // split the uri by slashes -- the first char is always /!! final String[] url = request.getUrlPath().split("/"); // first thing is to check for servlets if(url.length > 1) { final Class<? extends SimpleServlet> servletC...
772146cf-3022-4826-9b62-04773c1d2cc9
3
public void displayAllCandidates() { if (nakeds == null) { System.out.println("No Candidates Stored"); return; } for (int i=0; i < nakeds.size(); i++) { NakedCandidates current = nakeds.get(i); System.out.println("Eval at Coordinate x="+current.x+", y="+current.y); for (int j=0; j < current.v...
7b3e91b4-7f26-4810-8019-f5d5c6beeeb4
3
public static String postHtml(String url,String charSet,Map<String,String> param){ DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = postForm(url,param); HttpResponse httpResponse = null; try { httpResponse = httpClient.execute(httpPost); } c...
4e70127c-f191-4356-a8f9-9b49b2e6b847
0
public static void main(String[] args) throws Exception { new Main(new File("."), args).start(); }
a834ad9e-519e-4568-9a65-ca79e2f07bdd
3
private String copyOrCatUrl(String dst, String src) { if (src != null) { if (src.startsWith("http://")) { dst = src; } else { if (!src.startsWith("/")) { dst += "/"; } dst += src; } } ...
16f89466-206f-4597-a7d7-bf3c323313ab
7
protected void setProperty(Object object, String name, String value) throws SQLException { Class<?> type = object.getClass(); PropertyDescriptor[] descriptors; try { descriptors = Introspector.getBeanInfo(type) .getPropertyDescriptors(); } catch (Exception ex) { SQLException sql...
efd90752-2c64-47b5-9575-572da62f075d
9
private boolean getShipCoords() { System.out.println("INSIDE GET SHIP COORDS"); this.validPoints = 0; this.pointsOnBoard = 0; int size = this.shipSelected.getSize(); //Gets tje size of the Ship from class Ship int orientation = this.shipSelected.getOrientation(); //Gets the ori...
a5a1be51-43e4-4217-ad3e-f5a36a4aae70
1
protected void demo11() throws IOException, UnknownHostException, CycApiException { if (cycAccess.isOpenCyc()) { Log.current.println("\nThis demo is not available in OpenCyc"); } else { Log.current.println("Demonstrating getImpreciseParaphrase api function.\n"); CycFormulaSentence formula ...
4bd8c1a6-d929-4266-8137-24a1a7da06e1
8
public Coordinate shiftTarget(int direction, Coordinate c) { int shiftWide = 1; switch(direction) { case 0: return new Coordinate(c.getXCoordinate() ,c.getYCoordinate()+shiftWide); case 1: return new Coordinate(c.getXCoordinate()-shiftWide,c.getYCoordinate()+shiftWide); case 2: return new Coordinat...
6ed544d7-b10f-4b5f-9d13-b91468af193a
8
@Override public boolean isValid( PositionValidator validator ) { if (coordinates==null) return false; if (coordinates.size()==0) return false; for ( List<List<Double>> linearRing : coordinates ) { if (linearRing==null) return false; if (linearRing.size()<4) return false; for ( List<Double> posit...
b0d0facc-6083-4bac-8246-07ea6e330f41
7
public static JButton getDefenceThrowButton() { if (defenceThrowButton == null) { defenceThrowButton = new JButton("Throw"); defenceThrowButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // int dice = (Integer) defenceSpinner.getValue(); int dice = ((D...
bbecf186-9821-44ac-ad7c-e2f84c2479ec
3
public Tile getTile(int x, int y) { for (int i = 0; i < tiles.size(); i++) { if (tiles.get(i).getX() == x && tiles.get(i).getY() == y) { return tiles.get(i); } } return null; }
c5e6da81-08c5-40ab-9b7a-82e066430da1
6
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); int MOD = 1000000, MAX = 101; int[][] dp = new int[MAX][MAX]; dp[0][0] = 1; for (int i = 1; i < dp.length; i++) {...
0b9086e4-0f95-4137-90e5-dba93dba75f8
0
@Override public void focusLost(FocusEvent e) { recordRenderer(e.getComponent()); textArea.hasFocus = false; }
3664dada-9406-4f7e-9ea2-42802b904546
8
public static <E extends Comparable <E>> void subsets(E[] array) { if (array == null) return; HeapSort.sort(array); for (int i = 0; i < array.length - 2; i++) { if (array[i] != array[i + 1]) { for (int j = i + 1; j < array.length - 1; j++) { if (array[j] != array[j + 1]) { for (...
7ccf5b30-8bb6-4384-a6e1-1a91f8044ac3
7
protected JPanel createPicrossPanel(boolean fileOpened){ JPanel panel = new JPanel(); // Calculate Parameters int leftColumnWidth = maxSize(picross.left) * pixelSize; int leftColumnHeight = picross.left.size() * pixelSize; int upColumnWidth = picross.up.size() * pixelSize; ...
ca74af50-7ceb-487a-8cec-1a019b2b4d61
0
public String getDescription() { return delegate.getDescription(); }
7b998afa-379c-4c25-9a4a-8c483c1dfed4
5
private void drawPiece(Graphics2D g2) { if (piece == null) return; Pos center = piece.getCenter(); for (int x = 0; x < piece.getWidth(); x++) { for (int y = 0; y < piece.getHeight(); y++) { if (piece.get(x, y)) { int cx = x + posX - center.x; ...
197f27b0-00b8-4068-a5be-b98bbc0b9021
2
public Class<? extends Tag> getListType() { if (type.getName().equals("java.lang.Class")) return CompoundTag.class; else return type; }
49254811-46c6-4031-862f-9118b977310e
5
public void tryProcessNewVehicles(int time,Simulator sim) throws VehicleException, SimulationException { if(time > Constants.CLOSING_TIME || time < 0) throw new VehicleException("Time violate constraints"); // try create new vehicle if(sim.newCarTrial()){ if(sim.smallCarTrial()){ count++; Car sc = n...
682313e4-8e40-4552-9e5f-905f335ce05a
2
public static PlayerChoice randomChoice() { double i = Math.rint(Math.random() * 100); if(i<33) return createPlayerChoiceFromCode(ChoiceCode.P); if(i>66) return createPlayerChoiceFromCode(ChoiceCode.R); return createPlayerChoiceFromCode(ChoiceCode.S); }
2f3034cc-1806-4cfc-80f7-11fda92ae174
7
public void checkpoint(SegmentInfos segmentInfos, boolean isCommit) throws IOException { if (infoStream != null) { message("now checkpoint \"" + segmentInfos.getCurrentSegmentFileName() + "\" [" + segmentInfos.size() + " segments " + "; isCommit = " + isCommit + "]"); } // Try again now to delete an...
0d9bd7c3-5a41-41f5-825d-7720ae5fbb8d
0
public void setBulletTimer(long timer){ this.bulletTimer = timer; }
d98ddab1-bdf4-4ef6-826a-462424c68bd3
3
public void run() { try { boolean running = true; while (running) { // Small delay to prevent spamming of the channel Thread.sleep(_bot.getMessageDelay()); String line = (String) _outQueue.next(); if (line !...
1e7d904b-ed0f-4160-b5ef-e60725e42336
1
protected void calcFATSz() { if (BPB_FATSz16 != 0) { FATSz = BPB_FATSz16; } else { FATSz = BPB_FATSz32; } }
a481505c-1bca-4a6d-b457-65846b74b6b4
8
private int xoff(int dir) { switch (dir) { case 0: case 7: case 6: return -1; case 1: case 5: return 0; case 2: case 3: case 4: return 1; } return 0; }
66931d7d-9090-4fbc-af9c-a58d2c3678e4
2
protected int possiblyAddColVar(CycVariable colVar) { String col = colVar.toString(); int colIndex = -1; List<String> columnNames = getColumnNamesUnsafe(); if ((colIndex = columnNames.indexOf(col)) < 0) { columnNames.add(col); for (List<Object> row : getRS()) { row.add(null); }...
dc92705a-d75b-470f-ac28-d572efcfea36
0
public JPasswordField getjPasswordFieldMdp() { return jPasswordFieldMdp; }
93ba191f-6eea-4d17-9367-8b3baef4dbe0
4
public static void printAll() { try { PreparedStatement stmt = Main.EMART_CONNECTION.prepareStatement("select * " + "from martitem"); ResultSet rs = stmt.executeQuery(); System.out.println("Mart Items:"); while (rs.next()) { System.out.println("Item:"); System.out.println(rs.getString("...
144a089c-9eb9-4ebd-a7b2-2b0e392a4f8e
5
protected void setVisibleComponent(Component component) { if (visibleComponent != null && visibleComponent != component && visibleComponent.getParent() == tabPane) { visibleComponent.setVisible(false); } if (component != null && !component.isVisible()) { component.setVisi...
20370e50-f8e3-4525-b68d-83babbca6b11
9
@Override public double[] calculateFractal3DWithoutPeriodicity(Complex pixel) { iterations = 0; double temp = 0; Complex[] complex = new Complex[1]; complex[0] = new Complex(pixel);//z Complex zold = new Complex(); Complex zold2 = new Complex(); if(parser.f...
a20f6c96-fa13-4653-a65a-7d496c5af436
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 Option)) { return false; } Option other = (Option) object; if ((this.id == null && other.id != null) || (this.i...
a0d3c18b-82d3-49f8-8c0d-dc71b78d6c7a
5
public Overview(Adrianna adrianna) { super(new BorderLayout()); this.adrianna = adrianna; JPanel topPanel = new JPanel(); topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.LINE_AXIS)); topPanel.add(new JLabel("Directory")); topPanel.add(Box.createHorizontalBox()); pathField = new JTextField(ad...
778ae95c-19e5-4982-ba9e-9f4d605e0838
0
@Override public String getDesc() { return "Default"; }
c8f14bce-7797-4739-8d50-88175907d578
7
public void characters(char ch[], int start, int length) throws SAXException { if (title) { document.setTitle(new String(ch, start, length)); title = false; } if (dateline) { document.setDateline(new String(ch, start, length)); dateline = false; } //we don't actually do anything here... this ...
632f0c10-828c-450f-bcf8-c1cbc9a6e30d
2
public static void createDisplay() { try { PixelFormat pixelFormat = new PixelFormat(); ContextAttribs contextAttribs = new ContextAttribs(3,2).withProfileCore(true); Display.setDisplayMode(new DisplayMode(1280, 800)); Display.create(pixelFormat,contextAttribs);...