text
stringlengths
14
410k
label
int32
0
9
@Override public void run() { int i = 0; int random = (int) Math.round(Math.random() * 2); setImage(images[random]); while(true) { do{ i++; xPosition -= 1; gameVue.repaint();...
3
public byte[] getModulus() { return modulus; }
0
public static String getProxyLocation() throws IOException { String str2 = null; String str1 = System.getenv("X509_USER_PROXY"); if (str1 == null) { str1 = System.getProperty("X509_USER_PROXY"); } if (str1 != null) { return str1; } try { ...
6
public String applyFunctianality(Text text) { ArrayList<String> firstSentenceWords = new ArrayList<String>(); boolean isFirstSentence = true; Iterator<PartOfText> parts = text.getParts(); while(parts.hasNext()){ PartOfText part = parts.next(); if(part instanceof S...
8
public WhoObject (String s, boolean sortname) { S=s; SortName=sortname; if (s.length()<=30) { V=-50; Name=""; Stat=""; return; } Stat=s.substring(0,5); StringParser p=new StringParser(s.substring(30)); String h=p.parseword(); p=new StringParser(h); if (p.isint()) { V=p.parseint(); if (p.skip("k"))...
7
public nameList addNameNoSave(String x) { if(x.equals("") || x.equals("null")) return null; nameList temp = head; while(!(temp==null)) { if(temp.getName() != null) if(temp.getName().equals(x)) return temp; temp = temp.getNext(); } tail = new nameList(x,tail); if(head == null) head =...
6
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String data = ""; response.setContentType("text/plain"); response.setCharacterEncoding("UTF-8"); PrintWriter writer = response.getWriter(); String dbDriver = "org.postgresql.Driver"; ...
5
private static String getPath(File file) { try { return file.getCanonicalPath(); } catch (IOException e) { return file.getAbsolutePath(); } }
1
public void actionPerformed(ActionEvent e) { //perform login function if users clicks logins if (e.getSource() == btnLogin) { String user = txtUsername.getText(); char[] pass = password.getPassword(); String p = new String(pass); int i = 0; logininfo.setInfo(user, p); username = user; try { ...
9
public void handleModifyFile(FolderWatcherQueue s) { Connection con = DBManager.establishConnection(); DBManager db = new DBManager(); db.serverModify(con, FileFunctions.getRelativePath(s.getFullPath()), db.getTimeStamp(s.getDate())); if (FileFunctions.isDirectory(s.getFullPath())) { File[] files = new F...
3
public static void sort(int[] array) { printArray(array); int n = array.length; int bask[][] = new int[10][n]; int index[] = new int[10]; int max = Integer.MIN_VALUE; //array中最高位数 for (int i = 0; i < n; i++) { //求array中的最高位数 max = max > (Integer.toString(array[i]).length()) ? max : (Integer .toStrin...
9
public final TransmitterConnectionInfo[] getTransmitterConnectionInfo(long transmitterId) { BaseSubscriptionInfo readBaseSubscriptionInfo = new BaseSubscriptionInfo( _configurationId, AttributeGroupUsageIdentifications.CONFIGURATION_READ_REQUEST, (short)0 ); TransmitterConnectionInfoRequest telegram = new Tr...
9
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { __in.peekTag(); if (__typeMapper.verifyElement(__in, accountId__typeInfo)) { setAccountId(__typeMapper.readS...
9
public final void adventure() throws RecognitionException, TokenStreamException { try { // for error handling match(BEGIN_ADV); if(board.initGame()) mode = ADVENTURE_MODE; { _loop295: do { if ((_tokenSet_0.member(LA(1)))) { instruction(); } else { break _loop295; } ...
4
private BufferedImage getDarkenedSourceImage(BufferedImage sourceImage, float startAlpha, float endAlpha, boolean leftToRight, Color blendColor) { if (startAlpha > ZERO_PERCENT_THRESHOLD || endAlpha > ZERO_PERCENT_THRESHOLD) { final BufferedImage blendSource = new BufferedImage(1, sourceImage.getHeight(), Bu...
7
@Override public void modifyGenRace(MOB mob, Race me, int showFlag) throws IOException { if(mob.isMonster()) return; boolean ok=false; if((showFlag == -1) && (CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)) showFlag=-999; while((mob.session()!=null)&&(!mob.session().isStopped())&&(!ok)) { int showNum...
9
public boolean doesDrawStateLabels() { return drawLabels; }
0
@EventHandler public void ZombieSpeed(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.getZombieConfig().getDouble("Zombie.Speed.Dod...
6
public static Integer gt(Object o1, Object o2){ if (o1 == null && o2 == null){ return 0; } else if (o1 != null && o2 == null){ return 1; } else if (o1 instanceof Number && o2 instanceof Number){ return ((Number)o1).doubleValue() > ((Number)o2).doubleValue() ? 1 : 0; } return 0; }
7
@Override public void onEnable() { saveDefaultConfig(); PluginManager pm = getServer().getPluginManager(); Plugin gmi = pm.getPlugin("GameModeInventories"); if (gmi == null) { System.err.println("[GMIDatabaseConverter] This plugin requires GameModeInventories!"); ...
7
@Override public String getPhone() { return super.getPhone(); }
0
public void saveScores() throws java.io.IOException { int size = this.size(); //sort currente arraylist in decreasing order Collections.sort(this); Collections.reverse(this); try { //check if the file exists, if not, create one File file = new File("d...
5
private void fitVectorsToSize() { m_fileContent.setSize(getRowsCount()); int fileSize = getRowsCount(); int colCount = getColsCount(); for (int i = 0; i < fileSize; i++) { Vector aRow = (Vector)m_fileContent.get(i); if (aRow == null) { m_fileContent.set(i, new Vecto...
2
public void minSubArray(int[] arrA, int x) { int start = 0; int ansEnd = 0; int ansStart = 0; int currSum = 0; int minLen = arrA.length; for (int i = 0; i <= arrA.length; i++) { while (currSum > x) { currSum = currSum - arrA[start]; if (i - start < minLen) { minLen = (i - start); ansEnd...
5
public void quit() { int save = JOptionPane.showConfirmDialog(this, "Do you want to save the changes to this project?", "Close", JOptionPane.YES_NO_CANCEL_OPTION); switch(save) { case 0 : boolean exit = fileOps.saveChanges(); if(exit) break; else return; case 1 : dispose(); break; case 2 :...
5
public EncryptedDataType getEncryptedValue() { return encryptedValue; }
0
@Test public void testSnzInputStream() throws IOException, InterruptedException { File tmpDirectory = TestUtil.directoriesToFile("tmp", "SnzInputStreamTest"); TestUtil.copyRecursive(testdataDirectory, tmpDirectory); ProcessBuilder pb = new ProcessBuilder(snzipExecutable, "*"); pb.directory(tmpDirectory)...
3
public void testPrintSerializedDataModel(ViewType type){ if(type == ViewType.FOOD_GENRE) { System.out.println("Test"); FoodGenreList testFGL = theSerializedDataModel.getFoodGenreList(); for(int i = 0; i < testFGL.getTheFoodGenreList().size(); i++) { ...
6
public UpdateHandler getUpdateHandler() { return this.update; }
0
public ContactSorter constructSorter(SortType type) { switch (type) { case FIRST_NAME: return new FirstNameContactSorter(); case LAST_NAME: return new LastNameContactSorter(); } return null; }
2
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Position other = (Position) obj; if (orientation != other.orientation) { return false; } if (x != other.x) { return f...
6
public static String getMaxAithorID(){ try { ResultSet rs=DB.myConnection().createStatement().executeQuery("select max(AuthorID) from author"); while(rs.next()){ max_Author_id=Integer.toString(rs.getInt(1)+1); } } catch (ClassNotFoundE...
3
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
public Id3v2PlayCountFrame(Property property,PropertyTree parent) { super(property, parent); }
0
public static int flagsCheck(IOFlags flags) { int output = 0; if (flags.PRODUCE) { if (flags.LOAD) output = 1; } if (flags.SAVE) { if (!flags.PRODUCE) output = 2; } if (flags.LOAD) { if (flags.PRODUCE || flags.SAVE) output = 3; } return output; }
7
protected final static void writeCRC(OutputStream os, CRC32 crc) throws IOException { int i = (int) crc.getValue(); os.write(new byte[] { (byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF) }); crc.reset(); }
0
public void leave(String message) { if (left) return; left = true; if(properties.containsKey("translation") && !ping) { Translation t = (Translation)properties.get("translation"); System.out.println(t.translate("client.left", message)); } if(message == null) throw new NullPointerException(); t...
5
public static void main(String[] args) { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; ComboPooledDataSource source = new ComboPooledDataSource(); try { conn = source.getConnection(); ps = conn.prepareStatement("SELECT * FROM users where name=? and password=?"); ...
7
public AdminFrame(DB database, String loginName) { super("Ա"); this.database = database; this.loginName = loginName; GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); this.setLayout(layout); // 3ť JButton button = new JButton("ӹԱ"); layout.setConstraints(bu...
1
@Override public int fight() { return super.fight(); }
0
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SupplierStatus)) { return false; } SupplierStatus other = (SupplierStatus) obj; if (statusId == null) { if (other.statusId != null) { return false; ...
9
private void openFile() { JFileChooser fileChooser; if (lastOpenPath != null && !lastOpenPath.equals("")) { fileChooser = new JFileChooser(lastOpenPath); } else { fileChooser = new JFileChooser(); } FileFilter wavFilter = new FileFilter() { @Override public String getDescription() { retu...
8
public final byte[] toBytes() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { write(baos); } catch (IOException e) { } return baos.toByteArray(); }
1
public TreeNode creat( TextProcessing TextPro, String Situ, String ParName ) { TreeNode root = new TreeNode(); InformationGain infoGain = new InformationGain(); root.AttributeName = infoGain.getMaxGain(TextPro); root.SituationName = Situ; root.ParentName = ParName; root.isLeafNode = false; Attribute ob...
4
@Override public String getHdfs() { //return "hdfs://192.168.178.41:8020"; return "hdfs://192.168.178.40:9000"; }
0
public static DataSet loadDataSet(String path) throws Exception{ DataSet ret = new DataSet(); ArrayList<Row> datal = new ArrayList<Row>(); FileReader f = new FileReader(path); BufferedReader in = new BufferedReader(f); String line = "";//in.readLine(); while (line != null) { line = in.readLine(); if (...
9
public LoggerBuilder(ILoggerConfig loggerConfig) throws Exception { if (loggerConfig == null) throw new IllegalArgumentException("loggerConfig is null"); appenders = new ArrayList<String>(); config = loggerConfig; configureLogger(); }
1
private void changeDir(int clickX) { int dir = (int)Math.floor(clickX/29) + 1; if (dir == 1) { } else if (dir == 2) { } else if (dir == 3) { } else if (dir == 4) { if (buildDir.equals("N") || buildDir.equals("S")) selectedTrack = 3; ...
9
public void visit( final Class<?> type ) { if ( type == null || type.getPackage().getName().startsWith( JAVA_PACKAGE ) ) { return; } // TYPE this.visitElements( type ); if ( !type.isInterface() ) { // CONSTRUCTOR this.visi...
6
@Override public Acesso getByTipo(String tipo) { Acesso acessoLido = null; try{ conn = ConnectionFactory.getConnection(); String sql = "SELECT id " + "FROM acesso" + "WHERE tipo LIKE \'?\';"; ps = conn.prepareState...
3
public static void createDatabase() { if (getConfig.MySQLEnabled()) { Connection connection = null; Statement st = null; int rs = 0; try { //Connecting to database connection = DriverManager.getConnection("jdbc:mysql://" + getConfig.MySQLServer() + "/" + getConfig.MySQLDatabase() , getConfig.MySQ...
5
private void saveMailsLocalyByFireingUIDLandRETRandDELE(int amount) throws IOException { String reply = ""; String uidlOfMail = ""; for (int i = 1; i <= amount; i++) { // firering UIDL writeToServer("UIDL " + i); reply = readFromServer(); uidlOfMail = reply.split(" ")[2]; // firering ...
6
public static double getHue(int color) { double var_R = ( color >> 16 & 0xff ) / 255.0; //RGB from 0 to 255 double var_G = ( color >> 8 & 0xff ) / 255.0; double var_B = ( color & 0xff ) / 255.0; double var_Min = Math.min(Math.min( var_R, var_G), var_B ); //Min. value of RGB double var_Ma...
6
public void start() { CommandFactory commands = new CommandFactory(citationStorage, io); io.println("Welcome to \"Citation Needed\"!"); io.println("Available commands: " + commands + ", quit"); while (true) { String commandStr = io.getString("> "); commandStr = ...
8
public ClientP2P() { /* Initialise GUI */ gui = new ClientP2PGUI(this); /* Get server IP */ server_IP = JOptionPane.showInputDialog("Enter server IP:"); if (server_IP == null) System.exit(-1); else if (server_IP.equals("")) server_IP = "localhost"; /* Generate random key */ key = (int) (Math.random()...
9
public boolean renderBlockStairs(Block block, int i, int j, int k) { boolean flag = false; int l = this.blockAccess.getBlockMetadata(i, j, k); if (l == 0) { block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F); this.renderStandardBlock(block, i, j, k); bl...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof User)) return false; User other = (User) obj; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstNa...
9
private float gaussian(int sample, int mean){ int diff = Math.abs(mean - sample); // .46 + 2(.22) + 2(.04) + 2(0.01) = 1.0 if (diff == 0) return 1.0f; //else if (diff == 1) return 0.22f; //else if (diff == 2) return 0.04f; //else if (diff == 3) return 0.01f; return 0f; }
1
public LigneDeCaisses (Echeancier echeancier) { tableauDesCaisses = new Caisse[nombreTotalDeCaisses]; int i = 0; int rapide = ratioDeCaissesRapides; while ( i < tableauDesCaisses.length ) { rapide = rapide - 1; Caisse caisse = new Caisse (this, i + 1, rapide == 0); tableauDesCaisses[i] = caisse; if...
4
public boolean isFree(int casePositionX, int casePositionY) { if(casePositionX < 0 || casePositionX >= mapFile.getNbCol() || casePositionY < 0 || casePositionY >= mapFile.getNbLine()) return false; //Si la case dépasse les limites de la fenêtre, alors false else if(mapTab[casePositionY][casePositionX] =...
7
private static int getUserOption(BufferedReader br, int min, int max) { int opt; while (true) { try { opt = Integer.parseInt(br.readLine()); if (opt >= min && opt <= max) { break; } else { System.out.prin...
4
public BEPlaylist getById(int id) throws SQLException { for (BEPlaylist aSong : getAllPlaylists()) { if (aSong.getId() == id) { return aSong; } } return null; }
2
public void setState(State state) { this.state = state; }
0
public Iterator GetIterator() { return busStop.iterator(); }
0
@Override public String getEmail() { return super.getEmail(); }
0
protected void processOtherEvent(Sim_event ev) { try { // get the sender ID. // NOTE: Sim_event.get_data() carries a generic object. It might // carries Gridlet, String, etc depending on the sender. // Therefore, be careful when casting th...
3
protected void appExec(int param1) throws Exception { if (param1 != cmdlineArgs.length) { cmdParser.usage(cmdlineArgs, 0, "Excess params="+(cmdlineArgs.length-param1)); return; } long systime_boot = System.currentTimeMillis(); System.out.println(new java.util.Date(systime_boot)+" - NAF BOOTING in "...
8
public void promote( ) { //promotes player2's pieces for( int column = 1 ; column < MAX_COLUMNS ; column += 2 ) { if( board[ 0 ][ column ] != null && board[ 0 ][ column ].toString().equals( Checker.TWO.toString() ) ) { board[ 0 ][ column ] = Checker.TWO_KING; } } //promotes player1's pieces ...
6
public Method[] factoryMethods() { Set<Method> methods = new HashSet<Method>(); for (Method m : clazz.getMethods()) { if (Modifier.isPrivate(m.getModifiers())) { continue; } if (!Modifier.isStatic(m.getModifiers())) { continue; } if (m.getReturnType() != clazz) { continue; } metho...
4
public void process(JCas aJCas) throws AnalysisEngineProcessException { //Annotation's index from JCas pipeline AnnotationIndex<Annotation> an_toks = aJCas.getAnnotationIndex(Token.type); //Iterators for annotations FSIterator<Annotation> iter_toks = an_toks.iterator(); ArrayList<Annotation> tokens = new Arr...
8
protected void processEntity(IXMLReader reader, IXMLEntityResolver entityResolver) throws Exception { if (! XMLUtil.checkLiteral(reader, "NTITY")) { XMLUtil.skipTag(reader); return; } XMLUtil.skipWhitespace(reader, null); char c...
9
public boolean isFull() { boolean full = false; for(int index =0; index < seat.length; index++) { if(seat[index] == true) { full = true; } else { full = false; return full; } } return full; }
2
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
public static Object getValueClass(char ch) { switch (ch) { case '@': return PatternOptionBuilder.OBJECT_VALUE; case ':': return PatternOptionBuilder.STRING_VALUE; case '%': return PatternOptionBuilder.NUMBER_VALUE; ...
9
public void saveFileWithCipher(File file, boolean useCipher, boolean resetOldPass) { try { JAXBContext jc = JAXBContext .newInstance("org.nisshiee.passwordManager.xml"); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); Fil...
9
public TableHelper( final String tableId, final String tableClass, final Object[] headersTopRow, final Object[] headersLeftRow, final Object[][] contents ) { super(); this.headersTopRow = headersTopRow; this.headersLeftRow = headersLeftRow; this.contents = contents; if (this.headersLeftRow != nul...
4
public boolean keyup(KeyEvent ev) { if (focusctl) { if (focused != null) { if (focused.keyup(ev)) return (true); return (false); } else { return (false); } } else { for (Widget wdg = child...
5
@Test public void test() { List<String> myOutput = new LinkedList<String>(); for (String s : input) { String[] parts = s.split("->"); NonTerminalSymbol key = new NonTerminalSymbol(parts[0]); List<List<Symbol>> productionDestination = new ArrayList<List<Symbol>>(); if (parts.length > 1) { for (Strin...
8
@Override @SuppressWarnings( "LocalVariableHidesMemberVariable" ) public void execute() throws MojoExecutionException, MojoFailureException { if( skip ) { getLog().info( "artifactinfo-maven-plugin execution is skipped" ); return; } String packa...
9
@Override public List<Move> generateMoves(Position from) { List<Move> result = new ArrayList<Move>(); Column column = from.getColumn(); Row row = from.getRow(); Position to; if (!row.isFirst()) { if (!column.isFirst()) { to = Position.get(column.previous(), row.previous()); result....
8
public boolean conflict(ValueIndexPair in) { return index1 == in.index1 || index1 == in.index2 || index2 == in.index1 || index2 == in.index2; }
3
@Override public void update(LinkedList<GameObject> object) { x += velX; y += velY; if (falling || jumping) { velY += gravity; if (velY > MAX_SPEED) { velY = MAX_SPEED; } } collision(object); }
3
private static Move BackwardRightCaptureForBlack(int r, int c, Board board){ Move backwardRightCapture = null; if(r<Board.rows-2 && c>=2 && ( board.cell[r+1][c-1].equals(CellEntry.white) || board.cell[r+1][c-1].equals(CellEntry.whiteKing) ...
5
@Override public void mousePressed( MouseEvent e ) { for( MouseListener listener : listeners( MouseListener.class )){ listener.mousePressed( e ); } }
1
public void run() { Map<String, Term> solution; Variable X = new Variable("X"); // -------------------------------------------------- Query q2 = new Query("child_of", new Term[] { new Atom("joe"), new Atom("ralf") }); System.err.println("child_of(joe,ralf) is " + (q2.hasSolution() ? "provable" : "not prova...
5
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!super.okMessage(myHost,msg)) return false; if(!(affected instanceof MOB)) return true; if((msg.amISource((MOB)affected)) &&((msg.targetMinor()==CMMsg.TYP_LOOK)||(msg.targetMinor()==CMMsg.TYP_EXAMINE)) &&(msg.target()...
7
private int decodeWhiteCodeWord() { int current; int entry; int bits; int isT; int twoBits; int code = -1; int runLength = 0; boolean isWhite = true; while (isWhite) { current = nextNBits(10); entry = white[current]; // Get the 3 fields from the entry isT = entry & 0x0001; bits = (ent...
5
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final GetFields_Result other = (GetFields_Result) obj; if (!Objects.deepEquals(this.projectIds, other.projectId...
5
@Override public boolean equals(Object o) { if (!(o instanceof FieldID)) { return false; } FieldID id = (FieldID) o; return name.equals(id.name) && owner.equals(id.owner) && desc.equals(id.desc); }
3
public void setBrewButtonStatus(int status) { this.brewButtonStatus = status; }
0
public String toString() { return (this.parent == null ? "" : (this.parent.toString() + " ")) + this.name; }
1
@Override public Object getValueAt(int indiceLinha, int indiceColuna) { //Verifica o índice da linha e obtém o valor através da posição na lista RegistroNaoConformidadeApontado registroNaoConformidadeApontado = linhas.get(indiceLinha); //Verifica o índice da coluna e obtém o valor ...
9
private void startTimer() { if (timerMode_ == TimerMode.SINGLE) { stopTimer(); } if (timer_ == null) { try { timer_ = new Timer(); int delay = getSetting(Delay).getValue().getInt(); if (timerMode_ == TimerMode.SINGLE) { timer_.schedule(new MyTask(), delay); } else { timer_.sched...
4
public void calcCourseResult() { setNumofTotalStudent(0); setNumofSecondGradeStudent(0); setNumofThirdGradeStudent(0); setNumofFourthGradeStudent(0); setNumofMainMajorStudent(0); setNumofMultiMajorStudent(0); setNumofPartMajorStudent(0); setNumofOtherStudent(0); int secondGrade = 0; int thirdGrad...
9
public static void openURL(String url) { String os = System.getProperty("os.name").toLowerCase(); Runtime rt = Runtime.getRuntime(); try { if (os.indexOf("win") >= 0) { rt.exec("rundll32 url.dll,FileProtocolHandler " + url); } else if (os.indexOf("mac") >= 0) { rt.exec("open " + url); } else if...
7
protected boolean validateParameters(ParameterBlock args, StringBuffer msg) { // The number of parameters supplied. int argNumParams = args.getNumParameters(); if(argNumParams == 0) { // set width to default args.add(paramDefaults...
9
public void compExecTime() { double newExeTime; double newCost; dEval = 0; dTime = 0; dCost = 0; for (int i = 0; i < iClass; i++) { newExeTime = 0; // System.out.print("Cost[" + i + "]"); for (int j = 0; j < iSite; j++) { if (dmAlloc[i][j] != -1) { if (dmAlloc[i][j] < 1) { newExeTime...
8
private static Task getTask(String id) { Task retVal = null; try { XStream xstream = new XStream(new DomDriver()); File remFile = new File((String) Server.prop.get("taskFilePath")); Task[] allTasks = (Task[]) xstream.fromXML(remFile); for (Task task : allTasks) { if (task.getId().equals(id)) { ...
3
public List<MediaUrlModel> getUrlList() { List<MediaUrlModel> mediaUrlModelList = new ArrayList<MediaUrlModel>(); Statement stmt; ResultSet rs; try { stmt = con.createStatement(); String query = "SELECT * FROM " + TABLE_NAME + ";"; rs = stmt.executeQuery(query); while (rs.next()) { MediaUrlMo...
2
public static void main( String[] args ) throws Exception { System.err.println(urlEncode( "http://it.bestshopping.com/prezzi/Rome.sku=9780751339031|.html" )); }
0