method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
2d129369-5a4c-4c78-bed5-06979fecb1f3
6
@Override public void printBPB(javax.swing.JTextArea a, javax.swing.JTextArea b) { b.append("\t\t 0\t 1\t 2\t 3\t 4\t 5\t 6\t 7\t\t 8\t 9\t A\t B\t C\t D\t E\t F"); for (i = 0; i < bytes_per_Sector; i++) { if (i % 16 == 0) { b.append(String.format("\n%07X0\t", address++))...
2290a05e-63ba-4d3a-a6db-69ac119274fb
0
public CheckExit() { super("Are you sure?"); this.setResizable(false); this.setLayout(new BorderLayout()); JLabel label=new JLabel("Do you really want to exit?"); label.setHorizontalAlignment(SwingConstants.CENTER); this.add(label, BorderLayout.CENTER); JPanel yesNo = new JPanel(); yesNo.setLayout(new FlowLayou...
93c4e22a-4b3b-4128-a2ff-2fec5439cf47
5
public void run() { while (true) { try { //get the data from the client byte[] receivedData = new byte[1024]; DatagramPacket receivePacket = new DatagramPacket(receivedData, receivedData.length); datagramSocket.receive(receivePacket); ...
0b6aa6dd-9987-43a3-a4ec-1ac7cbe30bde
5
public static void printFields(Class<?> c){ display2.append("フィールド\r\n"); Field[] declaredfields = c.getDeclaredFields(); Field[] fields = c.getFields(); ArrayList<Field> fieldList = new ArrayList<Field>(fields.length); for(int i = 0; i < fields.length; i++){ fieldList.add(fields[i]); } for(int i = 0;...
44951903-3e46-4c70-9243-0c545211839d
2
public void setRectXOR(int[] buffer, CPRect rect) { CPRect r = new CPRect(0, 0, width, height); r.clip(rect); int w = r.getWidth(); int h = r.getHeight(); for (int j = 0; j < h; j++) { for (int i = 0; i < w; i++) { data[(j + r.top) * width + i + r.left] = data[(j + r.top) * width + i + r.left] ^ buffe...
0e8ff842-c279-4475-897d-34b37229e07b
6
public boolean execute(CommandSender sender, String[] args) { if (!(sender instanceof ConsoleCommandSender)) { return true; } String command = args[0]; if (command.equalsIgnoreCase("getconfig")) { return GetConfig((ConsoleCommandSender)sender, args); } els...
6e90a0c7-f70b-49eb-86b1-ab3833715722
8
private void shutdown(){ // Escribo archivo pozos if(!getNombreArchivoPozos().equals("")){ escribirArchivoPozos(); } // Escribo archivo multilang if(!getNombreArchivoMultilang().equals("")){ escribirArchivoMultilang(); } imprimirDebug("Link...
1ce97608-c57f-4e7b-a77e-1ce7aa1747f4
7
protected static String getLine() throws IOException{ String input; if (replayIn != null && controlInput) { // get a packet from the replay input file Packet line; try { line = getPacket(); } catch (CorruptPacketException e) { throw new ReplayException("Error while reading replay file"); } ...
f59cd7bd-c28c-4f4b-992d-c4066352bab2
2
@Test public void testNonExistingClass() throws Exception { PersistenceManager pm = new PersistenceManager(driver, database, login, password); // drop all tables pm.dropTable(Object.class); pm.close(); pm = new PersistenceManager(driver, database, login, password); // test deleting object of non-existing...
62250c64-8fac-4353-8e66-9e98b7f77f27
4
private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); for (PropertyChangeListener l : getPropertyChangeListeners()) { if (l instanceof Serializable) { s.writeObject(l); } } for (VetoableChangeListener l : get...
29ae7510-11a9-4918-ba9f-601aaf5855a3
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SpeciesReference other = (SpeciesReference) obj; if (species == null) { if (other.species != null) return false; } else if (!species.equ...
7658a9c6-67cb-4dd6-b794-143a80a3b559
7
public Room getStep(String direction){ Room locRoom = (Room) getLoc(); Map map = getWorld().getMap(); Cell locCell = map.getCell(locRoom); int x = locCell.getX(); int y = locCell.getY(); int z = locCell.getZ(); switch (direction){ cas...
b7b6fc23-bdac-49e5-bfd6-2643375f1b23
7
public boolean clickContinue() { final Component component = getContinue(); if (!component.valid()) { return false; } if (component.valid() && ((Random.nextBoolean() && component.contains(ctx.input.getLocation()) && ctx.input.click(true)) || component.click())) { if (Condition.wait(new Callable<Boole...
5718e17b-9f5e-4a0d-8c26-080137704321
7
private static void zipSingleFile(ZipOutputStream out, File file, String entryName, WithProgressAdapter progress, Progress zipProgress) throws ZipException, IOException { ZipEntry entry = new ZipEntry(entryName); if (file.isDirectory()) { entryName += "/"; out.putNextEntry(entry); out.closeEntry(); for ...
c926d42c-3227-4c53-89b9-8ea27b796817
1
public void print() { for (int i = 0; i < id.length; i++) { System.out.print(id[i] + " "); } System.out.println(); }
c8329914-5e2a-476d-9f94-71e0e428d754
3
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...
e98f3a0c-cf47-49a2-825c-dc36f544957c
2
public static boolean checkLibrary(Library library) throws ModelingException { for(String elementName : library.library.keySet()) { Element element = library.library.get(elementName); if(!element.check()) { throw new ModelingException(0x50, elementName); } ...
de8a1483-84b4-476d-ba0b-036a089a4bbb
0
public static CarListJsonConverter getInstance() { return instance; }
62389be1-404f-48b2-85a3-5b7c44788ac1
9
@Override public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if (s==Return) { MenuHandler.CloseMenu(); } else if (s==Prev) { Game.edit.ChangePlayer(false); } else if (s==Next) { Game.edit.ChangePlayer(true); } for (int i = 0; i < Game.displayU.size(); i++) { if (s==Units[...
668dd5a1-a56c-45e1-a073-425667d9b842
1
public void showDebugGrid(boolean draw) { if(draw == true) { DRAW_DEBUG_GRID = true; } else { DRAW_DEBUG_GRID = false; } }
0c8e42c9-2937-4221-abd2-9876b4081d1e
3
void parseDocument() throws DaoException { try { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = null; parser = factory.newSAXParser(); if (file != null) { parser.parse(file, this); } } catch (Exception e) { if (log.isEnabledFor(Level.ERROR)) { log.error(e); ...
a93347e9-fd49-4911-8924-94a922c19a4e
3
@Override public boolean validateAndStartScriptExecutable(ScriptExecutable pScriptExecutable, int pStatementSequence) { if(pScriptExecutable instanceof ScriptSQL && isRerun()){ try { ScriptSQL lSQL = (ScriptSQL) pScriptExecutable; boolean lRunAllowed = validateScriptExecutable(lSQL); ...
3d104905-0077-45c8-ae80-0a9c37efd5be
6
private void setCell(int c, int x, int y, BufferedImage myBoard) { Point pos = window.getPos(x, y);new Point(x, y); if(Color.isBlue(c) && Color.isOne(pos, myBoard)) { //Cell is 1 board[x][y] = 1; } else if(Color.isTwo(pos, myBoard)) { //Cell is 2 board[x][y] = 2; } else if(Color.isTh...
3d5692f2-79dc-4c6a-b4d5-b1c811b5cf38
9
public int longestConsecutive(int[] num) { if (num == null || num.length == 0) return 0; if (num.length == 1) return 1; HashMap<Integer, Boundary> map = new HashMap<Integer, Boundary>(); int maxlen = 0; for (int i = 0; i < num.length; i++) { if...
5a545e09-c378-45db-b82d-2a005bf2c483
5
@Override public void run() { List<File> rawFiles = null; Processor processor = null; while (true) { if (null != (rawFiles = rawEntityStore.getRawFiles())) { for (File file : rawFiles) { processor = new EmployeeProcessor(file); if (null != processor.getEntityList()) { PoolExecutor.addProce...
043f5e5e-3106-40cc-8f3e-02bcbc948056
0
public User getUser() { return user; }
341570f2-f8f5-4989-b874-b4719cee3b57
1
private void display_list_content(myDataList myLink_list) { data my_Data; for (int i = 0; i < myLink_list.size(); i++) { my_Data = ((data) myLink_list.get(i)); System.out.println(my_Data.getChar() + " " + my_Data.get_probability() + " " + my_Data.isFlag() + " " ...
c6a38d7f-174f-4c48-afef-c3d6803349c0
0
public synchronized boolean stopped() { debug("Route.stopped() returning " + stopped); return stopped; }
672fc62a-53ab-4a13-b733-48eb09ea2f01
3
public void insertSupplierData(order tempOrder) throws SQLException{ try { databaseConnector = myConnector.getConnection(); SQLQuery = "INSERT INTO familydoctor.order "+"VALUES(?,?,?,?,?)"; PreparedStatement preparedStatement = dat...
381b2d41-ac34-451d-bffd-6e8affbebeff
8
boolean isReference(String ent) { if (!(ent.charAt(0) == '&') || !ent.endsWith(";")) { return false; } if (ent.charAt(1) == '#') { if (ent.charAt(2) == 'x') { try { // CheckStyle:MagicNumber OFF Integer.parseInt(ent.substring(3, ent.length() - 1), HEX); // CheckStyle:MagicNum...
29627216-80ff-43c3-b48c-b78eb6799295
4
private void notifyListeners(final CycLeaseManagerReason cycLeaseManagerReason) { //// Preconditions assert cycLeaseManagerReason != null : "cycLeaseManagerReason must not be null"; assert listeners != null : "listeners must not be null"; assert cycAccess != null : "cycAccess must not be null"; if (...
3ad32d04-3b85-40e0-810a-d5f311fc9f89
7
public static void main(String[] args) throws Exception { ChessMan a = new ChessMan(1); ChessMan b = new ChessMan(2); ChessMan c = new ChessMan(3); ChessMan d = new ChessMan(4); ChessMan e = new ChessMan(5); ChessMan f = new ChessMan(6); List<ChessMan> list= new ArrayList<ChessMan>(); list.add(a); lis...
c8df4f59-d62c-4939-984c-251dbc3c5208
6
private void updateTableColor(Thread t, int index) { switch (t.getState().toString()) { case "NEW": colors.set(index, Color.GREEN); break; case "RUNNABLE": colors.set(index, Color.CYAN); break; case "BLOCKED": colors.set(index, Color.RED); break; case "WAITING": colors.set(index, Color.YE...
c97d911d-30cd-4c34-a095-9d599ef49136
4
@Override public int loop() { if(startscript) { if(task == null || !task.hasNext()) { task = container.iterator(); } else { final Node curr = task.next(); if(curr.activate()) { curr.execute(); } } ...
e56e3cd3-3a1c-447c-b814-ec00105b4b69
5
public int algorithm(List<Integer> L, int k, Callback iteration, Callback comparison){ int pivot = L.get(r.nextInt(L.size())); iteration.callback(0); ArrayList<Integer> l1 = new ArrayList<Integer>(); ArrayList<Integer> l2 = new ArrayList<Integer>(); for(int element : L){ ...
14ed71cc-b58b-42bd-b480-2b8519a346c0
8
@Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : ""; if((mob.isAttributeSet(MOB.Attrib.AUTOMAP) && (parm.length()==0))||(parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB.Attr...
5a249684-2200-4a02-b1f3-48c95311615c
6
private void addType(final Type type) { if (type.isMethod()) { // Add all of the types of the parameters and the return type final Type[] paramTypes = type.paramTypes(); for (int i = 0; i < paramTypes.length; i++) { // db("typeref " + type + " -> " + paramTypes[i]); addType(paramTypes[i]); } ...
c5a93ef0-30ef-4bda-9e52-2d8318d54f07
8
protected void addRandomNucleotide() { double dr = 4 * Math.random(); Nucleotide nn = null; if (dr >= 0 && dr < 1) nn = Nucleotide.ADENINE; else if (dr >= 1 && dr < 2) nn = Nucleotide.GUANINE; else if (dr >= 2 && dr < 3) nn = Nucleotide.CYTOSINE; else if (dr >= 3 && dr < 4) nn = Nucleotide.URACI...
524ae480-e31e-42eb-b51c-599d21832c71
4
public void fixCamera() { if (fc_yaw >= 360) { fc_yaw -= 360; } if (fc_yaw < 0) { fc_yaw += 360; } if (fc_pitch < -75) { fc_pitch = -75; } if (fc_pitch > -10) { fc_pitch = -10; } }
97f2a967-e526-4072-8f25-63d44a9c786b
8
@Override public Iterable<ExtendedAttribute> listExtendedAttributes(String path) throws PathNotFoundException, AccessDeniedException, UnsupportedFeatureException { if (extendedAttributes) { try { String[] lines = FileSystemUtils.readLines(attributeFs, getAttributePath(path)); List<ExtendedAttribu...
ca0a4d6d-606b-4a66-a049-624ccc82f090
9
public static void main(String[] args) throws Exception{ SOP("==========Chapter 9 Recursion And Dynamic Programming==="); SOP("To run: java c9 [function name] [function arguments]"); SOP("Example: java c9 fib 10"); SOP(""); SOP("Possible functions:"); SOP("fib\tCompute nth fibo...
44bec2e0-a691-4d84-b006-0b66b4992429
5
@Override public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) { if (getWidth() <= 0 && (infoflags & WIDTH) != 0) { // The image's width has been finalized. setWidth(width); } if (getHeight() <= 0 && (infoflags & HEIGHT) != 0) { // The image's height has been fina...
64095018-33de-4d5c-89a5-de0300ded1eb
1
public Animator getAnimator() { if (_painter == null) { throw new IllegalStateException(); } Animator returnValue = new SwingAnimator(_painter, "Traffic Simulator", VP.displayWidth, VP.displayHeight, VP.displayDelay); _painter = null; return returnValue; }
5a5815d3-5cea-4248-a58e-fa5ee1354cb1
5
@Override public boolean equals(Object obj) { if (obj instanceof Command) { Command cmd = (Command) obj; if (this.thrust == cmd.getThrustCommand()) { if (this.direction == cmd.getDirectionCommand()) { if (this.speed == cmd.getSpeedCommand()) { ...
fe262e71-75ac-44ee-a73f-be6273dedde2
4
public float getWidth(char code, String name) { int idx = (code & 0xff) - getFirstChar(); // make sure we're in range if (idx < 0 || widths == null || idx >= widths.length) { // try to get the missing width from the font descriptor if (getDescriptor() != null) { ...
dcaf5d2e-ae88-4e62-b6be-db95f28affc6
6
@Override public void run() { if (ctx.bank.opened() && ctx.bank.close()) { if (!Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return !ctx.bank.opened(); } }, Random.nextInt(100, 200), 15)) { return; } } final Item potion = ItemHelper.ge...
5c48334c-d395-4019-81e6-81d796794c95
0
public BaseDO update(final BaseDO baseDO) { return getEntityManager().merge(baseDO); }
98a3396c-be45-4f87-976c-3130e2012b63
4
public void close() throws IOException { if (DEBUG) { dbg.printf("%s closed%n", this); } out.close(); try { eth.join(); if (DEBUG) { dbg.printf("%s joined %s%n", this, eth); } } ...
b9d214b6-b098-4402-a324-ff864fa6c566
1
public void doDelimitedFileExportToExcel() { try { final String mapping = ConsoleMenu.getString("Mapping ", DelimitedFileExportToExcel.getDefaultMapping()); final String data = ConsoleMenu.getString("Data ", DelimitedFileExportToExcel.getDefaultDataFile()); DelimitedFileExp...
2f4bd26a-2227-4f1c-981d-0781362a4eca
0
public static Persist getPersist() { return new Persist(getConnection()); }
744db685-dcda-4e0e-b3e8-4e280376fbc2
9
public int FindHighestPrec(LinkedList<Element> linkedList, int startPos, int endPos) { int elmWithHighPrec = startPos; int highestPrec = 8; int currPos = startPos; int parenMatcher = 0; Element currObj; Operator currOp = new Operator(); currObj = (Element) list.get(currPos); for (currPos = startP...
c30c8955-61cc-4d15-8b5e-34679541bc36
0
public SimpleStringProperty lastNameProperty() { return lastName; }
e2433698-0d87-4cc2-9aef-e7b60a357d9f
3
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((majorVersion == null) ? 0 : majorVersion.hashCode()); result = prime * result + ((minorVersion == null) ? 0 : minorVersion.hashCode()); result = prime * result + ((version == null) ? 0 : version.hashCo...
461b706b-a931-461d-947b-707dc3d078e3
8
void highlightGuide(Integer pos, Color color, int offset) { if (pos == null) { if (guide[offset] != null) { removeFeedback(guide[offset]); guide[offset] = null; } location[offset] = pos; return; } // pos is an integer relative to target's client area. // translate pos to absolute, and then ...
9c38d984-d976-4138-b6ce-cda6e8c0f0ed
6
public int getMinMaand(int jaar) { int maand = 12; // Itereer de datasets for (DataSet set: this.datasets) { for (Category cat: set.categories) { for (SubCategory scat: cat.subcategories) { SubCategory subcat = new SubCategory(scat.id, scat.naam, scat.datatype, s...
333415b7-781f-46fe-a7aa-6dcb6cf64eb1
2
static int findColumn(TableModel model, String name) { for (int i = 0; i<model.getColumnCount(); i++) { if (name.equals(model.getColumnName(i))) { return i; } } return -1; }
4558f4fe-2331-478c-ac48-2c6e522e7728
6
public void searchByBookTitle (LYNXsys system, String query, int page) { // search for books by Title for (int i = 0; i < system.getBooks().size(); i ++) { // loop through arraylist of books if (system.getBooks().get(i).getTitle().equalsIgnoreCase(query)){ // check if book title matches search query displayedS...
43c2f12b-08b0-4294-b812-9c6959ccda22
4
@Override public boolean contains(Object o) { if (o != null) { int i = index(o.hashCode()); synchronized (table[i]) { Node<E> c = table[i].next; while (c != null) { if (c.element == o || c.element.equals(o)) { return true; } c = c.next; } } } return false; }
cc97cf77-8a7d-420b-821f-1e189b51e082
5
public void paintComponent(Graphics g){ for(int x = 0; x < 500; x += 50){ for(int y = 0; y < 500; y += 50){ g.setColor(Color.WHITE); g.fillRect(x, y, 50, 50); g.setColor(Color.BLACK); g.drawLine(x, y, x + 50, y); g.drawLine(x, y, x, y + 50); if(player.xPos == x/50 && player.yPos == y/50...
c6af0434-2185-4e7c-a41d-aac7ffcaf553
7
@Override public MarkovChain constructChain() throws Exception { // @debug sampleValueIndices = new ArrayList<>(); MarkovChain mcResultante = new MarkovChain(stats); transitionResultante = new double[stats.length][stats.length]; MarkovChain mcSimulation = new MarkovChain(s...
e02d9bf7-8560-4bb4-92f5-60e27df95412
5
public InputStream send() { //Prepare parameters prepare(); try { HttpURLConnection con = prepareConnection(new URL(String.format(URL_FORMAT, this.url, this.parameters))); int responseCode = con.getResponseCode(); String responseMessage = con.getResponseMessage(); if (responseCode == HttpURLConn...
a414df29-ff75-48a5-8180-d2cabf6321f9
3
public static JScanner getInstance(Component component) { Container parent = component.getParent(); if (parent instanceof JPopupMenu) return getInstance(((JPopupMenu) parent).getInvoker()); while (parent != null) { if (parent instanceof JScanner) return (JScanner) parent; parent = parent.getParent();...
a77b2e5c-cc9d-4f1a-a87b-8a3ee15a07f3
3
public static TopQueue search(String target, String dictFile) throws IOException { BufferedReader reader; reader = new BufferedReader(new FileReader(dictFile)); TopQueue topQueue = new TopQueue(); String word; int distance; while((word = reader.readLine()) != null) ...
69cefc7b-f172-478c-90dc-303e3ce2c6ef
5
public void keyPressed(KeyEvent e) { System.out.println("KeyPressed "+e.getKeyCode()); try { switch (e.getKeyCode()) { case KeyEvent.VK_UP : { System.out.println("UP"); model.move(Directions.UP, score); ...
0a8ab96d-f512-40bc-9280-6726a96aade8
5
public double[] evaluateNeuralNetwork(double[] inputVector){ ArrayList<Node> inputLayer = networkLayers.get(0).getNodes(); ArrayList<Node> outputLayer = networkLayers.get(networkLayers.size()-1).getNodes(); //If the input vector is not of the same size as the input layer return null. if(...
b58707d7-0cdb-46a5-bd67-3efa675b5982
0
public void mouseDragged(MouseEvent event) { return; }
caa84bfb-e48f-47f9-8366-720a4504c1aa
2
public void update() { List<Zombie> zombies = house.zombieList; Rectangle2D box; int x, y, width, height; charactersGraphics.clearRect(0, 0, characters.getWidth(), characters.getHeight()); backgroundGraphics.setColor(Color.BLUE); for (Tile t : house.tileList) { x = (int) t.getX() * 50; ...
cb3d03eb-fb29-4b88-a436-2b2ec766f0d5
0
public static void main(String[] args) throws Exception { new HelloWorldOGL().loop(); }
78dce577-a5fa-460f-baf9-6fd155906e1b
0
public Flooder(String host) throws java.net.UnknownHostException, java.net.SocketException { t = new Thread((Runnable) this); this.host = InetAddress.getByName(host); sock = new DatagramSocket(); stop = false; //t.start(); }
35c2e1ec-5d0b-4f28-8f6e-ccd9626fca50
8
public void updatePlayer() { if (userRace.equalsIgnoreCase("human")) user = new Human(this, userName, null, -1); else if (userRace.equalsIgnoreCase("cyborg") && userColor.equalsIgnoreCase("purple")) user = new Cyborg(this, "purple", userName, null, -1); else if (userRace.equalsIgnoreCase("cyborg") && userCo...
b59c14db-80da-45cd-820c-b4edd957ce57
3
public static ArrayList<bDefeito> getDefeitos(String arg_serial) throws SQLException, ClassNotFoundException { ArrayList<bDefeito> sts = new ArrayList<bDefeito>(); bDefeito bObj; ResultSet rs; Connection conPol = conMgr.getConnection("PD"); if (conPol == null) { throw...
057bcab3-e38a-4565-88a0-41add121c232
3
public HalfEdge findEdge (Vertex vt, Vertex vh) { HalfEdge he = he0; do { if (he.head() == vh && he.tail() == vt) { return he; } he = he.next; } while (he != he0); return null; }
d89d93fd-6138-45ee-94df-023174d0898b
3
void buttonClicked(final String answer) { state.setPictureChanged(false); state.setResultFromButton(true); List<String> currentRightAnswers = state.getRightAnswers(); //если верно: увеличиваем счет и показывем картинку. если неверно: уменьшаем счет if (currentRightAnswers.contain...
2025acdd-c5ed-458c-a6fb-4cdd8735416e
9
public static boolean rectIntersection(CvRect rect1, CvRect rect2) { if (rect1.isNull() || rect2.isNull() || rect1.width() <= 0 || rect1.height() <= 0 || rect2.width() <= 0 || rect2.height() <= 0) { return false; } int x0 = rect1.x(); int y0 = ...
8597dfe3-e5df-4d86-9702-b9a3f257bbf0
1
public String status() { return "#" + id + "(" + (countDown > 0 ? countDown : "Liftoff!") + "), "; }
a5a8adb8-505e-4394-9bf2-91326a1ddf0b
8
public static void set_connect(_YM2151 chip,int op_offset, int v, int cha) { OscilRec om1 = chip.Oscils[op_offset]; OscilRec om2 = chip.Oscils[op_offset+8]; OscilRec oc1 = chip.Oscils[op_offset+16]; /*OscilRec *oc2 = om1+24;*/ /*oc2->connect = &chanout[cha];*/ /* set connect al...
d73d36a2-41a5-41a4-aae2-c8e41735812c
1
public void outputAllGameScreenStatistics() { for (GameScreen gameScreen : gameScreens.values()) { logger.info(gameScreen.toString()); } }
f9af5927-d246-46ec-b0d4-c6c33fb77b70
1
public static void getStrings(String... text) { for(String s:text) { System.out.println(s); } }
9ea831e1-cc20-4ea1-8bf5-416fc9f18137
6
@Override public Screen respondToInput(KeyEvent key) { switch (key.getKeyCode()) { case KeyEvent.VK_1: return new LoadGameScreen(slot, 1); case KeyEvent.VK_2: return new LoadGameScreen(slot, 2); case KeyEvent.VK_3: return new LoadGameScreen(slot, 3); case KeyEvent.VK_4: return new LoadGameScreen(...
a5f9aa03-027b-4d7b-9ec4-fa13a8f82a5a
0
public static float getMaxDestToRad() { return MaxDestToRad; }
26853916-08f8-49f0-b81e-c00aaf1c4a1b
1
public void remover(long id) throws Exception { String sql = "DELETE FROM Pesquisacolaboradores WHERE id1 = ?"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); stmt.setLong(1, id); } catch (SQLException e) { throw e; } }
085cff1c-b4cf-4420-ac16-f91a7761d1d6
1
public void setHTML(String html, String base_url) { Graphics2D graphics = (Graphics2D) xhtml_panel.getGraphics(); // graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, Joculus.settin...
3285a5d3-fb51-40f5-8f6a-c65880efb559
5
public static boolean isUpdated(ClassNode cached, String jarLink) { try { URL url = new URL("jar:"+jarLink+"!/"); JarURLConnection conn = (JarURLConnection)url.openConnection(); conn.setDoOutput(true); JarFile jar = conn.getJarFile(); Enumeration<?> en...
908597be-3bc2-4980-bc14-58345d140251
2
private int muokkaaTuote(ArrayList<Tilausrivi> tilausrivit, String action) throws IOException { // otetaan tuoteID irti valuesta int tilausriviNumero = Integer.parseInt(action.substring(5)); // etsitään tuote tilausriveistä ja asetetaan tuoteID url:n parametriksi int numero = 0; for (int i = 0; i < til...
c0a02e93-2d34-4efc-a645-6a3e954db589
5
public synchronized void deposer(Site n) { // Compteur du nombre de personnes descendues pour le print. int cpt = 0; for (int i = 0; i < tfest.length; i++) { if ((tfest[i] != null) && (n.equals(tfest[i].destination))){ cpt++; // On "reveille" le festivalier tfest[i].setStop(true); delFestiv...
0d77298f-5028-4430-b86c-31b410fa5f34
9
public void fire_shot(double v, double angle, double height, int team) { double i=0.0, x=0.0, y=1.0, vx, vy, maxY=0.0, a=0.0; final int fixed_angle = 100; mydata.clear(); vx = v * (Math.cos(angle * (3.1416 / 180))); vy = v * (Math.sin(angle * (3.1416 /...
b8c6e2d5-6d8d-4d06-93dd-28c2feb797f1
9
public void updatePos(){ xspeed += xacc / speedDivider; yspeed += (yacc + gravity) / speedDivider; xspeed *= friction; yspeed *= friction; x += xspeed; y += yspeed; if(x < 0){ x = 0; xspeed = -xspeed * elasticity; ballColour = n...
c21f27eb-832c-47a9-a6d7-693f8df0b2a8
9
public static boolean isTokenDelimiter(int c) { switch (c) { case 'ä': case 'ö': case 'ü': case 'ß': case 'Ö': case 'Ä': case 'Ü': return false; } return c < 10 || c > 126 || DELIMITER_TOKEN.cont...
b6e1c391-af37-45c2-bc35-aad6e7bd6f25
2
private void addSchema(Document doc) throws IOException, XPathExpressionException { if(doc != null) { Node srcSchemaNode = Utilities.selectSingleNode(doc, "/xsd:schema", this.namespaces); String name = Utilities.getAttributeValue(srcSchemaNode, "targetNamespace"); if(!this.schemas.containsKey(name)) { ...
09b9fee2-8fb7-4fa2-882e-23ee371e5eb2
3
public void calculcate() { Rectangle r = this.getBounds(); float width = (float) r.getWidth(); float height = (float) r.getHeight(); // System.out.println("Width : " + width + " Height : " + height); float xScale = width / (bX + sX); float yScale = height / (bY + sY); scale = 0.0F; if (xScale > yScal...
cfc74c1c-c32a-4c28-860d-635aedfa7b39
3
public XmlNode CreateReplica(XmlNode parent, XmlNode node, String name) { if (parent == null || node == null || name == null) return null; XmlNode replicanode = new XmlNode(XmlNodeType.REPLICA, name); parent.addChild(replicanode); String path = tree.getPath(replicanode, node); replicanode.setAttribu...
114f4b72-8556-45e7-896b-d955f90f9078
1
public static void right() { if(viewX + 100 < WIDTH - 100) { viewX += 1; } }
4444526c-8632-481a-a796-fe244562f1c9
1
public static PeerID generateMagic() throws java.security.NoSuchAlgorithmException { boolean notFound = true; Random random = new Random(System.currentTimeMillis()); byte[] peerid = new byte[20]; int tries = 0; while (notFound) { tries++; random.nextBytes(peerid); notFound = isMagic(peerid); } ...
98c32ba3-1b59-4f75-b1ed-3820bed8b314
7
public static void paint(Ocean sea) { if (sea != null) { int width = sea.width(); int height = sea.height(); /* Draw the ocean. */ for (int x = 0; x < width + 2; x++) { System.out.print("-"); } System.out.println(); for (int y = 0; y < height; y++) { System...
77ffb2c7-aade-493f-9751-c1f344b84c20
3
public void addFile(String directory) throws IOException { Path path = Paths.get(directory); String ZipDirectory = path.getFileName().toString(); zipEntry = new ZipEntry(ZipDirectory); byte[] buffer = new byte[1024]; int bytesRead=0; CRC32 crc = new CRC32(); ...
c4a2a7a6-23fa-4f1b-9cba-21f321c67ef0
1
private void sendMessageToChat_Lobby() { // TODO Auto-generated meth od stub String message = lobby.fetchJTextValue("lobbyChat_message"); String result = sendMessageToSomeSocket(ChatSocketServer.MESSAGE, ",message=" + message, chatSocket); if (result.contains(ChatSocketServer.MESSAGE_RECEIVED)) { updateC...
d809229a-e574-4b8d-94cf-24e6e59c92b1
4
public void deleteAuthHeaderByToken(String token){ Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConnection(dbCon.getDATABASE_URL(), ...
a22e4a65-1067-4b94-9668-16c818ece235
9
public void enviarPecasParaJogador(Socket[] lista,int player) throws Exception{ for(int i =0;i<player;i++){ DataOutputStream info = new DataOutputStream(lista[i].getOutputStream()); if(player==1){ for(i=0; i<jogo.pecas1.size(); i++){ info.writeByte...
190b8a6a-2569-4b2c-be49-61d0a5face0d
3
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); }...
48978574-b391-45fe-8dd8-a3a5ee14556c
7
public String toSource(String className) throws Exception { StringBuffer result; int i; result = new StringBuffer(); if (m_ZeroR != null) { result.append(((ZeroR) m_ZeroR).toSource(className)); } else { result.append("class " + className + " {\n"); ...