method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
025cb8c1-a838-4a33-8d46-880882d49385
1
public BTServerController() { Vector<BluetoothService> bts = (new BluetoothService_TextLoader()) .loadServices(); if (bts.size() == 0) { JOptionPane .showMessageDialog( null, "No Bluetooth services found\nPlease create a bluetooth service first.", "Error", JOptionPane.ERROR_MESSAGE...
a4df332f-3ee7-40ef-a38c-7b350342cb56
7
public int delete() throws SQLException { StringBuilder sb = new StringBuilder(); if (commentLine != null) { sb.append("/* ").append(commentLine).append(" */"); } sb.append("delete from " + TABLENAME + ""); int length = whereMap.size(); if (length > 0) { StringBuilder sbWhere = new StringBuilder(); ...
7ae81772-fd6d-4b2e-b094-47cc34ad5953
1
private void setDefaultSelect(String player, AbstractButton button) { if (controller.getClientName().equals(player)) { button.setSelected(true); votedOutPlayer = controller.getClientName(); } }
a985e88c-035d-4e25-9a07-00759a5ab484
6
@Override public void run() { String msg = "!auction-ended " + getHighestBidder().getName() + " " + printHighestAmount() + " " + getDescribtion(); try { // if owner is online- send notification if (userManagement.getUserByName(owner.getName()).isOnline()) { // AuctionServer_UDPSocket.getInstamce().sendMe...
0217d963-d319-4264-b343-72dc321b074e
3
public void onDisable() { if (dbCtrl != null) { for (Player p : getServer().getOnlinePlayers()) { xAuthPlayer xp = plyrMngr.getPlayer(p); if (xp.isProtected()) plyrMngr.unprotect(xp); } dbCtrl.close(); } }
903c7733-ba00-4fa4-9abe-d21cae464d3d
9
public void actionPerformed(ActionEvent e) { this.setVisible(false); if (e.getSource() == CreateRoundButton) { this.f.getPanelJudgeCreateRound().setVisible(true); } else if (e.getSource() == ModifyRoundButton) { this.f.getPanelJudgeModifyRound().updateComboBox(); this.f.getPanelJudgeModifyRound().setVisi...
09e36a26-4ef6-4d28-89f1-f51eae8f6fed
5
private void writeCSVFile(String outCSVFile) { Charset charset = Charset.forName("US-ASCII"); try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(outCSVFile),charset)) { if (timeToPitch.size() > 0) { Iterator<String> keys = timeToPitch.keySet().iterator(); for(int i=0; i<timeToPitch.size(); ...
943b54cd-5587-451f-97aa-209a472b50c4
2
static int revtable(byte foo){ for(int i=0; i<table.length; i++){ if(table[i]==foo)return i; } return 0; }
be78c84c-d625-4215-adfb-67ace7818df6
6
void run() { // load the nml Frame frame = new Frame(); FileDialog fileDialog = new FileDialog(frame, "open nml file", FileDialog.LOAD); fileDialog.setVisible(true); String filePath = fileDialog.getDirectory(); String fileName = fileDialog.getFile(); DocumentBuilderFactory factory = DocumentBuilderFa...
24555f94-a99c-4d07-9ca1-74026ac33ed1
1
public void visit_putfield_nowb(final Instruction inst) { final Type type = ((MemberRef) inst.operand()).nameAndType().type(); stackHeight -= type.stackHeight() + 1; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } }
5f82f8c2-d949-42f5-8afb-35ac7b17159a
2
public static List<Field> getFieldsByType(Object object, Class type) { List<Field> list = new ArrayList<Field>(); Field[] fields = object.getClass().getDeclaredFields(); for (Field field : fields) { if (field.getType().isAssignableFrom(type)) { list.add(field); } } return list; }
9c162d5c-1c51-4d7b-b679-62329c72e0e1
2
@Override public void actionPerformed(ActionEvent event) { client.update(); if (client.getSession() != null) { client.getSession().update(DT); } if (gamePanel.isVisible()) { gamePanel.repaint(); } }
7d1ff306-c49f-4863-a4db-8d1429eb47dc
4
public static void initItemFeature() { double sum; for(int i = 0; i < DataInfo.num_of_item;i++) { sum = 0; for(int j = 0; j < DataInfo.itemlist[i].length; j++) { int a = DataInfo.itemlist[i][j]; sum += a % 10; } DataInfo.itemFeature[i][0] = sum / DataInfo.num_of_user; } Random ran...
3a1a09a9-69fb-4085-a252-ec6f0e52b487
5
public void mouseMoved(MouseEvent e) { int y = e.getY(); if (defaultCursor == null) { defaultCursor = getCursor(); } thresholdPos = (int) (getHeight() - (threshold * (getHeight() - 1)));//- if (y >= thresholdPos - 5 && y <= thresholdPos) { ...
67d549bd-89d7-4fa2-9dfd-0a1971f63912
9
public void foo() { for (int n = 5; n < 6; n++) { int count = 0; for (Permutation p : new UniversalPermClass(n)) { boolean sorted = false; // System.out.println(p); ArrayList<String> sortings = new ArrayList<String>(); KStackSta...
b7202e1a-3765-448d-ac3f-7ebade660f6a
1
public boolean opEquals(Operator o) { return (o instanceof UnaryOperator) && o.operatorIndex == operatorIndex; }
95041e2f-89fe-46dc-b4af-30c9d3efd996
9
@Override public void run(){ while (crawlerCTRL.peekInputJob() != null){ Job job = crawlerCTRL.peekInputJob(); if (job == null) break; Task task = job.pollOutputBus(); if (task == null){ this.waitForever(); continue; } Task[] tasks = null; String ext = task.getExtension(...
2f90fbea-3a20-493c-a0ce-5d244c6567a3
5
public static float getRate(int rateId){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { Statement stmnt = conn.createStatement(); ...
d91c4660-3bc2-4f84-8181-9a5bccbd71ee
0
public void setData(int newData) { data = newData; }
1966d621-cd70-46c1-bd91-1e0e82bd837d
8
public static boolean isJulianDate(int month, int day, int year) { if ((month < 0) || (month > 11)) { return false; } int[] months = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (month == 1) { int febMax = 28; if ((year % 4) == 0) { febMax = 29; } if ((day < 1) || (day > febMax)...
586acb07-817a-4b93-8821-628684cf3286
9
private CtLiteral generateLiteral(spindle.core.dom.Literal literal) { CtLiteral cLiteral = objectFactory.createCtLiteral(); if (literal.isNegation()) { CtLiteral.Not cNegLiteral = objectFactory.createCtLiteralNot(); cNegLiteral.setAtom(literal.getName()); cLiteral.getNot().add(cNegLiteral); } else { c...
fadd72c6-1d95-4f81-858b-bf5e9f696f37
7
public void setHls(float hue, float luminance, float saturation) { if (saturation == 0) { red = green = blue = (int) (luminance * 255.0f + 0.5f); } else { float h = (hue - (float) Math.floor(hue)) * 6.0f; float f = h - (float) Math.floor(h); float p = luminance * (1.0f - saturation); float q = lumina...
60de15a3-634d-4d5e-acab-361bdf994f29
2
public long inserir(Pesquisador pesquisador) throws Exception { String sql = "INSERT INTO pesquisador(nome,nome_cientifico,email,sexo,classe,titulacao,curso_vinculado,areaformacao, curriculo_lattes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)"; long idGerado = 0; try { PreparedStatement stmt = ConnectionFactory.ge...
b011be18-0610-43eb-8ee9-b2a891103268
0
public HashSet getNewLambdaSet() { return new HashSet(); }
386cbcf3-1225-4219-9218-a9babf42bb56
5
protected void dealWith( String urn ) { boolean success = false; try { if( (success = cache(urn)) ) cacheRecurse(urn); } catch( MalformedURLException e ) { e.printStackTrace(); } catch( InterruptedException e ) { Thread.currentThread().interrupt(); } finally { enqueuedAndInProgressUrns.re...
b556f14f-55dd-48d9-a65a-fb80d784b93f
9
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the * to str...
08c55e6e-6ef2-461d-b7f6-63b7ddb0b6bf
6
public String[] dataCacheToArray(ArrayList <String> dataCache, String dataField){ /* * @param (ArrayList <String> dataCache, "link" || "seed" || "leech" || "size") * example (BuildDataCache(String[] foo), "size")) will return all the torrent sizes in a string array. * Parses the SizeStats ArrayList into ...
81c3d288-db3b-4d9b-bf7e-74cb194a18fb
9
public int saveQuiz(ArrayList<Question> quiz){ try{ Class.forName(classname); connect = DriverManager.getConnection(url,un,pwd); st = connect.createStatement(); int quizid=0; if(quiz==null ||(quiz!=null && quiz.isEmpty())){ st.close(); return -1; } Question q = q...
6da20032-4761-4e92-aaf3-00b5e5acd253
8
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((cost == null) ? 0 : cost.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((partNumber == null) ? 0 : partNumber.hashCode()); result = prime * result ...
aaa4e675-08b8-4991-bad3-ac68eb55f31d
3
static BufferedImage load(String path) throws IOException { BufferedImage orig = ImageIO.read(new File(path)); BufferedImage processed = new BufferedImage(orig.getWidth(null), orig.getHeight(null), BufferedImage.TYPE_INT_ARGB); Color rtColor = new Color(orig.getRGB(0, 0)); Color trColor ...
94e9119c-ae6f-46af-b4d4-690eb442d81d
1
public static void main(String[] args) { // TODO Auto-generated method stub int k = Integer.parseInt(args[1]); for(int i = 0; i <= k;i++){ System.out.println(args[0]); } }
e230f457-835f-41c0-88cb-9922c6332563
2
public void test_set_RP_int_intarray_String_Locale() { BaseDateTimeField field = new MockBaseDateTimeField(); int[] values = new int[] {10, 20, 30, 40}; int[] expected = new int[] {10, 20, 30, 40}; int[] result = field.set(new TimeOfDay(), 2, values, "30", null); assertEquals(tru...
00cbcc53-6269-4da6-80db-83778e49a829
1
public void setImage(Image image) { button.setIcon(image == null ? null : new ImageIcon(image)); }
c783fba4-8b78-45db-848b-d126a2fa6fb9
6
private File chunkFileForXZ(int var1, int var2) { String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat"; String var4 = Integer.toString(var1 & 63, 36); String var5 = Integer.toString(var2 & 63, 36); File var6 = new File(this.saveDir, var4); if(!var6.ex...
03147aeb-68fb-4e09-85b5-53eb3190aca2
6
public void initialEnemyMove(){ // Is this enemy one of the initial 3 switch(priority){ case 1:{ if(getxCoord()-speed > 1250){ setxCoord(getxCoord() - speed); } else{ done = true; } ...
03bdf91a-2e69-466e-b03c-78782d9888be
2
@Override public List<TourType> load(Criteria criteria, GenericLoadQuery loadGeneric, Connection conn) throws DaoQueryException { int pageSize = 10; List paramList = new ArrayList<>(); StringBuilder sb = new StringBuilder(WHERE); String queryStr = new QueryMapper() { @Ov...
ead8d6e8-9be5-44bb-a26a-13f2619c3fb1
2
public static Socket fork (ZContext ctx, IAttachedRunnable runnable, Object ... args) { Socket pipe = ctx.createSocket (ZMQ.PAIR); if (pipe != null) { pipe.bind (String.format ("inproc://zctx-pipe-%d", pipe.hashCode ())); } else { return null; } ...
c1086e0e-9875-4660-a2ad-c543252f51b1
1
public static boolean isSystem(final Type type) { Class c = null; try { c = Class.forName(type.className().replace('/', '.')); } catch (final ClassNotFoundException ex) { System.err.println("** Could not find class " + type.className()); ex.printStackTrace(System.err); System.exit(1); } // Have ...
83393782-d37b-447f-b693-22f68d06bd9f
1
public void testSeDurationBeforeEnd_RI2() { MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2); try { test.setDurationBeforeEnd(new Duration(-1)); fail(); } catch (IllegalArgumentException ex) {} }
d12e5030-875e-487c-970a-473ae3457e58
9
static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) { String docData; Document doc = null; if (charsetName == null) { // determine from meta. safe parse as UTF-8 // look for <meta http-equiv="Content-Type" content="text/html;charset=g...
b1b56dea-88b9-43a2-889c-b4e87318ea63
7
public void run() { drawableObjects.add(new RectTextureSprite2D(new Vector(MIN_X, MIN_Y), new Vector(MAX_X-MIN_X, MAX_Y-MIN_Y), 0, "assets/textures/Stage1.png", "PNG")); //Player Sprites Player.player1Punch = new RectTextureSprite2D(new Vector(), new Vector(22, 31), 0, "assets/textures/CatPunch1.png", "PNG"); ...
c25e8359-1bcd-4d7a-b912-b615be5699b6
7
public Enemy shoot() { shootDelay--; if (shootDelay > 0) return null; else shootDelay = fireRate; Geometry geometry = towerLocation.getGeometry(); ArrayList<PathTile> tilesInRange = geometry.getNearby(towerLocation, (int) (range * rangeModifier)); Random rand = new Random(); Enemy target = null; for...
8887c7a7-5a2a-4ea3-a089-617be551cfba
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 Role)) { return false; } Role other = (Role) object; if ((this.id == null && other.id != null) || (this.id != n...
ac64c2ec-2ff4-4913-a95a-46cc90dbc037
5
public Object clone() { // Ken Rune Helland <kenh@csc.no> is our local clone() guru final Element element = (Element) super.clone(); // name and namespace are references to immutable objects // so super.clone() handles them ok // Reference to parent is copied by super.clone()...
586a25d0-0b86-49d1-93ec-04a18c083b3b
1
public Rank getThirdRank() { return (ranks.size() < 3 ? Rank.Null : ranks.get(2)); }
7ad68916-4482-4680-bc36-2086fd40c5d7
3
public Date getMaxDate(){ Date ret = null; for (Integer key: colMaxDates.keySet()) { Date d = colMaxDates.get(key); if (ret == null || ret.before(d)){ ret = d; } } return ret; }
58d11899-0511-419e-8858-ec8fe7752009
7
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BorderArrangement)) { return false; } BorderArrangement that = (BorderArrangement) obj; if (!ObjectUtilities.equal(this.topBlock, that.topBlock)) { ...
1d5e9f75-f581-49cb-8ad8-bdd743d638d1
0
public void setHouseNumber(String houseNumber) { HouseNumber = houseNumber; }
b3f76492-0c97-468d-84f7-6a0fb9782705
0
public State getBlock() { return myBlock; }
edfdb789-3a87-4b94-a46d-7e3bd8d5c240
5
public static void become(TuringMachine dest, TuringMachine src){ System.out.println("Calling the real become"); dest.clear(); // Copy over the states. HashMap<TMState, TMState> map = new HashMap<TMState, TMState>(); // Old states to new states. // Iterator it = src.states.iterator(); for (Object o...
6761d2ca-7c68-43c7-b84d-53d5687be07a
0
public void setAlgorithm(String value) { this.algorithm = value; }
d58a00e5-fd8a-42fa-8a17-a0e5d6ce537e
2
public boolean deleteItem(int index){ int itemCount = getItemCount(); // unacceptable index - reject if(index < 0 || index >= itemCount) return false; // delete indexed entry leafItems.remove(index); // successful delete return true; }
cf0bc054-be2c-411a-a27c-b92e0fb14118
7
public void collisionCount() { for (int i = 0; i < asteroids.size(); i++) { if (ship.collision(asteroids.get(i)) && asteroids.get(i).getAlive()) { ship.setAlive(false); } for (int e = 0; e < lasers.size(); e++) { if (lasers.get(e).collision(ast...
09995206-349d-4ddc-822e-2e3c7de62d6a
4
public InheritanceVisitor(File output, List<File> caches) throws IOException { super(Opcodes.ASM4); if (output != null) { FileOutputStream fos = new FileOutputStream(output); out = new PrintWriter(fos); } graph = new InheritanceGraph(); for (File cache ...
1180f5ea-d8ab-4278-b233-5f086a8c8015
7
private void init(Type t){ if(t==null){ type = TYPE_NULL; g=null; }else if(t instanceof Integer){ type = TYPE_INTEGER; g=t; }else if(t instanceof Long){ type = TYPE_LONG; g=t; }else if(t instanceof Double){ ...
f4aed774-51da-403a-a1dd-7bca7b18cd06
7
public static Keyword medianOfNumbersSpecialist(ControlFrame frame, Keyword lastmove) { { Proposition proposition = frame.proposition; Stella_Object listarg = (proposition.arguments.theArray)[0]; List sortlist = List.newList(); Stella_Object listskolem = Logic.argumentBoundTo(listarg); Stell...
555f6616-7bb0-4e45-993d-329ad2189748
0
public static void main(String[] args) { printMenu(); inputCustomerChoice(); supplyBeverage(); }
c38fcc37-0972-47f8-9015-1523dd82d047
8
@BeforeClass public static void setupForClass() { Properties openejbProp = new Properties(); InputStream in = OpenEjbTestFixture.class.getClassLoader().getResourceAsStream("openejb.properties"); if (in != null) { try { openejbProp.load(in); System...
58092596-d998-475f-9281-b3cb91ee6cab
4
public int addSidebarItem(SidebarItem e) { if(((heightFilled + e.getHeight() + Sidebar.VERTICAL_SPACING) > Sidebar.windowHeight_) || (((2 * Sidebar.HORIZONTAL_SPACING) + e.getWidth()) > Sidebar.WIDTH)) { return -1; } for(int i = 0; i < Sidebar.MAX_ELEMS; i++) { if(elements[i] == null) { elem...
ca6e5374-a4d9-4c52-a99f-016572841f90
8
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetc...
5a5e624a-f5c8-4c0b-b07b-14dc0275ef7f
4
public static void cleanUpTable() { //Loop through every row in the table for(int k = 0;k<=5;k++) { if(clientsTable.getModel().getValueAt(k, 0) == null) { System.out.println("Found Null Value at: " + k); if(k != 5) { if(clientsTable.getModel().getValueAt(k+1, 0) != null) { Syst...
fa0443b2-1db1-4e04-a605-f9b849252800
3
private void putLastKeywords() { //put the last time frame keywords into /*//check if there are keywords in last time frame but not in this time frame //(given the condition that there is space remaining) if(newKeywords.size()<Settings.keywordMax){ for(String lastKey : Settings.TFHashtagFreq_last.keySet...
a63b8f15-9182-4f26-a2b6-901ba4c8fc7f
4
public Pacman( Maze startMaze, int lives,Logica inte) { sleep=100; this.logica = inte; mov = new Movimento(); maze = startMaze; livesLeft = lives; cells = maze.getCells(); Toolkit kit = Toolkit.getDefaultToolkit(); for (int i = 0; i < pacm...
07b89c8f-6260-4771-ae7d-cb59f03d21ac
4
private void turnTowardsTargetAngle() { double angleDifference = angle - targetAngle; if (Math.min(Math.abs(angleDifference), 2 * Math.PI - Math.abs(angleDifference)) < da) { angle = targetAngle; } else if (angleDifference > Math.PI) { angle += da; angle %= 2 ...
bd9361a2-c2fb-4152-9e72-7e91d7b8bd71
9
public void search() { Set<Node> explored = new HashSet<Node>(); PriorityQueue<Node> queue = new PriorityQueue<Node>(); /* cost from start */ startState.setScore(0); queue.add(startState); boolean found = false; while((!queue.isEmpty())&&(!found)){ ...
b8595292-1594-40a1-9875-f6c021bc3047
9
public boolean shutdownFileUpdate() { ArrayList<String> deleteFiles = new ArrayList<String>(); //Updating download locations or delete file from system if it's a local file that's not downloaded for(File f : fileManager.getLocalSystemFiles()) { String fileName = f.getName(); if(fileManager.getNetw...
ebc8af36-64f7-48f6-bce7-154a6d87ba69
2
private static String createResolutionString(PrinterResolution res) { if (res != null) { StringBuilder buffer = new StringBuilder(); int x = res.getCrossFeedResolution(1); int y = res.getFeedResolution(1); buffer.append(Integer.toString(x)); if (x != y) { buffer.append("x"); //$NON-NLS-1$ buffe...
fad37027-fb54-4414-b627-7bf75c77db4f
5
public static ArrayList<String> getEmployeeNames(){ Statement stmt = null; ResultSet rs = null; String sql= "SELECT * FROM EMPLOYEES"; ArrayList<String> names=null; try { stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); r...
0e4288a1-57e6-41b0-9538-3ca3d3533639
8
static void optimize(final File f) throws IOException { if (f.isDirectory()) { File[] files = f.listFiles(); for (int i = 0; i < files.length; ++i) { optimize(files[i]); } } else if (f.getName().endsWith(".jar")) { File g = new File(f.getParentFile(), f.getName() + ".new"); ZipFile zf = new ZipFi...
f30eecff-4629-49fb-80a8-f71f29dd58ea
8
private void customGame() { JPanel custom = new JPanel(new GridLayout(3, 2)); // Make the panel to go inside optionPane JLabel rowsL = new JLabel("Number of rows:"); JLabel colsL = new JLabel("Number of columns:"); JLabel minesL = new JLabel("Number of mines:"); JTextField rowsF = new...
a309dfa1-b587-4a19-940d-32d104768c8e
9
public void drawInventoryBag(JFrame frame) { int roomId = this.room.getId(); // if room is floor draw another HUD if (!(roomId == 1 || roomId == 2 || roomId == 3 || roomId == 14 || roomId == 13 || roomId == 16 || roomId == 17)) { BufferedImage inventoryBag = null; try { inventoryBag = ImageIO.read(...
6349d254-e736-4c06-b272-f1c6816719b0
9
protected static void createDescriptor() { try { InputStream descriptorStream = NaturalAspectsParseControllerGenerated.class.getResourceAsStream(DESCRIPTOR); InputStream table = NaturalAspectsParseControllerGenerated.class.getResourceAsStream(TABLE); boolean filesystem = false; if(de...
c7f4100b-7891-4a93-9dc8-3e2aafd672c4
9
public InferSampler () { documentTypes = new ArrayList<Integer>(); for (int type = 0; type < numTypes; type++) { documentTypes.add(type); } documentTopics = new ArrayList<Integer>(); for (int topic = 0; topic < numTopics; topic++) { ...
6a671f9b-cbcb-43f3-bdb1-88d89fe2f933
5
public void terminated(Pipe pipe_) { // Drop the reference to the deallocated pipe. assert (pipe == pipe_ || terminating_pipes.contains (pipe_)); if (pipe == pipe_) // If this is our current pipe, remove it pipe = null; else // Remove th...
d5f3926b-5f73-4402-a7fa-3f83bbc75d28
9
public void Decorate() { super.Decorate(); Graphics g; int cx, cy, cc; try { g = icons[0].getImage().getGraphics(); } catch (NullPointerException e) { System.out.println("Could not get Graphics pointer to " + getClass() + "Image"); retu...
7e872521-31af-48a0-beaa-88131b1ce1e7
7
private void initializeStream() throws IOException { int headerDataSize; if (isPasswordEncrypted) { headerDataSize = AES256v3Ciphertext.HEADER_SIZE + AES256v3Ciphertext.ENCRYPTION_SALT_LENGTH + AES256v3Ciphertext.HMAC_SALT_LENGTH + AES256v3Ciphertext.AES_BLOCK_SIZE; } els...
2440c996-2382-43cc-b929-88e811a227cb
3
public static List<String> getComboData() { List<String> comboData = new ArrayList<>(); try (DataInputStream dis = new DataInputStream(new FileInputStream(FILE_NAME))) { while(dis.available() > 0) { comboData.add(dis.readUTF()); } } catch (FileNotFoundExce...
1ba3191e-a0e0-4cd4-8b34-dcbe4ddf06c2
3
private void nameLengthStatistics() { Iterator i = Person.iterator(); Person p; int l = Person.getMaxNameLength(); int lengthTable[] = new int[l+1]; int j; System.out.println(); System.out.println("Name length: Number of persons"); while (i.hasNext()) { ...
7e85a7d1-b502-4a59-aa33-37ead1ea496c
4
private static void startResourceCIRTTCalculator(String sampleDir, String sampleName, String topicString, int size, int neighborSize, Features features, boolean userSim, boolean bll, boolean novelty, boolean calculateOnTag) { BookmarkReader reader = null; String suffix = "r3l_" + features; if (bll) { suffi...
7edffa5e-8c58-4286-b10e-e0b0f04b991a
2
public DCPackage(int number, byte[] payload) throws InputMismatchException { if(payload.length > PAYLOAD_SIZE) { System.err.println("[DCPackage] Severe: Rejecting input " + String.valueOf(payload) + " since it is too much for a single message."); throw new InputMismatchException("Payload size exceeds bounds: Pa...
84923e7c-94d7-401a-bc7c-27e90f6bc7c3
0
public void setPicturePaths(ArrayList<String> picturePaths) { PicturePaths = picturePaths; }
6ac9e195-b104-4eaf-a803-96a4a02bde01
4
public void disableRow(Row row) { if (row == null) { throw new IllegalArgumentException("cannot disable NULL row"); } if ( !room.equals(row.getRoom())) { throw new IllegalArgumentException("cannot disable row from another room."); } for (Ticket ticket : tickets) { if (ticket.getPl...
f7efcba3-2d31-4939-afe0-a431e5b5a576
5
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((declarations == null) ? 0 : declarations.hashCode()); result = prime * result + ((fparams == null) ? 0 : fparams.hashCode()); result = prime * result + ((ident == null) ? 0 : ident.hashCode()); result = ...
f31cf4e5-fe62-4460-a277-203660ed2fca
8
final void method1218(byte[] is, int i, ByteBuffer class348_sub49) { try { if (i != 29123) method1217(-91, null); anInt2073++; if (((((ByteBuffer) class348_sub49).payload [((ByteBuffer) class348_sub49).position]) ^ 0xffffffff) != -32 || (((ByteBuffer) class348_sub49).payload [1 + ((Byte...
7050549c-cd60-479e-89c2-b3857f7ba9c2
0
public String get(int index) { RangeCheck(index); return data[index]; }
cd4c08b4-1530-400c-aeac-281cc9abbf0d
2
public void close() { if (out != null) try { out.close(); out = null; } catch (IOException e) { e.printStackTrace(); } }
bf7c9eb2-fec0-46ab-9604-6277931b2a77
3
protected void addText(GlyphText sprite) { // look for white space characters and insert whitespace word if (WordText.detectWhiteSpace(sprite)) { // add as a new word, nothing special otherwise WordText newWord = new WordText(); newWord.setWhiteSpace(true); ...
c259f7d4-8911-49f7-b266-1162e0321c31
1
@Override public Message putMessage(Message msg) throws JSONException, BadResponseException { Representation r = new JsonRepresentation(msg.toJSON()); r = serv.putResource("intervention/" + interId + "/message", null, r); Message message = null; try { message = new Message(new JsonRepresentation(r).getJson...
ef46cea7-d59a-4a51-a4e0-aaf18b4e79e7
0
public String getName() { return name; }
4f543628-d82a-496d-88e9-5010924c74e0
2
public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue( Map<K, V> map ) { List<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>( map.entrySet() ); Collections.sort(list, new Comparator<Map.Entry<K, V>>() { public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2) { return (o1....
2b25d874-549f-413c-b55b-42d8d07b66a5
4
public static long syJacobi(long a, long n) { long v=n; long u=a; long s=1; long temp; if(u<0) { u=-u; s=(long) Math.pow(-1,(v-1)/2); } while(u>=2) { if(u%2==0) { u/=2; s*=(long) Math.pow(-1,(v*v-1)/8); } else { s*=(long) Math.pow(-1,(v-1)*(u-1)/4); temp=v%u; v=u; ...
a250d5ad-9f19-4d20-9802-4e1728cdba25
1
public void addInt(final int i) { if (ClassEditor.DEBUG) { System.out.println(" " + codeLength + ": " + "int " + i); } addByte(i >>> 24); addByte(i >>> 16); addByte(i >>> 8); addByte(i); }
663561b1-1e4d-4671-b867-24d2c071b807
7
@Override public void run() { if(!StaffChat.getStaffChat().getConfiguration().shouldCheckForUpdate()) { return; } if (Updater.this.url != null) { // Obtain the results of the project's ...
8ed65472-04eb-4cb6-be75-b6bf11c0df9e
0
public String getName() { return Name; }
c460fdc7-dafb-489d-8153-db74634f7be5
5
public static void renderDemBoxes(){ int q = 0; boolean check = true; while (check){ try { //YO RICHARD worldInfo w = worldInfo.allWalls.get(player.world).get(q);q++; float x1 = w.xCoord; float y1 = w.yCoord; TextureImpl.bindNone(); switch(w.typeID){ case 0: block1.bind(); ...
cb0f41db-3d24-498a-a00b-906324a1efe5
4
public static void Update() { if (elements[1] != null) { elements[1].Update(); } else if (elements[1] == null && msgQueue.size() != 0) { elements[1] = msgQueue.get(0); msgQueue.remove(0); } if (elements[2] != null) { elements[2].Update(); } }
f7e78a45-688b-43af-aee1-09eb57a13932
2
private static ArrayBitmap generateLighting(int radius, int width, int height, Color color) { ArrayBitmap result = new ArrayBitmap(width, height); int centerX = width / 2; int centerY = height / 2; int radiusSq = radius * radius; for (int j = 0, distY = -centerY; j < height; j++, distY++) { for (int i =...
45aac706-9491-47bc-926b-ef4cfd556b83
8
private boolean collision (int [] [] block, int blockX, int blockY) { for (int i = 0; i < block.length; i++) { for (int j = 0; j < block[0].length; j++) { if (block[i][j] != 0) { if (0 > i + blockX || i + blockX >= this.fiel...
5d6d8ed5-e343-46a6-a6b8-4a50534d8eda
7
public void updateInput(Input input, float deltaTime) { if (input.isKeyPressed(Input.KEY_I)) { inventory.show(gameBase.getCurrentState()); } float speed = 128f; targetSpeed = 0; float targetDirectionX = 0; float targetDirectionY = 0; if (input.isKeyDown(Input.KEY_W)) { targetSpeed = speed; if (in...
d45699e1-2f59-4202-aeb6-b3c747b6de69
9
private static void inheritSuperOwners(Class<?> cls, Map<Class<?>, Set<Class<?>>> clsToOwnersMap) { Set<Class<?>> ownerSet = new HashSet<>(); Class<?> curCls = cls; while (curCls != null) { Set<Class<?>> curOwnerSet = clsToOwnersMap.get(curCls); if (curOwnerSet !...