method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e1ba2bc5-64cc-4d50-9b07-90fb1c282b13
6
@SuppressWarnings("unused") private static void insertTestFileObjectsIntoDatabase() { File directory = new File("Pictures"); File[] files = directory.listFiles(); int i = 0; for(File file : files) { FileObject f = Metadata.getImageObject(file); f.setLocationObject(new LocationGPSObject("Japan")); ...
3e4ca240-e58f-4313-986f-0e40f94fbc5e
4
public String findResult(String SituName, String ParName, TextProcessing TextPro) { int resultIndex = 0; String result = null; for ( int i = 0; i < TextPro.Headers.length; i ++ ) { if ( TextPro.Headers[i].equals(ParName) ) { resultIndex = i; } } for ( String textLine:TextPro.textList ) { Strin...
47412536-8b44-4aa5-a870-c7b56270e481
8
public void removeNode(){ ArrayList<Node> oldNodes=new ArrayList<Node>(); ArrayList<Line> oldLines=new ArrayList<Line>(); for(Node node:this.mindmap.getNodes()) oldNodes.add(node); for(Line line:this.mindmap.getLines()) oldLines.add(line); for(Node node:this.children) node.removeNode(); this.mindma...
20178b17-4946-4839-b463-f38dbe443ddc
1
private String charArrToString(char[] arr) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { sb.append(arr[i]); } return sb.toString(); }
f49a4591-512d-47c3-a959-38935238f669
2
public void visitIntInsn(final int opcode, final int operand) { mv.visitIntInsn(opcode, operand); if (constructor && opcode!=NEWARRAY) { pushValue(OTHER); } }
7f483ba9-c7a9-408c-94a2-c71d4700ed3c
2
double percentCds(ChangeEffect changeEffect) { int cdsLen = changeEffect.getAaLength(); int codonNum = changeEffect.getCodonNum(); if ((cdsLen >= 0) && (codonNum >= 0)) return codonNum / ((double) cdsLen); return Double.NaN; }
930f08d7-3835-48dc-9f27-dfc3d4dc2a9e
1
public static boolean transform(InstructionContainer ic, StructuredBlock last) { return (createLocalPrePostInc(ic, last) || createPostInc(ic, last)); }
afce94d4-a9a0-4616-a600-e95277306e70
5
public BackgroundManager(GameController gc, Registry rg) { super(gc, rg); backgrounds = new ArrayList<Background>(); parallaxBackgrounds = new ArrayList<Parallax>(); int x, y; float ms; Background b; Parallax parallax; int camMapX = registry.getGameCont...
2c0d76a9-b282-47ba-8410-2efd1f391a43
5
public static void main (String args[]) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int round = Integer.parseInt(reader.readLine()); for (int i = 0; i < round; i++) { StringTokenizer tokenizer = new StringTokenizer(reader.readLine...
12b16f4a-ad16-451c-9217-ef8cb09d508f
5
public void wonBet() { if (hand.getHand().get(0).getRank().equals("Ace") && (hand.getHand().get(1).getRank().equals("King") || hand.getHand().get(1).getRank().equals("Queen") || hand.getHand().get(1).getRank().equals("Jack") || hand .getHand().get(1).getRank().equals("Ten"))) { blackJack(); ...
057f401f-9198-4bd8-bf06-f1050be06f2a
1
public void setTipo(Tipo tipo) throws SemanticError { if(!Tipo.isPreDefinido(tipo)) throw new SemanticError("Contantes só podem possuim valor de tipo pré-definido"); this.tipo = tipo; }
afa872f7-fad1-49a9-9b16-3268116b2fb6
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 fe...
badcb497-5606-4f09-92bc-9d06ad24a9b7
4
public void paint(Graphics g) { super.paint(g); LOGGER.info("Desenhando ClienteCliente:\t" + cliente.toString() ); if (fase != null && cliente != null && cliente.getMario() != null && cliente.getLuigi() != null) { g.drawImage(fase.getBackground(), 0,0, this); g.drawImage(fase.getMarioDirImg(), client...
bd01293d-2dd7-4daf-8103-27eed8a3847a
9
private BufferedImage setColors(BufferedImage image, double [] values, PaintType paintType) { int width = image.getWidth(); int height = image.getHeight(); for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { for (int k = 1; k < criticalValues.length; ...
1bf97bcf-511a-469c-a2c1-5f6b2051041b
2
public void encryptOrDecrypt(String key, int mode, InputStream is, OutputStream os) throws Throwable { DESKeySpec dks = new DESKeySpec(key.getBytes()); SecretKeyFactory skf = SecretKeyFactory.getInstance("DES"); SecretKey desKey = skf.generateSecret(dks); Cipher cipher = Cipher.getInstance("DES"); // DES/ECB/P...
05fd83d4-9e8f-4fd7-9e83-56cf4263adc1
1
@Override public void hoverOver(EventMouse eventMouse) { if(!active){ // square.setTextureCoor(inputTexture.getHover()); } }
b120032f-ec68-4bba-9abf-c61c094462d8
6
private void generateGems(int times){ String[] gems1 = new String[10]; gems1[0] = "banded, eye, or moss agate\n"; gems1[1] = "azurite\n"; gems1[2] = "blue quartz\n"; gems1[3] = "hematite\n"; gems1[4] = "lapis lazuli\n"; gems1[5] = "malachite\n"; gems1[6] = "obsidiam\n"; gems1[7] = "rhodoscrosite\n"; ...
fce1d251-41cb-4629-8bad-0c2151bf3ec4
3
private void checkGridletCompletion() { ResGridlet obj = null; int i = 0; // NOTE: This one should stay as it is since gridletFinish() // will modify the content of this list if a Gridlet has finished. // Can't use iterator since it will cause an exception while ( i ...
024aed00-861b-4672-8b3d-7fdcaa1e248d
4
public void fillDeclarables(Collection used) { if (usedAnalyzers != null) used.addAll(usedAnalyzers); if (innerAnalyzers != null) { Enumeration enum_ = innerAnalyzers.elements(); while (enum_.hasMoreElements()) { ClassAnalyzer classAna = (ClassAnalyzer) enum_.nextElement(); if (classAna.getParent()...
a80c354a-94d7-4e9e-8c86-bb833117d516
2
@SuppressWarnings("unchecked") ArrayList new52() /* reduce ANonTerminal$Classdecl */ { @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList(); @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop(); @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop(); Li...
caa60559-2f2c-4c8e-988b-d6fc93e835eb
6
private boolean implementsCustom(final Class<?> oneClass, final Class<?> customClass) { Class<?>[] interfacesImplemented = oneClass.getInterfaces(); for (Class<?> oneInterface: interfacesImplemented) { if (oneInterface.getName().equals(customClass.getName())) { return true; } } return false; }
eb1e5358-7ab4-44eb-9b38-2fe4a2a2c206
9
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target==null) return false; if(target.fetchEffect(ID())!=null) { mob.tell(targ...
b8a21db7-d4ca-4380-b873-4e47096cf9d9
5
public void onMouseEvent(int mx, int my, int buttonPressed, boolean released) { if(buttonPressed == 0 && released && isMouseOver(mx,my)) { SoundManager.instance.playSoundFX("/assets/sounds/click.ogg", 0.5f, 1f); selected = !selected; if(group != null && selected) group.handleSelected(this); listene...
43ec14b8-7c97-47d6-8e72-0397ddfd6df0
9
private void writeSubstring(Kim kim) throws JSONException { this.substringkeep.reserve(); zero(); int from = 0; int thru = kim.length; int until = thru - JSONzip.minSubstringLength; int previousFrom = none; int previousThru = 0; // Find a substring from the subst...
8e7d7d0c-bee2-45dc-b5f3-e83ecbb5f6aa
9
void injectKey(int new_key, boolean shift_pressed, boolean ctrl_pressed, boolean alt_pressed, boolean command_pressed) throws AWTException { // create Robot instance if necessary if (robot == null){ robot = new Robot(); } // use upper c...
8d7fcadf-84bc-49d2-b4bb-f3fa4b670c08
5
public void render(GameContainer container, Graphics g) { g.setFont(container.getDefaultFont()); g.setColor((isActive() ? new Color(0f, 0f, 0f, 0.70f) : new Color(0f, 0f, 0f, 0.65f))); if(isRadial) g.fill(new Circle(getX() + (getWidth() / 2), getY() + (getHeight() / 2), getWidth() / 2, getHeight() / 2)); ...
55acdad4-cefb-400d-b7ae-f9fd28412b34
7
public double[] distributionForInstance(Instance inst) throws Exception { double[] newDist = new double[inst.numClasses()]; if (m_FirstSuccessor == null) { for (int i = 0; i < inst.numClasses(); i++) { if (m_Range.isInRange(i)) { newDist[i] = 1; } } return newDist; ...
fe2467f2-1d00-4380-92f5-be716de52dfc
2
public void buscarPorCodigo(String codigo) { DefaultTableModel modelo = crearCabecerasTabla(); for (clsPersona p : lstPersonas) { if (p.getCodigo() == Integer.parseInt(codigo)) { crearFila(p,modelo); } } tablaRegistrar.setModel(modelo); }
fe7cc97f-d9a7-4d26-a5cb-003d5175b3ff
4
@Override public void load() throws DataLoadFailedException { permissions.clear(); options.clear(); debug = false; List<String> list = yamlConfiguration.getStringList("permissions"); LinkedList<String> global = new LinkedList<String>(); for (String l : list) { ...
6c292161-44fe-4ab2-89fc-9b7b728f3dcc
5
public void run() { // while thread is alive continue always! while ( true ) { synchronized (this) { // check if thread is paused... while ( threadPause ) { try { // ...and keep it waiting, as long as paused wait (); } ...
e4bb80ac-7ba0-489f-b10b-7db1a9e29261
7
public Expr evaluate(IEvaluationContext context, Expr[] args) throws ExprException { assertMinArgCount(args, 4); assertMaxArgCount(args, 5); double cost = asDouble(context, args[0], true); if (cost < 0) return ExprError.NUM; double salvage = asDouble(cont...
b303896f-d3f9-41c0-875f-4f2a7dbee55b
9
@Override public void actionPerformed(ActionEvent e) { if (x == load_x && y > a.ir.y && y < a.ir.y + 170) { // loading gold, right island if (currentgold + 5 <= maxcapacity && a.ir.goldcount > 0) { currentgold += 5; a.ir.goldcount -= 5; } } els...
8fa182b8-d075-471e-ae51-1886ba60cb60
5
public void actionPerformed(ActionEvent e){ // reset counts for (int i = 0; i < 26; i++){ counts[i]=0; } try { // create file input stream Scanner input = new Scanner(new File(jtf.getText().trim())); while (input.hasNext()){ String line = input.nextLine(); for (int i...
4be9e1b6-0a14-4027-a161-38fd5b01c402
2
public <L extends Layer> L layer(Class<L> cl) { checkerr(); for (Layer l : layers) { if (cl.isInstance(l)) return (cl.cast(l)); } return (null); }
c0ad59f8-f7b3-4c12-aef2-c241c9d80d2a
1
public WhileStatement(Tree condition, Tree body){ this.condition = condition; this.body = body; this.labelFirst = Tree.getNextLabel(); this.labelLast = Tree.getNextLabel(); ArrayList<Tree> loopControlStatements = findLoopControlStatements(); for (ListIterator<Tree> iter = loopControlStatements.list...
95108f3c-d17a-4cae-b677-29453d56cb8a
1
public FindSSCsInGraph(int numNodes, String filename) throws IOException { originalGraph = new HashMap<Integer, LinkedList<Integer>>(); reversedGraph = new HashMap<Integer, LinkedList<Integer>>(); nodesStatus = new BitSet(numNodes); nodesFinishtime = new int[numNodes]; nodesSortedbyFt = new int[numNodes]; n...
fadc5f11-11d5-488e-947b-386d7641e633
7
public void test_08() { initSnpEffPredictor(); // Read CDS (hg37, chromosome Y) from a file and store them indexed by transcript ID HashMap<String, String> cdsByTrId = new HashMap<String, String>(); String cdsY = Gpr.readFile("./tests/cds_hg37_chrY.txt"); String lines[] = cdsY.split("\n"); for (String line...
9e43803a-a4ac-434e-83c0-e56b28738d57
6
public Group finalPath(double xWidth, double yHeight) { Group finalPath = new Group(); int intxWidth = Double.valueOf(xWidth).intValue(); int intyHeight = Double.valueOf(yHeight).intValue(); Dimension[] pathCoordinates = { new Dimension(intxWidth, 7 * intyHeight), new Dimension(7 * intxWidth, intyHeig...
9d756418-ed65-4a4e-9d9a-497d244b266d
2
private boolean hayAlgunJugadorQueCedaLugar() { for (Jugador inscripto : inscriptos) { if(inscripto.dejaLugarAOtro()){ return true; } } return false; }
4a43b234-2e42-412e-9d78-6603430b50b3
1
public static void main(String[] args) { /* * We'll just use this class for testing our ccde. * We'll provide input and get some output... */ //Low-level modules Employee emp1 = new HourlyPlusIncentiveEmployee(10.50, 2020); Employee emp2 = new SalariedEmployee...
ca74b3d8-244e-47c8-a229-5fe917ca1001
6
@Override public byte[] write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) { Integer lengthTemp = lengthUnit.write(out, ptc, thread, serverToClient); if(lengthTemp == null) { return null; } if(lengthTemp*3 != length) { ptc.printLogMessage("Error writin...
ee32d16d-1103-4ea2-90e6-47b2d94e1972
9
@Override public void run() { // TODO Auto-generated method stub System.out.println("testing1:you are there in the serve"); while (!(StringConstants.ip != null && StringConstants.ip_config != null && StringConstants.MasterDir != null && StringConstants.servername != null && StringConstants.Downlo...
4abba22b-a42a-487a-a0e6-0856f88260ec
6
public static GlobalStats getGlobalStats(){ double LOCLimits=0; double LOCBalance=0; int LOCNumber=0; double LoanBalance=0; int LoanNumber=0; double CheckingBalance=0; int CheckingNumber=0; double CDBalance = 0; int CDNumber=0; double SavingsBalance=0; int SavingsNumber=0; for (BasicAccount a : accounts.values...
ebaaae17-fb7e-4b82-bfa2-523741326014
7
@Override public void mouseClicked(MouseEvent arg0) { JTable tab = (JTable)arg0.getSource(); int row = tab.getSelectedRow(); int column = tab.getSelectedColumn(); if(tab.equals(tblFav)){ if(column == 0){; Recipe rec = favList.get(row); createRecipeFrame(rec); } else { Recipe rec = favList.get...
25476785-391e-4e08-9235-7417f6fcec9b
3
static void writeCSV(String sFileName, String text) { try { boolean writeHeader = false; File csv = new File(sFileName); if (!csv.exists()) writeHeader = true; FileWriter writer = new FileWriter(csv, true); if (writeHeader) writer.append("NN_Path;Learn_Path;WeigthMatrix;LearningRate;MaxIter...
dae97ea3-d9ae-436a-90ed-e3e994e37289
6
@Override public void visitImport(XTreeImport _import) { XCodeGen code = getCode(_import); for (XTreeImportEntry importEntry : _import.imports) { String importName = importEntry._import.name; XTreeIdent name = importEntry.as == null ? importEntry._import : importEntry.as; String asName = name.name; int...
5a5a7932-8441-4899-af89-533f7fb63c1e
8
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
6a374177-c7f8-47a7-b0a9-5764fafdddce
5
private void cmdPegarItem(String item) throws Exception { Sala sala = salas[salaAtual]; List<Item> itens = sala.getItens(); for(Item i : itens){ if(item.equalsIgnoreCase(i.getDescricao())){ if(i instanceof Chave) jogador.setChave((Chave) i); if(i instanceof Arma) jogador.setArma((Arma) i);...
0d9058ea-8baf-4774-b62f-3ddb96047374
0
public static void main(String[] args){ mainWindow = new FramesRuner(); mainWindow.runMainFrame(); // MainFrame.getInstance().setVisible(true); }
71d1dedb-ae08-4e78-a50c-e102f9d4ad67
5
private static InetAddressNode create(Enumeration<InetAddress> addresses) { if (!addresses.hasMoreElements()) throw new IllegalArgumentException(); InetAddressNode first = null; InetAddressNode prev = null; InetAddressNode node = null; int count = 0; while (addresses.hasMoreElements()) { InetA...
03d608a5-fa98-4dd7-84e5-f59a8c8d2b79
1
public void Update(float delta) { for(GameComponent component : m_components) component.Update(delta); }
9b2b8f06-046e-4a2f-951c-536808bb2460
2
public ArithmeticQuantity(double value, Unit unit) { super(value, unit); if(!Distance.class.isInstance(unit) && !Volume.class.isInstance(unit)) { throw new RuntimeException("Cannot create ArithmeticQuantity with unit " + unit); } }
215229ca-1889-488d-a9f5-479d29dcf57f
7
public void removeImageData(Rectangle rect, boolean autoRemove){ ImageData match = null; for(Iterator<ImageData> it = imgs.iterator(); it.hasNext();){ ImageData iData = it.next(); if (rect.equals(iData.getRect())){ match = iData; JPanel p = (JPanel) iData.getButton().getParent(); p.remove(iData.ge...
422aaff3-cb18-4c6d-915a-4370f36d9da5
6
private WorkerWish getBestWorkerWish(AIUnit aiUnit, java.util.Map<UnitType, List<Wish>> workerWishes) { final Unit unit = aiUnit.getUnit(); List<Wish> wishList = workerWishes.get(unit.getType()); WorkerWish nonTransported = null; WorkerWish transported = null; float best...
0b9a5785-d957-4ef9-88b5-9063147cbe4b
5
final int[][] method3047(int i, int i_7_) { anInt9434++; int[][] is = ((Class348_Sub40) this).aClass322_7033.method2557(-111, i); if (i_7_ != -1564599039) method3140(72, -13); if (((Class322) ((Class348_Sub40) this).aClass322_7033).aBoolean4035) { int[] is_8_ = this.method3048(-1 + i & Class299_Sub2....
2a14b732-1952-431e-af27-de0d98bd1f0e
5
public Rectangle findSling() { if (_sling != null) return _sling; // use the highest sling typed component int minY = 999999; ConnectedComponent sling = null; for (ConnectedComponent c : _components) { int top = c.boundingBox()[1]; if ...
a69af3ef-8e0b-42ce-b5d8-d60115f0483d
8
public String parse(){ final StringBuffer result = new StringBuffer(text.length()*2); //乘以多少可以再看 XmlTree xmltree = new XmlTree(); lines = text.split("\n"); //初始化每行的lv linelvs = new int[lines.length+1]; //+1是为了应对最后一行 int i=0; for( ;i<lines.length; i++){ linelvs[i] = getLineLevel(lines[i]); } l...
22d0aa9c-86e0-4b51-b792-07326637dc8f
1
@Override public LngLatAlt deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonArray data = json.getAsJsonArray(); LngLatAlt node = new LngLatAlt(); node.setLongitude(data.get(0).getAsDouble()); node.setLatitude(data.get(1).getAsDouble()); if (da...
1c2c33c6-f651-4dd5-b8f3-d6f531984e4e
3
public void create(Usuario usuario) throws PreexistingEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); em.persist(usuario); em.getTransaction().commit(); } catch (Exception ex) { ...
e179ebd7-f6f9-48d1-953e-cb5240fd2c18
5
public XMLElement getChild(String name) { // The first matching child will be kept here Node child = null; // Iterate over all the child nodes for (Node node : new NodeListIterator<Node>(element.getChildNodes()).toIterable()) { // Look for Element instances that match the ...
6ae08ce8-7ba8-49a3-a11c-3362d1891990
6
protected void extendColumnWithShape(final int height, final int[] colIndexs, final int rowIndex, final Class<? extends Shape> type) { if (Size.DEFAULT_HEIGHT < height) { final int count = height / Size.DEFAULT_HEIGHT - 1; for (int i = 0; i < coun...
f3b9df71-46a0-4538-bec3-ff8126883f98
8
@Override public void run() { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); brea...
c07c8fcb-b115-414c-b5bc-c83fd4468e87
6
public void visitReturnExprStmt(final ReturnExprStmt stmt) { if (CodeGenerator.DEBUG) { System.out.println("code for " + stmt); } stmt.visitChildren(this); genPostponed(stmt); final Type type = stmt.expr().type(); // Stack should be empty after return if (type.isReference()) { method.addInstruc...
62628e2c-51d6-4981-8fb6-02db42056ddc
2
private StreamTokenizer getTokenizer() throws IOException { if ( !new File( this.getFilename() ).exists() ) { throw new IOException( this.getFilename() + " does not exist!" ); } if ( this.getEncoding() != null ) { this.reader = new InputStrea...
de36c35e-5ed8-4dd9-bea9-e87665f1ebd2
0
public CheckResultMessage checkL6(int day) { return checkReport.checkL6(day); }
42c02eb9-60a6-47c8-82b3-65a25446650e
8
public static <T extends User> Integer compareProperties(T t1, T t2) throws Exception{ for(String name: t1.fieldsToCompare()){ logger.info("comparing property {} ",name); Object property1 = PropertyUtils.getProperty(t1, name); Object property2 = PropertyUtils.getProperty(t2, name); if (property1...
a513219d-0b14-4bc2-a057-bc14ef18c664
9
public void GenMostScore() { Object[] keys = Environment.RoomManager.GetRooms().values().toArray(); Room[] Rooms=new Room[keys.length];int[]Scores=new int[keys.length]; int row = 0; for (int a = 0; a < keys.length; a++) { Room Current = (Room) keys[a]; ...
01a9fe35-ba6f-445f-9d02-751497364a0d
7
public void reCompute() { short x = inputPins[0].get(); // 16 bit d input short y = inputPins[1].get(); // 16 bit m/a input short zx = inputPins[2].get(); // 1 bit flag short nx = inputPins[3].get(); // 1 bit flag short zy = inputPins[4].get(); // 1 bit flag short ny = in...
d4035894-e50e-4cbc-ae03-71b286d940bc
8
public void emit(String event, Object... args) { List<EventHandler> handlers = listeners(event); if (handlers == null || handlers.size() == 0) { if (!event.equals("error")) return; StringBuilder sb = new StringBuilder("error"); if (args.length > 0) sb.append(":"); for (Object arg : args) s...
eeedbb01-c1a2-4460-b6c6-86994ba89d30
2
@Override public void update(PositionChangedObservable observable) { if(observable.getPositions().contains(position)) { System.out.println(this + " " + observable + " " + incomingElement); addHoveringElement(observable); if(observable != incomingElement) observable.accept(new CollideWithTeleporterVisito...
3dcc09e5-bb58-476f-a054-99ddbb36120b
4
public Direction flipped() { switch (this) { case NORTH: return SOUTH; case SOUTH: return NORTH; case EAST: return WEST; case WEST: return EAST; default: return null; } }
7c59b0b7-681c-4f2a-9521-04f79c9f0993
5
public static String[] verifyDateTimeArguments(String[] args) throws Exception { if (null == args) throw new IncorrectNoOfArgumentsException(3); if (!(args.length == 3 || args.length == 6)) throw new IncorrectNoOfArgumentsException("3 or 6"); String d[] = verifyDateArguments(new String[] { args[0], args[1], args...
e9b64db1-6ac5-456a-bc1c-f85878c78372
3
public void setPitch( float p ) { // Make sure there is a pan control if( sampleRateControl == null ) { return; } float sampleRate = p; // make sure the value is valid (between 0.5f and 2.0f) if( sampleRate < 0.5f ) sampleRate = 0.5f; ...
e144d93c-8db2-4b90-b24c-eed8f87ecc3c
0
public ITicketPool getPool() { return this._pool; }
5ebcfd1c-e575-444a-bdb0-98a02e816bd6
8
void refresh() { int n = view.getModel().getNumberOfParticles(); if (n > viewer.getAtomCount()) n = viewer.getAtomCount(); Atom at; int argb = 0; float sigma = 0; for (int i = 0; i < n; i++) { at = view.atom[i]; if (at.isVisible()) { sigma = getCurrentSigma(at); if (view.model instanceof Re...
8768ab1d-7063-4183-b0d6-9eede464c0fb
7
public Object[][] bacaDaftar(){ boolean adaKesalahan = false; Connection cn = null; Object[][] daftarPembeli = new Object[0][0]; try{ Class.forName(Koneksi.driver); } catch (Exception ex){ adaKesalahan = true; JOptionPane.showMessageDialog(null...
2a6df31a-9bb1-4330-a47b-7a5ea6fa7ad8
6
private void imprimir_acciones_de_parsing(Stack pila, Token tokenReconocido) { //Parsing Stack System.out.print(padRight(new StringBuilder("$ ").append(pila.toString().replaceAll("\\[", "").replaceAll("]", "").replaceAll(",", "")).toString(), 135)); //Input System.out.print(padRight(tok...
e5a198d3-17de-4f80-8155-a7c78479cc69
4
private void setupPlayer(String filename) { try { InputStream is = getClass().getResource(filename).openStream(); if(filename.contains("music/")){ musicPlayer = new AdvancedPlayer(is, createAudioDevice()); } else if(filename.conta...
4cf08b33-cecd-4a42-9821-5eaf261ce9ae
7
public String toString() { String string = "#< " + factory.getCache().tableName(type); if (extendsModels()) { string += " inherits ("; Set<Class> sup = supers.keySet(); boolean first = true; for (Class s : sup) { string += first ? "" : ", "; string += " "+ factory.getCache().tableN...
130f42c4-2de6-4a99-abe4-89221811d37f
3
private boolean isLayoutClass(SootClass theClass) { if (theClass == null) return false; // To make sure that nothing all wonky is going on here, we // check the hierarchy to find the android view class boolean found = false; for (SootClass parent : Scene.v().getActiveHierarchy().getSuperclas...
80af5c08-0be1-49fc-b239-7a78cf8ed93b
3
private void registerAsParent() { if (children != null) { for (int i = 0; i < children.capacity(); i++) { TrieNode<S, T> c = children.valueAt( i ); if (c != null) { c.parent = this; } } } }
ddd5978c-0f1f-41bc-ab8b-7aa39ad52380
2
public static Commercial selectCommercialById(int id) throws SQLException { String query = null; Commercial Util = new Commercial(); ResultSet resultat; try { query = "SELECT * from COMMERCIAL where ID_COMMERCIAL=? "; PreparedStatement pStatement = ConnectionBD...
16cc624e-56a7-4abb-94e7-fb93e662b770
0
public void setOnline() { lastSignal = System.currentTimeMillis(); }
78f8dbdc-f63f-45f8-bddc-2f8915a333bc
5
public boolean repExists(long zobrist) { int hashkey = (int) (zobrist % HASHSIZE); if (hashtable[hashkey] == 0) return false; else if (hashtable[hashkey] == zobrist) return true; for (int i = 1; i < HASHSIZE; i++) { if (hashtable[(hashkey + i) % HASHSIZE] == 0) { return false; } else if (hasht...
1e0ca219-9e4e-41ea-9d63-10adf8ea9238
0
private void initialize() { setAutoCreateColumnsFromModel(true); setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); setPreferredScrollableViewportSize(getPreferredSize()); setFillsViewportHeight(true); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); DefaultTableCellRenderer rightRenderer = new...
df20a499-5139-4fcd-8c05-d398083a9f88
5
public void handleInput() { /* * if (Keys.isPressed(Keys.ENTER) && currentChoice == 1) { * sfx.get("bump").play(); return; } */ if (Keys.isPressed(Keys.ENTER) /* && currentChoice != 1 */) { sfx.get("menuselect").play(); System.out.println("Handled Enter"); select(); } else if (Keys.isPressed(Key...
a09d322a-fb4c-4fe9-a08a-88558a47c070
9
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException{ ObjectInputStream inputStream = new ObjectInputStream( new BufferedInputStream(new FileInputStream( "D:\\darshan\\temp\\FinalIndexLexicon"))); Lexicon lexicon = (Lexicon) inputStream .readObjec...
90efebc8-3595-42f5-a2bb-619d81e09bb6
0
protected void onServerPing(String response) { this.sendRawLine("PONG " + response); }
c55c5ecd-ba4d-4fcb-beec-8e3ccf7a7bce
6
@Override public Resource objectToJena(Model toAddTo, Alert alert) throws IllegalArgumentException { if (alert.getResourceURL() == null) { throw new IllegalArgumentException(String.format(msg_ResourceWithoutURI, "alerts")); } Resource res = toAddTo.createResource(alert.getResourceURL().toString()); toAdd...
55efec05-ab23-4af7-9821-2c20999edc24
7
public synchronized void linstep(int id, int frame, int l) { boolean isplayer = isplayerid(id); Gob g = getgob(id, frame); if (g == null) return; Moving m = g.getattr(Moving.class); if ((m == null) || !(m instanceof LinMove)) return; LinMove lm = (...
18a118a6-18a6-4856-84cb-83b6501ecaaf
6
@Override public Boolean value(final Long input) { if (input < this._primes.get(1L)) return false; long largestKnownPrime = this._primes.size(); largestKnownPrime = this._primes.get(largestKnownPrime); if (largestKnownPrime <= input) { for (long pc = largestKn...
d8107f1d-b885-4242-b7ac-48734efc903a
1
public AbstractFullTestClass(){ mapWithAnnot = new HashMap<Integer, String>(); iterableWithAnnot = new IdentityArrayList<String>(); int i = 0; while (i<5){ mapWithAnnot.put(i, "e"+i); iterableWithAnnot.add("e"+i); i++; } }
0ee69bfa-b069-4b9e-8c67-8888bc0e8ff8
6
@SuppressWarnings("rawtypes") private void runDemo(String demoKey) { Class demo = this.demos.get(demoKey); Method mainMethod = null; for(Method method: demo.getMethods()) { if(method.getName().equals("main")) { mainMethod = method; break; } } System.out.println("Running " + demo.getNam...
f332a213-a6fa-4c6c-840a-3ccff35c6a5b
0
public void addEdge(Object from, Object to) { adjacent(from).add(to); }
1a541a8a-95c4-4434-a47d-a46ce78ef4ad
6
public final static URL getMbRecordingsOfRelease(String releaseID) throws MusicbrainzUrlException { if(releaseID == null || releaseID.equals("")) throw new MusicbrainzUrlException("The releaseID is null or empty"); URL url= null; URI uri= null; try { uri= new URI("http","www.musicbrainz.o...
38498fd1-0431-4509-9cd7-459617a98f43
2
private void enlarge() { if (Math.random() >= 0.5) { width++; } if (Math.random() >= 0.5) { height++; } }
775b20cf-47e6-4610-814b-fbdedb0626ff
2
public void incrementTime(int minutesToIncrement) { rawMinutes += minutesToIncrement; minute += minutesToIncrement; while(minute >= 60) { hour++; minute-=60; } while(hour >=24) { day++; hour-=24; } }
b349988a-97e2-4c51-8193-ddeee81eda88
6
public HashMap<String, Integer> getSpillCosts() { HashMap<String, Integer> spillCosts = new HashMap<String, Integer>(); for(int i = 0; i < lines.size(); i++) { String[] lineParams = lines.get(i).split(","); if(lineParams[0].replaceAll("\\s", "").contains("br")) loopDepth++; if(lineParams.length > 3 ...
141776b3-45e2-4d54-861e-7d286105d524
5
private void handleRemoveListeners() { for (Object listener : listenersToBeRemoved) { if (listener instanceof EntityHealthListener) { healthListeners.remove(listener); } else if (listener instanceof DeathListener) { deathListeners.remove(listener); } else if (listener instanceof EntityAttributeListen...
d9db9f71-4a8c-45e2-bbc0-9172c80ac40f
8
private static By newSelector(SelectorType selectorType, String selector) { switch (selectorType) { case className: return By.className(selector); case cssSelector: return By.cssSelector(selector); case id: return By.id(selector...