text
stringlengths
14
410k
label
int32
0
9
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TabelKeyAccount other = (TabelKeyAccount) obj; if (!Objects.equals(this.kodeKa, other.kodeKa)) { ...
3
static void lengthLimitedCodeLengths(Cookie cookie, int[] frequencies, int maxBits, int[] bitLengths) { cookie.resetPool(); int n = frequencies.length; int nn = 0; Node[] leaves = cookie.leaves1; for (int i = 0; i < n; i++) { if (frequencies[i] != 0) { leaves[nn] = cookie.node(fr...
8
@Id @GeneratedValue public int getId() { return id; }
0
public int getGraphX() { return graphX; }
0
public boolean load(String audiofile) { try { setFilename(audiofile); sample = AudioSystem.getAudioInputStream(getURL(filename)); clip.open(sample); return true; } catch (IOException e) { return false; } catch (UnsupportedAudioFileException e) { return false; } catch (LineUnavailableException...
3
@SuppressWarnings("unchecked") private static final Object[] decodeList(byte[] bencoded_bytes, int offset) throws BencodingException { ArrayList list = new ArrayList(); offset++; Object[] vals; while(bencoded_bytes[offset] != (byte)'e') { vals = decode(bencoded_b...
1
public ArrayList<Integer> encodage(String motACoder) { tailleMot = motACoder.length(); trieTableur(motACoder); ArrayList<Integer> code = new ArrayList<Integer>(); //Ajout de la position du mot de depart //code.add(String.valueOf(positionChaine).charAt(0)); leC...
1
public boolean createLocalRC() { // if a local RC already exists if (localRC_ != null) { System.out.println(super.get_name() + ".setLocalRC(): Warning - " + "a local Replica Catalogue entity already exists."); return false; } // if a ...
4
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // Create Offer try { if (jTextField1.getText().trim().equals(jTextField3.getText().trim())) { JOptionPane.showMessageDialog(this, "Asset and currency type id canno...
5
public static void main(String[] args) { // Load frame from disk byte[] frameBytes = new Frame("data/token.plain").bytes; // Setup analyzers List<AbstractAnalyzer> analyzers = new LinkedList<>(); analyzers.add(new StringAnalyzer()); analyzers.add(new TimestampAnalyzer()); // Run analyzers for (Abs...
6
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected) { if (tabPane.isRequestFocusEnabled() && tabPane.hasFocus() && isSelected && tabIndex >= 0 && textRect.width > 8) { g.setColor(AbstractLookAnd...
5
public final String toString() { final StringBuffer result = new StringBuffer(); boolean comma = false; result.append("\n["); for (Method method : this.getClass().getMethods()) { final String methodName = method.getName(); if ((methodName.startsWith("get") || meth...
8
@Override public void actionPerformed(ActionEvent ae) { if(currX == newX && currY == newY) timer.stop(); // Check for infinite slope if(newX != currX) { slope = (newY - currY) / (newX - currX); // Moving to the left if(newX < currX) { currX--; currY -= slope; } // Moving to t...
6
@Override public void swapRaces(Race newR, Race oldR) { for(final Enumeration<Room> e=CMLib.map().rooms();e.hasMoreElements();) { final Room room=e.nextElement(); for(int i=0;i<room.numInhabitants();i++) { final MOB M=room.fetchInhabitant(i); if(M==null) continue; if(M.baseCharStats().ge...
8
@Override public Iterator<BxTreeEntry> find(final int key, final boolean includeKey) { int size = getSize(); if(size == 0) { return Utils.emptyIterator(); } return new Iterator<BxTreeEntry>() { private LeafNode nextNode = LeafNode.this; private Iterator<BxTreeEntry> currentBaseIter = null; private ...
6
@Override public String getDataAsText(Column column) { switch (column.getID()) { case 0: return getName(); default: return getSecond(); } }
1
public Grafika produkujemyGrafike(){ return new GrafikaDlaLaptopa(); }
0
private boolean receiveDataGridlet(DataGridlet dg) { if (dg == null) { return false; } // get a list of required files LinkedList list = (LinkedList) (dg.getRequiredFiles()).clone(); int serviceLevel = dg.getNetServiceLevel(); // get priority // for each fil...
5
public static String convertLineEndings(String text) { if (line_ending.equals("unix")) { return convertToUnix(text); } else if (line_ending.equals("pc")) { return convertToPC(text); } else if (line_ending.equals("mac")) { return convertToMac(text); } else { return text; } }
3
public static Image convert(Image image) { if (image.isRgb()) return convertToHsv((RgbImage) image); else if (image.isHsv()) return convertToRgb((HsvImage)image); return null; }
2
public void removeEntry(Stella_Object key, Stella_Object value) { { KeyValueList self = this; { KvCons cursor = self.theKvList; KvCons previouscursor = null; if (cursor != null) { if (Stella_Object.eqlP(cursor.key, key) && Stella_Object.eqlP(cursor.value, value)) { ...
6
public Route getRoute() { return this._route; }
0
void doReceive(final File file, final boolean resume) { new Thread() { public void run() { BufferedOutputStream foutput = null; Exception exception = null; try { // Convert the integer address to a proper IP address. ...
3
public DataBase(){ this.driver = "org.apache.derby.jdbc.EmbeddedDriver"; this.url = "jdbc:derby:"+db_name+";create="+create+";user="+user+";password="+pass; try{ Class.forName(driver); this.con = DriverManager.getConnection(this.url); if(...
2
public String recieveMsg(String msg) { if(msg.contains(LOGIN) || msg.contains(REGIS)) { String[] authentication = msg.split(","); if(authentication[0].equalsIgnoreCase(LOGIN)) { if(authentication.length == 3) return authentication(authentication[1], authentication[2]); else return "LOGIN_FAILED"; }el...
5
public String printAST() { StringBuilder ret = new StringBuilder(); if(((Terminal)rhs.get(0)).Name == "IF"){ ret.append("if ("); ret.append(((Expr)rhs.get(2)).printAST()); ret.append(")\r\n"); switch(rhs.size()) { case 5: ret.append(((Stmt)rhs.get(4)).printAST()); break; case 7: re...
3
private void parseNow(int parseDepth) throws XMLException { data = new Hashtable<String,Object>(); types = new Hashtable<String,String>(); Iterator<?> it = elt.getChildren().iterator(); while( it.hasNext() ) { Element key = (Element) it.next(); if( !key.getName().equals("key")) throw new XMLExcepti...
8
public int compare(Sprite s0, Sprite s1) { if (s0.y + s0.x < s1.y + s1.x) return -1; if (s0.y + s0.x > s1.y + s1.x) return 1; if (s0.x < s1.x) return -1; if (s0.x > s1.x) return 1; if (s0.y < s1.y) return -1; if (s0.y > s1.y) return 1; if (s0.z < s1.z) return -1; if (s0.z > s1.z) return 1; re...
8
public boolean hasMoved() { return moved; }
0
public static void main(String[] args) { int totalPage = 7; int currentPageNo =10; int pad = 6; if (currentPageNo > totalPage) { currentPageNo = totalPage; } if (currentPageNo <= 0) { currentPageNo = 1; } System.out.println("上一页: " + (currentPageNo - 1)); if (currentPageNo - pad > 2...
8
public void service(HttpServletRequest hreq,HttpServletResponse hres) { try { if(hreq.isRequestedSessionIdValid()) { con.setAutoCommit(true); String text=hreq.getParameter("ctext"); HttpSession hs=hreq.getSession(false); System.out.println("entered into commadd"); String uname=(String)hs.getAttribute("uname"); String t...
7
public void solveEquation(String equation) { WAEngine engine = new WAEngine(); engine.setAppID(appid); engine.addFormat("plaintext"); WAQuery query = engine.createQuery(); query.setInput(equation); try { // For educational purposes, print out the URL we are about to send: System.out.println("...
9
private ItemDAO(){ try{ session = HibernateUtil.getSessionFactory().openSession(); }catch(ExceptionInInitializerError e){ JOptionPane.showMessageDialog(null, "Sorry can't connect to database", "Error", JOptionPane.ERROR_MESSAGE); logger.error("Cant connect to database"); System.exit(1); } }
1
String getClassForParameter(String object, String field, boolean type) { for (KVP def : comps.entries) { if (object.equals(def.getKey())) { String clname = def.getValue().toString(); clname = getComponentClassName(clname); Class c; try { c = getClassLoader().loadClass(clname); } catch (Cla...
8
static List<Card> getTopCards(List<List<Card>> sets) { Card topA; Card topB; Card top; List<Card> tops; List<Card> setA; List<Card> setB; setA = sets.get(0); setB = sets.get(1); topA = null; topB = null; tops = new ArrayLis...
2
public String toDiagonalString(){ StringBuilder sb = new StringBuilder(); int m = columns; int n = rows; for (int slice = 0; slice < m + n - 1; slice++) { int z1 = slice < n ? 0 : slice - n + 1; int z2 = slice < m ? 0 : slice - m + 1; for (int j = slice - z2; j >= z1; --j) { sb.append(boardArray[j]...
8
private boolean deprecated_acquireOverheadData_WINDOWS(BufferedReader brSocket, PrintWriter pwSocket) { this.dataAcquisitionComplete = false; try { sendCommand_RAW_ToAgent("hostname"); this.myHostName = brSocket.readLine(); sendCommand_RAW_ToAgent("echo %username%"); this.myUserNa...
8
private int readFully(byte[] b, int offs, int len) throws BitstreamException { int nRead = 0; try { while (len > 0) { int bytesread = source.read(b, offs, len); if (bytesread == -1) { while (len-->0) { b[offs++] = 0; } break; //throw newBitstreamException(UNEX...
4
public void merge(AirNowDataSite site){ if (site.getLatitude() != 0 || site.getLongitude() != 0 || site.getElevation() != 0){ setLatitude(site.getLatitude()); setLongitude(site.getLongitude()); setElevation(site.getElevation()); } AirNowDataPoint[][] dataPoints = site.getDataPoints(); for (AirNowDataPo...
7
@Get public String represent() { try { host = (getRequestAttributes().get("host") == null) ? host : ((String) getRequestAttributes().get("host")).trim(); port = (getRequestAttributes().get("port") == null) ? port : Integer.parseInt(((String) getRequestAttributes().get("port")).trim()); ...
9
public AutomatonDrawer getDrawer() { return drawer; }
0
@Override public void printAnswer(Object answer) { if (!(answer instanceof String)) return; System.out.print((String)answer); }
1
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length == 1 && args[0].equalsIgnoreCase("help")) { showHelp(sender); return true; } if (args.length == 1 && args[0].equalsIgnoreCase("list")) ...
6
public static void main(String args[]) { long begin = System.currentTimeMillis(); int total = 475748; int limit = 31716; ExecutorService executorService = Executors.newFixedThreadPool(total / limit); for (int i = 0; i <= total / limit; i++) { String name = "T" + i; executorService.execute(new SetTF(...
2
private void getStartFiles() { try { dataFolder.mkdir(); info("Downloading changelog and readme..."); downloadFile("https://raw.github.com/GetPerms/GetPerms/master/Changelog.txt", changeLog); downloadFile("https://raw.github.com/GetPerms/GetPerms/master/ReadMe.txt", readMe); info("The changelog and rea...
4
public static void Command(CommandSender sender, String[] args) { if(sender.hasPermission("gm.survival.others")) { Player target = Bukkit.getPlayer(args[1]); if(target != null) { if (target.getGameMode() != GameMode.SURVIVAL) { target.setGameMode(GameMode.SURVIVAL); if(sender instanceof ...
7
public void changeChannels(String newChannel) { if (listening.contains(channel.toLowerCase())) listening.remove(channel.toLowerCase()); channel = newChannel.toLowerCase(); listening.add(channel.toLowerCase()); // create it if it doesn't exist ChatChannel chan = ChannelManager.getChannel(channel.toLowerCas...
6
public List<String> inOrderWithInformation(BinaryNode<K,V,W> root) { if(root != null) { inOrderWithInformation(root.left); inOrderWithInformation(root.right); l.add(root.address.toString()); } return (l); }
1
private void classify() throws TooManyDendritesException { final int MINPOINTS = 2; if (this.classiferEnabled) { //prepare the incoming data LinkedList<Double> dendriteValues = new LinkedList<Double>(); for (AbstractNode d : this.getDendrites()) { dendriteValues.add((double) d.getAxon()); } ...
6
public String value() { if (position >= 0 && position < items.length) { return items[position]; } else { return null; } }
2
public static void main(String[] args){ //The actual program progress.setStringPainted(true); //So the progressbar can have text on it progress.setString("Click download to begin"); //Info on the bar list.setEditable(false); list.setLineWrap(true); dir.setEditable(f...
1
@Override public boolean onCommand(CommandSender sender, Command cmd, String lable, String[] args) { if(cmd.getName().equalsIgnoreCase("setJob")){ Player p = (Player) sender; String Job = args[1]; String name = args[0]; if(!plugin.isPlayer(name)){ p.sendMessage(red + name + " is not a pl...
7
@Subscribe public void login(LoginEvent event) throws SQLException { String player = event.getConnection().getName(); if(player==null){ return; } String connection = event.getConnection().getAddress().getAddress().toString(); if(!plugin.getUtilities().playerExists(player)){ plugin.getUtilities()...
4
public static void startupDescribe() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$); Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get()))); if (...
6
public void visitCallStaticExpr(final CallStaticExpr expr) { if (expr.method() != null) { print(expr.method().declaringClass()); } print("."); if (expr.method() != null) { print(expr.method().nameAndType().name()); } print("("); if (expr.params() != null) { for (int i = 0; i < expr.params().len...
5
@Override public String getAnswerText() { return isKeyword ? String.format("\"%s\" is Java key word.", word) : String.format("\"%s\" is NOT Java key word.", word); }
1
public void run() { while(true) { long then = System.currentTimeMillis(); for (int j = 0; j < DDT; j++) { for (int i = 0; i < agents.length; i++) agents[i].control(agents, null); shuffle(agents); for (int i = 0; i < agen...
9
public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); // write the header buf.putShort(getFormat()); buf.putShort((short) getLength()); buf.putShort(getLanguage()); // write the various values buf.putShort((short) (getSegme...
7
@Override public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException { List paramList1 = new ArrayList<>(); List paramList2 = new ArrayList<>(); StringBuilder sb = new StringBuilder(UPDATE_QUERY); String ...
1
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://downl...
6
public void assertObject(Handle factHandle, PropagationContext propagationContext, WorkingMemory wm) { try { Object object = factHandle.getObject(); Class clazz = object.getClass(); Method method = clazz.getMethod("get"+fieldName); Object result = method.invoke(ob...
6
public void setLastName(String lastName) throws Exception{ if (lastName.length() < MIN_INT_VALUE || lastName.toString() == null || lastName.length() > MAX_CHAR){ throw new IllegalArgumentException(NAME_ERR); } this.lastName = lastName; }
3
public AccountManagerHandler(AccountManager target){ try { logger.addHandler(new java.util.logging.FileHandler()); // logger.addHandler(new java.util.logging.ConsoleHandler()); } catch (SecurityException e) { logger.warning(e.toString()); } catch (IOException e...
2
@Test public void testShortCoding() { Debugger.tc(() -> { byte[] buf = null; for (int s = Short.MIN_VALUE; s <= Short.MAX_VALUE; s++) { buf = BytesUtils.encodeShort((short) s); short bs = BytesUtils.decodeShort(buf, new Offset()); if (bs != s) { System.err.println(String.format("Wrong with %d ...
2
public SqlSelector(Connection connetion) { this.connetion = connetion; }
0
public BitSet getAvailablePieces() { BitSet availablePieces = new BitSet(this.pieces.length); synchronized (this.pieces) { for (Piece piece : this.pieces) { if (piece.available()) { availablePieces.set(piece.getIndex()); } } } return availablePieces; }
2
@Override public StatusType getInput(Object object){ StatusType gameStatus = StatusType.PLAYING; do { try{ this.display(); // display the menu // get commaned entered String command = this.getCommand()...
7
public void setState(int newState) { if(state != null) state.dispose(); if(newState == SPLASH) { state = new PlayState(this); } if(newState == TITLE) { state = new TitleState(this); } if(newState == PLAY) { state = new PlayState(this); } }
4
public Object getValueAt(Object o, int i) { Conflict c = (Conflict) o; switch (i) { case 0: return c.getRelativeId(); case 1: return c.getType(); case 2: return c.getActual() == null ? "" : c.getActual().getUserFriendlyValue(); case 3: return c.getReference() == null ? "" : c.getReference().g...
9
private int getIndexToWrite() { //returns the first empty particle array index, and if none exist returns the location of the "oldest" particle instead int oldestParticleAge = 0; int oldestParticleIndex = 0; for (int particleIndex = 0; particleIndex < particleArray.length; particleIndex...
3
static TreeInfo recurseDirs(File startDir, String regex) { TreeInfo result = new TreeInfo(); for (File item : startDir.listFiles()) { if (item.isDirectory()) { result.dirs.add(item); result.addAll(recurseDirs(item, regex)); } else // Regular file if (item.getName().matches(regex)) result.files....
3
public void editLocation() { World<T> world = parentFrame.getWorld(); Location loc = display.getCurrentLocation(); if (loc != null) { T occupant = world.getGrid().get(loc); if (occupant == null) { MenuMaker<T> maker = new MenuMaker<T>(parentFrame, resources, displayMap); ...
2
public void saveRecord(String name){ if( name == null || name.equals("")) name = "未命名存档"; int score = Game.enemy_killed * 100 + Game.propScore ; PreparedStatement pstmt = null ; try{ pstmt = ConnectionUtil.getInstance().prepareStatement("" + "insert into t_record(id, time, stage, score, name) valu...
5
private void RcodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RcodigoActionPerformed vtexto = Ctexto.getText(); DefaultTableModel tr = (DefaultTableModel)tabla.getModel(); try { Statement s = cone.getMiConexion().createStatement(); ...
8
private Object getMultiArray(Class<?> prototype) { int start = _next; int type = nextType(CLASS_MULTI_ARRAY, CLASS_REREF); if (type == CLASS_REREF) { _next = start; Object array = get(null, null); if (array == null || array.getClass().isArray()) { ...
9
@Override protected void paintComponent(Graphics gg) { Graphics3D g = Graphics3D.create(gg); w = (getWidth() - (leftGap + gap * hand.size())) / hand.size(); int h = getHeight() - 2 * gap; int x = leftGap; int y = gap; Font font = new Font("Arial", Font.BOLD, 50); for (Json card : Lists....
9
public static void find2Methods(Object self, String superMethod, String thisMethod, int index, String desc, java.lang.reflect.Method[] methods) { synchronized (methods) { if (methods[index] == null) { methods...
2
public int getIdAmount(String id) { int amount = 0; for(int i=0;i<identity.size();i++) { if(identity.get(i).contains(id)) { amount++; } } return amount; }
2
public MainWindow() { this.eventHandler = new MainEventHandler(); // TODO don't do this, create a real package PackageManager.getInstance().registerCommand( SafeResourceLoader.getString("COMMAND_SHUTDOWN", "com.ikalagaming.omega.core.resources.PackageManager", "shutdown"), Editor.getInstance()); ...
5
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); BigInteger zero = BigInteger.ZERO; while ((line = in.readLine()) != null && line.length() != 0) { String[] data = ...
6
public boolean canHaveAsLightGrenade(LightGrenade lg) { for (Element e : elements) { if (e.getPositions().contains(lg.getPosition())) return false; } return true; }
2
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { //get incoming text String inText = aJCas.getDocumentText(); //split lines String[] lines = inText.split("\n"); Token token; int indexCount=0; int dummy=0; int q_a=0; int countLine=1; Sy...
8
/* */ @EventHandler /* */ public void onPlayerInteract(PlayerInteractEvent event) /* */ { /* 185 */ if (Main.getAPI().isSpectating(event.getPlayer())) /* */ { /* 187 */ if (Main.getAPI().isReadyForNextScroll(event.getPlayer())) /* */ { /* 189 */ if (Main.getAPI().ge...
9
private String getCommaStringFromArrayList(ArrayList<String> a) { if (a.size() == 0) { return ""; } else { String s = ""; for (int i=0;i<a.size();i++) { if (i != a.size()-1) s = s + a.get(i) + ","; ...
3
@Test public void test_get_file_missing() { Assert.assertNull(getFile("bogus_key!")); }
0
@EventHandler public void onInteract(PlayerInteractEntityEvent event) { Player player = event.getPlayer(); String worldName = player.getLocation().getWorld().getName(); // We do not have to check on this world. if (plugin.getAPI().isDisabledWorld(worldName)) return; // Ignore creative? if (plugin....
9
static boolean isElevatedTile(int x, int y) { anInt1332++; if (x < 0 || (y ^ 0xffffffff) > -1 || x >= Class348_Sub33.settingFlags[1].length || (Class348_Sub33.settingFlags[1][x].length ^ 0xffffffff) >= (y ^ 0xffffffff)) return false; if ((Class348_Sub33.settingFlags[1][x][y] & 0x2) != 0) return true; retu...
5
public void spaceHorizontal(FastVector nodes) { // update undo stack if (m_bNeedsUndoAction) { addUndoAction(new spaceHorizontalAction(nodes)); } int nMinX = -1; int nMaxX = -1; for (int iNode = 0; iNode < nodes.size(); iNode++) { int nX = getPositionX((Integer) nodes.elementAt(iNode)); if (nX < nM...
7
public FrameProcessCalculate(){ initialize(); }
0
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException { input = container.getInput(); GameState state = game.getCurrentState(); if (!(state instanceof World)) return; prevVelocity.set(velocity); invMass = 1F / size; ...
6
private void resolveSummonProperties(SummonableService instance_, Class<?> clazz_) { //System.out.println("Summon.resolveSummonProperties(): " + clazz_.getName()); Field[] fields = clazz_.getDeclaredFields(); // Property fields for (Field field : fields) { // allow to change private fie...
8
int alignmentConstant (String align) { if (align.equals("LEFT")) return SWT.LEFT; if (align.equals("RIGHT")) return SWT.RIGHT; if (align.equals("TOP")) return SWT.TOP; if (align.equals("BOTTOM")) return SWT.BOTTOM; if (align.equals("CENTER")) return SWT.CENTER; return SWT.DEFAULT; }
5
@Override public void pause(int objectId) { AudioChannel channel = channels.get(objectId); if (channel != null) { alSourcePause(channel.source); } }
1
public void setTarget(String value) { this.target = value; }
0
public Rectangle2D.Float getBounds() { // lazy load the bounds as the calculation is very expensive if (bounds == null) { // word bounds build from child word bounds. for (WordText word : words) { if (bounds == null) { bounds = new Rectangle2D....
4
private void itmMnuProjetoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itmMnuProjetoActionPerformed // Menu - Cadastro > ItemMenu - PROJETO DepartamentoBO depBO = new DepartamentoBO(); Departamento DEPexistente = null; try { DEPexistente = depBO.SelectDeparta...
3
private synchronized void changeBid(int auction, Bid bid, Bid newBid) { Bid activeBid = getBid(auction); if (activeBid != null) { if (activeBid.same(bid)) { bids[auction] = newBid; } else { Bid child; while ((child = activeBid.getReplacing()) != null && !child.same(bid)) { activeBid = chi...
6
public static void recDFS(Vertice v) { for (Aresta a : v.getArestas()) { // checa se a aresta do v entrada ja foi visitada if (!a.checkVisitado()) { // tmp == vertice de destino Vertice tmp = a.getDestino(); if (!tmp.checkVisitado()) { a.visitar(); tmp.visitar(); if (go) { Syst...
5
private void getData(){ try { cbSubject.removeAllItems(); cbObject.removeAllItems(); cbVerb.removeAllItems(); cbLocation.removeAllItems(); cbLocationObject.removeAllItems(); ConnectDatabase cdb = new ConnectDatabase(); ResultSet result = cdb.st.executeQ...
9
public double averageBytes() { int runs = runs(); double[] sizes = new double[runs]; int retries = runs / 2; final Runtime runtime = Runtime.getRuntime(); for (int i = 0; i < runs; i++) { Thread.yield(); long used1 = memoryUsed(runtime); int number = create(); long used2 = memoryUsed(runtime); ...
4