text
stringlengths
14
410k
label
int32
0
9
public ArrayList<String> getItemTypeList(String category, String types) { ArrayList<String> matchingItems = new ArrayList<String>(); ItemType itemType = null; for (int i = 0; i < itemTypesList.size(); i++) { itemType = itemTypesList.get(i); if(itemType.getCatego...
3
private static void setLookAndFeel(String lookAndFeel) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if (lookAndFeel.equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); ...
6
public void tick(Input input) { player1.tick(input); //player2.tick(); //player3.tick(); //player4.tick(); for(Particle p : particles) { p.tick(); if(p.remove) { particles.remove(p); } } ...
5
private void releaseKey(int code) { keyDown[code] = false; if (code < maxKeyCount) { String keyName = keyNames[code]; if (keyName != null) { lastKey = keyName; } } }
2
public void close() { if (sequencer != null && sequencer.isOpen()) { sequencer.close(); } }
2
public void makeMove(Location loc) { if (loc == null) removeSelfFromGrid(); else moveTo(loc); }
1
public static ArrayList<Station> getAllStation() { Statement stat; ArrayList<Station> stations = new ArrayList<>(); try { stat = ConnexionDB.getConnection().createStatement(); stat.executeUpdate("use nemovelo"); ResultSet res = stat.executeQuery("select * fro...
3
@Override public Future<WebServer> stop() { FutureTask<WebServer> future = new FutureTask<WebServer>(new Callable<WebServer>() { @Override public WebServer call() throws Exception { if (channel != null) { channel.close(); } ...
5
public static void UperFirstName(){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCommit(false); PreparedStatement st...
4
private void init() { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); Box box = Box.createVerticalBox(); box.add(getTopPanel(), BorderLayout.NORTH); box.add(testPanel.getMainPanel(), BorderLayout.NORTH); add(box, BorderLayout.NORTH); new Thread(new Ru...
1
public void setFromDate(String fromDate) { this.fromDate = fromDate; }
0
private static void trainTransitionParameters(double[] emissions, GaussianMarkovModel mm, GaussianForwardAlgorithm fa, GaussianBackwardsAlgorithm ba) throws Exception { int numStates = mm.getMarkovStates().length; double[][] A = new double[numStates][numStates] ; double logPx = fa.getLogFinalPValue(); ...
6
public TreePanel initTreePane() { final TreePanel tpane = new TreePanel(treeDrawer); gui.SuperMouseAdapter a = new gui.SuperMouseAdapter() { public void mouseClicked(MouseEvent event) { TreeNode n = tpane.nodeAtPoint(event.getPoint()); controller.nodeClicked((MinimizeTreeNode) n, event); } public ...
0
private static void createContext ( String subscriptionClassName, String[] parameterValues, String connectionURL ) throws Exception { Class<?> subscriptionClass = Class.forName( subscriptionClassName ); SubscriptionSignature subscriptionSignature = (Sub...
5
public void processEpsilonValue() { try { DataWriters = new ArrayList<DataWriter>(); DataWriters.add(new OpinionDensityDataWriter(Constants.files.get(OpinionDensityDataWriter.id))); DataWriters.add(new OpinionClusterDataWriter(Constants.files.get(OpinionClusterDataWriter.id))); DataWriters.add(new Realiza...
5
public String getMessage() { return Message; }
0
private void doBeforeProcessing(ServletRequest request, ServletResponse response) throws IOException, ServletException { if (debug) { log("FiltradoSesion:DoBeforeProcessing"); } // Write code here to process the request and/or response before // the rest of the f...
1
private String getIntegerValue(final Field field, final Object object) { Object result = getRawValue(field, object); if (result == null) { result = ""; } return result.toString(); }
1
public ZFrame unwrap() { if (size() == 0) return null; ZFrame f = pop(); ZFrame empty = getFirst(); if (empty.hasData() && empty.size() == 0) { empty = pop(); empty.destroy(); } return f; }
3
public List<Movimentacao> buscaPorContaETipo_Concatenando_LevementeRefatorado(Conta conta, TipoMovimentacao tipo) { StringBuilder jpql = new StringBuilder(" select m from Movimentacao m "); List<String> criteria = new ArrayList<String>(); if (conta != null) { criteria.add("m.conta = :conta"); } if (tipo...
8
public static FileDescriptor forTuple(Tuple tup) { if (!tup.isOfTypes(byte[].class, Integer.class, Long.class)) throw new IllegalArgumentException( "Invalid Tuple passed to FileDescriptor.forTuple()!"); String id = new String((byte[]) tup.getItem(0)); int owner = (int) tup.getItem(1); long size = -1L...
5
private void broadcastFinalScores(){ String stringScores; int finalScore[]; System.out.println(); printStatus("[ GAME OVER ] " + GameInfo.indexToPlayerName(turn) + " wins"); stringScores = ""; finalScore = new int[hands.length]; // all elements are set to 0 by default in Java //...
6
private static boolean meetsFilter(String ticker) { boolean fits = true; for (FilterPanel fp : EarningsTest.singleton.filters) { if (!fp.include.isSelected()) continue; int id = fp.getId(); boolean checkDividendHistory = DBLabels.labels[id] .equals("Dividends"); float low = fp.getLow(); flo...
5
protected void processKeyEvent(KeyEvent ke) { int kc = ke.getKeyCode(); if (ke.isShiftDown()) { speed = HYPER; rotAmount = Math.PI / 60.0; } else { speed = NORMAL; rotAmount = Math.PI / 120.0; } if (ke.isAltDown()) { altTransform(kc); } else { if (ke.isControlDown()) { controlTransform...
3
private static Region getBestNeighborRegion(Region missingRegion, ExpansionDecisions madeExpansionDecisions, BotState state, SuperRegion superRegion) { List<Region> ownedNeighbors = missingRegion.getOwnedNeighbors(state); int maximumIdleArmies = 0; // First calculate the maximum amount of armies of an owned ne...
5
private void defineRoomSums() {//Fills in table roomSumsFrame = new JFrame(); roomSumsTable = new JTable(); roomSumsTable_header = new String[DataBase.schoolPeriodCount*2+1]; roomSumsTable_data = new String[DataBase.rooms.length][DataBase.schoolPeriodCount*2+1]; roomSumsTable_header[0] = "Room";//First...
5
public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (image != null) { AlphaComposite alpha = AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 1); g2d.setComposite(alpha); g2d....
7
@Override public void run() { while (!stop) { try { opcion = canalEntrada.readInt(); } catch (IOException e) { System.out.println("Error al recibir comando" + e.getMessage()); } switch (opcion) { case 1: break; case 2: System.out.println(recibirMensaje()); break; } ...
7
@Override public boolean equals(Object object) { if (!(object instanceof KeyedId)) { return false; } KeyedId other = (KeyedId) object; return !((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name)) ...
8
public void recruited() { for (int i=0; i<recruits.length; ++i) { recruits[i].updateRange(); } for (int i=0; i<buys.length; ++i) { buys[i].checkActive(); } units.updateUnits(); updateResources(); }
2
public void paint(Graphics g){ super.paint(g); if(gameover){ gameover(g); } else{ Graphics2D g2d = (Graphics2D)g; g2d.setColor(Color.YELLOW); g2d.fillRect(apple.getX(), apple.getY(), a_width, a_width); g2d.setColor(Color.GREEN); g2d.fillRect(player.getX(), player.getY(), p_width, p_width);...
2
private final int jjMoveStringLiteralDfa17_0(long old1, long active1, long old2, long active2) { if (((active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_0(15, 0L, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(16, 0L, ac...
6
@EventHandler public void SpiderNightVision(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getSpiderConfig().getDouble("Spider.Nig...
6
public void connect() { int iPort = 6667; if (wikimediaBot == null || !wikimediaBot.isConnected()) { try { iPort = Integer.parseInt(port); } catch (Exception e) { System.out.println("IRC.java, problem parsing integer: " + e.getMessage()); } String[] channels ...
9
public static void filewrt() throws FileNotFoundException, UnsupportedEncodingException{ PrintWriter wfile = new PrintWriter(fnames, "UTF-8"); for (int i=0;i<names.size();i++){ wfile.println(names.get(i)); } wfile.close(); }
1
public Set equivalent(final Node node) { Set s = (Set) equiv.get(node); if (s == null) { s = new HashSet(1); s.add(node); // A node is equivalent to itself equiv.put(node, s); } return s; }
1
public void visitLocalVariable(String name, int index) { if (index >= ignoreCount && index < ignoreCount + paramCount) { if (!name.equals("arg" + currentParameter)) debugInfoPresent = true; result.append(','); result.append(name); ...
3
void compareHypergeometric(int k, int N, int D, int n, double result) { double p = Hypergeometric.get().hypergeometric(k, N, D, n); double abs = Math.abs(p - result); double diff = abs / Math.min(p, result); if ((abs > 1E-300) && (diff > 0.00001)) throw new RuntimeException("Difference:" + diff + "\t\t" + p + ...
2
public static String readline(InputStreamReader in) { int ch; StringBuffer line=null; try { while (true) { ch = in.read(); if (ch==-1) { if (line==null) return null; return line.toString(); } if (ch==10 || ch==13) { // eol if we read other characters, ignore if not if (line!...
9
public int deleteFile(final String directory, final String name) { final String path = directory + "/" + name; int error = 0; final Integer fileNode = fileTable.containsKey(path) ? fileTable.get(path) : -1; if( fileNode != null && fileNode != -1 && Utils.range(fileNode, 0, MAX_FILES) ) { final File f...
9
public static synchronized TaskQueue getInstance() { if (instance == null) { instance = new TaskQueue(); } return instance; }
1
public void fixJumping() { if(!isRightHeld && !isLeftHeld) { if(currentAnimation() == jumpLeft) { setAnimation(stillLeft); this.direction = "left"; } if(currentAnimation() == jumpRight) { setAnimation(stillRight); this.direction = "right"; } } else { if(!this.frictionLock) { if(is...
9
@Override public void run() { arr_data = Product.showAll(); data = new Object[arr_data.size()][]; for (int i = 0; i < arr_data.size(); i++) { data[i] = arr_data.get(i).Array(); } this.fireTableDataChanged(); }
1
@Override public String toString() { final StringBuffer a = new StringBuffer(); final StringBuffer b = new StringBuffer(); Element temp = pattern; while(temp != null) { if (temp.isSpecial) { switch(temp.item) { case '.': a.append("[:ANY:]"); break; case 'd': a.append("[:dig...
9
@Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + averageStartsCount; return result; }
1
public int getEventId() { return eventId; }
0
public synchronized void stageOne() { try { //do your work here Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } list1.add(random.nextInt(100)); }
1
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
7
@Override public int compare(Patient o1, Patient o2) { //throw new UnsupportedOperationException("Not supported yet."); if(o1.isPrivatpatient() == true && o2.isPrivatpatient() == false){ return -1; } if(o1.isPrivatpatient() == false && o2.isPrivatpatient() == true){ ...
8
public String[][] getRows(String name, String[] columnNames, SortFilterState sortFilter, int start, int pageSize) { List<String[]> result = new LinkedList<String[]>(); StringBuilder sb = new StringBuilder(); sb.append("SELECT "); for (int i = 0; i < columnNames.length; ++i) { sb.append(columnNames[i]); ...
9
public void writeKnownAttributes(GrowableConstantPool gcp, DataOutputStream output) throws IOException { if (lvt != null) { output.writeShort(gcp.putUTF8("LocalVariableTable")); int count = lvt.length; int length = 2 + 10 * count; output.writeInt(length); output.writeShort(count); for (int i = 0;...
4
private static boolean getIsCreateFromConsole() throws CancelOperationException { String[] options = { "Create a new queue in the system.", "Delete an existing queue from the system."}; final StringBuilder builder = new StringBuilder("Please enter the number of the option to continue:\n"); // Prints each line ...
7
private void trackListGenerator(Object[] inpista) { //Recibe un arreglo y crea una lista de pistas vacias y su archivo .gdb tracksList.clear(); String location = ruta + "\\GameData\\Locations"; for (Object pista : inpista) { String fileMask = pista.toString(); Str...
2
public void paint(Graphics g2) { Controls.setTile(getTile()); Graphics2D g = (Graphics2D) g2; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (map != null) { g.scale(scale, scale); g.drawImage(map, mapLoc.x, mapLoc.y, nul...
6
public void copyRegionHFlip(CPRect r, CPLayer source) { CPRect rect = new CPRect(0, 0, width, height); rect.clip(r); for (int j = rect.top; j < rect.bottom; j++) { for (int i = rect.left, s = rect.right - 1; i < rect.right; i++, s--) { data[i + j * width] = source.data[s + j * width]; } } }
2
/*Update Username*/public boolean changeUsername(String username, String newUsername){ try{ if(newUsername.length() > 40)return false; if(username.length() > 40) return false; select1.setString(1, newUsername); ResultSet rs = select1.executeQuery(); if(rs.next())return false; updateUsername.s...
4
@Override public void run() { System.out.println("UserHandler thread started"); String hours = new SimpleDateFormat("HH").format(Calendar.getInstance().getTime()); String minutes = new SimpleDateFormat("mm").format(Calendar.getInstance().getTime()); String seconds = new SimpleDateFo...
4
public String getComponentTitle() { return "Multiple Runs"; }
0
private static String stringify(final InputStream inputStream) { if (inputStream == null) { return ""; } try { int ichar; ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (;;) { ichar = inputStream.read(); if (ichar < 0) { break; } baos.write(ichar); } return ba...
6
public static LocaleCode getByLocale(Locale locale) { if (locale == null) { return null; } // Locale.getLanguage() returns either an empty string or // a lower-case ISO 639 code. String language = locale.getLanguage(); // Locale.getCountry() retu...
5
public List<double[]> run(File image) { if (!image.exists()) return new LinkedList<double[]>(); descriptor.run(ImageProcessorFactory.newProcessor(image)); return descriptor.getFeatures(); }
1
public final void spawnBlockParticles(Level level, int x, int y, int z, int side, ParticleManager particleManager) { float offset = 0.1F; float var8 = x + random.nextFloat() * (minX - maxX - offset * 2F) + offset + maxX; float var9 = y + random.nextFloat...
6
@Override public Subtitles parse(InputStream inputStream, String charset, double fps) throws UnsupportedSubtitlesFormatException { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(inputStream, charset)); Subtitles subtitles = new Subtitles(fps); String line; ...
9
private void postPlugin(boolean isPing) throws IOException { // Server software specific section PluginDescriptionFile description = plugin.getDescription(); String pluginName = description.getName(); boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enab...
5
private void validateFileName(String fileName) throws InvalidFileException { Pattern pattern = Pattern.compile(FILE_NAME_REGEXP); Matcher matcher = pattern.matcher(fileName); if (matcher.matches()) { File file = new File(fileName); if (!file.exists() || file.isDirectory()) throw new InvalidFileException...
3
@EventHandler public void onPlayerChat(final AsyncPlayerChatEvent e) { String msg = e.getMessage(); msg = ChatColor.translateAlternateColorCodes('&', msg); String newMsg = msg; if (plugin.getConfig().getBoolean("Tagging")) { if (inCooldown.contains(e.getPlayer())) { e.getPlayer() .sendMessage( ...
7
public NetworkUtils(String address, int port, String message){ try { this.ipaddress = InetAddress.getByName(address); this.port = port; this.message = message; } catch (UnknownHostException e) { Bukkit.getLogger().severe("Can not connect to host, did you use the correct address?"); } }
1
private double[][] createEmptyValueGrid(GeoParams geoParams, Operator operator) { double delta_y = Math.abs(geoParams.geoBoundNW.latitude - geoParams.geoBoundSE.latitude); double delta_x; if (geoParams.geoBoundNW.longitude > geoParams.geoBoundSE.longitude) { //We've wrapped around from 180 to -180, delta_x ...
5
public static SortedDocValues wrap(SortedSetDocValues sortedSet, Type selector) { if (sortedSet.getValueCount() >= Integer.MAX_VALUE) { throw new UnsupportedOperationException("fields containing more than " + (Integer.MAX_VALUE-1) + " unique terms are unsupported"); } SortedDocValues singleton = ...
8
public void addUniform(String uniform){ int uniformLocation = glGetUniformLocation(program,uniform); if (uniformLocation == 0xFFFFFFFF){ System.err.println("Could not find uniform: " + uniform); new Exception().printStackTrace(); System.exit(1); } un...
1
@Override public void deserialize(Buffer buf) { cellId = buf.readShort(); if (cellId < 0 || cellId > 559) throw new RuntimeException("Forbidden value on cellId = " + cellId + ", it doesn't respect the following condition : cellId < 0 || cellId > 559"); objectGID = buf.readShort()...
3
public static void main(String[] args) throws Exception { System.out.println("==== Menu ====="); System.out.println("1. Serveur"); System.out.println("2. Client"); String str = sc.nextLine(); int value = Integer.parseInt(str); switch (value) { case 1: new Serveur().createServeur(); break; c...
2
@Override public boolean eval(Critter c) { // TODO implement me! // returns the boolean value of this condition for Critter c if (op.toString().equals("<")) return left.eval(c) < right.eval(c); else if (op.toString().equals("<=")) return left.eval(c) <= right.eval(c); else if (op.toStrin...
6
@EventHandler public void receivePluginMessage( PluginMessageEvent event ) throws IOException, SQLException { if ( event.isCancelled() ) { return; } if ( !( event.getSender() instanceof Server ) ) return; if ( !event.getTag().equalsIgnoreCase( "BSHomes" ) ) { ...
8
private boolean isStatement() { return peekTypeMatches("RETURN") || peekTypeMatches("ID") || peekTypeMatches("IF") || peekTypeMatches("WHILE") || peekTypeMatches("FOR") || peekTypeMatches("BREAK"); }
5
private static boolean isPrimitiveEquivalent(Class<?> primitive, Class<? extends Object> aClass) { if (primitive == int.class || primitive == long.class || primitive == float.class || primitive == double.class) { return (aClass == Integer.class ...
9
@Override public void rotate(int angle) { super.rotate(angle,center); setColoredExes(); }
0
public static boolean isQualified(){ //if (shopList = 0) return false; //@todo should check the size of shopList if (isSorted) return true; if (shopListArr.length <= maxShopListSize) return true; return false; }
2
public void setForegroundColor( Color foregroundColor ) { if( foregroundColor == null ) { throw new IllegalArgumentException( "foregroundColor must not be null" ); } this.foregroundColor = foregroundColor; regraph(); }
1
public void count() { genome = snpEffectPredictor.getGenome(); readLengthSum = 0; readLengthCount = 0; // Iterate over all BAM/SAM files try { if (verbose) Timer.showStdErr("Reading file '" + fileName + "'"); countReads = new CountByKey<Marker>(); countBases = new CountByKey<Marker>(); countType...
4
protected int findColumnStrict(CycVariable col) throws IllegalArgumentException { if (col == null) { throw new IllegalArgumentException("Got null column name."); } return findColumnStrict(col.toString()); }
1
public static List<String> topDown (List<Character> s) { // trivial case if ( s.size() == 2 ) { String s1 = new String(new char[]{s.get(0), s.get(1)}); String s2 = new String(new char[]{s.get(1), s.get(0)}); ArrayList<String> al = new ArrayList<>(); al.add(s1); al.add(s2); return al; }...
3
public File getFile() { return _file; }
0
public Othello() { super(GAME_WIDTH, GAME_HEIGHT); boolean test = false; if (test || m_test) { System.out.println("Othello :: Othello() BEGIN"); } if (test || m_test) { System.out.println("Othello :: Othello() END"); } }
4
public void quickS(int low, int high) { int mid = (low + high) / 2; int left = low; int right = high; int pivot = arrA[mid]; // select middle element as pivot while (left <= right) { while (arrA[left] < pivot) left++;// find element which is greater than pivot while (arrA[right] > pivot) right--...
6
public void updateObjects(int deltaTime) { // Draws settings Menu if necessary if (getIsDrawingSettingsMenu()) { drawSettingsMenu(); } // Update ImageButtons for (ImageButton obj : screenObjects) { obj.update(deltaTime); } // Update LoopMenu if necessary if (loopMenu != null) { loopMenu.updat...
3
public boolean equals(Object other) { if ( (this == other ) ) return true; if ( (other == null ) ) return false; if ( !(other instanceof BiCopiesarticlesId) ) return false; BiCopiesarticlesId castOther = ( BiCopiesarticlesId ) other; return (this.getNoArticle()==castOther.getNoArticle())...
7
public String bitrate_string() { if (h_vbr == true) { return Integer.toString(bitrate()/1000)+" kb/s"; } else return bitrate_str[h_version][h_layer - 1][h_bitrate_index]; }
1
public StorageDatabase() { try { Class.forName("org.h2.Driver"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } File root = Constants.getRoot(); File databaseLocation = new File(root,"storageDatabase"); String path = null; try { ...
5
public static void main(String[] args) throws Exception { if (args.length != 9) { System.err .print("Syntax error. Correct syntax:\n" + " <trainfile_supervised> <trainfile_semisupervised> " + " <testset>" + "<supervised_weight> <observation_feature> <state_feature> " + "<modelfile...
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IpEntity ipEntity = (IpEntity) o; if (ip != null ? !ip.equals(ipEntity.ip) : ipEntity.ip != null) return false; if (urlMap != null ? !urlMap.eq...
7
@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 Link)) { return false; } Link other = (Link) object; if ((this.codlink == null && other.codlink != null) || (th...
5
@Override public void actionPerformed(ActionEvent e) { if (e.getSource()==questionDeleteButton) { this.setVisible(false); this.getParent().remove(this); this.invalidate(); } }
1
private void unfilter(byte[] curLine, byte[] prevLine) throws IOException { switch (curLine[0]) { case 0: // none break; case 1: unfilterSub(curLine); break; case 2: unfilterUp(curLine, prevLine); ...
5
public ArrayList<Boolean> CreateAgendaSlotStatus(){ ArrayList<Boolean> result = new ArrayList<Boolean>(); int hour1,hour2,duration; boolean overlapTasksExist = false; for (int i = 0; i < 25; i++) { result.add(true); } for (int i=0; i<currDateTask.size(); i++){ if(Character.isDigit(currDateTask.get(i)....
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; GraphGenericNode<?> other = (GraphGenericNode<?>) obj; if (Data == null) { if (other.Data != null) return false; } else if (!Data.equals...
8
public synchronized T checkOut() { long now = System.currentTimeMillis(); T t; if (unlocked.size() > 0) { Enumeration<T> e = unlocked.keys(); while (e.hasMoreElements()) { t = e.nextElement(); if ((now - unlocked.get(t)) > expirationTime) {...
4
public void send(Message msg) { System.out.println("Sneding message: \"" + msg.encode() + "\""); try { conn.send(msg.encode()); } catch (CouldNotSendPacketException e) { System.out.println("Could not send message: " + e.getMessage()); } }
1
private int score(int[] bowl){ int sum=0; for(int i=0;i<12;i++){ sum+=pref[i]*bowl[i]; } return sum; }
1
public static String getExtension(String filename) { int i = filename.lastIndexOf('.'); int j = filename.lastIndexOf(File.separatorChar); return (i > 0 && i > j && i < filename.length() - 1) ? filename .substring(i + 1).toLowerCase() : ""; }
3