method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
8675382b-bfb6-46cb-bfff-05e3611fc092
3
public static void main(String [] args) { //Start time long startTime = System.currentTimeMillis(); for( int c = 334; c < 1000; c++) { for( int a = 1; a < c; a++) { int b = 1000 - c - a; if( isPythagTriple(a,b,c)) { System.out.println(a + " , " + b + " , " + c); System.out.println( a * b * c...
e33684cc-6b4a-47fc-bf63-da7fae9ffe6c
9
public void changerDeVue(String nomVue){ System.out.println("GuiCR::changerDeVue()"); if(nomVue.equals("Liste visiteurs")){ this.vues.show(this.conteneur,nomVue) ; this.vueVisualiserVisiteurs.actualiser() ; } else if(nomVue.equals("Liste praticiens h�sitants")){ this.vues.show(this.conteneur,nomVue) ; ...
8c86b635-3a5f-428c-bdfc-8edc74997611
8
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("UTF-8"); // Setup output stream PrintWriter out = response.getWriter(); // out.println("System is closed."); boolean isAuthorized = false; String requestU...
1ca0da2b-ac20-470e-832a-aba114611fc0
6
public static void main(String[] args) { try { Socket s = null; for(int i = 0; i < Robot.robots.size(); i++) { try { SocketAddress local = new InetSocketAddress(InetAddress.getLocalHost(), CBCGUI.PORT + 1 + i); SocketAddress server ...
d1454f24-0e35-48cc-9cd2-02ed887dd4c8
9
private int GeneraNumero(int[][] matriz, int fila, int columna) { int resp = 0; boolean flag = false; //Genera lista para validar los numeros utilizados en el ciclo ReiniciarSecuencia(); do { boolean validaFila = true; ...
8f310646-a585-4cf5-bcbd-74f68e2d3775
6
@Override protected void onNotify(BTServerStateListener listener, int event, Object o) { if ((SERVER_STARTED & event)>0){ listener.serverStarted(); } if ((SERVER_ACCEPT & event)>0){ listener.serverAccept(); } if ((SERVER_STOPPED & event)>0){ listener.serverStopped(); } if ((SERVER_LIST...
abf1920f-18bd-4b49-893e-41942ed07017
6
public static ACTIONS fromString(String strKey) { if (strKey.equalsIgnoreCase("ACTION_UP")) return ACTION_UP; else if (strKey.equalsIgnoreCase("ACTION_LEFT")) return ACTION_LEFT; else if (strKey.equalsIgnoreCase("ACTION_DOWN")) return ACTION_DOWN; else if (strKey.equalsIg...
7354b1ff-833c-4797-ae67-b3189e95f6eb
2
public void addNotes(String note) { String eol = System.getProperty("line.seperator"); if(this.contactNotes==null || this.contactNotes.equals("")) { this.contactNotes = note; }else{ this.contactNotes = this.contactNotes + eol + note; } }
e8187bbc-015e-4fd9-8b36-8775e6c38e12
5
public Object [][] getDatos(){ Object[][] data = new String[getCantidadElementos()][colum_names.length]; //realizamos la consulta sql y llenamos los datos en "Object" try{ if (colum_names.length>=0){ r_con.Connection(); String c...
16ebe61e-ae8a-4605-ba96-5be8a64ff601
1
public void poistaRivi(int rivi) { if (rivi >= 0) { elokuvalista.poista(rivi); this.fireTableDataChanged(); } }
783fb711-62a4-426a-bb26-41845ab1ab28
6
public static double dynamicallyEstimateInferenceCost(NamedDescription self) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_DYNAMICALLY...
061b4c39-b84c-4932-8e9a-726a5dc7a1b3
6
public static ListNode alterList(ListNode head) { if (head == null || head.next == null) return head; //find the midpoint of the list ListNode p = head, q = head.next; while (q != null && q.next != null) { p = p.next; q = q.next.next; } q = p.next; p.next = null; //reverse the half of ...
92fbb9e3-7d82-4da6-9d1c-e0321c703ed5
7
@Override public void buildModel(Dataset dataset) { estimators = new DecisionTreeC45[estimatorCount]; estimatorWeight = new double[estimatorCount]; for(int i = 0; i < estimatorCount; i++) { estimators[i] = new DecisionTreeC45(); estimators[i].maxHeight = splitCount; estimators[i].needPrune = false; ...
d9bdf8e3-ca3f-4147-91b8-347a087bcc01
5
final void removeImageFetcher(Canvas canvas) { do { try { anInt7674++; if (canvas == aCanvas7626) throw new RuntimeException(); if (!aHashtable7577.containsKey(canvas)) break; Long var_long = (Long) aHashtable7577.get(canvas); anOpenGL7664.releaseSurface(canvas, var_long.longValue()); aHas...
223f32af-11ef-43d8-8250-8c7819f207b9
2
public static ArrayList<QuizTakenRecord> getQuizHistoryByUserID(int userID) { ArrayList<QuizTakenRecord> records = new ArrayList<QuizTakenRecord>(); String statement = new String("SELECT * FROM " + DBTable + " WHERE userid = ?"); PreparedStatement stmt; try { stmt = DBConnection.con.prepareStatement(statemen...
7b329309-5805-4d77-9afd-911d5273c72a
8
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int k = Integer.parseInt(line.trim()); Manacher m ...
3e8f096e-7d51-40cc-bce1-17013bfd3104
4
public static void initializeTranslates() { // Initialize the scaling translates Transform.scalingTranslates = new ArrayList<Double> (); int startTranslate = (int) Math.floor((Math.pow(2,Settings.startLevel)*Settings.getMinimumRange())-Wavelet.getSupport()[1]); int stopTranslate = (int) Math.ceil((Math.pow(2...
43ec6a3b-e83a-4ed2-bebf-26c2212fa80a
3
private void delCchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delCchButtonActionPerformed if(tablaCoches.getSelectedRow() >= 0){ askWind a = new askWind(new javax.swing.JFrame(),true,"Seguro que desea eliminar este vehiculo?"); a.setLocationRelativeTo(null);...
c6b69caa-634f-42e4-a0ad-2ff940fa7a88
0
@Override public Integer getValue() { return this.value; }
1d95e64a-a7a1-44a5-9f27-c285d4e3c478
0
public CFPumpingLemmaChooser() { myList = new ArrayList(); //old languages myList.add(new AnBnCn()); myList.add(new WW()); myList.add(new AnBjAnBj()); myList.add(new NaNbNc()); myList.add(new NagNbeNc()); myList.add(new AiBjCk()); myLi...
634c90ac-fae5-4533-ae32-e864d0961fad
6
private XTreeTry makeTryPosStarted(){ expect(XKeyword.TRY); XTreeScope resources; if(tokenOk(XTokenKind.KEYWORD, XKeyword.LBRAKET)){ startPosition(); tokenizer.next(); List<XTreeStatement> list = new ArrayList<XTreeStatement>(); list.add(makeExpr()); while(tokenOk(XTokenKind.KEYWORD, XKeyword.SEMIC...
0a5a0e98-228b-43bb-b34c-6f5467d26d26
3
public char skipTo(char to) throws JSONException { char c; try { int startIndex = this.index; reader.mark(Integer.MAX_VALUE); do { c = next(); if (c == 0) { reader.reset(); this.index = startIndex...
c932a6a8-5bb0-420c-9ceb-2b02f136ad23
8
private static void StackWithArrayMenu(StackWithArray<Integer> StackWithArray){ System.out.println("What do you want to do ?"); System.out.println("1) pop"); System.out.println("2) top"); System.out.println("3) push"); System.out.println("4) print"); System.out.println("Enter your option"); try{ choose...
ba493c63-0fcb-4f43-beee-02abbd1eff86
9
* @param var2 The second list * @return result The difference of var1 and var2 */ static LinkedList<Integer> subtract(LinkedList<Integer>var1, LinkedList<Integer>var2){ LinkedList<Integer> result = new LinkedList<Integer>(); // If var1 has fewer digits than var2, var1 must be smaller than var2, so return 0 ...
76dbf70e-9ca2-4d60-8e76-1630aa175947
1
public void update() { int current = currentQueue; currentQueue = (currentQueue + 1) % 2; eventQueues.get(currentQueue).clear(); ArrayDeque<IGameEvent> toEmpty = eventQueues.get(current); while(!toEmpty.isEmpty()) { IGameEvent event = toEmpty.pollFir...
2683330d-c710-44e9-80f9-8e03f7087810
2
private static void test_itostrb(TestCase t) { // Print the name of the function to the log pw.printf("\nTesting %s:\n", t.name); // Run each test for this test case int score = 0; for (int i = 0; i < t.tests.length; i += 2) { String exp = (String) t.tests[i]; int arg1 = (Integer) t.tests[i + 1]; S...
98d5eedf-9a52-4dea-9218-7255b7ab7d9a
0
public String getImageFile() { return filename; }
ef02aefb-35ca-4d9a-935b-783fa005ddda
6
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Search_Result other = (Search_Result) obj; if (!Objects.deepEquals(this.imageIds, other.imageIds)) { ...
35457f02-1600-4003-a9a5-dd772c573dce
3
public void loadKompetenser() { PanelHelper.cleanPanel(kompetensHolderPanel); Dimension d = kompetensHolderPanel.getPreferredSize(); d.setSize(400, 10); kompetensHolderPanel.setPreferredSize(d); ArrayList<HashMap<String, String>> a1 = null; try { String query ...
42c53dfc-8cd7-4855-a3e6-b3dc94ba7c60
2
public void transformCode(BytecodeInfo bytecode) { this.bc = bytecode; calcLocalInfo(); if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_LOCALS) != 0) { GlobalOptions.err.println("Before Local Optimization: "); dumpLocals(); } stripLocals(); distributeLocals(); if ((GlobalOptions.debuggingFl...
6f0df848-7004-4d46-a05a-9d3f9a54da2c
3
public int insert(Funcao f) { Connection conn = null; PreparedStatement pstm = null; int retorno = -1; try { conn = ConnectionFactory.getConnection(); pstm = conn.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS); pstm.setString(1, f.getNome(...
0d396a37-78c7-43b6-aeed-529880f903c4
5
@Override public void execute(String command) throws CommandExecutionException { System.out.println("Execution: " + command); Validate.notEmpty(command, "Command line must be not empty."); Process process = null; Throwable throwable = null; try { process = Runt...
58ffbaa7-4edf-4a63-8946-03809ea91ec8
2
@Override public void atacar(){ if(!this.matriz[this.objectivo.x][this.objectivo.y].getOcupado()){ this.objectivo.x=0; this.objectivo.y=0; }else{ ImageIcon iconLogo = new ImageIcon(IMG.getImage(this.mainImg)); this.refLabel.setIcon(iconLogo); ...
b76d74f9-8baa-43ca-8721-36ccbfe33b7c
7
@SuppressWarnings("unchecked") private void Help(StateInfo<T> u){ if(u==null) return; switch(u.state){ case StateInfo.IFlag: if(u.info instanceof IInfo) HelpInsert((IInfo<T>) u.info); break; case StateInfo.MARKED: if(u.info instanceof DInfo) HelpMarked((DInfo<T>)u.info); break; case ...
516625fe-dca0-4f8b-8c5b-4f96825743b2
0
public String getName() { return this.name; }
f2ba328c-67c0-42c4-93d6-38f7b4e51233
2
public int compare(Object o1, Object o2) { int prob_diff=((data)o2).get_probability()-((data)o1).get_probability(); if(prob_diff<0)return -1; if(prob_diff>0)return 1; return 0; }
dbd0efff-cca4-4613-bdf5-de76e3eed716
1
private void skip0(CSVParser csv, int lines) { try { csv.skipLines(lines); } catch (IOException ex) { throw new RuntimeException(ex); } }
a08e5f4b-f48b-4cf3-b098-6dd367189229
9
public void testRefTime() { ReferenceGroupSet ref = new ReferenceGroupSet(); for( int i = 0; i < 100000; i++ ) { switch( mRand.nextInt( 4 ) ) { case 0: { int c = mRand.nextInt( 10 ); int v = mRand.nextInt( 100 ); ref.a...
75f9bacd-9bf2-426a-bb77-4cb8729525ce
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 feel. * For details see http://down...
3c38d616-1c55-42ca-a54c-3f031722b7e1
9
@Test public void testLongWalkManager() throws IOException { int nvertices = 33333; LongWalkManager wmgr = new LongWalkManager(nvertices, 40000); int tot = 0; for(int j=877; j < 3898; j++) { wmgr.addWalkBatch(j, (j % 100) + 10); tot += (j % 100) + 10; ...
2c6e50dd-8d40-41b5-bb8f-2f937eece564
7
@Override public void processCommand(String command, Scanner sc) { switch (command) { case "-help": { getHelp(); break; } case "-expatt": { processExpAtt(sc); break; } case "-expst": { processExpSt(sc); break; } case "-cc": { createCourse(sc); break; } case "-cs": { creat...
efb4d7c3-623e-427c-9488-f7286dd43321
0
@Override public void windowDeactivated(WindowEvent arg0) { // TODO Auto-generated method stub }
63e04b4f-77b5-429a-9732-6a2ab74bcdbf
9
private void initConnection() { try { if (url.toURI().toString().contains("https")) { connection = (HttpsURLConnection) url.openConnection(); } else { connection = (HttpURLConnection) url.openConnection(); } } catch (IOException | URISyntaxException e1) { // TODO Auto-generated catch block e...
442fec6e-da41-428c-ac2f-76f10a933374
6
public void mouseClicked(MouseEvent me) { try { if (me.getSource() == jb_connexion) { login = jtf_login.getText(); password = String.valueOf(jpf_password.getPassword()); System.out.println("Email : "+login); System.out.println("MotDePasse : "+password); User u = null; ...
29de397f-b365-418c-bc6d-8ccf978b25f2
1
public static void main(String[] args) throws Exception { URL yahoo = new URL("http://www.yahoo.com/"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(...
71f4f5d4-0513-46a0-ba6f-8a5a7d38271d
2
private void initBorders() { for(int i = 0; i < height; i++) { grid[0][i] = new Fence(0, i, this); grid[width-1][i] = new Fence(width-1, i, this); } //Offset by 1 because corner for(int i = 1; i < width; i++) { grid[i][0] = new Fence(i, 0, this); grid[i][height-1] = new Fence(i, height-1, this); }...
86219f64-4f1f-4e27-9819-408ec4cf7cac
7
public Piece selectPieceJouable(int tour) { Position pos = null; Piece pieceSelected = null; boolean stop = false; do { pos = this.getCaseCliquee(); if(pos != null) if(this.E.getTableau()[pos.getI()][pos.getJ()] != null) if(((tour%2 != 0) && (this.E.getTableau()[pos.getI()][pos.getJ()].getCou...
f45dcd8f-4da3-450d-8947-cb6fd0679e98
4
public boolean doTransformations() { return ((initBlock == null && type == POSSFOR) || (initInstr == null && type == FOR)) && CreateForInitializer.transform(this, flowBlock.lastModified); }
06d0d6d2-5bc8-4a17-8602-631051d2f48c
1
private void initGUI() { try { { jPanelText = new JPanel(); getContentPane().add(jPanelText, BorderLayout.EAST); jPanelText.setPreferredSize(new java.awt.Dimension(343, 362)); } { jPanelLabel = new JPanel(); getContentPane().add(jPanelLabel, BorderLayout.WEST); jPanelLabel.setPreferre...
49653029-84c0-44b3-a849-7b3845b0ff2d
8
public static MaplePacket updateParty(int forChannel, MapleParty party, PartyOperation op, MaplePartyCharacter target) { MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendPacketOpcode.PARTY_OPERATION); switch (op) { case DISBAND: ...
925b039c-c843-453d-ad21-ca2c71d38a44
4
public <T extends Apple & Comparable<Apple>> Collection<? super T> getNewFilteredCollection( Collection<? extends T> collection, T element) { Collection<Apple> filtereCollection = new ArrayList<>(); for (T t : collection) { if (t.compareTo(element) > 0) { filtereCollection.add(t); } } return filter...
1685cb9e-e171-4e9f-b2bf-5c5ae4138b23
4
public boolean saveFilesToDisk(String path) { for (MultipartFile mpf : files) { try { errorMsg += "\nFile saved to: " + path; File dest = new File(path, mpf.getOriginalFilename()); if (!dest.exists()) { dest.mkdirs(); ...
6a86082d-535f-400c-adff-e7b9f89967e1
2
public static <T> Constructor<T> getConstructorIfAvailable(Class<T> clazz, Class<?>... paramTypes) { Assert.notNull(clazz, "Class must not be null"); try { return clazz.getConstructor(paramTypes); } catch (NoSuchMethodException ex) { return null; } }
b5730e5a-c40e-4934-bf5b-ccb391f9be3f
0
public Integer getIdEntrada() { return idEntrada; }
63e12eba-a4b5-4ee0-b48c-dc48c4afe25e
5
public void setCount(int newHeadCount) { if (newHeadCount >= headCount) return; headCount = newHeadCount; if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_CONSTRS) != 0) { GlobalOptions.err.println("setCount: " + this + "," + newHeadCount); new Throwable().printStackTrace(GlobalOptions.err); } ...
a98fcafc-0c4d-4e9b-bab1-12be3714e049
1
public SplashScreen() { Camera.get().addScreenEffect(new TintEffect(new Vector4f(0f, 0f, 0f, 0f), 1f, true, Tween.IN)); if(loadRandom) { loadRandomSplashes(); } else { loadSplashes(); } }
847f0cd5-1cb7-4956-af2a-b42d969636f9
7
public void handleWaves(int delta) { if (!wavesHaveBegun) { handleWaitForFirstWave(delta); return; } Wave currentWave = waves.get(waveIndex); currentWave.update(delta); if (currentWave.hasNextSpawn()) { spawnEnemy(currentWave.nextSpawn()); } if (currentWave.isFinished() && !isFinalWave()) { ...
63000d68-32d6-4260-a937-8a6a354ec12b
4
public LatLong(double latitude, double longitude) { if (latitude > 90 || latitude < -90) { throw new IllegalArgumentException("Latitude:" + latitude +", is outside of acceptable values (-90<x<90)"); } else if (longitude < -180 || longitude > 180) { throw new IllegalArgumentException("Longitude :" + longitude ...
4e975f71-289c-4566-9d4c-677a8b809735
3
@Override public LogicalArea findArea(Area area) { if (getAreas().contains(area)) return this; //in our area nodes else //in the subtree { for (int i = 0; i < getChildCount(); i++) { final LogicalArea ret = getChildArea(i).findArea(area...
aea22840-2a3b-4c8a-a774-cb0255295a81
5
@Override public Exam get(String examId) { Exam.Builder examBuilder = new Exam.Builder(); try (Connection con = getConnection(); CallableStatement callableStatement = con.prepareCall(querySelectExamById)) { callableStatement.setNString(1, examId); try (ResultSe...
b28f26dc-5657-41d8-a28c-fab579464b12
4
public String checkNumber(int number) { if (number == 1) { return "Ace"; } else if (number == 11) { return "Jack"; } else if (number == 12) { return "Queen"; } else if (number == 13) { return "King"; } return null; }
446b540f-58f9-4089-81f5-13f6c2144f9f
6
@Override public boolean equals(Object o) { if (o == null) return false; if (o == this) return true; if (!(o instanceof Arbeitsplan)) return false; Arbeitsplan a = (Arbeitsplan) o; if(a.getId() != this.getId()) return false...
334ce507-ca22-42a3-97b6-f890c9ff7209
7
private void doSettings(int setting) { switch (setting) { case 0: File SettingsDirectory = new File("Settings/"); if (!SettingsDirectory.exists()) { SettingsDirectory.mkdir(); } break; //-------------------------------------------------------------...
3a1f47d5-b755-4c39-b804-b91cdc769778
7
private void formScreen(String action, Connection database, HttpSession session, HttpServletRequest request, PrintWriter webPageOutput) { int orderNumber=0; String orderName=""; ...
c74c4cef-be98-42d8-bf89-e63698a2d7db
9
private void growRegionSeeds(){ int remainingSpaces = countSpaces(); while (remainingSpaces > 0){ Region r = regions.get((int) (Math.random() * regions.size())); Tile t = r.getTiles().get((int) (Math.random() *r.getTiles().size()) ); Tile nt = null; int x = t.getX(); int y = t.getY(); /* * ...
fe25c7ad-6fcb-4133-8ea1-505a39e7e04e
2
@Override protected Void doInBackground() throws Exception { final int BUFFER_SIZE = 10000; Client client = new Client(BUFFER_SIZE, BUFFER_SIZE); client.getKryo().register(PacketLogin.class); client.getKryo().register(PacketLoginResponse.class); client.getKryo().register(Pac...
c87f420c-c950-42f9-b4d7-3c46aa2c51af
6
@Override public void update(GameState state) { pos.add(vel, state.seconds); if (pos.x < 0 || pos.x > AsteroidsGame.WIDTH || pos.y < 0 || pos.y > AsteroidsGame.HEIGHT) { expire(); } // TODO Coll Detection for (int j = 0; j < AsteroidsGame.enemies.size(); j++) { if (getBoundary().intersects(...
efc452e1-a774-4d5b-9c65-c42c6a07c60b
0
public void setNilai(String nilai) { this.nilai = nilai; }
356a755e-2221-40f7-930d-a49a66696bc6
3
private Music loadMusic(String path) throws SlickException { if (path == null || path.length() == 0) throw new SlickException("Sound resource has invalid path"); Music music = null; try { music = new Music(path); } catch (SlickException e) { throw new SlickException("Could not load sound", e); } ...
01d98501-5b31-4c9e-9e39-68a4b91cea03
0
@Override public long getIdleTimeout() { return idleTimeout; }
51c8ed12-808d-478b-8f89-019c554cc414
4
public static int fieldNum(String name) { int fieldNum = 0; if (name.equals("LOF.GENE")) return fieldNum; fieldNum++; if (name.equals("LOF.GENEID")) return fieldNum; fieldNum++; if (name.equals("LOF.NUMTR")) return fieldNum; fieldNum++; if (name.equals("LOF.PERC")) return fieldNum; fieldNum++; ...
5031cf07-f7b8-40ac-9bd4-5ef1d141b94e
8
public String generateXML() { // Fisierul XML se va genera intr-un folder separat de cel cu executabilele String thisXMLPath = getXMLFolder() + "\\" + getName() + id + ".xml"; // Se ia fiecare parametru si se trece in tag-uri File file = new File(thisXMLPath); try { file.createNewFile(); } catch (IOEx...
ae0e089f-8c55-4f21-8632-ad4ae513f59b
3
@Override public void assignValue(Designator d, BasicBlock cur, BasicBlock join, Environment env, Value newVal) throws Exception { if(global) { used = true; Adda ad = new Adda(getGBP(), getAddr(d)); cur.addInstruction(ad); Store st = new Store(d.getVar...
755ba5e5-40d9-4f2a-becb-a1e8fd1e81a2
3
private void borrarFichero(File dir, int i) { File[] files = dir.listFiles(); if (files != null) { for (File f : files) { if (f.isDirectory()) { borrarFichero(f, i); } else { f.delete(); } } ...
46111268-12ed-4dc6-8891-f9078c270718
1
static void init(){ SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); try { startDay= sdf.parse("1900-01-01 00:00:00.000"); endDay= sdf.parse("2001-12-04 00:00:00.000"); } catch (ParseException e)...
274bb376-2990-42b5-be9f-13bfb91c95a9
6
public static void main(String[] args) { try { List<String> warnings = new ArrayList<String>(); boolean overwrite = true; File configFile = new File(ClassLoader.getSystemResource(runXMLAUTHORITY).getFile()); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConf...
4640b457-c8c9-492d-abe0-30b66b14ca27
2
public static String getPopulation(String date, String state, String gender) { DB db = _mongo.getDB(DATABASE_NAME); DBCollection coll = db.getCollection(COLLECTION_POPULATION); BasicDBObject query = new BasicDBObject(); query.put("year", "" + getYear(date)); DBCursor cur = coll.find(que...
c3bce6bf-7860-43e5-a89c-bc68c77e4cf6
7
@SuppressWarnings("serial") public MvcView(MvcModel model, JFrame Frame) { // add a property change listener to the model to listen and // respond to changes in the model's state model.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { // if the ...
215700ba-495e-4ada-b69c-bf23a4200b82
0
@After public void tearDown() { }
2cafc014-4b82-40a1-b1a5-38a907f896b4
4
private int minBest(int i, int j, int k){ double di = fitness.get(i); double dj = fitness.get(j); double dk = fitness.get(k); if(di <= dj && di <= dk){ return i; }else if(dj <= di && dj <= dk){ return j; }else{ return k; } }
68f797c2-317a-4db0-8e84-ca37ae1f5239
7
public void beginTurn() { if (!autoGame) { autoGame = true; for (int i = 0; i < numPlayers; i++) { if (!players[i].isAI() && players[i].isLiving()) autoGame = false; } } playerPnlHash.get(activePlayer).setActive(true); int troopCount = Math.max(map.getTerritoryCount(activePlayer) / 3, 3)...
a3ee834f-b1c4-466d-b63f-41fb3b793b10
0
public int getSequence() { return this._sequence; }
58225295-707c-4ec3-81b6-74da39a7e49d
5
@Override public boolean processBuffer() { // Stream buffers can only be queued for streaming sources: if( errorCheck( channelType != SoundSystemConfig.TYPE_STREAMING, "Buffers are only processed for streaming sources." ) ) return false; // Ma...
0fb62556-da9a-4a74-9c9c-243abac46eac
9
protected void recoverStatements() { class MethodVisitor extends ASTVisitor { public ASTVisitor typeVisitor; TypeDeclaration enclosingType; // used only for initializer TypeDeclaration[] types = new TypeDeclaration[0]; int typePtr = -1; public boolean visit(ConstructorDeclaration constructorDeclaration, Cl...
67f4dce5-b317-40b0-aac2-cdbf10d6aa4d
1
@Override public void update(long deltaMs) { if(spawned) { checkBossStatus(); } else { spawnBoss(); } }
7faa2990-f361-4552-8968-9382a63f6196
6
public KladrComboBoxModel(String code, Integer type){ Kladr kladr = new Kladr(); LinkedHashMap<String, String> subjects = null; if(code == null){ subjects = kladr.getSubjects(); }else if(type == KladrComboBoxModel.REGION){ subjects = kladr.getRegions(code); ...
f28900e6-941f-4658-a3a9-dd3766891956
6
public int run() { Utils.setConsoleTitle(log.localize("interactive.cmd.title")); log.println("interactive.header", se.getFactory().getEngineName(), se.getFactory().getEngineVersion()); se.put(XScriptLang.ENGINE_ATTR_INTERACTIVE, true); se.put(XScriptLang.ENGINE_ATTR_SOURCE_FILE, ".interactive"); @SuppressWarn...
9cecf695-0577-4dfb-8081-9ff8b80fdabc
6
public static Stella_Object accessSavedInferenceLevelProofAdjunctSlotValue(SavedInferenceLevelProofAdjunct self, Symbol slotname, Stella_Object value, boolean setvalueP) { if (slotname == Logic.SYM_LOGIC_SAVED_INFERENCE_LEVEL) { if (setvalueP) { self.savedInferenceLevel = ((InferenceLevel)(value)); ...
5603ee0c-0df3-4852-86d4-918a4f602621
9
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){ if(cmd.getName().equalsIgnoreCase("settag")){ if (sender instanceof Player){ if (args.length==1){ if(((Player) sender).getItemInHand().getTypeId() == plugin.getConfig().getInt("radioitemid")){ if(args[0].equals(...
ad9bf205-5cd0-488c-812a-6a46b951dc48
3
@Raw public Weapon getNextWeapon() throws IllegalStateException { if (currentWeaponIndex == -1 && weaponList.size() == 0) throw new IllegalStateException("Next Weapon isn't available since the list doesn't contain any weapons."); if (currentWeaponIndex == weaponList.size() - 1) return weaponList.get(0); el...
c8de15b2-46dc-40b7-aa77-81815475d5a0
8
public static boolean fileprocess(String downloadpath, String filepath, String []paras, String sn){ int errorcode=0;// print error code in the final output file; int errornum = 13; String result=""; File downloadfile = new File(downloadpath+"\\humid_test.txt"); File outputfile = new File(filepath); do...
b5fb432f-44da-4d16-ac62-68f01654e2dd
8
private String readIACSETerminatedString(int maxlength) throws IOException { int where = 0; char[] cbuf = new char[maxlength]; char b = ' '; boolean cont = true; do { int i; i = rawread(); switch (i) { ...
0f00538f-4ab9-4926-8877-fe9f48782c75
5
protected static Object getter(Object obj, String type, String attr) { Class<?> c = obj.getClass(); Method method = null; if (type.equals("boolean")) { try { method = c.getMethod("is" + attr); } catch (Exception e) { LOG.error("没有这个方法is" + attr + "或者因为安全问题无法访问", e); } } else { try { meth...
711413bb-30f5-4aa5-8bd2-0509c73c2afd
0
public void setDest(String dest){ this.dest = dest; }
c27ddcf5-2ade-4c06-b285-9c1af6684e58
7
public boolean additionalStrictCheck() { for (GridElement ge : g) { if (ge instanceof Cell) { Cell cell = (Cell) ge; if (cell.getDigit() != -1) { if (cell.countYesEdges() != cell.getDigit()) { iV = cell.getY(); ...
cfd168ea-e05a-4a94-82e1-15226516685b
1
public static double getSumValue(HashMap<String, Double> map) { Double count = 0.0D; List list = new LinkedList(map.entrySet()); for (Iterator it = list.iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); count += map.get(entry.getKey()); } return count; }
01a3d1dd-11ef-46fc-b28d-268c3e65c395
2
public static void main(String[] args) { //Set Used Queues values to False for(int k = 0;k<=5;k++) { usedQueues[k] = false; usedStatusArea[k] = false; usedConnectionThread[k] = false; usedUploadQueues[k] = false; usedUploadStatusArea[k] = false; usedUploadConnectionThread[k] = false; } ...
ee43c018-c121-429d-86e8-f046e5222c63
9
@Override public void map(LongWritable id, Text line, OutputCollector<IntWritable, Text> out, Reporter reporter) throws IOException { // Get Name and Text of document contents = line.toString().split("\\|",2); words = contents[1].split("\\s+"); // Process for document names and contents that are ...
ae462fbc-db31-405a-aa14-f0c1079f1701
5
public static void newStartMenu(Game game, Screen parent, PokeInstance pokemon) { try { pokemonStatusMenuClass.getConstructors()[0].newInstance(game, parent, pokemon); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArg...
cfd837a6-a800-4316-8680-cf4bc2c23d2d
7
public void start() throws Exception { _unavailable=0; super.start(); if (!javax.servlet.Servlet.class .isAssignableFrom(_class)) { Exception ex = new IllegalStateException("Servlet "+_class+ " is no...