text
stringlengths
14
410k
label
int32
0
9
@SuppressWarnings("unchecked") public static LinkedHashMap<String,Object> gvHashSO(LinkedHashMap<String,Object> array, String key) { if (array == null) return new LinkedHashMap<String,Object>(); Object retObj = gv(array,key); LinkedHashMap<String,Object> hm = new LinkedHashMap<String,Object>(); if (retObj inst...
4
public int peak(int [] arrA,int low, int high, int size){ int mid = (low+high)/2; if((mid==0||arrA[mid]>=arrA[mid-1]) && (arrA[mid]>=arrA[mid+1]||mid==size-1)){ return mid; } else if(mid>0 && arrA[mid]<arrA[mid-1]) return peak(arrA,low,mid-1,size); else return peak(arrA,mid+1,high,size); }
6
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); try { if(request.getParameter("page").equalsIgnoreCase("createquestion")){ String questionid=CommonResource.getNextId("question"); String question=request.getP...
5
public static String encode(double latitude, double longitude){ double[] lat_interval = {-90.0 , 90.0}; double[] lon_interval = {-180.0, 180.0}; StringBuilder geohash = new StringBuilder(); boolean is_even = true; int bit = 0, ch = 0; while(geohash.length() < precision){ double mid = 0.0; if(i...
6
public Mes(int i, boolean bis) { if (i == 3 || i == 5 || i == 8 || i == 10) { n = 30; } else if (i == 1) { if (bis == false) { n = 28; } else { n = 29; } } else { n = 31; } dia = new Dias[...
7
private void validate() throws ScheduleException { // For each team... for ( NFLTeam team : NFLTeam.values() ) { // ...make sure it has its schedule loaded. NFLMatchup[] schedule = matchups.get(team); if ( null == schedule ) { s...
7
@Override protected void logBindInfo(Method method) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("绑定" + getDescription() + "到方法[" + method + "]成功"); } }
1
protected boolean storeRegistrationID(Sim_event ev, List list) { boolean result = false; if (ev == null || list == null) { return result; } Object obj = ev.get_data(); if (obj instanceof Integer) { Integer id = (Integer) obj; list....
5
public void deleteUser(String userEmail) { initConnection(); PreparedStatement sqlStatement = null; try { //Prepare Statement sqlStatement = (PreparedStatement) connection.prepareStatement("DELETE FROM users WHERE email= ?;"); sqlStatement.setString(1, userEmail); //Execute Prepared Statem...
2
private Map<Integer, List<Integer>> createDAG(String sentence) { Map<Integer, List<Integer>> dag = new HashMap<Integer, List<Integer>>(); TrieNode trie = wordDict.getTrie(); int N = sentence.length(); int i = 0, j = 0; TrieNode p = trie; while (i < N) { char c...
7
public Object tooltip(Coord c,boolean again){ if(tip != null) return(tip); if(tips != null && !tips.equals("")){ tip = RichText.render(tips,200); } return(tip); }
3
public String getMsgID() { return msgID; }
0
private void installLookAndFeel() { if (fLFName != null) { UIManager.LookAndFeelInfo[] lfInfos = UIManager.getInstalledLookAndFeels(); if (lfInfos != null) { for (int i = 0; i < lfInfos.length; i++) { if (lfInfos[i].getName().equals(fLFNam...
8
public static void main(String[] args) throws IOException { System.out.println(new Date()); Features feat = new Features(50,50); feat.integralImages(feat.FACES, feat.numbFaces, feat.integralFaces); for(int i = 0; i < 2; i++){ for (int j = 0; j < 4; j+=2) { System.out.println(i + " " + j + " " + feat.getS...
2
public void clickChooseCharacters(Scanner kb, ArrayList<MainMenuHeroSlot> heroies) { //Print out prompt System.out.println("Please input what type of heroes you would like to use one by one"); for(int i = 0; i < Constants.heroNames.length; i++) System.out.println(" - " + Constants.heroNames[i]); //Pick...
4
private UserBean createUserBean(ResultSet result){ try { //gebe null zurück, falls kein User vorhanden ist if (result == null || result.getFetchSize() < 0){ return null; }else{ UserBean user = new UserBean(); user.setId...
3
public void run() { //Guarda el tiempo actual del sistema tiempoActual = System.currentTimeMillis(); //Ciclo principal del Applet. Actualiza y despliega en pantalla la animación hasta que el Applet sea cerrado while (true) { if (!pausa && !instrucciones) { a...
4
private void decodeGroup(String serviceName, OMMFilterEntry serviceFilterEntry) { byte[] group = null; byte[] mergedToGroup = null; OMMState groupStatus = null; // Get Group, MergedToGroup and Status from the payload OMMData serviceFilterEntryData = serviceFilterEntry.getDa...
8
@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 CountrylanguagePK)) { return false; } CountrylanguagePK other = (CountrylanguagePK) object; if ((this.countryCo...
9
public static void main(String[] args) { Ex3 e = new Ex3(); D1.main(args); }
0
public HiloBean loadId(HiloBean oCliente) throws NumberFormatException { try { if (request.getParameter("id") != null) { oCliente.setId(Integer.parseInt(request.getParameter("id"))); } else { oCliente.setId(0); } } catch (NumberFormatEx...
2
public List<Ban> searchBans(String search, boolean reverse) { List<Ban> result = new ArrayList<Ban>(); if (search == null || search.isEmpty()) { result.addAll(bans.values()); } else { // compile regex to search... Pattern searchPattern = Pattern.compile(sear...
4
public static void insertTva(String tva, float taux) throws SQLException { String query = ""; try { query = "INSERT INTO TVA (TVALIBELLE,TVATX) VALUES (?,?) "; PreparedStatement pStatement = ConnectionBDD.getInstance().getPreparedStatement(query); pStatement.setStrin...
1
BitSet[] computeRows() { HashMap<Short,BitSet> sets = new HashMap<Short,BitSet>(); for (int i=all.nextSetBit(0);i>=0;i=all.nextSetBit(i+1)) { sets.put( (short)i, (BitSet)all.clone() ); } for ( int i=0;i<sections.size();i++ ) { Section s = sect...
7
@Override public void mouseDragged(MouseEvent e) { if (e.isConsumed() || (selectedTask == null)) { return; } Graphics2D g2 = (Graphics2D)chart.getGraphics(); g2.setXORMode(Color.WHITE); g2.draw(new Line2D.Double(selectedPoint, lastPoint)); lastPoint = e.getPoint(); Object hoverTask = chart.getTaskAt...
7
public void releaseVM(SlaveVM vm) { System.out.println("DEBUG: VM " + vm.getId() + " is available again"); vm.setState(VMState.WAITING); this.vmsInUse.remove(vm); this.vmsAvailable.add(vm); final int id = vm.getId(); Thread timeout = new Thread() { public void run() { try { Thread.sleep(Resour...
2
public void actionPerformed(ActionEvent paramActionEvent) { try { if (paramActionEvent.getActionCommand().compareTo("title") == 0) { if (this.minimized) { setMinimized(false); return; } setMinimized(true); return; } if (pa...
9
public GUIController(WorldFrame<T> parent, GridPanel disp, DisplayMap displayMap, ResourceBundle res) { resources = res; display = disp; parentFrame = parent; this.displayMap = displayMap; makeControls(); occupantClasses = new TreeSet<Class>(new Comparato...
6
public static void main(String args[]){ int a = 0; while(a == 0){ int d = Integer.parseInt(JOptionPane.showInputDialog("Choose your decision:\n1 - Add a Girl\n2- Save to DB\n3- Load from DB\n4- List Items\n5- Exit")); if(d == 1){ String name = JOptionPane.showInputDialog("Input Name:"); String img = "...
8
static void runFlowAnalyzes(OptFunctionNode fn, Node[] statementNodes) { int paramCount = fn.fnode.getParamCount(); int varCount = fn.fnode.getParamAndVarCount(); int[] varTypes = new int[varCount]; // If the variable is a parameter, it could have any type. for (int i = 0; i ...
8
public static void main(String[] args) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // this is simple... we parse out the [xx] bit first then compare to // the last line. String line = reader.readLine(); List<Double> list = new ArrayList<Double>(); while (l...
7
private void loadFromFile(File f) throws ImageProcessingException, IOException { filename = f.getName(); filepath = f.getParent(); filesize = f.length(); filedate = f.lastModified(); Metadata metadata = ImageMetadataReader.readMetadata(f); Directory directory = metadata.getDirectory(ExifSubIFDDirector...
2
public synchronized void stop(HTSMsg msg, int clientId){ Subscription s = getSubscription((Long) msg.get("subscriptionId"), clientId); HTSPServerConnection c = monitor.getServerConnection(s.serverConnectionId); msg.put("subscriptionId", s.serverSubscriptionId); try { c.send(msg); } catch (IOException e) { ...
2
public static void main(String[] args) { System.out.println("Begin: RankSumNoReplacementSimulate"); int numberOfSamples = 100000; for( int n = 2; true; n++ ) { // Generate random rank sums RankSumNoReplacementSimulate rss = new RankSumNoReplacementSimulate(numberOfSamples, n); // Show mean / variance f...
4
public boolean isBombed(int x, int y) { return (sea[x][y] == HIT || sea[x][y] == MISS); }
1
public void saveTileSet() { if (canvas.getMap().getTileSet().getPath() == null) { int returnVal = chooser.showSaveDialog(canvas); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); File imagesDir = new File(file.getPare...
4
public static void main(String[] args) { ServerSocket server_sock = null; Socket client_sock = null; // Initialize the server socket MsgDumperCmnDef.WriteDebugSyslog(__FUNC__(), __LINE__(), "Initialize the server socket in MsgDumper daemon..."); try { server_sock = new ServerSocket(MsgDumperCmnDef.SERVE...
5
@Override public boolean join(String n) { boolean accepted = false; try { m_connectionSocket = new Socket(K.ADDRESS_TCP, K.TCP_SERVER_PORT); ObjectOutputStream os = new ObjectOutputStream( m_connectionSocket.getOutputStream()); // Sending join message to the server ... Join join = new Join(n); ...
4
public static void driveStraightGyro(double power) { double leftMod = 1.0; double rightMod = 1.0; if (!newGyroReadingDriveStraight) { initGyro = gyro.getAngle(); newGyroReadingDriveStraight = true; } if (power < 0) { if ((gyro.get...
7
public CycLeaseManager(final CycAccess cycAccess) { //// Preconditions if (cycAccess == null) { throw new InvalidParameterException("cycAccess must not be null"); } logger = Logger.getLogger("org.opencyc.api.CycLeaseManager"); this.cycAccess = cycAccess; }
1
@Override public void close() throws IOException { if(os != null){ try{ os.flush(); os.close(); os = null; } catch (IOException e ){ e.printStackTrace(); } } if(fs != null){ try{ fs.close(); fs = null; } catch (IOException e ){ e.printStackTrace();...
8
public void setProducto(Producto producto) { this.producto = producto; }
0
public DoubleVectorIndividual createIndividual( final EvolutionState state, int subpop, int index, int thread ) { Individual[] inds = state.population.subpops[subpop].individuals; DoubleVectorIndividual v = (DoubleVectorIndividual)(inds[index].clone()); do ...
9
protected PropertySearchResults(PropertyTree firstNode) { results=new ArrayList<Result>(1); // size 1; guessing there will not be any conflicting values results.add(new Result(firstNode)); sorted=true; totalNodes=1; }
0
public void visit_lxor(final Instruction inst) { stackHeight -= 4; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 2; }
1
public SimpleProperty(Class clazz, String name) { this.name = name; Class[] readParams = {}; readMethod = Reflection.getMethod(clazz, "get" + name, readParams); if (readMethod == null) { readMethod = Reflection.getMethod(clazz, "is" + name, readParams); } if...
9
public int getNumberOfFreeCells(){ int sum=0; for(int i=0;i<getX();i++){ for(int u=0;u<getY();u++){ if(this.cells[i][u]==0){ sum++; } } } return sum; }
3
public ConstructorWrapper findByArgumentTypes(Class<?>... types) { for (ConstructorWrapper wrapper : this.constructorWrappers) { List<ParameterWrapper> parameters = wrapper.parameters(); if (parameters.size() == types.length) { boolean valid = true; for (int i = 0, max = parameters.size(); i < max && va...
7
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder out = new StringBuilder(); int testCases = Integer.parseInt(in.readLine().trim()); for (int t = 0; t < testCases; t++) { int[] nm = readInts(in.readLine()); i...
8
private void mrXMoveLog() { URL busIcon = this.getClass().getResource("Bus.png"); URL taxiIcon = this.getClass().getResource("Taxi.png"); URL tubeIcon = this.getClass().getResource("Underground.png"); URL doubleIcon = this.getClass().getResource("DoubleMove.png"); URL secretIcon = this.getClass().getResource...
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Product product = (Product) o; return number == product.number && !(name != null ? !name.equals(product.name) : product.name != null); }
5
private void setWidth() { float missingWidth = 0; float ascent = 0.0f; float descent = 0.0f; if (fontDescriptor != null) { if (fontDescriptor.getMissingWidth() > 0) { missingWidth = fontDescriptor.getMissingWidth() / 1000f; ascent = fontDescrip...
7
public void checkParserState( XmlPullParser xpp, int depth, int type, String name, String text, boolean isEmpty, int attribCount ) throws XmlPullParserException, IOException { assertTrue("line number must be -1 or >= 1 not "+xpp.getLineNumber(), ...
9
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
6
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) { final UText shape = (UText) ushape; final FontConfiguration fontConfiguration = shape.getFontConfiguration(); final UFont font = fontConfiguration.getFont(); final Dimension2D dimBack = calculateDimension(St...
9
static private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { jj_gen++; if (++jj_gc > 100) { jj_gc = 0;...
6
@Test public void testDatabasePool() throws Exception { //test normal operation DataConnectionPool dcp = new DataConnectionPool(1, driver, database, login, password); dcp.getConnectionWrapper().commitAndDiscard(); dcp.getConnectionWrapper().rollbackAndDiscard(); //get several connection wrappers Connecti...
2
public void transform(int form){ // TODO change form based upon input from user if(currentForm!=4){ timeSinceTransform = 0; if(form == 0){ if (fireFormEnabled){ currentForm = 0; fireOrbs = 0; currentFormDuration = fireFormDuration; fireFormEnabled = false; } } else if (form == 1){ if (lightning...
7
@Override public String toString() { if (type == NUM) { return "NUM: " + value; } else if (type == CMD) { return "CMD: " + name; } else if (type == UNK) { return "UNK"; } else if (type == EOF) { retur...
9
@Override public void keyTyped(KeyEvent e) { if (consoleInputField != null) { /* User can enter backspaces. */ if (e.getKeyChar() == (char) 8 && consoleInputField.getCmd().length() > 0) { String nev = consoleInputField.getCmd(); ...
7
public static <T> T[] concat(T[] first, T[] second) { T[] result = Arrays.copyOf(first, first.length + second.length); System.arraycopy(second, 0, result, first.length, second.length); return result; }
0
private void checkForRemovedMarkers() { markersToRemove.clear(); for (Node node : pane.getChildren()) { if (node instanceof Marker) { if (getSkinnable().getMarkers().keySet().contains(node)) continue; node.setManaged(false); node.removeEventHan...
4
private boolean r_prelude() { int among_var; int v_1; // repeat, line 36 replab0: while(true) { v_1 = cursor; lab1: do { // (, line 36 ...
8
public int search(String docs) { int N = docs.length(); long docsHash = hash(docs, M); if (docsHash == patternHash) return 0; for (int i = M; i < N; i++) { // remove leading digit docsHash = (docsHash + Q - RM * docs.charAt(i-M) % Q) % Q; // add trailing digit docsHash = (docsHash * R + docs.ch...
3
public static void mergeSort(int x[], int y[]) { int z[] = new int[x.length + y.length]; System.out.print("First Array :\t"); for (int i = 0; i < x.length; i++) { System.out.print(x[i] + " "); z[i] = x[i]; } System.out.print("\nSecond Array :\t"); for (int i = x.length, j = 0; i < z.length; i++, j++) ...
2
int opcode(int op) { if (op == IFNULL) return IFNONNULL; else if (op == IFNONNULL) return IFNULL; else { if (((op - IFEQ) & 1) == 0) return op + 1; else return op - 1; ...
3
public static void main(String[] args) { EdgeWeightedDigraph G = new EdgeWeightedDigraph(new In(args[0])); int s = Integer.parseInt(args[1]); AcyclicSP sp = new AcyclicSP(G, s); for (int t = 0; t < G.V(); t++) { System.out.print(s + " to " + t + " (" + String.format("%.2f", sp.distTo(t)) + ") : "); ...
3
public void MoonCheck() { CopyOnWriteArrayList<GameObject> objects = state.getMyObjects(); for (int j = 0; j < objects.size(); j++) { for (int i = 0; i < objects.size(); i++) { CollisionResults results = new CollisionResults(); Vector3f opos = objects.get(j).getPosition(); Vector3f odir = objects.g...
6
public void write(int address, int data) { if (this.cache.contains(address)) { this.cache.write(address, data); return; } else { for (int i = 0; i < this.history.length; i++) { if (this.history[i] == address) { // conflict miss int mode = Integer.valueOf(this.cache.getMode(), 2); if (mod...
7
public static void main(String[] args) { String name = JOptionPane.showInputDialog("Please enter your name"); if (name == null) return; String address = JOptionPane .showInputDialog("Please enter the server address"); if (address == null) return; int port = Integer.parseInt(JOptionPane .showInpu...
4
public void renderEffects(){ for (ArrayList<GameObject> effect: effects) { for (GameObject gameObject : effect) { gameObject.render(); } } }
2
public static void main(String[] args) { /** Hand hand1 = new Rock() ; Hand hand2 = new Paper() ; Hand hand3 = new Scissors() ; System.out.println(hand1 + " beats " + hand1 + "? " + hand1.beats(hand1)) ; System.out.println(hand1 + " beats " + hand2 + "? " + hand1.beats(hand2)) ; Sys...
5
public static boolean isCglibProxy(Object object) { return SpringClassUtils.isCglibProxyClass(object.getClass()); }
0
@Override public void setPlayerToTradeWith(int playerIndex) { receiverIndex = playerIndex; if(receiverIndex > -1 && checkForValidTradeValues()) { getTradeOverlay().setTradeEnabled(true); getTradeOverlay().setStateMessage("Trade!"); } else { getTradeOverlay().setTradeEnabled(false); getTradeOverlay(...
2
public void watch( Source source ) { // make sure the source exists: if( source == null ) return; // make sure we aren't already watching this source: if( streamingSources.contains( source ) ) return; ListIterator<Source> iter; ...
5
private void setSettings() { this.setBorder(new Border() { @Override public Insets getBorderInsets(Component c) { return new Insets(5, 7, 5, 7); } @Override public boolean isBorderOpaque() { return false; } @Override public void paintBorder(Component c, Graphics g, int x, int y...
9
public void printTree(treeNode rootNode, int orderIndex) { if (rootNode != null) { // System.out.println("Printing tree with root:" + rootNode.value); switch (orderIndex) { case 1: { // In-order printTree(rootNode.leftLeaf, orderIndex); System.out.print(' '); System.out.print(rootNode.value); ...
4
private String readLine() throws IOException { byte[] readBytes = new byte[512]; int readIndex = 0; while (true) { int nextByte = remoteInputStream.read(); if (nextByte == -1) { if (readIndex == 0) { return null; } break; } if (nextByte == 10) { if (!ignoreNextLinefeed) { bre...
7
public static boolean otherCharactersFound(String s, char[] c){ boolean found = false; for (int i=0; i<s.length(); i++) { found = false; for (int j=0; j<c.length; j++) if (s.charAt(i)== c[j]) found = true; if (!found) return true; } return false; }
4
public static WordSearch loadFromFile(File file) { WordSearch wordSearch = new WordSearch(); BufferedReader reader; List<Character> chars = new ArrayList<>(); try { reader = new BufferedReader(new FileReader(file)); int character; while ((character = reader.read()) != ':') { char c = (char)...
5
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed // TODO add your handling code here: if (v1.size() == 0) { JOptionPane.showMessageDialog(null, "You must enter Author Name to \n save book details"); } else if ((jTextField2.getText().equals(""...
5
public int getPriority() { switch (getOperatorIndex()) { case 26: case 27: return 500; case 28: case 29: case 30: case 31: return 550; } throw new RuntimeException("Illegal operator"); }
6
public static final SocksImplementation getImplementation( final ConfigurationFacade configurationFacade, final Socket socket) throws IOException, AccessDeniedException, ProtocolException { final InputStream inputStream = socket.getInputStream(); final int protocol = inputStream.read(); switch (protocol) ...
7
private void userSave (ArrayList < String > command) { String filename=null; if (command.size()>1) { filename=command.get(1); try { BufferedWriter bw=new BufferedWriter(new FileWriter(command.get(1))); for (int i=0; i<moveHistory.size(); i++) { bw.write(moveHistory.get(i)+" "); } bw...
4
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == inputText) { if(inputText.getText().trim().equals("")) { resetInputField(); return;} /** Look for it every time, if it's not there he's probably offline. */ NetworkSharedUser sendTo = Users.getUserById(targetUserId); if(sendTo == ...
4
public void loadConfigBoard() { try { FileReader reader = new FileReader(boardConfigFile); Scanner in = new Scanner(reader); while (in.hasNext()) { String input = in.nextLine(); String[] tokens = input.split(","); if (input.length() < 1) { throw new BadConfigFormatException("Error with boa...
7
public static Cons removeVariableTypePropositions(Proposition proposition) { { Keyword testValue000 = proposition.kind; if (testValue000 == Logic.KWD_AND) { { Cons typedeclarations = Stella.NIL; Proposition goalproposition = null; { Stella_Object arg = null; Vector ve...
8
public static Vector2D<Integer> getCrossVector(Vector2D<Float> orig, Vector2D<Float> dest) { int crossX = 0; if (orig.getX().floatValue() < 0f && dest.getX().floatValue() >= 0) { crossX = 1; } else if (orig.getX().floatValue() >= 0f && dest.getX().floatValue() < 0) { crossX = -1; } int crossY = 0...
8
private void extend(Object component, Object lead, Object row, boolean recursive) { Object anchor = get(component, ":anchor"); if (anchor == null) { set(component, ":anchor", anchor = lead); } char select = 'n'; boolean changed = false; for (Object item = get(component, ":comp"); // anchor - row ite...
9
final public void Function_statement() throws ParseException { /*@bgen(jjtree) Function_statement */ SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_STATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { Function_call_...
8
public static boolean computeCell(boolean[][] world, int col, int row) { // liveCell is true if the cell at position (col,row) in world is live boolean liveCell = getCell(world, col, row); // neighbours is the number of live neighbours to cell (col,row) int neighbours = countNeighbours(world, col...
8
public ExtGState getExtGState(String namedReference) { ExtGState gsState = null; if (extGStates != null) { Object attribute = library.getObject(extGStates, namedReference); if (attribute instanceof Hashtable) { gsState = new ExtGState(library, (Hashtable) attribut...
3
protected void loadConfig() { // Read config file if (verbose) // Timer.showStdErr("Reading configuration file '" + configFile + "'" // + ((genomeVer != null) && (!genomeVer.isEmpty()) ? ". Genome: '" + genomeVer + "'" : "") // ); config = new Config(genomeVer, configFile, dataDir); // Read configurati...
4
private Node find(Node node, String string) throws KeyNotFoundException { int index = 0; while (index < string.length()) { if (node == null) throw new KeyNotFoundException(); int cmp = node.ch.compareTo(string.charAt(index)); if (cmp < 0) node = node.right; ...
4
@Override public void onHitByBullet(final HitByBulletEvent e) { // TODO check if this is needed if(lastState != null) { lastState.update(e); } if (doMove) { move.onHitByBullet(e); } }
2
private void log(String text) { textArea.append(text + "\n"); textArea.setCaretPosition(textArea.getDocument().getLength() - 1); }
0
public void run() { String theMsg = null; ITupleSpaceConnectorListener theListener = null; while (isRunning) { synchronized(messages) { if (messages.isEmpty()) { theMsg = null; theListener = null; try { messages.wait(); } catch (Exception e) {} } else if (isRunning ...
7
public void render(Graphics2D g2d) { for (int row = rowOffset; row < rowOffset + numRowsToDraw; row++) { if (row >= rows) break; for (int col = colOffset; col < colOffset + numColsToDraw; col++) { if (col >= cols) break; if (map[row][col] == 0) continue; ...
5
public FrequencyGen(Pair<Integer, Gen<T>> ... generatorPairs) { this.generatorPairs = generatorPairs; this.size = 0; for (int i = 0; i < generatorPairs.length; ++i) { this.size += generatorPairs[i].fst(); } }
1
private final void setMinimumComponentBounds() { for (int i = 0; i < getTComponents().size(); i++) { TComponent c = getTComponents().get(i); if (resizeComponentArray.get(i)) if (isVertical) { if (c.getHeightD() > smallestComponentHeight) smallestComponentHeight...
5