method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
0543fd5a-6041-44a9-a386-b7422c01f8fb
5
private void predict(Particle a) { if (a == null) return; for (int i = 0; i < particles.length; i++) { double dt = a.timeToHit(particles[i]); if (t + dt < limit) pq.insert(new Event(t + dt, a, particles[i])); } double dtx = a.timeToHitVerticalWall(); double dty = a.timeToHitHorizontalWall(); if...
cb3bae50-bfc9-440b-a905-90ea574fab83
6
private float setFontScale(int line) { String[] hold = script[line].split(":"); float scale = 1; switch (hold[0]) { case "POS": scale = 1f; break; case "EMPLOYE": scale = .5f; break; case "DEPT": scale = 1.5f; break; case "STAGE": scale = 1f; break; case "COLLAB": ...
3d5c8593-2c3a-4f77-a7af-9522d07b02bb
0
@Id @Column(name = "sale_id") public int getSaleId() { return saleId; }
13ff7955-6ed7-41b1-bf8e-496e1fb972d9
6
public boolean checkFields(){ if(this.nameTextField.getText().compareTo("") == 0){ ErrorMessage.giveErrorMessage("Please enter a sequence name."); return false; } if(this.sequencePanel.getOriginalText().compareTo("") == 0){ ErrorMessage.giveErrorMessage("Please enter a genetic sequence."); return f...
b54595e7-30b8-40ca-ab3d-d265ad0fee68
3
@Override public void init() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { ex.printStackTrace(); } //Create and display the applet try { java.awt.EventQueue.invokeAndWait(new Runnable(...
eb41d69e-fcfc-4096-bf20-1be913d1ffc5
1
public void paint(Graphics g){ g.drawImage(this.bodypart.getIcon(), 0, 0, null); if(bodypart.isUsed()){ g.setColor(Color.red); }else{ g.setColor(Color.black); } g.drawString(this.bodypart.getName(), 8, 18); }
48207a9e-c58c-4247-a546-2966aa8773ea
0
public int getId() { return id; }
97be3f65-0f8b-4676-901c-f5215f89c085
4
public void close () { try { if (socketChannel != null) { socketChannel.close(); socketChannel = null; if (selectionKey != null) selectionKey.selector().wakeup(); } } catch (IOException ex) { if (DEBUG) debug("kryonet", "Unable to close TCP connection.", ex); } }
65862d2a-eb9d-4cee-ba7e-05836a161dac
8
public static double incompleteGammaSer(double a, double x) { if (a < 0.0D || x < 0.0D) throw new IllegalArgumentException("\nFunction defined only for a >= 0 and x>=0"); if (x >= a + 1) throw new IllegalArgumentException("\nx >= a+1 use Continued Fraction Representation"); double igf = 0.0D; if (x != 0.0D)...
0e8645aa-454e-4cdc-84d1-9ae9cd914761
5
public void addIncrement(int nmult){ try { if(allowedValue == null){ int n = this.getValue(); if(n + nmult*increment > vmax) { n = vmax; }else if(n + nmult*increment < vmin) { n = vmin; }else{ n += nmult*increment; n = increment * (int)( n / (double)increment + 0.5); } setN...
1186044d-d3ee-4b67-af05-e6d582b234c5
5
public List<BookLanguage> getBookLanguages() { List<BookLanguage> list = new ArrayList<>(); Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConn...
34508744-3c07-489c-b731-88e70e76d360
9
private void processCookies(String setCookie) throws Exception{ //================================= //init Reader input = new StringReader(setCookie); int n = 0; //================================= //parse Set-Cookie pairLoop: while(n != -1){ //init pair StringBuilder key = new StringBuilder()...
46a16343-9418-4ee7-af57-5e74a6ebced4
2
public String otherPlayer(String s) { if (s.equals("red")) return "blue"; else if (s.equals("blue")) return "red"; else return null; }
319972e4-e1c4-4cf8-a724-5d609bd68c27
0
public static void setMinDestToRad(float minDestToRad) { MinDestToRad = minDestToRad; }
74ab810b-9728-4e46-bad0-fd0152850613
5
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed if(Domino.listaTablero.size()!=0&&MiSistema.turno==1){ d.robarFicha(true); this.tablero.add(Domino.listaFichaHumano.get(Domino.listaFichaHumano.size()-1)); ...
90668ea9-d9af-4418-9935-d6c1aeac4f3e
2
public static Entity create(int id, int lvl){ Entity mob = null; switch(id){ case 1: mob = new Slime(lvl); break; case 2: mob = new AniBear(lvl); break; } return mob; }
b234d3ab-29a9-46c9-9747-029c007d6db1
7
private static void ReadWordFileFilldictionary(String string) { BufferedReader br1 = null; BufferedReader br2 = null; Writer writer = null; try { String FirstCurrentLine; String SecondCurrentLine; br1 = new BufferedReader(new InputStreamReader(ParseTamilMeanings.class.getClassLoader().getResource...
0817d26f-c251-45f6-b27f-a9025aafc62f
2
public boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock) { for (int i = 0; i < subBlocks.length; i++) { if (subBlocks[i] == oldBlock) { subBlocks[i] = newBlock; return true; } } return false; }
694c1316-8e93-4d99-bb01-76c76c3547d1
1
private void faceCam(Vector3f direction) { float cameraROT = (float)Math.toDegrees(Math.atan(direction.getZ() / direction.getX())); if(direction.getX() < 0) { cameraROT += 180; } transform.getRotation().setY(cameraROT + 90); }
bbb0a30d-1253-4cbb-b7be-b9d538716f58
9
private static void updateKeyboardList() { mousePressed = false; mouseReleased = false; while(Mouse.next()) { boolean button = Mouse.getEventButtonState(); int eventButton = Mouse.getEventButton(); if(button && eventButton == 0) { mousePressed = true; } else if(!button && eventButton == 0) ...
2c18daac-2a19-4369-9a2d-ecdc0e99e2a0
6
public Map(String res) { tileList = new ArrayList<Tile>(); try { map = new TiledMap(res); for (int i = 0; i < map.getHeight() - 1; i++) { for (int j = 0; j < map.getWidth() - 1; j++) { TileType type = null; if (map.getTileId(j, i, 0) == 1) { type = TileType.WALL; } if (map.getT...
174530b6-b0ff-4129-a1b3-cee75763db45
3
@Override public void parse() throws IllegalArgumentException { try { setEncoding(Encoding.getEncoding(buffer[0])); } catch (IllegalArgumentException ex) { // ignore the bad value and set it to ISO-8859-1 so we can continue parsing the tag setEncoding(Encoding.ISO_...
69a6d1f2-9959-4607-8e4e-e0ed558bb94b
7
private static void setColor(int hue, float sat, float val, int max) { int h = 6*hue/max; float f = 6*(float) hue/max - h; float p = val*(1-sat); float q = val*(1-sat*f); float t = val*(1-sat*(1-f)); if (h == 0 || h == 6) GL11.glColor4f(val,t,p,1); if (h == 1) GL11.glColor4f(q,val,p,1); if (h == ...
9fc64595-1636-41d7-8c5e-472b3ff63db7
8
public DataType typeFromString(String strType){ if(strType.equals("FLOAT")){ return DataType.FLOAT; }else if(strType.equals("STRING")){ return DataType.STRING; }else if(strType.equals("INFILENAME")){ return DataType.INFILENAME; }else if(strType.equals("OUTFILENAME")){ return DataType.OUTFILENAME; ...
4be4da20-974d-497f-8cdf-7b649e352696
0
public Point getInitialPoint() { return initialPoint; }
e0bbd157-0db3-4e93-bbbf-21d942e3bad4
7
@Override public void deserialize(Buffer buf) { nbSubOwned = buf.readInt(); if (nbSubOwned < 0) throw new RuntimeException("Forbidden value on nbSubOwned = " + nbSubOwned + ", it doesn't respect the following condition : nbSubOwned < 0"); subTotal = buf.readInt(); if (sub...
5640eabc-2d33-4664-846d-4c6610f36f03
0
public void setFund(String fund) { this.fund = fund; }
9c61aeb5-6239-435a-bffc-56884431dfbe
2
public String stringApiValue() { if (isKeyword() || (!shouldQuote())) { return toString(); } return "(QUOTE " + toString() + ")"; }
8d5fcaa3-e9eb-408d-bfcf-5b08a1beef7d
7
@Override public Buildable create(Object name, Object value) { if (name.equals("model")) { if (model != null) { throw new ComponentException("Only one 'model' element allowed."); } model = new Model(); model.setRes(res); return mode...
3a5fa710-e306-4f16-9fac-274686b44f00
1
public MainFrame() { super("Conway's Game of Life"); try { doAesthetics(); setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
f835182a-4342-4a1a-9ea9-7da1179dc1a8
1
public static SampleRoundingContext narrow(final RoundingContext context) { if (SampleRoundingContext.class.isInstance(context)) { return (SampleRoundingContext) context; } else { throw new ClassCastException("Not sample context " + context); } }
de691a77-ca55-45a7-bb65-0a33eefff741
5
public void execute(InetAddress addr, int port, JSONObject arguments){ try { Iterator<PodLocation> it = pod.getPendingFriends().iterator(); //on vérifie qu'il s'agit bien d'une réponse à un ADD en parcourant la liste des pendingsFriends. while(it.hasNext()) { PodLocation friendLocation = it.next(); ...
2f618314-da19-473c-841d-9bc21c722523
1
public void changeVIP(){ if (VIP == false){ VIP = true; }else{ VIP = false; } }
5ba4a8df-0191-40e5-8158-35cf373021df
0
public Object getFoo() { return foo; }
c89ec33d-a88e-4c5e-b102-fe71be6cf95e
7
private void unicast (Message m, int delay) { int src = m.getSource(); int dst = m.getDestination(); Record source = r.find (src); Record destination = r.find (dst); if ((source == null) || (destination == null)) { /* In this unlikely event. */ String msg = String.format("Error: link <P%d, ...
6535da7f-d74e-4173-8aae-a586ddbc9ff3
4
private void setKeyToFirstElement() { Column column; for ( int i = 0; i < columns.size(); i++ ) { column = columns.get( i ); if ( column.isKey() ) { if ( i == 0 ) return; columns.remove( i ); columns.add( 0, c...
079f335d-65b5-44b0-9bba-da58e4a804d9
3
public boolean existsInListMultipleTimes(String stringToCount, List<String> allKMers) { int count = 0; for (String s : allKMers) { if (s.equals(stringToCount)) { count++; } } if (count > 1) { return true; } return fal...
030e482d-d4a1-4b9f-9131-38310cfb2199
5
private boolean zzRefill() throws java.io.IOException { /* first: make room (if you can) */ if (zzStartRead > 0) { System.arraycopy(zzBuffer, zzStartRead, zzBuffer, 0, zzEndRead-zzStartRead); /* translate stored positions */ zzEndRead-= zzStartRe...
2cde2734-9a45-41d8-8912-9ec05b5b1d92
1
public void start() { // Initialization initLogger(); initDisplay(); initGL(); initTime(); initTexture(); initSprite(); while (!Display.isCloseRequested()) { int delta = getDelta(); update(delta); renderGL(); Display.update(); Display.sync(60); } log.dbg("Closing."); Display.destro...
05a1d7e5-77ad-4cc0-b419-5e48d1b2cdb8
1
public static InputHandler getInstance() { if (instance == null) { instance = new InputHandler(); } return instance; }
cc522f4c-2ce4-40c3-b0f6-084e9d4a8571
4
public static int solve(String group) { if (counted.containsKey(group)) return counted.get(group); if (!groups.containsKey(group)) { counted.put(group, 0); return 1; } String[] members = groups.get(group); int count = 0; for (int i = 0; i < members.length; i++) if (!counted.containsKey(members[i...
9bbfdb1b-bb96-4687-ada6-e832731be5f8
9
public TextConversionStream(int inputStyle, int outputStyle, OutputStream out) { super(out); switch (inputStyle) { case TEXT_CRLF: { stripCR = false; stripLF = false; stripCRLF = true; ...
a936c1b8-002b-40a3-9213-719a6d6b826d
0
public void setHalted(boolean b){ isHalted = b; }
06999eef-2934-42c9-92bf-40e0e80c0558
7
public void clear(Location one, Location two) { World w = one.getWorld(); int sx = one.getBlockX() + 1; int sy = one.getBlockY(); int sz = one.getBlockZ() + 1; int ex = two.getBlockX(); int ey = two.getBlockY(); int ez = two.getBlockZ(); // clear the area...
4a4da74d-4e2a-4191-9287-29aba769c39a
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 AccessRequestResponseType)) { return false; } AccessRequestResponseType other = (AccessRequestResponseType) object; ...
dd01e4f8-5467-4bee-812f-8a425ed2c5b5
8
private void mergeStacks(Collection sources, ASTNodeStack target) { logger.debug("Merging ..."); Iterator iter = sources.iterator(); while (iter.hasNext()) { Node pred = (Node) iter.next(); dump(pred.stack, "Stack for " + pred); } ...
62459855-eb9d-4441-be1b-e44dae8e00b7
8
public void GraphToXml(Graph g, String _path) throws IOException { // inicio padrão do schema xml do prefuse StringBuffer xml = new StringBuffer( "<?xml version=\"1.0\" encoding=\"ISO8859-1\"?>\n<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\">\n" + "\t<graph edgedefault=\""+ ((g.isOrientado()) ? "d...
95e51a45-2f01-4232-a495-232ab0f7ce17
1
public T get(PK id) { T entity = (T) hibernateTemplate.get(this.persistentClass, id); if (entity == null) { log.warn("Uh oh, '" + this.persistentClass + "' object with id '" + id + "' not found..."); throw new ObjectRetrievalFailureException(this.persistentClass, id); } ...
1c98f28d-5a96-41a4-9d14-1f0aebd620f1
5
public static String implode(String delimiter, List<?> arlist) { if (arlist == null) return ""; if (delimiter == null) delimiter = ""; StringBuilder arlstTostr = new StringBuilder(); if (arlist.size() > 0) { arlstTostr.append(Functions.nn(arlist.get(0))); for (int i=1; i<arlist.size(); i++) { arlstTos...
ada2a4d8-6c72-497e-b662-5c2c9643676e
2
public void inactiveCustormer(VPosFuncionarios funcionario){ // OBTENGO EL CUSTOMER PosFuncEstado posFuncEstado = facOracleDAO.getPosFuncEstado( getIdPos(), funcionario.getFunCedula()); if (posFuncEstado.getFesIdFuncionario()!=null) { // DE PRONTO VAYA SIN ID EN MYSQL ...
823226cf-7eac-4ecd-a306-1c85d3ea2e21
0
public void f() { System.out.println("public f()"); }
3953deaa-ec03-4e27-8da0-aca58acb73f0
4
private void startGame() { if (!gameActive) { gameActive = true; // Start the timer gameTimer.schedule(new TimerTask() { /** Update the game by moving all objects as needed. The timer * fires every interval defined in TIMERINTERVAL. ...
4b631b48-e2ae-43be-8f5d-4e1044a6eb6f
9
private void openHttpsPostConnection(final String urlStr, final byte[] data, final int sampleRate) { new Thread () { public void run() { HttpsURLConnection httpConn = null; ByteBuffer buff = ByteBuffer.wrap(data); byte[] destdata = new byte[2048]; int resCode = -1; OutputStream out = null; ...
45333373-f8b3-414a-b6e6-138c0c3bf0e7
8
private int readFrameType(final Object[] frame, final int index, int v, final char[] buf, final Label[] labels) { int type = b[v++] & 0xFF; switch (type) { case 0: frame[index] = Opcodes.TOP; break; case 1: frame[index] = Opcodes.INTEGER; ...
92618c3c-87fc-4030-8a75-97985b7d2152
8
private static void monitorChannel(final ServerSocket server) { new Thread(new Runnable() { @Override public void run() { try { while (isRunning) { Socket socket = server.accept(); Communication comm = new Communication(socket); Message msg = comm.readMessage(); Communication cl...
653e87b2-8464-440a-bf96-c7f7084c2f1f
1
public boolean isAdditiveNumber(String num) { //if(Double.valueOf(num)>Integer.MAX_VALUE) return false; boolean[]arr=new boolean[num.length()]; for(int i=num.length()-1;i>=0;--i){ calculate(num,arr,i); } return arr[0]; }
f5afe606-7aa3-4652-adcb-0f28c7465587
6
public void moveLeft(){ if(canMoveLeft()){ int[][] temp = BlockInControl.getBlock(); int tempPosX = BlockPosX; int tempPosY = BlockPosY; ArrayList <Point> CoordinatesToLeft = new ArrayList <Point>(); for(int r=0; r<4; r++){ for(int c=0;c<4;c++){ if(temp[r][c] == 1 && getRowCol(tem...
6f05e7c7-0cbe-4ab5-8e38-7e1cc3ff97d5
0
protected Document createDefaultModel() { return new UpperCaseDocument(); }
7c91e772-fc52-4736-aefb-cce422c35bf0
3
private Expr term() { Expr res, nextFactor; res = factor(); while (theTokenizer.ttype == '*' || theTokenizer.ttype == '/') { char op = (char) theTokenizer.ttype; theTokenizer.next(); nextFactor = factor(); if (op == '*') { res = new Mult(res, nextFactor); } else { res = new Div(res, nextFac...
3add1931-5234-41f5-97ca-81aa133c7353
3
@SuppressWarnings("deprecation") public static void parseFile() throws IOException,Exception { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("./log/events.log.2013-12-29"))); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("./log/...
f1a22eee-8e39-4fa3-9281-3a007407be96
5
public void run() { ServerSocket serversocket = null; Socket s; InputStreamReader input; BufferedReader b; String message = null; boolean done = false; try { serversocket = new ServerSocket(process.getPort(), 1); serversocket.setSoTimeout(0); } catch (IOException e) { String msg = Str...
e91694ec-06f4-4d79-8a9a-4fb4d261c6d1
3
public boolean clearDir(File dir) { File[] contents = dir.listFiles(); if (contents != null) { for (File file : contents) { if (file.isDirectory()) { clearDir(file); } file.delete(); } } return dir.delete(); }
90c1c356-10ca-4492-808b-7d91113b16d0
2
public static <T extends DC> Set<Pair<PT<Integer>,T>> codom(Set<Pair<Pair<PT<Integer>,T>,Pair<PT<Integer>,T>>> phiMax) { if(phiMax!=null) { if(phiMax.getNext()!=null) { return new Set(phiMax.getFst().snd(),codom(phiMax.getNext())); } else { return new Set(phiMax.getFst().snd(),null); ...
15887b53-5749-4b7b-a069-c427f2fa473b
0
public String getAcademicLevel() { return AcademicLevel; }
5685662b-a62b-4717-9fb4-89d1cddcc1e9
1
void coalesce(final IGNode node) { Assert.isTrue(wide == node.wide); weight += node.weight; final Iterator iter = node.defs.iterator(); while (iter.hasNext()) { final LocalExpr def = (LocalExpr) iter.next(); defs.add(def); } }
d6c4b783-900e-4986-9023-879525b5fec7
9
private void extractModeConversionRule() throws XMLStreamException, TheoryException { String mode = ""; List<String> conversionList = new ArrayList<String>(); while (reader.hasNext()) { int event = reader.next(); switch (event) { case XMLStreamConstants.START_ELEMENT: currTag = getXmlTag(reader.getLo...
1a563348-e200-4b26-838e-1206d91f5e8c
7
@Override public NetworkConfiguration offerResource(String mac) { ResourceStatus rs = null; String ip = null; checkTimeOutLease(); synchronized(this) { for(Entry<String, ResourceStatus> e : getResources().entrySet()) { if(e.getValue().getMac().equals(mac) && e.getValue().isInLeasing()) { rs ...
f2a41b67-c05b-4d98-841b-ae1e6e760b1d
9
public BufferedImage modificatorType(int t) { try { switch(t) { case 0: return ImageIO.read(new File("data/img/wave.jpg")); case 1: return ImageIO.read(new File("data/img/chrono.jpg")); case 2: return ImageIO.read(new File("data/img/reversal.jpg")); case 3: return ImageIO.read(...
5f2d8ca8-5eb7-4a87-9bbc-194ae84fa6e2
8
public SchemeObject Invoke(SchemeObject args, SchemeEnvironment env) { SchemeObject argList = args; SchemeObject temp = SchemeObject.NIL; String result = ""; boolean symbol = true; while(argList != SchemeObject.NIL) { temp = interpreter.Eval(argList.Car(), env); if(temp.isError()) { return tem...
72dc81e3-f2ce-42b5-99e4-aef2bcf3338b
4
public String getMD5(String yourString){ // yourString = "123456789"; if (yourString != null) { byte[] bytesOfMessage = yourString.getBytes(); try { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] thedigest = md.digest(bytesOfMessage); StringBuffer hexString = new StringBuffer()...
05aa81dc-639d-48cd-9063-ea728395a113
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; QuizCatalogus other = (QuizCatalogus) obj; if (id != other.id) return false; if (quizzen == null) { if (other.quizzen != null) return...
55102bbb-4f86-4fe9-899a-99cc7f781022
1
public void createFile(File file){ try{ f = new Formatter(file.getPath()); }catch(Exception e){ System.out.println( "File creation failed! " + e ); } }
b1ce38b9-e57d-494c-88e8-e7c170956078
1
public int getAttack() { int result = attack + cityAttack; for (Artifact a: active.values()) { result += a.attack; } return result; }
e9d28100-6a4d-4188-8349-c3fac3bc923d
0
public void driver() { System.out.println("audo car drive"); }
836d33e1-efe5-48f8-acc0-ebf917161af5
3
void previous() { if (image != null && imageDataArray.length > 1) { if (imageDataIndex == 0) { imageDataIndex = imageDataArray.length; } imageDataIndex = imageDataIndex - 1; displayImage(imageDataArray[imageDataIndex]); } }
1d49622b-6627-40fd-a058-a6a8ab6e1859
5
public void actionPerformed(ActionEvent e) { String a = e.getActionCommand(); if (a.startsWith(Commands.MOVE) && running) { try { out.println(a + " " + player); String reply = in.readLine(); if (reply.equals(Erro...
3b436550-cd6e-4b6c-9cdc-f17e32b5ac5e
6
@Override public Vector3D getNormalVectorAt(Point3D point) { if(Math.abs(point.x - xBoundHigh) < .0001) { return new Vector3D(1, 0, 0); } if(Math.abs(point.x - xBoundLow) < .0001) { return new Vector3D(-1, 0, 0); } if(Math.abs(point.y - yBoundHigh) < .0001) { return new Vector3D(0, 1, 0); ...
c9f250cb-6c34-4e7f-ad1b-6a37c9999e04
3
public void showTop(CommandSender viewing, int amount) { LinkedHashMap<String, Double> Ranking = iConomy.Accounts.ranking(amount); int count = 1; Messaging.send(viewing, this.Template.parse("top.opening", new Object[] { "+amount,+a" }, new Object[] { Integer.valueOf(amount) })); if ((Ranking ...
71dcba5b-2773-4517-bc91-f51f5d6e2d4f
0
public void testInit() { SmartDashboard.putBoolean("Enabled", false); }
cc3939db-00dc-4e2c-ae2e-994414ba5848
0
public Iterator getOpenDocumentIterator(int index) { ArrayList temp = new ArrayList(); temp.addAll(openDocuments.subList(index, openDocuments.size())); temp.addAll(openDocuments.subList(0, index)); return temp.iterator(); }
8e294d8e-ea85-4f0a-83c8-4dea4018ca22
6
public void fade(float dt){ // System.out.println(title+": "+volume); float volume = getVolume(); volume += dt * fadeType * speed; if (volume >= goalVolume && fadeType==FADE_IN){ volume = goalVolume; fading = false; fadeType=0; } if (volume <= goalVolume && fadeType==FADE_OUT){ volume = goalVolume;...
3e81dc5d-e2e5-4486-b308-ff669cf4623c
1
public void setOption(String option, Collection values) { if (option.equals("all")) { onlySUID = false; } else throw new IllegalArgumentException("Invalid option `" + option + "'."); }
36caddd8-ab97-4b75-ab3e-b854488e5258
7
public void endElement(String name) { switch (etape) { case DICTIONNAIRE: if ("INFORMATION".equalsIgnoreCase(name)) { dictionnaireTable.addData((String) hashtable.get("code"), (String) hashtable.get("nom"), (String) hashtable ...
95546cc5-fdbf-43d8-8303-b7c00b1b2fb5
2
@Override public void keyPressed(KeyEvent e) { int code = e.getKeyCode(); if (code>0 && code<keys.length) { keys[code] = true; } }
88e3c964-889b-4ab5-8d6d-90188e4a4237
9
public int addStore(int n, CtClass type) { if (type.isPrimitive()) { if (type == CtClass.booleanType || type == CtClass.charType || type == CtClass.byteType || type == CtClass.shortType || type == CtClass.intType) addIstore(n); else if (typ...
db14ab68-9735-46fe-a10a-b03827006259
7
public void init(final Map attributes) throws SaslException { if (state != -1) { throw new IllegalMechanismStateException("init()"); } if (properties == null) { properties = new HashMap(); } else { properties.clear(); } if (attributes != null) { a...
ee5ed16e-5cc6-4133-b24e-39517c2f9913
0
public String parentRow(){ return "<tr class=\"parent nosort\" data-level=\"1\">"+ "<td/><td colspan=\"6\">"+this.label+"</td>"+ "<td>"+this.timediff+"</td>"+ "</tr>"; }
22e1a5bf-c646-4100-93a1-edccaac01327
2
private String nand(Register dest, Register source1, Register source2) { int source1Value = binaryToDecimal(source1.getValue()); int source2Value = binaryToDecimal(source2.getValue()); int newValue = (source1Value & source2Value); String theNewValue = decimalToBinary(newValue); String returnString=""; for...
97bb9213-0360-4990-91b4-fc4a6221eb90
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ConwaysCommunity other = (ConwaysCommunity) obj; if (cells == null) { if (other.cells != null) return false; } else if (!cells.equals(ot...
3bd1e284-c230-4bd5-b281-c43448300973
6
public int evaluatePieceDevelopment() { int score = 0; int[] minorPiecePositions = new int[]{ 1, 2, 5, 6 }; int turn = isWhiteTurn() ? 0 : 112; for ( int pos : minorPiecePositions ) { if ( !squareEmpty( pos + turn ) && !hasPieceMoved( pieceAt( pos + turn ) ) ) { if ( isWhiteTurn() ) { ...
552ea341-e2ee-4dce-9761-ed5bd85c36e1
3
public Artist getArtistFromShowName(String name) throws SQLException { if (exist(name)) return artists.get(name); else if (tempStore.containsKey(name)) return tempStore.get(name); else { collectQueryShowName.setString(1, name); ResultSet rs = collectQuerySh...
89799454-05b0-4f70-97cb-ec4a177268f0
3
@Override public CollectionObject putItem(String path, InputStream content) throws ContentRepositoryException, IOException { try (BufferedInputStream in = new BufferedInputStream(content)) { in.mark(1); int c = in.read(); in.reset(); if (c >= 0) { File file = new File(rootDir, path); try (File...
767644a8-a3cd-4de9-9103-08f633d3b5e1
8
public void testingPartialSeqScenario3(){ System.out.println("execute epi_test"); System.out.println("======================="); System.out.println("ONE SEQUENCE LEARNT"); System.out.println("======================="); int numTrials = seqStartIndexes.size()-1; int sumSuccess = 0; int l...
a02ad726-5cbd-400c-9800-26af3a9536eb
4
public boolean hasUnaryInput() { if (left instanceof LvalExpression && ((LvalExpression) left).hasUnaryInput()) { return true; } if (right instanceof LvalExpression && ((LvalExpression) right).hasUnaryInput()) { return true; } return false; }
0ae12902-bfb1-4ad1-ad35-21d817bb0a12
5
public boolean isValid() { return !(Float.isInfinite(x) || Float.isNaN(x) || Float.isInfinite(y) || Float.isNaN(y) || Float.isInfinite(z) || Float.isNaN(z)); }
c2c00ec1-0e32-4a05-afbf-b80e4fdfa97d
6
protected void checkLongArgResults(GetOpt getopt, Map<String,String> parsedArgsMap) { assertFalse(parsedArgsMap.size() == 0); int errs = 0; Iterator<Map.Entry<String,String>> it = parsedArgsMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry e = it.next(); String key = (String)e.getKey(); ...
c3ff5c19-dc69-4018-b4cf-f0464b7b2cb4
8
public int findClosest(){ int index=-1; for(int q=0;q<objects.size();q++) { if (objects.get(q) == this||objects.get(q).kind==kind||(objects.get(q).kind==0)) continue; int searchRadius = 400; //radius of whether the object will be findable boolean searc...
610f2df3-fb36-4c23-b48a-c15cfd2177bd
8
public static void writeStreamContent(XMLInputFactory inputFactory, XMLStreamWriter writer, InputStream content, Map<String, String> replacementMap, LocalizationUtil localizationUtil) throws XMLStreamException { XMLEventReader parser = inputFactory.createXMLEventReader(content); StartElement startEleme...
01583a33-cee4-4631-b38b-ccbc5e4f363e
0
public Date getDataEvasione() { return dataEvasione; }
5258559d-d01d-4415-88b3-93eeab0dc41a
9
private void setupPropertyView() { this.propKey = new Label(this.prop.getKey()); //set the font, if it is an object type (has sub properties) then make it bold like a header. if(this.prop.getPropertyType() == TiProperty.PROPERTY_TYPE_OBJECT) { this.propKey.setFont(Font.font("Arial", FontWeight.BOLD, 14)); } ...