method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
48eea25c-096f-4508-aeb0-07d12e6adf0d
9
private boolean validarDireccion(HttpServletRequest req) { boolean datosvalidos = true; domicilios = new ArrayList<Domicilio>(); ArrayList<Domicilio> domicilios_originales = new ArrayList<Domicilio>(persona.getDomicilio()); if (Validador.Texto(req.getParameter("dir1"))){ Domicilio dom = new Domicilio(); i...
f8781a0c-5cbf-4d56-9696-0165fe4a03da
9
public void reduce() { String currentWord; String lineNumber; String fileName; String oldHashValue; String newHashValue; boolean allDone = false; WordData data; // While there is data left to reduce while (!allDone) { //If there is nothing to grab, don't try if (!Index.buffers[BufferNumber].isE...
dcdfcdd1-2311-43ee-af42-41737040c656
0
public String getService() { return this.service; }
41fb3c9a-ecc1-4320-b854-01a75de83283
4
public void checkType(Symtab st) { exp1.setScope(scope); exp1.checkType(st); exp2.setScope(scope); exp2.checkType(st); if (!exp1.getType(st).equals("int") && !exp1.getType(st).equals("decimal")) { Main.error("type error in geq!"); } if (!exp2.getType(st).equals("int") && !exp2.getType(st).equal...
bf12073c-7603-4e1b-9514-754c52f90ab5
7
static final boolean method3549(int i, byte i_15_) { anInt7351++; int i_16_ = -72 / ((37 - i_15_) / 48); if (i == 25 || i == 20 || i == 44 || i == 46 || (i ^ 0xffffffff) == -61) return true; if ((i ^ 0xffffffff) == -31 || i == 1008) return true; return false; }
5d5cd471-5111-4458-ae22-a7b533cd54bb
4
public String toString() { String strType; switch (type) { case _COUNTER: strType = STR_COUNTER; break; case _ABSOLUTE: strType = STR_ABSOLUTE; break; case _GAUGE: strType = STR_GAUGE; break; case _DERIVE: strType = STR_DERIVE; break; default : // Don't you ...
2f5e6e34-5cd5-451d-89cf-2539d143fe34
0
protected String createFileName(){ return this.dirPath + getRightNowTimeStr("-", "-", "_"); }
39eda6cc-2216-40bc-9dcd-bdf6ce9c1ade
3
private void getChannelList() throws InterruptedException{ if(!main.isConnected()){ System.out.println("Not Connected!"); return;} System.out.println("Please wait, refreshing..."); list.removeAll(); //list.setVisible(false); startChannelsQuery = true; main.doList(); long t = System.currentTimeMillis...
aade8a6b-0b47-484d-87c0-e7dc8cbae264
5
@Override public Object getValueAt(int rowIndex, int columnIndex) { Customer customer = customers.get(rowIndex); switch (COLUMNS.values()[columnIndex]) { case ID: return customer.getId(); case FIRSTNAME: return customer.getFirstname(); ...
31e603f6-fab6-4850-b795-4cae532fc63a
4
private int start(int i) { int first = this.firstNonEmptyBucket(); if(i < first) { return -1; } else if(i == first) { return 0; } int result = 0; for(int j = first; j < i; j++) { if(buckets[j] != null) { result += bucket...
12dbae13-077c-4fcd-93bb-05217819f3ae
8
private Dimension layoutSize(Container target, boolean preferred) { synchronized (target.getTreeLock()) { // Each row must fit with the width allocated to the containter. // When the container width = 0, the preferred width of the container // has not yet been calculated so lets ask for the maximum. int ...
4cdebc21-0c79-4f23-9d69-9d8b91997c99
6
public int stdDevLookback( int optInTimePeriod, double optInNbDev ) { if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) ) optInTimePeriod = 5; else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) return -1; if( optInNbDev == (-4e+37) ) optInNbDev...
ea19eb43-8479-4cbc-a3c6-e4957eb513b2
6
public static ArrayList <MealCategoryData> loadData() { File load = new File("resources/files/MealCategoryData/"); Gson loader = new Gson(); ArrayList <MealCategoryData> res = new ArrayList <MealCategoryData>(); for (File f : load.listFiles()) { BufferedReader br = null; try { br = new BufferedReader(new Fil...
7f37979f-622d-42bd-9e3a-628be64216cc
7
private String getStringLabelFromMethod(Object r) { StringBuffer sb = new StringBuffer(); if(this.textLabelMethods == null) { this.initTextLabelMethods(r); } for(String methodName : this.textLabelMethods) { Method m = null; try { m = r.getClass().getMethod(methodName); sb.appe...
cb5423ae-9eea-40f8-a1d0-0c6b9b68ca53
9
public boolean deleteFourInRowVertical(int i,int j){ if(j < gridRows - 3 && tileGrid[i][j+1] != null && tileGrid[i][j+2] != null && tileGrid[i][j+3] != null && tileGrid[i][j].getTileType().equals(tileGrid[i][j+1].getTileType()) && tileGrid[i][j].getTileType().equ...
4f39124e-4275-44a1-b872-e630b5e0ed6b
8
public void set(String nick, String hpass) { if(nick.length() > 0) { String filename = dir + "\\" + nick + ".txt"; String filehpass = ""; this.nick = nick; this.hpass = hpass; file.makeDir(dir); try { if (!file.issetFile(fil...
99aa56f9-4712-44bf-9907-9f32a2214ff5
6
protected void UpdateLineColumn(char c) { column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else line += (column = 1); ...
f130c775-8da4-411f-b38f-d74d53811040
5
@Override public List<Element> sortHistory(final Collection<HistoryRecord> records, final Document doc) { LOG.fine("Sotring messages by UUID."); // group Nodes by UUID final SortedMap<UUID, List<HistoryRecord>> idGroups = new TreeMap<UUID, List<HistoryRecord>>(); List<Histor...
1db9e0c7-ff2c-4f70-975f-66b20c2fcede
1
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.blue); Dimension size = getSize(); Insets insets = getInsets(); int w = size.width - insets.left - insets.right; int h = size.height - insets.top - insets.bottom; Random r = new Ra...
89444a0f-3f66-4575-afc6-963efb8a5593
2
protected SuffixFileFilter(String filter) { if (filter == null) { System.out.println("Invalid Filter: defaulting to *.*"); filter = ".*"; } if (filter.charAt(0) == '*') { filter = filter.substring(1, filter.length()); } // System.out.println("filter = " + filter); this.filter = fi...
06940865-7b73-4010-8a24-1a6f64fb5e6b
9
public boolean equalMaps(Map<?, ?> map1, Map<?, ?>map2) { if (map1==null || map2==null || map1.size() != map2.size()) { return false; } for (Object key: map1.keySet()) { if (!map1.get(key).equals(map2.get(key))) { return false; } } return true; }
abec0689-26ec-4eab-bcb6-7ca4eab3cc39
0
public void movePegsHorizontally(Peg a, Peg b, Peg c) { a.centerX = centerX - width/2 + Peg.width/2 + horMargin; b.centerX = centerX - width/2 + Peg.width + Peg.width/2 + horMargin*2; c.centerX = centerX - width/2 + Peg.width + Peg.width + Peg.width/2 + horMargin*3; }
1c5d7226-4469-402b-acd6-b3801057482c
3
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...
67d253db-7d3a-48f8-9ad7-65331a30d55a
2
List<List<Double>> getBestOrganismAnswers() throws Exception { List< List<Double>> answers_results = new ArrayList<>(); int counter = 0; for (int i = 0; i < samples.size(); i++) { for (int j = 0; j < samples.get(i).size(); j++) { //count fitness and error for every da...
edb2563a-f904-4088-987d-abef8ed91790
9
public void addSeries(Comparable seriesKey, double[][] data) { if (seriesKey == null) { throw new IllegalArgumentException( "The 'seriesKey' cannot be null."); } if (data == null) { throw new IllegalArgumentException("The 'data' is null."); } ...
cd3faec5-4d54-4e45-a57e-55899c4f0037
5
public static String getNameOfOS() { String os = System.getProperty("os.name").toLowerCase(); if(os.contains("win")) { return "Windows"; } if(os.contains("sunos") || os.contains("solaris")) { return "Solaris"; } if(os.contains("unix")) { return "Linux"; } if(os.contains("mac")) { r...
25838bab-bb7c-4ad5-b091-e1d375a6ec9e
3
public static void unzipFiles(String dir, String outputDir) throws IOException { File directory = new File(dir); File[] files = directory.listFiles(); for (File f : files) { if (f.isFile()) { // getLogger().info("file name : " + f.getAbsolutePath()); unzipFile(f.getAbsolutePath(), outputDir); } e...
459b214e-2e33-4e48-b38e-8e4e05e5e7d0
8
public void moveObject(MouseEvent evt) { boolean bolRefresh = false; if ((moveObj != null) && (evt.getButton() == MouseEvent.BUTTON1)) { int newX = evt.getX(); int newY = evt.getY(); if (moveObj instanceof PlaceUI) { PlaceUI p = (PlaceUI) moveObj; p.setX(newX); p.setY(newY); bolRefresh = t...
6b4b310f-4022-4ad7-8e1b-3378a72b8efd
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AbstractNode other = (AbstractNode) obj; if (this.xPosition != other.xPosition) { return fals...
906b4654-4ba4-43c6-b022-c32fff971371
2
@Override public void xread_activated (Pipe pipe_) { if (!anonymous_pipes.contains(pipe_)) fq.activated (pipe_); else { boolean identity_ok = identify_peer (pipe_); if (identity_ok) { anonymous_pipes.remove(pipe_); fq.attach (p...
ceaf2cb3-87c0-4341-9d1e-063e5e8f4c04
6
public int uniquePaths(int m, int n) { if (m == 0 || n == 0) { return 0; } // 1. initialize int[][] sum = new int[m][n]; for (int i = 0; i < m; i++) { sum[i][0] = 1; } for (int i = 0; i < n; i++) { sum[0][i] = 1; } for (int i = 1; i < m; i++) { for (int j = 1; j < n; j++) { sum[i][j] =...
d5e8bde9-3853-4d2b-b1b2-dfebff4045cd
0
public Date getTimestamp() { return timestamp; }
c3a845c8-fbc0-4017-a551-3f61471f6535
3
public static void main(String[] args) throws Exception{ boolean logged = false; while(!logged) { try { login(); logged = true; System.out.println("Welcome to grading system"); if(loggedInUser.getPersonType().equals("teacher")) ...
55fe4c01-268a-4a78-a168-dd66a9b27d6f
3
public About() { this.setLayout(new BorderLayout()); JTextPane textPane = new JTextPane(); textPane.setContentType("text/html"); textPane.setText("<b>Author:</b><br />Evenprime<br /><br /><b>Contributors:<br /></b> Karach<br />PhracturedBlue<br /><br /><b>Homepage</b><br /><a href=http...
cd0bcca4-437c-4f57-9257-ba8aba9e66a7
0
public int push(int item) { runStack.add(item); return item; }
287b6ea9-a862-4a2d-8e3c-c5b8b49604bb
5
private void checkDiscogs() throws SQLException { DiscogParser dParser = new DiscogParser(); Collection<Record> records = GetRecords.create().getAllRecords(); for (Record rec : records) try { if (rec.getDiscogsNum() > 0) { Record cRecord = dP...
0ca2051e-c8f8-4b33-907f-ef398b5b248f
0
public void setEventName(String eventName) { this.eventName = eventName; }
cae05a96-5f67-4b45-8d16-8660d62c07c6
1
private void vlcDialogBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vlcDialogBtnActionPerformed if (vlcChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { controller.getModel().setVlcLocation(vlcChooser.getSelectedFile()); updateView(); } }//GEN-LAST:event_vlcDialogBtn...
827d32b2-2fa9-494a-9812-af18df1679fb
3
public void addObserver(ImageObserver observer) { if (observer == null) { return; } // update the new observer to the current state Image i = (Image) imageRef.get(); if (rendererFinished()) { // if we're finished, just send a finished notification, don't ...
5e284115-5d7c-41f7-8e6a-2b6a5d957610
9
private void shortLoop(RasterAccessor src, RasterAccessor dst) { int dwidth = dst.getWidth(); int dheight = dst.getHeight(); int dnumBands = dst.getNumBands(); int dstBandOffsets[] = dst.getBandOffsets(); int dstPixelStride = dst.getPixelStride(); int dstScan...
3f8db28a-e7e1-46e5-b862-aa002db7cadc
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...
97aac443-7544-4ac8-92c2-adcc2cc1d6cc
3
private void lisaaTiedote(HttpServletRequest request, HttpServletResponse response, TiedoteService service) throws IOException, ServletException { // Otetaan talteen lomakkeen tiedot String otsikkoTeksti = request.getParameter("otsikko"); String tiedoteTeksti = request.getParameter("tiedote"); Tiedo...
de90e89e-f59d-4be9-81e3-ffb14999fe31
7
int laskeKolot(Muodostelma muod) { int kolot = 0; List<Palikka> palikat = muod.getPalikat(); for (int i = 0; i < palikat.size(); i++) { int x = palikat.get(i).getX(); int y = palikat.get(i).getY(); boolean alin = true; for (int j = i + 1; j < palik...
42c79206-cbe3-4655-953f-49f3d292086f
8
private void defaultConfig(){ if(config[0]==0) config[0]=KeyEvent.VK_LEFT; if(config[1]==0) config[1]=KeyEvent.VK_RIGHT; if(config[2]==0) config[2]=KeyEvent.VK_UP; if(config[3]==0) config[3]=KeyEvent.VK_DOWN; if(config[4]==0) config[4]=KeyEvent.VK_A; if(config[5]==0) config[5]=KeyEvent.VK_...
fec25969-e646-41d6-87b5-c31ae162656b
3
protected Class<?> getMapping(String sqlTypeName) { Map<String, Class<?>> mappings = new HashMap<String, Class<?>>(); mappings.put("point", Point.class); mappings.put("linestring", LineString.class); mappings.put("polygon", Polygon.class); mappings.put("multipoint", Mult...
93cbf917-e961-41c2-ae31-63b4a57aa408
8
public static void htmlExecuteRetrieveQuery(int nvalues, Cons variables, Cons query, Cons options, Module mod, org.powerloom.PrintableStringWriter stream) { { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get(); try { Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true); { QueryI...
d9f92cb9-32af-4dad-a3ae-b8f560a11f5c
9
public static void main(String args[]) throws IOException { int training_size = DataSet.TRAININGSIZE; int testing_size = DataSet.TESTINGSIZE; DataSet training = new DataSet( "data/train.txt", true, training_size); DataSet testing = new DataSet( "data/test.txt", false, testing_size); String sol...
bc1c2ab3-866f-492e-bd5c-db27c6440ddd
9
@Override public void reduce(LongWritable key, Iterator<DoubleArrayWritable> it, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { DoubleWritable[] caster = new DoubleWritable[Coefficient.MAX_RATINGS]; double[] currentUserRatings = new double[Coefficient.MAX_RATINGS]; double[] otherUser...
059471ba-ade0-42ca-a33e-b3e0191f0323
6
@Override public void run() { long delta = 0; while (true) { long start = System.currentTimeMillis(); update((int) delta); BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(3); continue; } render(Graphics.instance(bs.getDrawGraphics())); if (bs != null...
93e7da42-16d1-47f6-8f44-7de4489e62fa
0
@Override public void update() { System.out.println("I am notified"); }
1dde4bdd-f5ed-425a-b0eb-7d334d0ffe84
1
public void connect(Point orig, Point dest) { if(graph.get(orig) == null) { HashSet<Point> adjacent = new HashSet<Point>(); adjacent.add(dest); graph.put(orig, adjacent); } else { graph.get(orig).add(dest); } }
f5fd98f7-194f-4178-9c90-9539f3ef16fe
1
@Override public String toString() { if (number != null) { return number.toString(); } return "[CycNumber: " + number + "]"; }
130f048e-0670-4110-a9b3-91b73568de5a
8
public void start(String iniFileName) { measurementNumber=0; ini = new IniFile(iniFileName); if (stdOut) System.out.println("java.library.path: " + System.getProperty("java.library.path")); /* memcache */ if ( false == ini.hasSubject("MEMCACHE") || ! ini.isTrue("MEMCACHE", "enabled") ) { System.err.pri...
591785f7-76a0-46c7-ae58-a5a9b5d9f542
5
public static void main(String[] args) { int longest = 0; int aFinal = 0; int bFinal = 0; for (int a = -999; a < 1000; a++) { System.out.println("A = " + a); for (int b = -999; b < 1000; b++) { int n = 0; boolean prime = true; while (prime) { BigInteger temp = BigInteger.valueOf(n * n +...
461e133f-1f2e-40c6-81a8-bf3bfe59c84e
9
public void run(){ DatagramPacket Receive=null; byte[] bufR = new byte[1024] ; Receive =new DatagramPacket(bufR,1024); String Vstr; //Vector 一条里的内容,包含用户名、IP地址、端口号,以双空格隔开 State=true; while(State){ try { Receive.setLength(1024); Listener.receive(Receive); String str = new String(Receive.getData...
9b19c137-5f75-41b9-b0d6-dfefb4606871
4
public void collision(PhysicsCollisionEvent event) { //AdministradorDeColisiones.colision(nomEscena, rootNode, bulletApp, event, score); if (event.getNodeA().getName().equals("Bala de captura")) { // Eliminamos la malla de captura de la escena rootNode.detachChild(event.getNodeA(...
75dfb577-e780-4ad6-917b-6dbeda545da7
5
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException { boolean isValueNumeric = false; try { if (value.equals("0") || !value.endsWith("0")) { Double.parseDouble(value); isValueNumeric = true; ...
24ffdf26-43e9-4c3b-bbe1-a4d07c7572d4
0
public boolean isAlive() { return dynamicStats.get(StatType.D_HEALTH).getValue() > 0; }
153d5b11-d048-4cdf-b483-d336e76feb08
7
public ChordRank readFromFile( String fileName ) throws IOException { ChordRank mock = new ChordRank(); mock.metaLocation = fileName; // Read properties file. Properties properties = new Properties(); properties.load(new FileInputStream( fileName )); // Convert from properties to object for ( Itera...
69a9e262-421b-4967-a2ee-a902f21790db
3
private Timer() { timer = new javax.swing.Timer(TIMER_DELAY, new ActionListener() { public void actionPerformed(ActionEvent e) { int time = timeManager.getTime(); timeManager.setTime(time + TIMER_DELAY); if (!warnPlayed && tim...
6042d87c-968b-4715-b427-f775f0c15d7f
5
private void declareWinner(){ System.out.println("All proposals received"); AID best = proposals.get(0).getSender(); for(ACLMessage proposal: proposals){ String time = proposal.getContent().replaceFirst("bid\\(", ""); time = time.replaceFirst(" sec\\)"...
ee18431a-1105-46a3-8a14-761f25b5047b
6
public void open() throws GPException, CardException, IOException { if (sdAID == null) { // Try known SD AIDs // FIXME: use an ordered list instead of unordered entrySet short sw = 0; for (Map.Entry<String, AID> entry : AID.SD_AIDS.entrySet()) { CommandAPDU command = new CommandAPDU(ISO7816.CLA_ISO78...
8d81696b-589c-4a66-aaaf-7fcdc82f9484
3
public Object getValueAt(int row, int col) { if (row > -1 && col > -1 && data != null) { return data[row][col]; } else { return null; } }
eebf77a4-53e5-41c7-93ea-cb559432c882
6
public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.motionY -= (double)this.particleGravity; this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.9800000190734863D; this.motionY...
f47f15a8-ff39-4589-8c23-2d7508bbe934
4
private User findUserByID(String userID) { if (currentGameMembers == null) { System.err.println("ERROR, currentGameMembers IS NULL."); } for (int i = 0; i < currentGameMembers.size(); i++) { if (currentGameMembers.get(i) == null) { System.out.println("ERROR, null current member."); } if (currentGa...
fe529f67-fc6e-43ad-b538-16d78dc0b482
7
public Background(StreamLoader streamLoader, String s, int i) { Stream stream = new Stream(streamLoader.getDataForName(s + ".dat")); Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat")); stream_1.currentOffset = stream.readUnsignedWord(); anInt1456 = stream_1.readUnsignedWord(); anInt1457 =...
2dfbd6cf-957f-4ee0-9d65-b8b17246eda1
7
private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) { if (par1World.isBlockSolidOnSide(par2, par3, par4, 1)) { return true; } else { int var5 = par1World.getBlockId(par2, par3, par4); if (var5 != Block.fence.bloc...
f777340d-7fd6-465e-85cd-636d364437c5
7
public static final void savePropResources() { if(propResources!=null) { synchronized(propResourceSync) { if(propResources!=null) { final StringBuilder str=new StringBuilder(""); for(final String section : propResources.keySet()) { final Map<String,String> secMap=propResources.ge...
cfb94549-838d-4b4d-81e4-4c7e13a2ab1b
5
public Wave37(){ super(); MobBuilder m = super.mobBuilder; for(int i = 0; i < 1600; i++){ if(i % 5 == 0) add(m.buildMob(MobID.PIDGEY)); else if(i % 4 == 0) add(m.buildMob(MobID.PIDGEOTTO)); else if(i % 3 == 0) add(m.buildMob(MobID.RATTATA)); else if(i % 2 == 0) add(m.buildMob(MobID.RATICATE)); ...
d7f028f0-26cf-491a-92eb-4b174a7cef2b
5
public ParameterInfo(Type param, Annotation[] annotations) { this.type = param; for (Annotation annotation : annotations) { if (annotation instanceof Optional) { state = State.OPTIONAL; } else if (annotation instanceof Property) { increment = 0; state = State.CONTEXT_PROPERTY; this.parameter =...
ff5e0a95-e454-4a86-9974-27e87a0f7e28
9
public static void UpdateStateMemory() { if (m_sStateTimer == 0) { m_VectorForAlloc = new int[STATE.MEMORY.MAX_KEY_PRESSED][]; m_VectorForAllocIndex = 0; m_iTotalAllocatedMemory = 0; m_iSystemGCTimer = 0; } if (m_iSystemGCTimer-- > 0) { System.gc(); } if (KeyPressed(KEY.NUMERIC1)) { m_Vect...
ea91d0b4-8f80-47ae-8429-e07c1b7d6323
2
private DataType(Class<?> primitive, Class<?> reference) { this.primitive = primitive; this.reference = reference; }
a93a3bc8-37bd-4194-bf55-f3b79e33f4d6
0
public CipherDataType getCipherData() { return cipherData; }
5bda9b76-1eb8-45c1-be2d-77f6ddf83a56
5
public static HandShake readBlockingHandShake(InputStream in) throws IOException{ boolean inComplete = false; HandShake hs = null; int size=-1;byte[] buffer = null;int off=0; while (!inComplete) { if (size == -1) { size = in.read(); buffer = new byte[48 + size]; off = 0; if(size>=100 && size<...
47d42607-e07f-48d2-b3da-e920a92606e6
5
public boolean init(String user_name){ username=user_name; valid_regex=">No such user.<"; valid_pat=Pattern.compile(valid_regex); urlstr="http://acm.hdu.edu.cn/userstatus.php?user="+username; try{ url=new URL(urlstr); in=url.openStream(); read = new InputStreamReader(in,"UTF-8"); br=new BufferedReade...
20911c2c-9372-4abc-91f8-71dba461ec01
0
public void setFacebookTourDatesUrl(String facebookTourDatesUrl) { this.facebookTourDatesUrl = facebookTourDatesUrl; }
39fa0c7d-5fd1-4d2c-8b6d-6286c86ab445
1
private boolean jj_3_41() { if (jj_3R_60()) return true; return false; }
9499f7dd-52dc-45d9-b79a-8b7b61143e03
8
public static void main (String [] args) { try { if (args.length < 8) { System.err.println("Usage : BoundaryPanelDistributed <dataset> " +"<class col> <xAtt> <yAtt> " +"<base> <# loc/pixel> <kernel bandwidth> " +"<display width> " +"<display height> <classifier " +"[classifier o...
5642a709-dde9-437a-9bee-700e49f393e7
1
public boolean disconnectUser(UserAccount account){ ChatServerThread thread = account.getThread(); if (thread==null) return false; thread.forceDisconnect(); return true; }
8d64e700-dfed-4028-804f-45c6a4a36de8
5
private Object handleConverterNotFound(Object source, Class<?> sourceType, Class<?> targetType) { if (source == null) { assertNotPrimitiveTargetType(sourceType, targetType); return null; } if (targetType.isAssignableFrom(sourceType) && targetType.isInstance(source)) { return source; } throw new Illeg...
0071ce3c-39dd-4a2c-9d28-03997e950491
6
public boolean getBoolean(int index) throws JSONException { Object object = this.get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equal...
bda314c7-66e0-40c3-8afb-e6504c11ceb9
8
private void visitBitOp(Node node, int type, Node child) { int childNumberFlag = node.getIntProp(Node.ISNUMBER_PROP, -1); generateExpression(child, node); // special-case URSH; work with the target arg as a long, so // that we can return a 32-bit unsigned value, and call // ...
1d1d7ef2-815f-4945-9a8e-261090d9edb6
1
protected void fireReceiveMessageEvent(final ReceiveMessageEvent evt) throws Exception { if (receiveMessage != null) { receiveMessage.OnReceiveMessagetEvent(evt); /* new Thread(new Runnable() { @Override public void run() { try { receiveMessage.OnReceiveMessag...
62e51c1f-c2df-4fe8-be10-1d90739b9345
5
public static <GInput> Filter<GInput> conjunctionFilter(final Filter<? super GInput> filter1, final Filter<? super GInput> filter2) throws NullPointerException { if (filter1 == null) throw new NullPointerException("filter1 = null"); if (filter2 == null) throw new NullPointerException("filter2 = null"); return n...
09f23dc9-644b-4509-871f-3877fa98961b
2
public void testFactory_Zone_int() { JulianChronology chrono = JulianChronology.getInstance(TOKYO, 2); assertEquals(TOKYO, chrono.getZone()); assertEquals(2, chrono.getMinimumDaysInFirstWeek()); try { JulianChronology.getInstance(TOKYO, 0); fail(); ...
b4ccc926-85f0-4f94-8a0a-476ce96233a0
9
public void generateWeakTransitionForState(State start, State current, Boolean UsedStrong, Action StrongAction, HashSet<State> alreadyVisited) { if (start == null) { throw new NullPointerException("start == null"); } alreadyVisited.add(current); for (Transition i : this.getOutgoingTransitions(curren...
7ee28888-8a1f-451d-9d32-f676b562d4a9
9
public Iterator<Chunk> nBestChunks(TagLattice<String> lattice, int[] tokenStarts, int[] tokenEnds, int maxResults) { if (maxResults < 0) { String msg = "Require non-negative number of...
7aef4118-ed89-459f-944e-93994fab4615
4
private void finishedMemoryProcessing(long beginTime) { long endTime = System.currentTimeMillis(); long duration = endTime - beginTime; if (duration > 0) cumulativeDurationManagingMemory += duration; if (previousTimestampManagedMemory != 0) { duration = beginTime ...
3095cec8-367a-484f-aa2b-d82396f9af84
1
@Override public Integer get(Object key) { if(!super.containsKey(key)){ return -1; }else{ return super.get(key); } }
840e1b9f-1c91-49a8-bbb7-083f41f91766
7
public int compareTo(InvalidOperation other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; InvalidOperation typedOther = (InvalidOperation)other; lastComparison = Boolean.valueOf(isSetWhat()).compare...
371d1a59-2aed-4ecd-8732-70d039f42220
5
public void setPhaseResult(Main main) { //If nothing has been parsed, handle Error main.setDmResult(null); int i =0; // for (String s : Main.giveMain().getNluResult().get(0)) { // System.out.println("Keyword" + " " + i + ": " + s); // i++; // } if (dialogManager.getErrorState() != Err...
f6b7590a-06d5-4259-8cf6-136b3ccee998
2
private String expandClassName(String className) { if (className.startsWith(".")) return this.packageName + className; else if (className.substring(0, 1).equals(className.substring(0, 1).toUpperCase())) return this.packageName + "." + className; else return className; }
34a01090-f8e4-4fbe-ad95-aafa031390e0
1
public PhpposPeopleEntity getPeopleEntityFromCedula(long cedula){ List<PhpposPeopleEntity> peopleEntities = getHibernateTemplate().find( "from PhpposPeopleEntity where zip = ? ", String.valueOf(cedula) ); if (peopleEntities.size()>0) { return peopleEntities.get(0); } else { return null; } }
7b369899-545e-437d-97f5-5cde700a37c6
0
protected void interrupted() { end(); }
0b53e03c-96c1-4be6-beed-82b3c9696829
2
private void sendClientsMessage() { for (Player player : players.getPlayers()) { if (player.getRole().equals(Role.Mafia.toString())) player.sendMessage(new MafiaRoleAssigned()); else player.sendMessage(new VillagerRoleAssigned()); } }
8605596c-673b-4b28-b9f8-7c8fcdd3df2a
4
public static void main(String[] args) { List<String> mylist = new ArrayList<String>(); mylist.add("Paul McArtnery"); mylist.add("Ringo Star"); mylist.add("John Lennon"); mylist.add("George Harrison"); mylist.add("Ringo Star"); Collection<String> noDupes...
8e8b9708-26b0-43ce-a46a-956c11ad635d
7
private Image createNewImage(AffineTransform transformation) { int width = pModel.getCanvasWidth(); int height = pModel.getCanvasHeight(); Stroke bigStroke, mediumStroke, smallStroke; if (pModel.getZoom() > 1.0) { bigStroke = new BasicStroke((float) (3.0 / pModel....
330d737f-96a7-4f0a-bae0-aa21a9ef1c82
6
public void UpdateDepartamento(Departamento departamento, String CodDepartamentoAntigo) throws SQLException { Connection conexao = null; PreparedStatement comando = null; try { conexao = BancoDadosUtil.getConnection(); comando = conexao.prepareStatement(SQL_UPDATE_DEPAR...
3d9ffe14-3e47-4378-93dd-597b1543c0ba
5
public boolean hasNext() { if(postingListMemoryMapped!=null && entry >=0 && entry < lexiconSize && currentPos >=0 && currentPos < toPos) return true; else{ synchronized(this){ // System.out.print...
f5747dce-624e-4435-93f0-e0d58b0a5680
2
public final synchronized char readchar(){ int ich = -1; char ch = '\u0000'; try{ ich = input.read(); }catch(java.io.IOException e){ System.out.println(e); } if(ich==-1){ ...