method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
f5d63b80-d798-4a6b-a934-26762abebff6
9
public static double ln(double a) { double aminus1 = a - 1.0; boolean gt1 = (sqrt(aminus1 * aminus1) <= 1) ? false : true; final int iteration_count = 300; double lnsum = 0.0; if (gt1) { // use trick for fast convergence: // ln(123.456) = ln(1.23456*10^2) // ln(123.456) = ln(1.23456) + 2*ln(10) ...
4bdf16e6-2724-4bda-932e-b22a13dfeb69
4
@Override public boolean equals(Object other) { if (other == null) return false; if (other == this) return true; if (this.row == null) return false; Place otherPlace = (Place) other; return this.number == otherPlace.getNumber() && this.row.equals(otherPlace.getRow()); }
1f42b7df-e860-4297-be27-d7d57ea876d7
6
private TreeElement handleClass(HashMap classes, ClassInfo clazz) { if (clazz == null) return root; TreeElement elem = (TreeElement) classes.get(clazz); if (elem != null) return elem; elem = new TreeElement(clazz.getName()); classes.put(clazz, elem); if (!clazz.isInterface()) { ClassInfo superCla...
e1c52a2c-cd2e-4072-983b-cef402307407
1
@Override public int registerPacketHandler(IPacketHandler iph) { log.finer("Registering a PacketHandler"); synchronized(PHList) { if(!PHList.contains(iph)) { PHList.add(iph); } return PHList.indexOf(iph); } }
2e19539b-af05-48cd-b1f2-fdf815fa80b5
9
JSONArray toJSONArray(final Message.EncodeMode encodeMode) throws JSONException { JSONArray jsonArray = null; if (values != null) { jsonArray = new JSONArray(); for (int i = 0; i < values.size(); i++) { Parameter param = values.get(i); if (encodeMo...
87128ca3-9eee-4517-9038-8203c7ed5cbc
8
public String toString() { StringBuffer sb = new StringBuffer("<class>" + getClass().getName() + "</class>\n"); if (uid != null) sb.append("<uid>" + uid + "</uid>\n"); if (!layout.equals(BorderLayout.NORTH)) sb.append("<layout>" + layout + "</layout>\n"); sb.append("<single>" + getSingleSelection() + "</s...
3e76da19-1894-4587-b38e-6216a391d986
5
public static double[][] readOtherData(Kattio io){ String tmp; double[][] points=null; int N=0; //read until reached the EOF line while(!(tmp=io.readLine()).equals("EOF")){ String sarr[]=tmp.split(" "); //try to read the dimension if(points==null && sarr[0].equals("DIMENSION")){ N = Intege...
ea9e2c9f-9eaa-43e0-bfa2-92186ebb8b39
6
public void resolvePrefixes(LinkedList<Prefix> pre){ //Scan subject, predicate and object (data indices 0 to 2) for (int i=0; i<3; i++){ String value=getByIndex(i); //Contains ':'? (a prefix) if (value.contains(":")){ //Replace prefix for (Prefix p:pre){ if (value.startsWith(p.getPrefix()...
9697c640-931c-4fd4-a876-665fffa5ace9
4
public void paint(Graphics g) { g.setColor(Color.GRAY); g.fillRect(0, 0, 1000, 1000); g.setColor(new Color(clr)); g.drawImage(texture, 0, 0, 128 * scale, 128 * scale, null); if(curTool == 3) { this.overlay = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB); this.overLayGraphics = this.ove...
299acc9b-29a1-41ac-9afe-1cb7fceea4da
6
private void runExtCommand(String[] cmd, File dir, String description, boolean print) { if (description == null) setStatusBar("Calling External Program..."); else setStatusBar(description); try { Runtime r = Runtime.getRuntime(); Process p; if (dir == null) p = r.exec(cmd); else p = ...
82b1b91d-ff7c-4bff-8d01-0a779ac05c5d
0
public boolean canEncode(Serializable structure) { return false; }
93d91be3-d5a1-4745-a127-eb866c82fe86
9
private RenderableObject generateRectangle(Scanner inFile) { Point s = null, e = null, loc = null; int thickness = 0; Color c = null; String current = inFile.next(); while (inFile.hasNext() && !(isCloseTag(current) && parseTag(current) == LegalTag.Object)) { if (isOpenTag(current)) { switch (parseT...
57be31b9-d663-4816-b6a4-2cb7853e9ed5
5
public void paintComponent(Graphics g) { super.paintComponent(g); //Paint grey background g.setColor(Color.LIGHT_GRAY); g.fillRect(0, 0, this.getWidth(), this.getHeight()); g.setColor(Color.BLACK); g.fillRect(myModel.TRASHCAN.y * 40, myModel.TRASHCAN.x*40, squareW, squareH); //Paint rubble f...
c3a10119-8c12-4b5b-bec0-03ffcaa2ec26
9
public void act(ArrayList<Plant> plist, ArrayList<Bacteria> baclist){ incrementAge(); if(isDying() || isDead()){ return; } //We give a small positive movement bonus to herbivores, and negative to carnivores double boost = gen.getAggression() * (-0.15); ...
964919d5-1d06-422c-87c5-24cfdb708384
4
public T get(int id) { if (id < 0) { return null; } T definition = cache.get(id); if (definition == null) { synchronized (lock) { definition = cache.get(id); if (definition == null) { try { definition = loader.load(id); cache.put(id, definition); } catch (Exception ignored) ...
9a34d7e3-ad6e-4b74-95ee-ab7bcc55d882
4
public static void main(String[] args) { String[] patterns; if(args.length < 2) { patterns = PATTERNS; } else { patterns = args; } String argString = patterns[0]; System.out.println("Input: " + argString); for(int i = 1; i < patterns.leng...
a2eced9f-bc0d-4ef2-9186-305d8aee3d73
4
public List<BoundingBox> getEntityBoundingBoxesInRange(double x, double y, double radius) { ArrayList<BoundingBox> list = new ArrayList<BoundingBox>(); for(Entity entity : entities) { if(entity != null && !entity.isDead && entity.getDistance(x, y) <= radius) { list.add(entity.boundingBox); } } return ...
af961cf9-5640-4a3f-abac-2b0645d6067f
3
public static void exit(final int iIn) { if (! Ezim.running) return; Ezim.running = false; EzimNetwork.thAckTaker.interrupt(); EzimAckTaker.getInstance().closeSocket(); EzimNetwork.thDtxTaker.interrupt(); EzimDtxTaker.getInstance().closeSocket(); EzimThreadPool etpTmp = EzimThreadPool.getInstance(); ...
a69bd4fa-98ac-4caf-b5dd-ebbcd81574eb
7
public void checkFields (LYNXsys system) { // check textfields before adding student to system boolean existingStudentFlag = false; // temp var to flag if student info is valid if (!(getFirstName().getTextField().getText().equals("")) && // check that ALL FIELDS are filled (4) !(getLastName().getTextField().ge...
10eecec5-3692-4fca-b973-6c19dd28d148
6
public void addYesterday(FacWarStat stat) { if (stat instanceof CharacterKills) { characterKillsYesterday.add((CharacterKills) stat); } else if (stat instanceof CharacterVictoryPoints) { characterVictoryPointsYesterday.add((CharacterVictoryPoints) stat); } else if (stat instanceof CorporationKills) { cor...
1376e43a-b2ea-4982-88a3-d7fa0ea4f24c
1
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { new Main(); } catch (Exception e) { e.printStackTrace(); } } }); }
7e360458-ce56-4707-8504-0134d0696e68
2
@Override public int compareTo(MediaElement o) { final int compareTo = this.name.compareTo(o.getName()); if (this != o && compareTo == 0) return this.name.compareTo(o.getName()); else return compareTo; }
607b2519-9bf5-4174-9233-f61d266dc4f3
6
@Override public void run() { List<Action> actions; long startTime = System.currentTimeMillis(), estimatedTime, timeToWait = 100; while (true && !sim.isEnded()) { actions = sim.prepareUpdate(); estimatedTime = System.currentTimeMillis() - startTime; Sys...
0ee4b164-977c-42d9-9571-80860eb2585b
5
private void handleCommitOnly(Sim_event ev) { int src = -1; // the sender id boolean success = false; int tag = -1; try { // id[0] = resID, [1] = reservID, [2] = trans ID, [3] = sender ID int[] obj = ( int[] ) ev.get_data(); // get the ...
95a761ca-e531-4e58-8f15-62882caf7335
4
public boolean isHorizontalCollision(Bounds r1, Bounds r2) { double tamX = r2.getRight() - r1.getLeft(); double tamY = r2.getBottom() - r1.getTop(); if(r1.getLeft() <= r2.getLeft() && r2.getLeft() < r1.getRight()) { tamX = r1.getRight() - r2.getLeft(); } if(r1.getTop() <= r2.getTop() && r2.getTop(...
8ec9368e-3e88-4e67-bc13-1794ce947715
8
protected void move() { //show/hide nodes if (visibleNodesCount != mainPanel.symbolsCount.intValue()) { visibleNodesCount = mainPanel.symbolsCount.intValue(); for (int i = 0; i < symbols.size(); i++) symbols.get(i).node.setVisible(i < visibleNodesCount); } //animate symbols for (int i = 0; i < mainP...
b4c4316c-bb22-458f-9c5c-6b7120594650
0
public DecisionQuestView() { super(); this.add(new JLabel("Decision")); // quest = QuestFactory.createQuest(QuestType.DECISIONQUEST); addAnswersTable(); }
d4590be6-91fb-4323-abd1-6fdad770a594
1
public int getFileCount() { try { return (int) (indexChannel.size() / IDX_BLOCK_LEN); } catch (IOException ex) { return 0; } }
4d8ac02a-f00b-476d-9bd4-f089fa575bff
0
public void setAccessPathLength(int accessPathLength) { this.accessPathLength = accessPathLength; }
9e784e4c-c787-4a3f-bf1b-a8a9d5e665ba
6
private static String errorToString(int id) { String errorMessage=""; switch(id) { case HABITRPG_SERVER_API_CALL_NOT_FOUND: case INTERNAL_WRONG_URL: errorMessage="The server wasn't found. Please check your hosts settings."; break; case SERV_EXPERIENCING_ISSUES: errorMessage="HabitRPG's server i...
039cbaee-be95-4913-9142-60d28f015a69
0
public static void setAlgorithm(Algorithm a) { AlgorithmInterface.algorithm = a; }
7e6c1147-4c02-4e06-891e-266841a8e71c
7
protected boolean parseFile(LineHandler handler, InputStream stream) throws Exception { BufferedReader bis = new BufferedReader(new InputStreamReader(stream)); int lineNum = 0; for (String line = bis.readLine(); line != null; line = bis.readLine()) { lineNum++; if (line.equals("")) { continue;...
2ec3e9ec-7a45-4b39-b7eb-92c2f845a573
2
public Builder socialRepository(Repository respository) { // If we didn't get a repository, do nothing. if (respository == null) { return this; } if (message.socialRepositoryList == null) { message.socialRepositoryList = new ArrayList<Repo...
a4c6e6c9-283e-4ccb-b8f3-3565738ab998
3
public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException { int read = readBytes(syncbuf, 0, 4); int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF); try { source.unread(syncbuf, 0,...
40c7b409-9b5b-4f96-bef8-61a431ba6615
4
private void addDataToTable(TableDescription tableDescription, DataContainer allData) { Map<String, Row> map = allData.getRowsByDescription(tableDescription); String tableName = tableDescription.getName(); for (String key : map.keySet()) { Row row = map.get(key); try { ...
30865f9f-653f-4168-9aad-ad0f106fa3fc
2
public synchronized void removeVM(SlaveVM vm) throws UnreachableVMException { System.out.println("DEBUG: VM " + vm.getId() + " is deleted"); if (vmsInUse.contains(vm)) vmsInUse.remove(vm); if (vmsAvailable.contains(vm)) vmsAvailable.remove(vm); vm.hardExit(); }
057a2825-5a0a-4fd6-bd91-617fdb9670c2
0
@Override public String execute(String[] args){ System.exit(0); return null; }
f4653478-e1e6-4606-82fc-896cf6190f9c
2
public Emitter on(String event, Listener fn) { ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event); if (callbacks == null) { callbacks = new ConcurrentLinkedQueue <Listener>(); ConcurrentLinkedQueue<Listener> _callbacks = this.callbacks.putIfAbsent(event, callba...
fff9685c-b39a-4008-b7d2-d0db0f442f3a
9
public List<Location> adjacentLocations(Location location) { assert location != null : "Null location passed to adjacentLocations"; // The list of locations to be returned. List<Location> locations = new LinkedList<Location>(); if(location != null) { int row = location.ge...
eecb704f-cac8-475c-8458-8de33fde2769
4
private String getNextString() { while ( pos < content.length() && content.charAt(pos) == ' ') pos++; if (pos >= content.length()) return new String(""); if (content.charAt(pos) == '<') { int endPos = content.indexOf('>', pos); String retStr = content.substring(pos, endPos+1); pos = endPos + 1; ...
6e02b35f-bb3a-4409-bc3d-9c027d36d56e
2
public static Stream allocate() { // create synchronized (Stream.queue) { Stream stream = null; if (Stream.pointer > 0) { Stream.pointer--; stream = (Stream) Stream.queue.popFront(); } if (stream != null) { stream.offset = 0; return stream; } } Stream stream = new Stream(); stream...
0d1debc8-3b54-430d-87bd-ef5d5331706c
2
public void print(){ for(int i =0 ; i < 9; i++){ for(int j = 0 ; j< 9; j++){ System.out.print ( etat[i][j]+" " ); } System.out.println(); } }
35fe4dba-0d2f-420e-b794-2e6ef944ccba
4
@Override public void setBoolean(long i, boolean value) { if (ptr != 0) { Utilities.UNSAFE.putShort(ptr + sizeof * i, value == true ? (short) 1 : (short) 0); } else { if (isConstant()) { throw new IllegalAccessError("Constant arrays cannot be modified."); ...
1f30f87b-1a2e-4811-b6dd-4193857551eb
3
public static void enginePulse(){ if(Game.currentGame == null) return; if(ObjectAction.difficulty == null){ Miscellaneous.log("[FATAL] Cycle rate not set, game ending."); Engine.destructGame(); } for(Entity entity : Entity.entityList){ enti...
903e608f-8247-4c3f-b44e-277739450ef5
1
public Output() { instance = this; // Check for HTML-Output if (Config.getHtmlPath() != null) { checkValidHtmlPath(); } }
2880ee33-2234-4f89-84c3-6652ffb6ffa5
3
@Override public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game) { if(sprite1.is_resource) { Resource r = (Resource) sprite1; applyScore=false; int numResources = sprite2.getAmountResource(r.resource_type); if(numResources + r.value <=...
e589eefc-feec-484a-9385-79ce64fffef6
4
public static List<String> tokenize(String source) { List<String> tokens = new ArrayList<String>(); String token = ""; for (char c : source.toCharArray()) if (isSpace(c)) { if (!token.isEmpty()) { tokens.add(token); token = ""; } } else token += c; if (!token.isEmpty()) tokens...
ffbecfc5-069f-4c30-af13-8fdf1c0fc0b6
8
private static boolean homePageForPassenger(ObjectOutputStream toServer, ObjectInputStream fromServer, Scanner scanner) throws ParseException, IOException, ClassNotFoundException { log.debug("Start method \"homePageForPassenger\""); System.out.println("1 - find train, 2 - timetable by station, 3 - buy t...
0a2d3b71-57a9-42a5-a68b-2f83688332cc
2
private synchronized Set<Message.RequestMessage> cancelPendingRequests() { Set<Message.RequestMessage> requests = new HashSet<Message.RequestMessage>(); if (this.requests != null) { for (Message.RequestMessage request : this.requests) { this.send(Message.CancelMessage.craft(request.getPiece(), req...
414840c6-b549-4c23-8db4-e134fea3f4e8
4
private boolean writeSign(Sign sign, Set<Matcher> matchers) { int index = 0; boolean needComma = false; String[] lines = {"", "", ""}; for (Matcher matcher : new HashSet<>(matchers)) { String tmp = needComma ? "," : ""; tmp += matcher.toString(); if ...
313bd935-e2c2-4af7-818b-26f787efbac9
4
private int secuenciaDeNodosContiguos(){ int rta=-1; if(secuencia.size()>1){ for(int i =1; i<secuencia.size();i++){ if(secuencia.get(i).getPosX()!=secuencia.get(i-1).getPosX() ||secuencia.get(i).getPosY()!=secuencia.get(i-1).getPosY() ){ rta=i; i=secuencia.size(); } } } return ...
71e90875-ed3d-4045-bc2f-a1ce82c789a9
8
private List<RegexNode> generateNodes(Map<Integer, List<Symbol>> table) { List<RegexNode> singles = new ArrayList<>(); List<RegexNode> parens = new ArrayList<>(); for (Entry<Integer, List<Symbol>> entry : table.entrySet()) { List<Symbol> symbols = entry.getValue(); ...
c6731985-91cc-4e82-8e3a-9468429310a8
3
public JSONObject accumulate(String key, Object value) throws JSONException { testValidity(value); Object o = opt(key); if (o == null) { put(key, value instanceof JSONArray ? new JSONArray().put(value) : value); } else if (o...
7cd61f5e-f2e8-45dc-905b-cd853f57d643
2
public ConsoleEvaluationHandler(PrintStream output, Reader console) { if (output == null) { throw new IllegalArgumentException("The given output stream must not be null."); } if (console == null) { throw new IllegalArgumentException("The given console must not be null.");...
824bb17c-295e-4eac-a87e-3489e284717d
8
String anonymizeString(String input,String nameToBeAnonymized) { //extract name terms String nameTerms[] = nameToBeAnonymized.split(" "); String textTerms[] = input.split(" "); String output = null; //go through input, replace name term sequences with substitute boolean lastTermWasName = false; for(int ...
2b89aea8-1695-4a07-b125-a237349fd278
5
public int getNumValue(boolean isABig) { switch (_value) { case "A": if (isABig) { return 14; } else { return 1; } case "J": return 11; case "Q": return 12;...
a11c5a01-707b-41d8-bd38-9328223d93a8
2
@Test public void testGetNeighbourhoodBest1Maximum(){ boolean result = true; double testFitness = 19; classUnderTest.setMaximum(true); classUnderTest.setWheel(19); for(int i = 0; i < 20; i++){ if(testSolutions.get(classUnderTest.neighbourhoodBest(i)) < testFitness){ result = false; } } assertTr...
01320139-111e-465d-b37b-f3a6000ba05b
7
@Override public List findRecords(String sqlString, boolean closeConnection) throws SQLException, Exception { Statement stmt = null; ResultSet rs = null; ResultSetMetaData metaData = null; final List list = new ArrayList(); Map record = null; // do this in an excpeti...
d514d7c1-ba2e-4833-b133-c6adce8f31e3
2
private void swim(int k){ while(k > 1 && less(k/2, k)){ exch(k/2, k); k = k/2; } }
553b2230-6ca1-4f91-bc14-0e99d511edb7
5
public static Record getAchievementRecordByXMLElem(XMLElement root) { User user = null; Achievement achievement = null; for (int i = 0; i < root.childList.size(); i++) { XMLElement elem = root.childList.get(i); if (elem.name.equals("user")) { user = User.getUserByUsername(elem.content); } else if (el...
a444256c-9293-469e-a5d8-557c2758c11b
1
public static long getElapsed(int tickID) { if (TickCount - tickID >= Ticks.length) { } long time = Ticks[(tickID % Ticks.length)]; return System.currentTimeMillis() - time; }
5494e4c9-7b4c-4e58-a291-47b71b6ae3ac
5
private void actionMix( ) { DefaultMutableTreeNode selNd = getSelectedNode(); if ( selNd != null ) { int[] selIdxs = getNodeIndexList(selNd); if ( selIdxs.length == 1 ) { LinkedList<double[]> audioList = audioVectors.get(selIdxs[0]); int m = audioList.size(); if ( m > 0 ) { NumberDialog numbe...
2f6945f9-9d2c-4da3-aa86-cf3117802acf
9
public static void createGraphs(LinkedList<Game> games) { HashMap<String, XYSeriesCollection> datasets = new HashMap<>(); for (Game game : games) { for (String key : game.getVarData().keySet()) { if (datasets.containsKey(key)) { try { ...
9756d339-8886-4e11-a0b9-618860048e82
3
public void heal() { List<Player> rangeList = getPlayersInRegion(); for (Player p : rangeList) { if (p.getHealth() != 20) { if (!p.isDead()) { p.setHealth(p.getHealth() + 1); } } } }
a52cadf4-fe8e-46dd-8474-c7a012b02375
1
public Set propagateUsage() { used = new SimpleSet(); Set allUse = new SimpleSet(); Set childUse0 = subBlocks[0].propagateUsage(); Set childUse1 = subBlocks[1].propagateUsage(); /* * All variables used somewhere inside both sub blocks, are used in this * block, too. Also the variables used in first bloc...
fa732a54-df39-4f72-ad41-7ee22eb1c023
2
public MetropolisTableModel() { // construct column names colNames = new ArrayList<String>( Arrays.asList("Metropolis", "Continent", "Population")); // connection to database try { // make sure JDBC driver is loaded Class.forName("com.mysql.jdbc.Driver"); // create connection between our ac...
b10109aa-c657-4360-93bf-f6d949c20a56
5
public boolean isSyncMark(int headerstring, int syncmode, int word) { boolean sync = false; if (syncmode == INITIAL_SYNC) { //sync = ((headerstring & 0xFFF00000) == 0xFFF00000); sync = ((headerstring & 0xFFE00000) == 0xFFE00000); // SZD: MPEG 2.5 } else { sync = ((headerstring & 0xFFF80C00) ==...
42e1a0fa-2a02-4ed8-9541-f514953b030e
7
public RdpPacket_Localised receive() throws RdesktopException, IOException, CryptoException, OrderException { int sec_flags = 0; RdpPacket_Localised buffer = null; while (true) { int[] channel = new int[1]; buffer = McsLayer.receive(channel); if (buffer == null) return null; buffer.setHeader(Rd...
628852b9-359d-4f3d-ae8a-b2f13eb384f5
8
public Point2DInt[] getCornersOfOneSide(LineSegmentInt seg, int sgn) { final Point2DInt[] corners = getCorners(); final double sgn0 = seg.side(corners[0]); final double sgn1 = seg.side(corners[1]); final double sgn2 = seg.side(corners[2]); final double sgn3 = seg.side(corners[3]); int nb = 0; if (Math.sig...
d541beb9-08a0-419e-93e1-39b78e0243aa
1
public boolean getScrollableTracksViewportHeight() { if (adapt) return true; return getPreferredSize().height < getParent().getSize().height; }
56741bae-93f7-4704-ba79-a6c874fdf240
9
public void cellAltDraw(int x, int y){ if(!sedna.getSelected() ||sedna.getSelection(x,y)){ if(cellfillflag){ switch(cft){ case 0: populate(x,y,2); break; case 1: break; case 2: break; default: populate(x,y,2); break;} } else{ switch(cdt){ ...
794282dc-a663-4185-a169-039c3aba79bc
0
@Basic @Column(name = "LOG_CANTIDAD") public int getCantidad() { return cantidad; }
36f43a1b-f289-493a-bd53-2034437bfe41
4
public static String traducirMensaje(int id){ if(id == 0) return "Mensaje de login"; if(id == 1) return "Mensaje para todos"; if(id == 2) return "Mensaje privado"; if(id == 4) return "Mensaje de logout"; return "Error: Mens...
152518cc-1ace-47a5-ae69-c20503b7eb4f
0
public String getDesc() { return desc; }
a3dcc2ec-50ae-45e2-bbaf-32dd4111df36
2
@Before public void setUp() { TestHelper.signon(this); MongoHelper.setDB("fote"); MongoHelper.getCollection("users").drop(); for(User user : users) { if(!MongoHelper.save(user, "users")) TestHelper.failed("user save failed!"); } }
7634166b-df77-4dd8-b8a8-c09c798543a5
6
public static MapFunction getInstance(Node root) throws ParsingException { URI returnType = null; NodeList nodes = root.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeName().equals("Function")) { ...
a6e29bad-d962-4ac9-a7cd-60d32dc9cbd0
4
private void costomedicamentosFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_costomedicamentosFieldKeyTyped // TODO add your handling code here: if (!Character.isDigit(evt.getKeyChar()) && evt.getKeyChar() !='.' && !Character.isISOControl(evt.getKeyChar())) { T...
9c56e4ac-c0ce-4fa7-9e10-d8f9b03eb006
1
public static void main(String[] args) throws InterruptedException, IOException, PropertyException, JAXBException { String path = "F:\\TargetFolder";// System.getProperty("user.dir"); boolean watchSubtree = false; //injector = GuiceInjector.getInjector(); FileOperationMask fileOperationMask = injector.getIn...
1c1c965a-af33-4e62-855e-1ea3c1d6ae7e
0
private MainFrame(){ frame = new JFrame(); initialize(); }
79888d54-2eda-4acd-bbd1-4ccae478b13a
8
public Pos findGoalPos() throws Exception { ArrayList<String> sTypes = new ArrayList<>(); for(int i = 1; i < 5; i++) { for(int j = 1; j < 5; j++) { //loops over the board, trying to find a unknown square. sTypes = m_Logic.locateAllAt(j,...
e68fed61-8969-4210-a808-7e78c3bfc765
4
private boolean jj_3R_45() { if (jj_scan_token(RETURN)) return true; Token xsp; xsp = jj_scanpos; if (jj_3_32()) { jj_scanpos = xsp; if (jj_3_33()) return true; } if (jj_scan_token(SEMICOLON)) return true; return false; }
f5209c1b-e103-4539-83a1-26bc1718c8c1
0
public Map placeNodes(TreeModel tree, NodeDrawer drawer) { HashMap nodeToPoint = new HashMap(); int[] width = Trees.width(tree), sofar = new int[width.length]; Arrays.fill(sofar, 0); setPoints((TreeNode) tree.getRoot(), width.length - 1, 0, width, sofar, nodeToPoint); return nodeToPoint; }
ddd6348e-1e33-47ad-b16f-ea999a38e525
9
public void parseFile( OperationList oplist ) throws Exception{ FileReader in_file = new FileReader( data_file ); BufferedReader file_buff = new BufferedReader( in_file ); String[] split_1, split_2, operands; String op_portion, comment_portion = ""; String li...
18e95ecf-171d-413f-8587-bf29cac90e66
0
public RoomState state(int row, int col){ return grid[row][col]; }
27401395-6b75-4228-9245-e1e0cfc22b60
2
@Override public boolean equals(Object obj) { if (obj instanceof Location) { Location other = (Location) obj; return this.x == other.x && this.y == other.y; } return false; }
4ced16a5-bab9-4387-8a1f-579949e5ad2e
5
private void getNextPosition() { // movement if (left) { dy -= moveSpeed; if (dy < -maxSpeed) { dy = -maxSpeed; } } else if (right) { dy += moveSpeed; if (dy > maxSpeed) { dy = maxSpeed; } } // falling if (falling) { dy += fallSpeed; } }
e157fb99-007a-4193-856c-48094256da84
1
public ArrayList<Edge> getToDo() { if (this.runDFS) { return this.dfs.toDo; } else { return this.bfs.toDo; } }
2e5ba1b6-e54e-4c4f-b78c-269b158b6f4e
0
public LoopingByteInputStream(byte[] buffer) { super(buffer); closed = false; }
7a30a4d5-e87b-469a-97f0-e68f7542da7d
6
public VerbConjugator(){ int confirm = 1; String verb = JOptionPane.showInputDialog(null, "Please input a verb in romaji to conjugate (dictionary form)"); Verb v = null; try { v = new Verb(verb); } catch (Exception e) { JOptionPane.showMessageDialog(null, "The input value does not conform to Japanese gr...
418642c4-a850-437a-8041-5a3afc6220a9
5
private void createDir(String dir) { File f = new File(dir); if(f.exists() && !f.isDirectory()) { Main.fatalError("Cannot create folder '" + dir + "'. There is a file called the same name."); } else if(!f.exists()){ try { if(!f.mkdirs()) { Main.fatalError("Could not generate all of the directories ...
41e1a2c8-5ef3-4f1f-8ab4-63935ca12a43
2
public double standardizedAllResponsesMaximum(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.variancesCalculated)this.meansAndVariances(); return this.standardizedAllResponsesMaximum; }
1346df5c-3e18-4d26-adcd-345dc4dbe8f8
3
@Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child for(ListIterator<PComando> i = this._comando_.listIterator(); i.hasNext();) { if(i.next() == oldChild) { if(newChil...
9cb5a6c6-77ed-46ab-bdca-f115664deaa6
1
public static PaymentResponse fromXml(String xml) throws ArsenalPayApiException { PaymentResponse paymentResponse = read(xml); String status = paymentResponse.getMessage(); if (! "OK".equalsIgnoreCase(status)) { throw translateToException(status); } return paymentResp...
d93f0181-ce9f-4db2-a11d-c4af040684f9
7
public void paint(Graphics2D g,boolean draw,boolean fill){ if (calcularVar) { calcular(); calcularVar = false; } if (draw && !fill) { g.draw(path); }else if(fill && !draw){ g.fill(path); }else if(draw && fill){ ...
6ede5cbd-d0e3-44e9-928c-240971a65382
8
public static void main(String args[]) { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { ...
048e3860-0071-4208-aa14-01b92a6c8908
6
private boolean startGame() { //To do Decide who is starting // in case of ai openent I'm starting if (playerIsReady && (oponent.getPlayerState() == ePlayerState.Ready)) { if (oponent instanceof AI) { if (gui != null) { gui.updateState...
9a88151d-ad84-4f9b-9a3c-26a9de7a9421
5
public static String getMediaPath(String fileName) { String path = null; String directory = getMediaDirectory(); boolean done = true; // if the directory is null if (directory == null) { // try to find the mediasources directory try { // get the URL for where we load...
c0a1c565-8156-4100-bbe0-4c7793ff8582
9
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, Case__typeInfo)) { ...
e749c92f-80f1-4c53-9cc7-92f6dd09605d
9
public static void main(final String[] args) throws Exception { int i = 0; int flags = ClassReader.SKIP_DEBUG; boolean ok = true; if (args.length < 1 || args.length > 2) { ok = false; } if (ok && "-debug".equals(args[0])) { i = 1; flag...
d650274f-3cdd-4b4d-9063-706d5a1682f2
2
@Override public void generate() throws GeneratorException { //get the extension of the template String ext=""; String templateFile = report.getTemplate(); int i = templateFile.lastIndexOf('.'); if (i >= 0) { ext = templateFile.substring(i+1); } try { report.generate(report.getOutput()+"."+ext)...