method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
df250474-983a-41a3-b6da-576e5c997181
7
protected void readImage() { ix = readShort(); // (sub)image position & size iy = readShort(); iw = readShort(); ih = readShort(); int packed = read(); lctFlag = (packed & 0x80) != 0; // 1 - local color table flag interlace = (packed & 0x40) != 0; // 2 - inte...
f0b94e70-348f-4d04-8559-0494b3d61f0e
9
private static int method503(char ac[], char ac1[], int j) { if (j == 0) return 2; for (int k = j - 1; k >= 0; k--) { if (!method517(ac[k])) break; if (ac[k] == '@') return 3; } int l = 0; for (int i1 = j - 1; i1 >= 0; i1--) { if (!method517(ac1[i1])) break; if (ac1[i1] == '*') ...
b2900b60-0b6f-477e-b535-a594f3a07f07
2
public void draw() { GL11.glPushMatrix(); GL11.glTranslatef((float)(container.getX() - Theater.get().getScreen().camera.getX()), (float)(container.getY() - Theater.get().getScreen().camera.getY()), 0); GL11.glColor3f(0.75f, 0.5f, 1.0f); GL11.glLineWidth(1.0f); GL11.glBegin(GL11.GL_LINE_LOOP); { GL11.g...
552417a4-5fa6-41ac-9634-bed5f0180453
5
public static void main(String [] args) { long limit = ((long)1e8)-1L; long palindromicSum = 0; for (int i=1; i<=Math.sqrt(limit); i++) { long sqSum = 0; for (int j=i; sqSum < limit; j++) { sqSum += j*j; if (i != j) { // don't want a single square like 3*3 = 9 (per hint that 11 palindromics below 1...
4644cd57-73af-449e-ac72-5fda02a390b4
2
@Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof DHCPPacket)) { return false; } DHCPPacket p = (DHCPPacket) o; boolean b; b = (this.comment.equals(p.comment)); b &= (this.op ...
75646ab6-b026-49bb-9264-da9c1a4d11d6
3
public void delete(Integer id){ Vector<String> usr = fileToVector(); FileWriter usersFile = null; PrintWriter pw = null; String key = id.toString(); try{ usersFile = new FileWriter("users.txt"); pw = new PrintWriter(usersFile); int i=0; while(i<usr.size()){ if(!usr.get(i).equals(key)){ pw...
3c5708c1-ec36-46bd-ac2c-176d601dbeee
8
private void processRequest(Packet packet) throws IOException { Packet out = null; if(packet == null) { out = Packet.getIncorrectCommandPacket(); } else { String code = packet.getCode(); if(code.equals(Packet.PACKET_CODES.REGISTR...
cc534b60-b0a3-48ca-9298-c4959fe968ea
9
private void btnSubmit() { Factory f = new Factory(); try { String username = this.txtUsername.getText(); Authentication a = Factory.createAuthentication(); ArrayList<User> u = f.getUsers(); System.out.println(username); //System.out.println(this.txtPassword.getPassword()); if(a.authenticateUs...
2d1a4dcb-7064-4776-8614-d29a6c08b814
9
protected static void createDescriptor() { try { InputStream descriptorStream = TTC13ParseControllerGenerated.class.getResourceAsStream(DESCRIPTOR); InputStream table = TTC13ParseControllerGenerated.class.getResourceAsStream(TABLE); boolean filesystem = false; if(descriptorStream == ...
716be531-3cbb-476f-ab31-8500695a7822
3
public void showProfileToFile(FileWriter f) throws IOException, ProfileNotSetException { if (this.getEmail() == "" || this.getPhone() == "" || this.getDescription() == "") { f.write("User " + this.getName() + " does not have any info set.\n"); } else { f.write("Us...
01dd6d41-7842-4ef9-b7a3-92960d2c9d75
4
@Override public Value evaluate(Value... arguments) throws Exception { // Check the number of argument if (arguments.length == 1) { // get Value Value value = arguments[0]; // If numerical if (value.getType().isNumeric()) { return new Value(new Double(Math.cos(value.getDouble()))); } if (val...
59756905-953e-48c0-bddd-6ebca9dd93fc
4
public static String getCMDKey(final MetaData columnMD, final String line) { if (!columnMD.isAnyRecordFormatSpecified()) { // no <RECORD> elements were specified for this parse, just return the // detail id return FPConstants.DETAIL_ID; } final Iterator<Entry<...
d968c528-f07c-4608-855c-631604676937
9
@Override public void visit(Page page) { if (!(page.getParseData() instanceof HtmlParseData)) { return; } HtmlParseData htmlParseData = (HtmlParseData)page.getParseData(); Document doc = Jsoup.parse(htmlParseData.getHtml()); Elements links = doc.select("a[href^=magnet]"); if (l...
d26c2a8b-5088-464e-972a-0a05dc61f9db
8
public boolean is_legal_bilevel() { final DjVuInfo info = getInfo(); if(info == null) { return false; } final int width = info.width; final int height = info.height; if((width <= 0) || (height <= 0)) { return false; } final JB2Image fgJb2 = getFgJb2(); if(...
1ae8f04e-298e-4f45-88e4-bf9c73af8042
6
@Override public void probeEquivalence(final Node other, final Notification result) { try { final SyntaxNode syntax = (SyntaxNode) other; if (!getAttribute(Attributes.TITLE).equals(syntax.getAttribute(Attributes.TITLE))) { result.error("Titles of syntx differs: '%s' ...
89f411d5-92b8-45c2-bd9a-644af0b10f46
2
private ResultSet executeQueryRS(String sql, Object[] params) { try { con = this.getConnection(); ps = con.prepareStatement(sql); for (int i = 0; i < params.length; i++) { ps.setObject(i + 1, params[i]); } rs = ps.executeQuery(); ...
12013d9a-04fd-4e44-a04e-e483782fddf9
9
public final static String replaceAlls(String str, final String pairs[][]) { if((str==null) ||(pairs==null) ||(str.length()==0) ||(pairs.length==0)) return str; final StringBuilder newStr=new StringBuilder(""); boolean changed=false; for(int i=0;i<str.length();i++) { changed=false; for (final ...
b719104b-6c5b-44b1-a8fb-66c120f7c460
7
public final WaiprParser.stat_return stat() throws RecognitionException { WaiprParser.stat_return retval = new WaiprParser.stat_return(); retval.start = input.LT(1); CommonTree root_0 = null; ParserRuleReturnScope globalstat54 =null; ParserRuleReturnScope localstat55 =null; try { dbg.enterRule(getGramma...
bad1b94b-ffe6-4b5f-a078-38cbe2a80863
4
private int partition(final int p, final int r) { final int x = values[p]; int i = p - 1; int j = r + 1; while (true) { do { j--; } while (values[j] > x); do { i++; } while (values[i] < x); if (i < j) { final int v = values[i]; values[i] = values[j]; values[j] = v; fin...
2940312a-67fa-4f49-8a6b-56e728b6e7a5
4
private ETrainerType trainerTypeMenu(){ ETrainerType trainerType = ETrainerType.NONE; do{ System.out.println("Select the energy type :"); System.out.println("1 - Item"); System.out.println("2 - Supporter"); System.out.println("3 - Stadium"); this.typedChoice = sc.nextLine(); switch(this.typ...
078131a5-fea1-4fa6-a67b-a6f7ec462046
4
private void unloadNatives(String nativePath) { if (!natives_loaded) return; try { Field field = ClassLoader.class.getDeclaredField("loadedLibraryNames"); field.setAccessible(true); @SuppressWarnings("rawtypes") Vector libs = (Vector)field.get(getClass().getClass...
248bcee5-223b-4242-bd76-0968895cb7d3
1
static public void main(String[] argv) throws Exception { // if (argv.length != 2) { // System.err.println("usage: java HTMLLinkExtractor [url] [file-to-process]"); // System.exit(1); // } // argv[0] should be in the form of proto://host.domain/dir/file URL aUrl = new URL("http://index.html"); File aFil...
50d4354c-ec1a-45a5-8171-50d486e7e7b3
6
private void genTajnA() { if (klientA == null || klientA.kluczPrywatny == null) { JOptionPane.showMessageDialog(null, "Naley wygenerowa klucz prywatny uytkownika A.", "Bd", JOptionPane.ERROR_MESSAGE); } else if (klientA.kluczPublicznyB == null) { JOptionPane.showMessageDialog(null, "Naley obliczy klucz publ...
3074e306-a2cf-43dd-b812-63962d268e2c
6
public void interval(int symbol, int[] result, ByteSet exclusions) { if (symbol == ArithCodeModel.EOF) symbol = EOF_INDEX; int sum = 0; for (int i = 0; i < symbol; ++i) if (!exclusions.contains(i)) sum += _count[i]; result[0] = sum; sum += _count[symbol]; result[1] = sum; for (int i = symbol+1; i < _count.lengt...
9328da53-dd64-47bc-b2a6-5c0f60e58987
5
public ArrayList<Interval> merge(ArrayList<Interval> intervals) { ArrayList<Interval> result = new ArrayList<Interval>(); Collections.sort(intervals, new Comparator<Interval>(){ public int compare(Interval obj1, Interval obj2) { if (obj1.start>obj2.start) ...
ebee7417-af2c-43d2-95e5-7a6de091f2f0
0
public WeaponSlots getWeaponSlot(){ return weaponSlot; }
8e2c69dc-e583-4442-bae5-55867d42cf10
2
public void setLineGain(float gain) { if (source != null) { if (source.isControlSupported(FloatControl.Type.MASTER_GAIN)) { FloatControl volControl = (FloatControl) source.getControl(FloatControl.Type.MASTER_GAIN); float newGain = Math.min(Math.max(gain, volControl.ge...
5483eb43-56b1-4fd4-89c6-ec3142c85df3
1
private void readFromFile(File file){ // fieldNameFile.setText(file.getName().split(".java")[0]); fieldNameFile.setText(file.getName()); ArrayList<String> buffer =(ArrayList<String>)PreparingNewAlgos.readSourceFromFile(file); for(int i = buffer.size()-1; i>=0; i--) textArea...
59976425-0c04-4b31-8f12-7e61086f912b
2
@Override public void readValue(NBTInputStream input) throws IOException { while (true) { final NamedBinaryTag nbt = input.readNBT(); if (nbt == null) { return; } this.addTag(nbt); } }
6efd240b-3649-4d7e-95a5-5a1ef9c9a67d
4
public void computeEditKeyFr(float value) { currentTrack().setKeyFr(value); currentTrack().setRefFr(refFr); float frPerBpm = 0; currentTrack().setTempoForRef(currentTrack().getBpm()*currentTrack().getRefFr()/currentTrack().getKeyFr()); if (currentTrack().getTempoForRef() > 0) frPerBpm = currentTrack().ge...
1fe3e579-97b4-4b07-ad30-bf74054eac8c
1
public void testSePeriodAfterStart_RI2() { MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2); try { test.setPeriodAfterStart(new Period(-1L)); fail(); } catch (IllegalArgumentException ex) {} }
70119feb-74e0-4461-95bb-40e78faecd63
8
final public void WhileStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(WHILE); jj_consume_token...
49ba3e05-0f19-4ca9-b384-a783f3718386
4
protected void turnRight() { if (moveDirection == UP) { moveDirection = RIGHT; checkDirection = UP; } else if (moveDirection == RIGHT) { moveDirection = DOWN; checkDirection = RIGHT; } else if (moveDirection == DOWN) { ...
b582888d-bde1-47c9-be23-7cee085834a2
0
public static void w(ActionCharacter x) { x.fight(); }
510fa863-9905-4c75-99da-5d8e7a8e1da0
8
private void merge(int left, int middle, int right){ for(int printCount=left; printCount<=middle; printCount++) System.out.println("MergeSort_Adv: Elements in LeftArray == > "+inputArray[printCount]); for(int printCount=middle+1; printCount<=right; printCount++) System.out.println("MergeSort_Adv: Elements...
5df687c1-8c43-46ae-83ef-5280c8afe3c2
8
@SuppressWarnings("unchecked") private static <T extends Number> T parseNumber(String text, Class<T> targetClass) { if (text == null) { throw new IllegalArgumentException("Text must not be null"); } else if (targetClass == null) { throw new IllegalArgumentException("Target class must not be null"); } Str...
ae7d075f-5ffb-4503-a22b-2a1732868cda
9
public int synthesis(Packet op) { Info vi = vd.vi; // first things first. Make sure decode is ready opb.readinit(op.packet_base, op.packet, op.bytes); // Check the packet type if (opb.read(1) != 0) { // Oops. This is not an audio data packet return (-1...
afb14083-4ea8-4b61-b11f-be977b761ced
7
public static boolean demoPauseP(boolean pauseP, Object [] MV_returnarray) { { boolean exitP = false; String input = null; if (pauseP) { System.out.print("------ pause ------"); input = InputStream.readLine(Stella.STANDARD_INPUT); System.out.println(); if (input.length()...
82f0d4dd-333c-44f9-b2f0-8fb1077712a1
5
public void tick() { up = keys[KeyEvent.VK_UP]; down = keys[KeyEvent.VK_DOWN]; left = keys[KeyEvent.VK_LEFT]; right = keys[KeyEvent.VK_RIGHT]; enter = keys[KeyEvent.VK_ENTER] || keys[KeyEvent.VK_E]; use = keys[KeyEvent.VK_X]; attack = keys[KeyEvent.VK_C]; ...
c08a54b2-0904-4cc9-9a2e-01b7107d081d
4
public boolean match(PathInput input) { input.rewind(); if ((httpMethods & input.getHttpMethod()) == 0) { return false; } for (Element element : elements) { if (element == null) { continue; } if (!element.match(input)) { ...
9a525bd3-7a63-4d98-a9a8-01e3f5f96a43
6
protected static boolean fixedTimeEqual(String lhs, String rhs) { boolean equal = (lhs.length() == rhs.length() ? true : false); // If not equal, work on a single operand to have same length. if (!equal) { rhs = lhs; } int len = lhs.length(); for (int i = 0; i < len; i++) { if (lhs.charAt(i) == rhs....
78993981-97c9-4da7-80c3-fa3aa068cfc6
0
public CheckResultMessage checkF05(int day) { return checkReport.checkF05(day); }
04152a4f-61bf-4e11-b52f-682b0e022dd1
1
public static void addBlock(Block b) { if (custom.contains(b)) return; custom.add(b); }
0288cd8b-6877-4146-aa8b-b7b221d36185
4
@Override public int compare(Object o1, Object o2) { Aula aula1 = (Aula) o1; Periodo p1 = aula1.getPeriodo(); Aula aula2 = (Aula) o2; Periodo p2 = aula2.getPeriodo(); int flag = 0; if(aula1.getDiaDaSemana() > aula2.getDiaDaSemana() ){ ...
b994b11e-0333-42ff-b34e-bae9ae3abc56
2
public static int ZipFiles(File[] srcfile, String zipFile) { try { // Create the ZIP file OutputStream os = new FileOutputStream(zipFile); BufferedOutputStream bs = new BufferedOutputStream(os); ZipOutputStream out = new ZipOutputStream(bs); // Compress the files for (int i = 0; i < srcfile.length; ...
cc349a2b-aed6-4065-be01-573370f03ffa
3
public void data( String sentence ) { String identifier = sentence.substring( 1, 6 ).replaceAll( "-", "" ); NMEASentence s; Class c; //create class object and sentence try { //get class object c = Class.forName( "com.anthonyontheweb.nmea.sentence." + identifier + "Sentence" ); //create the ...
7af2e2f9-0814-4be4-9ad7-1b19ba2c19ce
8
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Moto other = (Moto) obj; if (!Objects.equals(this.tipo, other.tipo)) { return false; ...
f198ab50-ff8d-4f46-9ff5-de007bb0cf1a
5
public static void allTests() throws IOException{ int error = 0; if(testEmptyString() == false){ error += 1; } if(testRightBraces() == false){ error += 1; } if(test1() == false){ error += 1; } /* if(testPlus() ...
229f04dd-bd8a-4867-ac4f-2678aae8db9b
1
public void run( int pageCount, boolean outputContent ) throws Exception { String seedFile = createSeedFile(pageCount); Path seedFilePath = new Path(seedFile); Configuration conf = new Configuration(); String input = Constants.SEED_INPUT; String output = Constants.POST_OUTPUT_DIR; FileSystem fileSystem =...
cc97801d-7625-45d1-9b10-4e8913ac6503
5
public ComboViewer(Setting s) throws Exception { super(s); box_ = new JComboBox<>(); if (s.getType() == ValueType.ENUM) { @SuppressWarnings("unchecked") EnumSet<?> set = EnumSet.allOf(s.getValue().getEnum().getClass()); for (Object obj : set.toArray()) { box_.addItem(obj.toString()); } } else if...
b02f5eb9-4c7c-4170-b28e-81dfa3e22dd7
1
public static void main(String[] args) throws Exception { SAXBuilder sb = new SAXBuilder(); Document doc = sb.build(new File("jdom.xml")); Element element = doc.getRootElement(); System.out.println(element.getName()); Element student = element.getChild("学生"); System.out.println(student.get...
20d1bd8b-b196-4b4d-aa79-32194ead049c
9
private boolean diagonalIncrementingAttack(int[][] grid, LinkedList<Square> squareStore, boolean pickOne) { //Attack - Diagonal Inc if ((grid[2][0] == 2 && grid[1][1] == 2) && grid[0][2] != 1) { BuildAndAddSquareZeroTwo(squareStore); pickOne = updateGridZeroTwo(grid); } e...
48b3553e-e31b-4c76-aaa9-97b6c8d0519a
2
public int lancerDe(int bonusDe) { showTemp("Lancement du dé..."); int value = (int) Math.round(Math.random() * (3.0 - 1.0)) + 1; if (bonusDe == 0) { showTemp("Résultat: " + value); } else if (bonusDe > 0) { showTemp("Résultat: " + value + " (+ " + bonusDe + ")"); } else { showTemp("Résulta...
1d7d3ab9-b783-40e5-8f63-28ab1bbe43fe
6
private boolean promptForNew(boolean brandNew) { // SO NOW ASK THE USER FOR A WORLD NAME String worldName = JOptionPane.showInputDialog( app.getWindow(), WORLD_NAME_REQUEST_TEXT, WORLD_NAME_REQUEST_TITLE_TEXT, JOptionPane.QUESTION_MESSA...
dbd9910a-0eff-4194-9d0f-bc22f0012c34
1
public static void deleteFile(String realpath) { File file = new File(realpath); if (file.exists()) file.delete(); }
6bafb7ed-5ae9-4404-a9d8-80e8328b5370
5
public CheckResultMessage checkL7(int day){ int r1 = get(17,5); int c1 = get(18,5); int r2 = get(30,5); int c2 = get(31,5); if(checkVersion(file).equals("2003")){ try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if(0!=getValue(r2+7, c2+day, 10).compareTo(getValue(r1+2+day...
fb70ba49-a7de-4f57-b7d9-0be721222b87
4
@Override public boolean equals(Object object) { if (object == null) { return false; } if (object == this) { return true; } if (object instanceof Instructor) { Instructor other = (Instructor) object; return name.equals(other.get...
1cf7edd8-bbad-4a29-aa35-508f4af1fbf7
4
public void parseVariable() { String var = nameField.getText() + ";"; if(stringField.isEnabled()) { var += "S;" + stringField.getText(); } else if(intSpinner.isEnabled()) { var += "I;" + intSpinner.getValue(); } else if(booleanBox.isEnabled()) { var += "B;" + booleanBox.isSelected(); } else if(floatS...
aed72392-a77c-4985-9f0e-52093ce12335
3
public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and fe...
53839ed0-b237-4f64-8696-246690653112
8
public Object retrieve(String key) { if(key == null) { return null; } totalAccess++; if(entryMap.containsKey(key)) { RREntry entry = entryMap.get(key); hitCount++; if(debug) System.out.println("Hit cache entry: " + key); return entry.value; } else if(refresherMap.containsKey(key)) { RREntry...
52ce27c2-8932-4dfd-a52a-e6b415235c62
7
@Override public void executeTask() { try { m_SendingSocket = new ServerSocket(LISTEN_PORT); } catch (IOException e2) { LISTEN_PORT += 1; executeTask(); } /* Responding the client to tell them which port to connect to */ try { Server selfServer = new Server(); selfServer .setCurrentIP(...
05a51878-1e83-4202-9469-88ded8454bac
5
synchronized void backward(float[] in, float[] out){ if(_x.length<n/2){ _x=new float[n/2]; } if(_w.length<n/2){ _w=new float[n/2]; } float[] x=_x; float[] w=_w; int n2=n>>>1; int n4=n>>>2; int n8=n>>>3; // rotate + step 1 { int inO=1; int xO=0; ...
b556e99c-4705-4aae-a51f-303c66c941cd
0
@Override public int getRowCount() { return size(); }
b98c259f-5cba-46b1-b1f9-08e6964f903f
3
private int getDirection(Pair<Integer, Integer> init, Pair<Integer, Integer> target) { if (target.second - 1 == init.second) { return Mouse.UP; } else if (target.second + 1 == init.second) { return Mouse.DOWN; } else if (target.first - 1 == init.first) { retur...
c5e23a1a-e9f3-434a-8c17-2babff9b240c
2
private void removeParentSelectionPath(TreePath p) { if (p.getPathCount() == 3 || p.getPathCount() == 4) { removeParentSelectionPath(p.getParentPath()); } super.removeSelectionPath(p); }
21cf0ab8-a6a4-44d5-ac4b-91cc63f4061f
6
public void run(){ try{ in = new BufferedReader( new InputStreamReader( clientSocket.getInputStream())); String inputLine; StringBuilder input = new StringBuilder(); Message msg = null; while ((inputLine = in.readLine()) != null) { if (inputLine.equalsIgnoreCase("EOM")){ msg = Mes...
ca9db542-835f-465b-840b-2d5b6fbd80a2
7
private void notifyStatChange(int eventType) { try { Object[] curListeners = listeners.getListenerList(); CycWorkerEvent cwe = null; for (int i = curListeners.length-2; i>=0; i-=2) { if (curListeners[i]==CycWorkerListener.class) { if (cwe == null) { cwe = new CycWorkerEvent(this); } switch(...
2a099869-9852-4038-bb93-702a1af2c336
4
@Override public Object getValueAt(int rowIndex, int columnIndex) { if (row == null) { return ""; } switch(columnIndex) { case 0: return row.getId(); case 1: return row.getVal(); case 2: return row.getExtra(); } return null; }
04299fab-a25f-4db3-a2b8-476448c2a63f
9
public void sendContentProviderMail(Screen s, String data) { //System.out.println("Send mail to CP: " + data); JSONObject form = (JSONObject) JSONValue.parse(data); String email = (String) form.get("email"); String id = (String) form.get("identifier"); String provider = (String) form.get("provider"); ...
d40c6e9c-001b-421d-a885-795b0f3913d5
0
@Override public void mouseReleased(MouseEvent e) { }
c6e7a78b-ee5f-479c-9242-4834ee14cacd
9
private boolean canDoOpToChunk(int x, int z, int op) { if (x < 0 || x >= xSize) return false; if (z < 0 || z >= zSize) return false; if (chunks[x][z] == null) return false; if (chunks[x][z].opsDone[op]) return false; for (int x...
d1fc52c3-01ff-4abe-b3f6-0582143c092b
1
@Override public void writeTo(Movie movie, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { JsonGenerator gen = Json.createGenerator(entityStream); gen....
3be9e6b7-fc3c-4e8a-9005-9dd8e1d222ca
2
public ArrayList<BEPlaylist> getAllPlaylists() throws Exception { try { if (m_songs == null) { m_songs = ds.getAllPlaylists(); } return m_songs; } catch (SQLException ex) { throw new Exception("Could not get songs..."); } }
c00f7314-ae84-4848-8be5-7bf67b3c1ed9
1
public void afficherDecoder(ArrayList<Integer> decoding) { System.out.print("["); for (Integer tab : decoding) { System.out.print(tab + " "); } System.out.print("]"); }
0e21b829-34cb-4a23-97db-d4b754fd38b8
0
@Override public void setCountry(String c) { super.setCountry(c); }
018815ad-8536-4824-853b-a8689061f931
8
public Sprite getSpriteCollision(Sprite sprite) { // run through the list of Sprites Iterator i = map.getBullets(); while (i.hasNext()) { Sprite otherSprite = (Sprite)i.next(); if (isCollision(sprite, otherSprite)) { // collision found, return the Sprite ...
86fc6cd2-fb7c-4b61-900d-1bec8170cc83
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY); if(target==null) return false; if(!(target instanceof Weapon)) { mob.tell(L("That's not a weapon!")...
1ff8bb84-d12c-45cc-be9b-c5e4289cbaff
0
public String getRegisseur() { return regisseur; }
d6fcf4e1-468f-4696-aefa-a165ab034b43
0
public BasicFileHandler() {}
3d64b1e8-06df-4ca5-9ea9-e197c24217f4
8
public String patch_addPadding(LinkedList<Patch> patches) { short paddingLength = this.Patch_Margin; String nullPadding = ""; for(short x = 1; x <= paddingLength; x++) { nullPadding += String.valueOf((char) x); } // Bump all the patches forward. for(Patch aPatch : patches) { aPatch.start1 += pad...
5c40e9c0-084d-4250-8389-e39a6b13f040
1
@Override public void keyTyped(KeyEvent event) { if (event.getKeyChar() == 'q') { hasQuit = true; } }
615b5e86-2f30-43cc-902d-c2d85926e08e
1
private double[] sampleFlows() { double[] sample = new double[flows.length]; for (int i = 0; i < flows.length; i++) { sample[i] = flows[i].sample(); } return sample; }
06f1447a-7f48-490f-aed3-6ddd52bfa1cd
1
public boolean matches( Class<?> clazz ) { Annotation fromElement = clazz.getAnnotation( this.annotation.annotationType() ); return this.annotation.equals( fromElement ); }
3d27652f-75c9-43a4-837f-9e6a14984e81
7
private static X509Certificate[] getX509CertsFromStringList( String[] paramArrayOfString1, String[] paramArrayOfString2) throws CertificateException { CertificateFactory localCertificateFactory = CertificateFactory .getInstance("X.509"); ArrayList localArrayList =...
41c5e7de-4f7b-4187-95dd-05753a8793cd
6
public MapData createBasicMap(){ for(int y=0;y<mapData.HEIGHT;y++){ for(int x=0;x<mapData.WIDTH;x++){ mapData.map[y][x] = dict.getTile('.'); if(x == 0 || x == mapData.WIDTH-1 || y == 0 || y == mapData.HEIGHT-1){ mapData.map[y][x] = dict.getTile('#'); } } } return mapData; }
52d2382f-d236-4164-a4ce-0291f4b3b0b6
9
public static String numberToWords(int number) { // Zero Rule if (number == 0) { return smallNumbers[0]; } // Array to hold four three digits group int[] digitGroups = new int[4]; // Ensure the number is positive to extract from int positiveNumber = ...
69d9245f-0f33-4639-b96f-707e0b68b2ae
0
public void setAlgorithm(String value) { this.algorithm = value; }
d763f20c-cdfb-43ed-848d-33f1ca2e58bc
9
public void analyseData(String path, int skipf) throws IOException { int amount = new File(path).listFiles().length; for (int i = 1; i <= amount; i += skipf) { DecimalFormat format = new DecimalFormat("0000000"); BufferedImage img = ImageIO.read(new File(path + "image-" + format.format(i) + ".png")); // if...
a6d7e2a4-36e2-4196-befb-c21ba50fa78d
3
public boolean generate(World var1, Random var2, int var3, int var4, int var5) { for(int var6 = 0; var6 < 64; ++var6) { int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); ...
d2223b51-f0d6-478f-8ba6-2725ab7e1d7b
4
public boolean isOptOut() { synchronized(optOutLock) { try { // Reload the metrics file configuration.load(getConfigFile()); } catch (IOException ex) { if (debug) { Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.ge...
c0859bd6-72cd-4dbd-950a-9ccd273f5cf8
2
public String nextString() { String returnedString = null; if(length == 0){ returnedString = ""; } else{ for (int idx = 0; idx < buf.length; ++idx){ buf[idx] = symbols[random.nextInt(symbols.length)]; returnedString = new String(buf); } } ret...
4e482500-691c-4995-8054-26c49f587a46
3
private String getUpdatedLogPropertiesFileContent() { final File propertiesFile = new File(logPropertiesFile); final String logRegex = ".*<file>(.*?)</file>.*"; final String logBackupRegex = ".*<fileNamePattern>(.*?)</fileNamePattern>.*"; final String logPath = (new File(logFilePath, logFileName)).getPath(); ...
4f279cc2-ab10-4e6b-a527-f866ec2fd5a4
2
private void display() { blitNumber((int) totalFps, 5, 2); blitNumber((int) lastPps, 5, 12); plantMan.drawRadar(buffer, car); if (!openGL) { if (!fullscreen) { buffer.display(gFrame, leftBorderWidth, titleBarHeight); } else { Graphics g=bufferStrategy...
6c8cc7db-eca1-491d-a0b1-eced1b942bfb
5
public static void main(String[] args) { try { String input = null; boolean outTime = false; for(int i = 0; i<args.length; i++) { switch(args[i]) { case "-time": outTime = true; break; def...
0f9c5406-aaf4-4ad2-b673-4f92a57a39e9
6
public 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://download.or...
fc7f5689-d0d2-4c80-91a6-3b833145a15a
4
public void mousePressed(MouseEvent e){ int loop; if (!holdingTurret && !sellOrUndo.contains(mX, mY)){ for (loop = 0; loop < turretBuilder.size(); loop++){ if (turretBuilder.get(loop).turretArea().contains(mX, mY)){ turretBuilder.get(loop).changeFocus(true); } else{ turretBuilder.get(loop)....
1e6d8a8e-567d-468d-bd7c-514bef75f978
2
public static HolidayTypeEnumerationx fromValue(DayTypeEnumeration v) { for (HolidayTypeEnumerationx c: HolidayTypeEnumerationx.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v.toString()); }
b087e59f-9f69-467d-984c-36b691cc82a7
6
protected void invoke() { // Reads the memory address register int address = Integer.parseInt(registerStore.readFrom(Register.MAR)); try { // Finds what memory operation should be performed switch(Integer.parseInt(registerStore.readFrom(Register.MRW))...
bb01492a-1456-4eaf-90d9-dec8eca3d2fe
7
private boolean isFinished(Algebra algebra, SolveFor solveFor) { switch(solveFor) { case SOLVE: return algebra instanceof Equation && isSolved((Equation) algebra); case SIMPLIFY: return algebra instanceof AlgebraicParticle && isSimplified((AlgebraicParticle)algebra) || algebra instanceof Expression && (isF...
9ebb8196-610d-48af-8cf1-946fb0005b0e
2
public void update() { for(int i = 0; i < collidable.size(); i++) { if(collidable.get(i).getAttachedEntity().isDead()) { collidable.remove(i); } } }