text
stringlengths
14
410k
label
int32
0
9
public void run() { try { take = player.pass(bowl,bowlid,round,canPick,mustTake); } catch (Exception e) { e.printStackTrace(); exception = e; } }
1
public void cargar() { try { String workingDir = System.getProperty("user.dir"); File dex = new File(workingDir+"/pokeDexNac.txt"); BufferedReader pokeDex = new BufferedReader(new FileReader(dex)); File stats = new File(workingDir+"/pokeSt...
5
public Object getValueAt(int row, int column) { if (row >= listData.size()) throw new IndexOutOfBoundsException("Table row "+row+" is not valid"); AccountTransaction r = listData.get(row); Object value; double amount; switch (column) { ...
9
private void handleUpdate() { if (pref instanceof PreferenceBoolean) { PreferenceBoolean prefBoolean = (PreferenceBoolean) pref; prefBoolean.setTmp(checkbox.isSelected()); checkbox.setSelected(prefBoolean.tmp); } }
1
public boolean isInitialized() { return this.initialized; }
0
void run(){ Scanner sc = new Scanner(System.in); int[] d = {0, 20, 19, 20, 19, 20, 19, 20, 19, 20, 19}; int T = sc.nextInt(); while(T--!=0){ int Y = sc.nextInt(), M = sc.nextInt(), D = sc.nextInt(); int res = 0; while(!(Y==1000&&M==1&&D==1)){ if(Y%3==0&&D==20 || Y%3!=0&&D==d[M]){ M++; D=1; ...
9
private BufferedReader createCatReader(File archivoCat) throws IOException { InputStream inputStream = new FileInputStream(archivoCat); if (archivoCat.getName().toLowerCase().endsWith(".gz")){ inputStream = new GZIPInputStream(inputStream); } return new BufferedReader(new InputStreamReader(inputStream, "ISO-...
1
private void processMoveResult(String result, CardMove move) { if (result.isEmpty()) { game.getHistory().push(move); } else if (!result.equals("ONTO_SELF")) { storeMessage(new RenderMessage(result, true)); } }
2
Info(BEDictionary dict) throws MetaInfoException, InvalidBEncodingException, UnsupportedEncodingException, NullHashException { mDictionary = dict; // ----- Required Keys ----------------------------------------------- if (mDictionary.contains(KEY_PIECE_LENGTH)) mPieceLength = mDictionary.getInt(KEY_PIECE_LENG...
6
public boolean isUnderstood(Event event) { int commandType = event.getCommandType(); int minExpectedArgCount = minExpectedArgByteCount(commandType); int maxExpectedArgCount = maxExpectedArgByteCount(commandType); if (minExpectedArgCount == maxExpectedArgCount) { ...
7
public byte getCloneLimit() { if (isHokage() && clonelimit < 69) { this.clonelimit = (byte) 69; } else if (isJounin() && clonelimit < 25) { this.clonelimit = (byte) 25; } else if (isGenin() && clonelimit < 15) { this.clonelimit = (byte) 15; } r...
6
private void handleSetupDevice(SetupDeviceMessage originalMessage, AcknowledgmentMessage message) { switch (originalMessage.getSetupDeviceMessageType()) { case CONNECT_DEVICE: handleConnectDevice(originalMessage, message); break; case SET_IMAGE_QUALITY: case SET_POLLING_RATE: // do nothing? break...
3
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!(affected instanceof MOB)) return super.okMessage(myHost,msg); final MOB mob=(MOB)affected; if((msg.amITarget(mob)) &&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS)) &&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL) &...
9
private void netTest() throws InterruptedException{ URL netTest = null; try{ netTest = new URL("http://themoneyconverter.com"); } catch(MalformedURLException e){ System.out.println(e+"test");} try { InputStream xml = netTest.openStream(); } ...
2
protected int deltaDBtoDeltaInfIndex(int curDB, int dDB) { int dII; if (curDB <= 0) { if (dDB <= 0) { // NEG NEG // no penalty dII = 0; } else { // NEG POS // penalty if dDB is big enough ...
5
private void parseArgs(ParseToken token, String[] args) throws CouldNotParseException { if (args.length > 2) { throw new CouldNotParseException(); } else if (args.length == 1) { String arg = args[0].trim(); if (Character.isLowerCase(arg.charAt(0)) ...
9
public FixtureDef[] build() { FixtureDef[] fixtures = new FixtureDef[shapes.size()]; Vector c1 = new Vector(allVertices.get(0)); Vector c2 = new Vector(c1); for (Vector v : allVertices) { c1.x = Math.min(v.x, c1.x); c1.y = Math.min(v.y, c1.y); c2.x = Math.max(v.x, c2.x); c2.y = Math.max(v.y, c...
6
public long getLong(String key) throws JSONException { Object object = this.get(key); try { return object instanceof Number ? ((Number) object).longValue() : Long.parseLong((String) object); } catch (Exception e) { throw new JSONException("JSONObject["...
2
public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; super.paintComponent(g2d); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ListIterator<Forme> it = model.getAllFormes().listIterator(); // Parcours de la liste pour redessiner toutes les form...
7
@Override public void perform(CommandSender sender, String[] args) { List<String> GymTypes = instance.getConfig().getStringList("GymTypes"); ChatColor statusColour; if (args.length == 1) { for (String i : GymTypes) { if (args[0].equalsIgnoreCase(i)) { boolean gymStatus = instance.getConfig(...
5
@Override public int move() { int rockMoves = 0,rockWins = 0; int paperMoves = 0, paperWins = 0; int scissorMoves = 0, scissorWins = 0; for(int i = 0;i<moves.size();i++){ if(moves.get(i)==RPSPlayer.ROCK){ rockMoves++; if(results.get(i)){ ...
6
private static List<AttackTransferMove> getNecessarySupportMoves(BotState state, Region neededHelpRegion, int missingArmies, int minimumUsefulArmies) { List<AttackTransferMove> out = new ArrayList<>(); List<Region> ownedNeighbors = new ArrayList<>(); ownedNeighbors.addAll(neededHelpRegion.getOwnedNeighbors(sta...
6
private void removeMarkedAlignements(boolean[][] marked) { for (int i = 0; i < marked.length; i++) { for (int j = 0; j < marked[i].length; j++) { if (marked[i][j]) { game.flush(i, j); marked[i][j] = false; } } } }
3
private boolean setIsOK(byte[] set) { // byte starting[] = new byte[row.length]; // System.out.println("Looking at set " + java.util.Arrays.toString(set)); for (int i=0; i < set.length - 1; i++) { for (int j=i + 1; j < set.length; j++) { // System.out.println("Comparing set[" + i + "]...
5
public static void main(String[] args) { /* * Enter your code here. Read input from STDIN. Print output to STDOUT. * Your class should be named Solution. */ Scanner in = new Scanner(System.in); int res; String n = in.nextLine(); String[] n_split = n.split(" "); int _a_siz...
1
public static void main(String[] args) { setLookAndFeel(); boolean firstLaunch = ConfigManager.getInstance().getProperties().getProperty("virgin").equals("true"); boolean isLauncherUpdateRequired = launcherUpdateRequired(); System.out.println("First launch: " + firstLaunch + " ...
2
public boolean execute() { updateGraph(); if (!trace) rp.reset(g.size()); else nextnode = 0; final int nn = (n < 0 ? Network.size() : n); if (method.equals("stats")) { IncrementalStats stats = new IncrementalStats(); for (int i = 0; i < nn; ++i) stats.add(nextDegree()); System.out.println(name + ": " ...
8
public static void display(tile[][] input) { System.out.println(" 1 2 3 4 5 6 7 8 9 10"); for (int y = 0; y < 10; y++) { System.out.print(y + 1 + " " + ((y != 9) ? " " : "")); for (int x = 0; x < 10; x++) { if (board[x][y].getFlag()) { System.out.print("F "); } else if (board[x][y].getCovered()...
5
@Override protected void onPart(String channel, String sender, String login, String hostname) { super.onPart(channel, sender, login, hostname); int targettab = 0; int i = 0; while(true) { try { if(Main.gui.tabs.get(i).title.equalsIgnoreCase(channel) || Main.gui.tabs.get(i).title.substring(1).equal...
5
public void vote(Client client, String answer) { synchronized (votes) { if (!votes.containsKey(client.getName()) && answers.contains(answer)) { if (closed) { String popup = Popup .create("Umfrage", String.format("Umfrage #%s - Problem", id), "Du hast dir f�r die Beantwortung ...
3
@Override public String toScript() { if (script != null) return script; StringBuilder sb = new StringBuilder(1000); // Build all hyperplanes x*(p-q) >= 0 sb.append("my $hyper = new Matrix<Rational>(["); boolean first = true; for (Point point : this.points) { // Corrects some problems ...
7
private void check(Object probe, Object current) { List<Object> nl = graph.get(current); if (nl == null) { return; } for (Object o : nl) { if (o == probe) { throw new ComponentException("Circular reference to: " + probe); } else { check(probe, o); } } }
3
private void button_clean_red_listMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button_clean_red_listMousePressed if(frame_index_selected!=-1) { if(current_frame==null) { Element new_frame = hitboxes_doc.createElement("Frame"); new_frame.setAttribute("num...
8
public void update(){ if(core.SubTerra.getLevel()==null) return; l = core.SubTerra.getLevel(); setReletiveTo(l.p); for(Entity e: l.ents){ e.update(); } for(int xx=0;xx<Level.SIZE;xx++){ for(int yy=0;yy<Level.SIZE;yy++){ if(l.worldDa...
5
@Test public void preAuthCompletionGreaterAmount() throws BeanstreamApiException { CardPaymentRequest paymentRequest = getCreditCardPaymentRequest( getRandomOrderId("GAS"), "120.00"); PaymentResponse response = beanstream.payments() .preAuth(paymentRequest); try { if (response.isApproved()) { Paym...
3
@Override public void endElement(String s, String s1, String element) throws SAXException { // if end of book element add to list if (element.equals("book")) { bookL.add(bookTmp); } if (element.equalsIgnoreCase("isbn")) { bookTmp.setIsbn(tmpValue); } ...
7
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String urlPath = request.getParameter("action"); String reqHelperClassName = (String) props.get(urlPath); if (reqHelperClassName != null) { try {...
3
protected synchronized int getRarestPiece(Peer peer) { int[] availability = new int[this.client_info.getNumber_of_pieces()]; //compute availability for (Peer aPeer:connectedPeers) { availability = RUBTToolKit.recomputeAvailability(availability, aPeer.getBitfield()); } ArrayList<Integer> rarestPieces = n...
8
private classifiedData classify(String imageFilePath){ classifiedData DataIn = new classifiedData(); try { // System.out.println("the file output: " + imageFilePath); //load the image as a buffered image (works multiple features from a single image) BufferedImage img = ImageIO.read(new ...
2
public void run() { Selector selector = DatagramAcceptorDelegate.this.selector; for (;;) { try { int nKeys = selector.select(); registerNew(); if (nKeys > 0) { processReadySessions(selector.sele...
9
private void ajouterSeance() { System.out.println("Liste de vos modules :"); Professeur professeur = (Professeur) this.modeleApplication.getCurrent(); ArrayList<Module> modules = this.universite.getModulesParProfesseur(professeur); if (modules.isEmpty()) { System.out...
5
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception { HashMap<String, HashMap<String, Integer>> map = new HashMap<String, HashMap<String,Integer>>(); BufferedReader reader = filePath.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamReader( ...
6
public SyncDownloadView(final JPanel panel) { // Build the left side table final SyncDownloadTableModel model = new SyncDownloadTableModel(); final JTable table = new JTable(model); final JScrollPane left = new JScrollPane(table); // Build the right side info final JPanel right = new JPanel(); right.setB...
2
public static void main(String[] args) { //Creates the return value for the highest domino in the series. String highestDomino = null; //Creates the placeholder for the weight of the highest domino. int highestValue = 0; //Creates the return value for the lowest domino in the series. String lowestD...
5
public boolean isBlack(BufferedImage image, int posX, int posY) { if(erase) { if(flat) { if(image.getRGB(posX, posY) == Color.RED.getRGB()) return true; } else { if(image.getRGB(posX, posY) == Color.WHITE.getRGB()) return true; } } else { if(image.getRGB(posX, posY) == Color.BLACK.getR...
5
public static InputStream inputStreamFrom(final Object object) throws IOException { if (object instanceof InputStream) return (InputStream)object; if (object instanceof File) return IO._inputStreamFrom_((File)object); if (object instanceof ByteArraySection) return IO._inputStreamFrom_((ByteArraySection)object); ...
5
private String scanYamlDirectiveValue () { while (peek() == ' ') forward(); String major = scanYamlDirectiveNumber(); if (peek() != '.') throw new TokenizerException("While scanning for a directive value, expected a digit or '.' but found: " + ch(peek())); forward(); String minor = scanYamlDirectiveNumb...
3
public static Database getAccessionType(String accession){ if(accession.contains("UNIMOD")){ return Database.UNIMOD; } else if(!accession.contains("UNIMOD") && accession.contains("MOD")){ return Database.PSIMOD; } else if(!accession.contains("MOD") && NumberUtils.isNumber...
5
@Override public void start(Stage primaryStage) throws MalformedURLException { File f = new File("img/1.png"); System.out.println(f.getAbsolutePath()); Image image = new Image(f.toURI().toURL().toString()); // // simple displays ImageView the image as is BackgroundRemoval br = new BackgroundRemovalImpl(...
4
public static DPCSchema loadSchemaResource(String aResourcePath) throws IOException { ArrayList<DPCColumnSchema> tResultColumnSchemaList = new ArrayList<DPCColumnSchema>(); InputStream tResourceInputStream = null; BufferedReader tResourceBufferedReader = null; tResourceInputStream = mInstance.getClass().getClas...
8
public String setName(final String name) { if (name == null) throw new IllegalArgumentException("name must not be null"); if (name.length() == 0) throw new IllegalArgumentException("name must not be an empty string"); this.name = name; return name; }
2
public String loadMedico() { Map parametros = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); String idMed = parametros.get("idMedico").toString(); Integer id = Integer.parseInt(idMed); int i; for (i = 0; i < medicosBean.size(); i++) { ...
2
public void visit_fcmpl(final Instruction inst) { stackHeight -= 2; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 1; }
1
boolean ifBlockCombination(ArrayList<String> blockSet){ boolean ifNoCombine = false; //這邊檢查同block name的結合 String name = new String(blockSet.get(0)); for(String a : blockSet){ if(name.equals(a) == false){ ifNoCombine = true; break; } } if(ifNoCombine == false) return true; //這邊檢查不同block...
7
public void setCtrMoaTipo(String ctrMoaTipo) { this.ctrMoaTipo = ctrMoaTipo; }
0
public static String toString(JSONObject o) throws JSONException { StringBuffer sb = new StringBuffer(); sb.append(escape(o.getString("name"))); sb.append("="); sb.append(escape(o.getString("value"))); if (o.has("expires")) { sb.append(";expires="); sb.ap...
4
private Message decideErr(Message oMsg){ Message sMsg = new Message(); sMsg.setRecipient(oMsg.getSender()); sMsg.setSender(oMsg.getSender()); for(int i = 0; i < oMsg.getHeader().size(); i++) sMsg.addHeader(oMsg.getHeader().get(i)); if (error == null) { } else switch (error) { case "syntax": ...
6
public void run() { if (arena.isClosed()) { sender.sendMessage(OITG.prefix + ChatColor.RED + "That arena is closed."); return; } if (arena.isIngame()) { sender.sendMessage(OITG.prefix + ChatColor.RED + "A round is already in progress in that arena."); ...
6
public void setFind(int i, String s) { this.finds.set(i, s); }
0
private void threadRunner() { try { while(true) { Runnable runnable = _queue.take(); //System.err.println(Thread.currentThread().getName() //+ ": Executing event."); try { runnable.run(); } catch(Exception exception) { exception.printStackTrace(); } } } ca...
3
@Test public void testConnected() { // initial : 0 1 2 3 4 // union(0, 1) : 1 1 2 3 4 // union(2, 3) : 1 1 3 3 4 // union(3, 1) : 1 1 3 1 4 // 1 4 // 0 3 // 2 QuickUnion spy = Mockito.spy(new QuickUnion(5)); when(spy.getRoot(1)).thenReturn(1); when(spy.getRoot(0)).thenReturn(1);...
0
private RoomState readRoom( InputStream in, int squaresH, int squaresV ) throws IOException { RoomState room = new RoomState(); room.setOxygen( readInt(in) ); for (int h=0; h < squaresH; h++) { for (int v=0; v < squaresV; v++) { // Dunno what the third int is. The others are for fire. // Values in the...
2
Stats(Collection<VoieEnum> voies) { voituresEnAttentes = new HashMap<VoieEnum, AtomicInteger>(); attenteParVoie = new HashMap<VoieEnum, AtomicLong>(); voituresEngageesParVoies = new HashMap<VoieEnum, AtomicInteger>(); voituresEntrees = new HashMap<VoieEnum, AtomicInteger>(); voituresSorties = new HashMap<Voie...
1
@Override public void unInvoke() { Item I=null; if(affected instanceof Item) I=(Item)affected; super.unInvoke(); if((canBeUninvoked())&&(I!=null)&&(I.owner() instanceof MOB) &&(!I.amWearingAt(Wearable.IN_INVENTORY))) { final MOB mob=(MOB)I.owner(); if((!mob.amDead()) &&(CMLib.flags().isInTheGa...
7
public DefaultLinkFinder(final String content) { if (content == null || "".equals(content.trim())) { throw new IllegalArgumentException("content cannot be null"); } this.content = content; }
2
private void firePeerDisconnected() { for (PeerActivityListener listener : this.listeners) { listener.handlePeerDisconnected(this); } }
1
@After public void teardown() { try{ if(connection!=null && !connection.isClosed()) { drop.executeUpdate("Drop table Client"); connection.close(); connection = null; }} catch(Exception ex) { ex.printStackTrace(); } }
3
public RichGameMap(){ startPoint=new StartPoint(); landList.add(startPoint); bareLands=new BareLand[58]; mines=new Mine[6]; int k=0; for(int i=1;i<64;i++) { if(i==14) { hospital=new Hospital(i); landList.add(hospital); ...
7
public void printMarket(){ if (deck == null){ return; } if (deck.getAskDeck() != null){ System.out.println("ASK:"); for(int i = 0; i < deck.getAskDeck().size(); i++){ System.out.print(deck.getAskDeck().get(i).getPrice()); System.out.print(deck.getAskDeck().get(i).isBid()); System.out.p...
7
public static void main(String[] args) throws ParseException { // Parse available options Options opts = createOptions(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(opts, args); // if help needed if (cmd.hasOption("h") || args.length==0) { HelpFormatter help = new HelpFo...
4
public static void main(String[] args) throws Throwable{ Escaner sc = new Escaner(); StringBuilder sb = new StringBuilder(); for (int c = 0, C = sc.nextInt(); c < C; c++) { int D = sc.nextInt(); int[][] shuffle = new int[D][52]; for (int i = 0; i < shuffle.length; i++) for (int j = 0; j < shuffle[i]...
9
@Override public void updatePlayers(List<Player> players) { allPlayers.removeAllElements(); for (Player player : players) { allPlayers.addElement(player.getName()); } checkMinimumPlayers(); }
1
@Override public void paint(Graphics2D g, JXMapViewer map, int w, int h) { g = (Graphics2D) g.create(); // convert from viewport to world bitmap Rectangle rect = map.getViewportBounds(); g.translate(-rect.x, -rect.y); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON...
6
@Override public double timeToReach(Node startNode, Node endNode, Message msg) { // TODO Auto-generated method stub double dist = startNode.getPosition().distanceTo(endNode.getPosition()); /* Link rate | time arrive mSec | dist * ---------------------------------------------------- * 11 | 2542 | 399 ...
7
private static List<String> getEtapeIntermediare(char[] source, char[] target, int[][] positionMinimum) { List<Operation> operations = getOperations(source, target, positionMinimum); List<String> etapes = new ArrayList<>(); char[] temp = new char[Math.max(source.length, target.length)]; ...
8
@EventHandler public void IronGolemWaterBreathing(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.getIronGolemConfig().getDouble("I...
6
public PhylogenyData copy() { final NodeData new_pnd = new NodeData(); if ( isHasSequence() ) { new_pnd.setSequence( ( Sequence ) getSequence().copy() ); } if ( isHasEvent() ) { new_pnd.setEvent( ( Event ) getEvent().copy() ); } if ( isHasNodeIdent...
9
private static String getCause(int statusCode){ String cause = null; switch(statusCode){ case NOT_MODIFIED: break; case BAD_REQUEST: cause = "The request was invalid. An accompanying error message will explain why. This is the status code will be ...
9
public static Result preemptiveHighestPriorityFirst(FutureStack future, int duration) { //Implemented with RR String result = ""; int time; ArrayList<Process> active; ArrayList<Process> completed = new ArrayList<Process>(); //Set up priority queues ArrayList<ArrayList<Process>> priorityQueues = new...
9
void imeOn() { try { Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_HIRAGANA); robot.keyPress(KeyEvent.VK_HIRAGANA); } catch (AWTException e) { /* ignore exception */ } }
1
protected void listAllVoices() { System.out.println("--------------------------------------------------"); System.out.println("All voices available:"); VoiceManager voiceManager = VoiceManager.getInstance(); Voice[] voices = voiceManager.getVoices(); for (Voice voice : voices) {...
1
public void saveProgram() { LogoDocument program = getProgram(); File file = program.getFile(); if (file == null){ file = askForFileName(); program.setFile(file); } if (file != null){ try { program.save(); } catch (IOException e) { e.printStackTrace(); } } }
3
@Test ( timeout = 2000 ) public void serverWriteToSocketClosedByClient () throws Exception { Socket[] sockets = connectToServer(); try ( Socket serverSocket = sockets[ 0 ]; Socket clientSocket = sockets[ 1 ] ) { clientSocket.close(); // wait for close to propag...
1
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
private void gerarTabela(List<Profile> lista, String tituloTabela, int linhaInicial) throws IOException, WriteException { WritableFont wf = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD); WritableCellFormat cf = new WritableCellFormat(wf); NumberFormat dp3 = new NumberFormat("####.###"); Writa...
9
public void exit() { _scanner.close(); try { UnicastRemoteObject.unexportObject(_instance, true); _remoteObj.logout(_username, ServerInterface.CLIENT); } catch(Exception ex) { if(connect()) { exit(); return; } System.out.println("Error on exit"); System.out.println(ex.getMessage()); } ...
2
@Override public boolean nextKeyValue() throws IOException, InterruptedException { if (key == null) { key = new LongWritable(); } key.set(pos); if (value == null) { value = new Text(); } value.clear(); final Text endline = new Text("\n"...
7
public boolean flowMayBeChanged() { return jump != null || jumpMayBeChanged(); }
1
public String generatePath() { // Our input for solving StartFinish startFinish = new StartFinish(); KeyTable<Vertex, String> table = new KeyTable<Vertex, String>(); prepareForSolving(table, startFinish); Vertex start = startFinish.getStart(); Vertex finish = startFinis...
9
public Ellipse2D getShape() { return new Ellipse2D.Double(x, y, XSIZE, YSIZE); }
0
public int w() { return _map == null || _map.length < 1?0:_map[0].length; }
2
public void log(Object message, int level) { Date date = new Date(); if (level <= this.level) { System.out.println(ConfigurationManager.portlet + ", " + date.toString() + " MSG: " + message); } }
1
public String getName() { return this.name == null ? "" : this.name; }
1
@Override public DataStructures getStructure() { return data; }
0
public static String rowToString(JSONArray ja) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < ja.length(); i += 1) { if (i > 0) { sb.append(','); } Object o = ja.opt(i); if (o != null) { String s = o.toString();...
5
public void AlteracaoDadosPessoais(Usuario user) throws SQLException { Connection conexao = null; PreparedStatement comando = null; try { conexao = BancoDadosUtil.getConnection(); comando = conexao.prepareStatement(SQL_ALTERACAO_DADOS_PESSOAIS); comando.setS...
6
public static void main(String[] args) { // TODO Auto-generated method stub Scanner cin = new Scanner(System.in); String input = cin.nextLine(); String[] al = input.split(" "); int i = 0; for(i = 0; i < al.length-1; i++,i++){ int first = Integer.parseInt(al[i]); int last = Integer.p...
3
public void initialize() throws Exception { if (m_baseExperiment == null) { throw new Exception("No base experiment specified!"); } m_experimentAborted = false; m_finishedCount = 0; m_failedCount = 0; m_RunNumber = getRunLower(); m_DatasetNumber = 0; m_PropertyNumber = 0; m_Cu...
7
public void cargarXml(){ //Se crea un SAXBuilder para poder parsear el archivo SAXBuilder builder = new SAXBuilder(); File xmlFile = new File( "config.xml" ); try { Document document = (Document)builder.build( xmlFile ); Element rootNode = document.getRoo...
7
private int calculateInternalHashCode(Cell[] currentBoard){ int maxLength = (currentBoard.length <= CELL_NUMBER_TO_CALCULATE_HASHCODE) ? currentBoard.length : CELL_NUMBER_TO_CALCULATE_HASHCODE; Cell[] limitedCurrentBoard = Arrays.copyOfRan...
1