text
stringlengths
14
410k
label
int32
0
9
Bishop(int t, boolean w, int x, int y){ super(t,w,x,y); dist = 7; int[][] ex = {{1, 1}, {-1, 1}, {-1, -1}, {1, -1}}; moves = ex; }
0
public String stringOfScanProduct() { StringBuilder products = new StringBuilder(); for (String s : scanProducts) { products.append(s); } return products.toString(); }
1
public double randomFunction(double x, double y){ switch(randomFunc){ case 0: random = Math.sin(Math.PI*nextNode.randomFunction(x,y)); break; case 1: random = Math.cos(Math.PI*nextNode.randomFunction(x,y)); ...
3
public static Mask buildEdgeEnhancementMask(int width, int height) { Mask mask = new Mask(width, height); double pixelAmount = width * height; for (int i = -mask.getWidth() / 2; i <= mask.getWidth() / 2; i++) { for (int j = -mask.getHeight() / 2; j <= mask.getHeight() / 2; j++) { mask.setPixel(i, j, -1); ...
2
private void searchWithFilter(IndexReader reader, Weight weight, final Filter filter, final Collector collector) throws IOException { assert filter != null; Scorer scorer = weight.scorer(reader, true, false); if (scorer == null) { return; } int docID = scorer.docID(); assert d...
8
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
@Override public Void doInBackground() { if (deriv == null || eqn == null || iterations == 0) { return null; } int counter = 0; double currentX = initialStart; double newX = 0; if (eqn.computeFor(currentX) == 0) { root = currentX; return null; } while (true) { newX = currentX ...
9
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public int print(LineNumberPanel lineNumPanel, Graphics g, PageFormat pf, int pageIndex) throws PrinterException { // TODO: Because of banded printing the OS and printer driver may actually call this method // two or more times for the same page, the first time is to help the printer determine extents. ...
7
public void processPackets() { if(left()) return; try { DataInputStream din = getInputStream(); if (din.available() >= 2) { short id = din.readShort(); Packet p = Packet.newPacket(id, this); if (p != null) p.handlePacket(); else kick("Invalid Packet"); } if (getSocket().is...
8
public void insert(Comparable item) { current = parent = grand = header; nullNode.element = item; while (current.element.compareTo(item) != 0) { great = grand; grand = parent; parent = current; current = item.compareTo(current.element) < 0 ? current.left : current.right; // Check if two red ...
6
private static int extractInt(int[] data, int startBit, int length) { if (data == null) { throw new IllegalArgumentException("data == null"); } if (startBit < 0) { throw new IllegalArgumentException("startBit < 0"); } if (length <= 0) { throw n...
9
@Override public int classDurationModifier(MOB myChar, Ability skill, int duration) { if(myChar==null) return duration; if((((skill.classificationCode()&Ability.ALL_DOMAINS)==Ability.DOMAIN_CRAFTINGSKILL) ||((skill.classificationCode()&Ability.ALL_DOMAINS)==Ability.DOMAIN_BUILDINGSKILL))...
9
static final int method473(byte i, int i_25_, LobbyWorld class110_sub1, int i_26_, boolean bool, boolean bool_27_, LobbyWorld class110_sub1_28_) { try { anInt5257++; int i_29_ = Class239_Sub8.compareLobbyWorlds(class110_sub1_28_, class110_sub1, bool, i_25_, (byte) -30); if ...
8
public static int getIndirectBufferByteOffset(Buffer buffer) { if (buffer == null) { return 0; } int i = buffer.position(); if (!(buffer instanceof ByteBuffer)) { if (buffer instanceof FloatBuffer) { return 4 * (((FloatBuffer) buffer).arra...
8
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { UserService userService = UserServiceFactory.getUserService(); User user = userService.getCurrentUser(); if(user != null) { UserModel usermod = DataStore.getUser(user.getUserId()); ...
2
private void parsePacket(byte[] data, InetAddress address, int port) { String message = new String(data).trim(); PacketTypes type = Packet.lookupPacket(message.substring(0, 2)); Packet packet = null; switch (type) { default: case INVALID: break; case L...
6
public void visit_dup2_x1(final Instruction inst) { stackHeight -= 3; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 5; }
1
public void inputDigits(String sval) { this.clear(); // clear all current digits Vector<Unsigned> vtmp = new Vector<Unsigned>(); // parse string for spaces Scanner scan = new Scanner(sval); while(scan.hasNext()) { try { int n = scan.nextInt(); if(n >= base_) { System....
5
private static int nfaMenu(EpsilonNFA nfa){ String menu = nfa.toString()+"\n\n"+ "1. Compute the Epsilon Closure\n"+ "2. Enter words\n"+ "3. Print out Alphabet\n"+ "4. Convert to DFA\n"+ "5. Print GRAIL format transitions\n"+ "6. Back\n"+alwaysMenu(); Scanner nfaScan = new Scanner(System.in...
8
private void doInit() { if (getConnections() == null) setConnections(new CopyOnWriteArrayList<ISocketServerConnection>()); serverStartListenerList = new EventListenerList(); serverStopListenerList = new EventListenerList(); clientConnectListenerList = new EventListenerList(); clientDisconnectListene...
1
protected void setBehaviorAsStateRule(Boolean state) { // set visible if ( stateRule.isVisible() != null ) { try { affectedWidget.setVisible( !( stateRule.isVisible() ^ state ) ); } catch(Exception e) { e.printStackTrace(); } } // enabled and value setting rules are only valid if not in...
9
final public void AnonymousFunction() throws ParseException {/*@bgen(jjtree) AnonymousFunction */ SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTANONYMOUSFUNCTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { jj_consume_token(FUN); Variable(); jj_consume_toke...
8
@SuppressWarnings("unchecked") public boolean execute(int columnIndex) { RowSorter<?> sorter = table.getRowSorter(); if(sorter instanceof DefaultRowSorter<?, ?>) { RowFilter<Object, Object> parentFilter = (RowFilter<Object, Object>) ((DefaultRowSorter<?, ?>) sorter).getRowFilter(); if(!(parentFilter instance...
9
public void cargarTabla(){ //borra toda la tabla primero for(int i=0;i<((DefaultTableModel)estrategyT.getModel()).getRowCount();){ ((DefaultTableModel)estrategyT.getModel()).removeRow(i); } //agrega lo que haya en el arraylist for(int i=0;i<contenedo...
7
public NewMultiArrayExpr(final Expr[] dimensions, final Type elementType, final Type type) { super(type); this.elementType = elementType; this.dimensions = dimensions; for (int i = 0; i < dimensions.length; i++) { dimensions[i].setParent(this); } }
1
private void fillInElementsLists(int projectID){ listOfElementsToApprove.clear(); listOfElementsApproved.clear(); if (projectID >=1){ try{ ResultSet elementsOnProjectListResultSet = null; Statement statement; statement = connection.crea...
5
public String getVoornaam() { return voornaam; }
0
public void addListener() { this.addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent e) { super.windowOpened(e); RandomHeader(); UpdateLookandFeel(); checkPatchState(); } }); infoButton.addActionListener(new ActionListener() { public void actionPerfo...
3
int unpack(Buffer opb){ int vendorlen=opb.read(32); if(vendorlen<0){ clear(); return (-1); } vendor=new byte[vendorlen+1]; opb.read(vendor, vendorlen); comments=opb.read(32); if(comments<0){ clear(); return (-1); } user_comments=new byte[comments+1][]; com...
5
public static String idlCreateCharacterSubstitutionTable() { { StringBuffer table = edu.isi.stella.javalib.Native.makeMutableString(256, '_'); { int code = Stella.NULL_INTEGER; int iter000 = (int) '0'; int upperBound000 = (int) '9'; boolean unboundedP000 = upperBound000 == Stella.NULL...
6
private boolean isCredentialMatch() { for (String credential : credentialsList()) { if (basicAuthCredentials.equals(credential)) { return true; } } return false; }
2
public void newMixer( Mixer m ) { if( myMixer != m ) { try { if( clip != null ) clip.close(); else if( sourceDataLine != null ) sourceDataLine.close(); } catch( SecurityException e...
8
private void readChunkUnzip(Inflater inflater, byte[] buffer, int offset, int length) throws IOException { assert(buffer != this.buffer); try { do { int read = inflater.inflate(buffer, offset, length); if(read <= 0) { if(inflater.finished()...
5
@Override protected void mutate(Individual i) { Expression ex = (Expression)i; Random r = new Random(); int depth =r.nextInt(ex.depth()>0?ex.depth():1); while(!ex.isLeaf()&&depth>0){ ex= ((Operator)ex).expressions[r.nextInt(ex.getArity())]; depth--; } if (!ex.isLeaf()){ Operator op = (Operator) ex...
7
public void loadMathStyle(Reader re) throws IOException { StreamTokenizer tok = new StreamTokenizer(re); tok.resetSyntax(); tok.whitespaceChars(0, 32); tok.wordChars(33, 255); tok.ordinaryChars('(', ')'); // commentChar('/'); tok.commentChar(';');// 59 is ';' ...
7
public void PESQUISADepartamentos() { DepartamentoDAO departamento = new DepartamentoDAO(); try { tblDepartamentos.setModel(DbUtils.resultSetToTableModel(departamento.PesquisaNaTabelaDepartamentos(txtPesquisaDepartamento.getText()))); } catch (SQLException ex) { } }
1
private void collision (LinkedList<GameObject> object){ for (int i=0;i< obbjectHandler.object.size();i++){ GameObject tempObject = obbjectHandler.object.get(i); if(tempObject.getId() == ObjectId.Test){ if(getBounds().intersects(tempObject.getBounds())){ y = tempObject.getY()-height; velocityY = 0;...
3
@Override public void handleClient(ObjectInputStream input, ObjectOutputStream output) { try { while(true){ Object obj = input.readObject(); if (obj instanceof String) { if ((((String) obj)).equalsIgnoreCase("exit")) { break; }else{ System.out...
8
public void testCycListVisitor() { System.out.println("\n*** testCycListVisitor ***"); CycListParser.verbosity = 0; try { CycList cycList2000 = getCyc().makeCycList("(1 . 24)"); CycList cycList2001 = getCyc().makeCycList("(1 . 23)"); assertFalse(cycList2001.equals(cycList2000)); C...
1
private void dealtDamage(int getX, int getY, int getWidth, int getLength, int getTime, int getDelay, double getDamage,int applyForce) { if (character.equals("P1")) { if (movementDirection) { getWorld().addObject(new P1AttackArea(x + getX, y + getY,getWidth,get...
4
private void destroyBricks() throws IOException { int line, col; BrickExplosion explosion; for(int i = 0; i < 8; i++) { if(blaster[i][2] == 1) { line = blaster[i][1] / 40; col = blaster[i][0] / 40; //Retirer la...
3
public void removeByAppointment(Appointment appt, int dayOffset) { this.removeBySpan(DateUtil.transposeToDay(appt.startTime, this.startOfDay + dayOffset*DateUtil.DAY_LENGTH), DateUtil.transposeToDay(appt.endTime, this.startOfDay + dayOffset*DateUtil.DAY_LENGTH)); }
0
private void ConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConnectActionPerformed UserDAO cdao = new UserDAO(); clients=cdao.findUserByLogin(login.getText()); boolean there = cdao.Authentification(login.getText(), pwd.getText()); if(there) ...
3
public Token getTokenList(Segment text, int initialTokenType, int startOffset) { resetTokenList(); this.offsetShift = -text.offset + startOffset; prevState = YYINITIAL; // Start off in the proper state. int state = YYINITIAL; switch (initialTokenType) { case INTERNAL_INTAG_START: state = INTAG_STAR...
6
public Application getApplication() { if (this.application == null) { Class clazz = null; try { clazz = this.getClass().getClassLoader().loadClass ("org.apache.shale.test.mock.MockApplication12"); this.application = (MockApplication) cla...
8
public DecreaseThread(SampleCalc sample) { this.SampleCalc = sample; }
0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Coordinate that = (Coordinate) o; if (x != that.x) return false; if (y != that.y) return false; return true; }
5
public void setDocument(Document doc, long start) { try { if(doc != null) { this.textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML); String contents = stringify(doc); this.textArea.setText(contents); setStats(start); } } catch(Exception e) { setContents(e.getMessage() + "...
2
public boolean isWonderBow(ItemStack item) { if (item != null && item.getType() == Material.BOW) { ItemMeta meta = item.getItemMeta(); if (meta != null && meta.getDisplayName().equals(this.metaBow.getDisplayName())) { List<String> lore = meta.getLore(); if...
5
@Command(command = "deletewarp", arguments = {"warp name"}, description = "Deletes a given warp", permissions = "delete.self") public static boolean deleteWarp(CommandSender sender, String warpName) throws EssentialsCommandException { // try to get that warp // get a resultset of all our warps ArrayLi...
5
public void keyPressed(int key) { if(key == KeyEvent.VK_A || key == KeyEvent.VK_LEFT){ player.setLeft(true); } if(key == KeyEvent.VK_D || key == KeyEvent.VK_RIGHT){ player.setRight(true); } if(key == KeyEvent.VK_W || key == KeyEvent.VK_SPACE || key == KeyE...
9
public void dispose() { for (Animation ani : animations) { ani.stop(); } }
1
public CheckResultMessage check14(int day) { return checkReport.check14(day); }
0
@Override public String execute() { if (databaseContext.table != null) { return Integer.toString(databaseContext.table.rollback()); } else { return "no table"; } }
1
public static void print(TreeNode root) { if (null != root) { System.out.println(root.val + "[" + (null == root.left ? "null" : root.left.val) + "," + (null == root.right ? "null" : root.right.val) + "]"); print(root.left); print(root.right); } }
3
public void visitVarInsn(final int opcode, final int var) { Type type; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: type = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: type = Type.DOUBLE_TYPE; break; case Opcodes.FLOAD: case Opcodes.FSTORE: type = Type.F...
8
public boolean contains( long testID ) { for ( int i = 0; i < numIDs; i++ ) { if ( statusIDs[i] == testID ) return true; } return false; }
2
public static void main(String[] args) { try { //lezen JAXBContext jc = JAXBContext.newInstance(World.class); World ls = (World) jc.createUnmarshaller().unmarshal(World.class.getResource("Wereld.xml")); for(Person p : ls.getPersons()){ ...
4
public File findCard(Card c) { String name = c.getFileName(); String set = c.getSet(); if(set == null) { set = map.get(name); if(set == null) return null; } File f = new File(new File(CubeMaker.cacheDir, set), name + ".jpg"); if(f.exists()) { return f; } else { return null; } }
3
private void setUserDirs() { homeDirs = new HashMap<>(); List<String> names = null; String base = new File("").getAbsolutePath(); try { names = UserStatementMaker.getUserNameList(); } catch (SQLException e) { Logger.logError(e); e.printStackTrace(); } names.forEach(n -> { String sandbox = base...
3
@Override public void log(String str){ System.out.println("MyClass logging::"+str); }
0
public void updateScrollBars() { if(tm.getTiles().size()>0) { verticalScrollbar.update(); if(verticalScrollbar.isSelected() && !tm.isTileSelected() || verticalScrollbar.isKeyboardInput()) { //System.out.println("vert bar selected: "+verticalScrollbar.isSelected()+", "+verticalScrollbar.isKeyVert()); ...
7
public boolean saveBooking() { boolean commitSuccess = false; boolean doubleBooking = false; bookingList = DBFacade.getBookingsFromDB(); notSavedBookings = new ArrayList<>(); ArrayList<Booking> bookingsForSaving = DBFacade.getBookingsFromUOF(); ArrayList<Booking> bookings...
4
public static void main (String args[]) throws Exception { String host ="omnimail1.omnifax.xerox.com"; String username ="edi"; String password ="ediedi"; // Get session Session session = Session.getInstance( new Properties(), null); // Get the store Store store = session.getStore("imap"); store...
9
public void executeLdrt(InstructionARM inst, boolean exec) { int rn = inst.getRnField(); int rd = inst.getRdField(); int offset = getAddrMode2(inst); int vaddr, paddr, rot, value; if (!exec) { printDisasm(inst, String.format("ldrt%s", inst.getCond...
9
private static void messageParser() throws IOException{ //Ok, lets use the potentially broken thing ot test the broken thing //right? MessageParser MP = new MessageParser(); ByteArrayOutputStream os=new ByteArrayOutputStream(); ByteArrayInputStream bis; byte [] info = testGen(20); byte [] id = testGen...
9
@AfterGroups("Insertion") @Test(groups = "AVL Tree") public void testAVLTreeSearch() throws KeyNotFoundException { Integer count; Reporter.log("[ ** 2-3 Tree Search ** ]\n"); try { timeKeeper = System.currentTimeMillis(); for (Integer i = 0; i < seed; i++) { avlTree.search(i); } Reporter.log(...
5
@Provides @Named("unmarshalContext") public JAXBContext getUnmarshalContext() throws JAXBException { return JAXBContext.newInstance(clazzezToBeBound); }
0
private void tryToFall(World par1World, int par2, int par3, int par4) { int i = par2; int j = par3; int k = par4; if (canFallBelow(par1World, i, j - 1, k) && j >= 0) { byte byte0 = 32; if (fallInstantly || !par1World.checkChunksExist(par2 - byte0, pa...
8
public void replaceSpace(char[] s, int length) { if (s == null || length == 0) { return; } int spaceCount = 0; for (int i = 0; i < length; i++) { if (s[i] == ' ') spaceCount++; } int j = spaceCount; for (int i = length - 1; i >= 0; i--) { if (s[i] == ' ') { j--; s[i + j * 2] = '%'; ...
7
public void advance(Territory territ, boolean all) { if (territ == fromTerrit) { if (toTerrit.units > 1) { int toPlace = getTroopTransferCount(all, toTerrit.units - 1); toTerrit.addUnits(-toPlace); fromTerrit.addUnits(toPlace); } if (all) endAdvance(); } else if (territ == toTerrit) { ...
6
public EntityUniqueIdentifier(Class<?> clazz, String uuid) { if (clazz == null) { throw new IllegalArgumentException("clazz musnt be null"); } if (uuid == null) { throw new IllegalArgumentException("uuid musnt be null"); } this.clazz = clazz; th...
3
@Override public Object getValueAt(int row, int col) { Order o = info.get(row); switch (col) { case 0 : return o.getOrderName(); case 1 : return o.printDate(o.getDueDate()); case 2 : return o.getSleeve().getMaterial().getName(); case 3 : r...
9
public int singleNumber(int[] A) { int x = 0; int result = 0; for (int i = 0;i < 32 ; i++ ){ x = 0; for (int j = 0;j < A.length;j++) { if( (A[j] & (1 << i)) != 0) x ++; } result = result |((x%3)<<(i)); }...
3
public String[] loadFromFile() { String filename = "Database.ini"; Scanner textScan; String[] params = new String[5]; System.out.print("Loading: " + filename + "..."); try { File file = new File(filename); textScan = new Scanner(file); int co...
5
private void deleteSigns(String filename) throws Exception { // check that the folder "filename" under the certificate folder is legal String pathname = (Server.SERVERDIRECTORIES[2] + "/" + filename); File file = new File(pathname); // Signature folder doesn't exist or path doesn't exist if(file == null || !f...
5
public static TileMap loadMapFromFile(String path) throws IOException{ System.out.println(Functions.getTimeStamp()+" [MAPMANAGER] : Parsing data from "+path+"..."); InputStreamReader in = new InputStreamReader(ClassLoader.getSystemResourceAsStream(path)); BufferedReader inputreader = new BufferedReader(in); Str...
9
public static double multiplicativeMean(double[] values) { int size = values.length; double product = values[0]; for (int i = 1; i < size; i++) { product *= values[i]; } return Math.pow (product, (1.0f / size)); }
1
private void renderSubset(ModelSubset sub) { processSubsetFlag(sub.getFlags()); Material mat = sub.getMaterial(); setMaterial(mat); Texture tex = null; if (mat.getTextureID() == -1) { if (_currentTexID != -1) { _currentTex.disable(); _currentTex.dispose(); _currentTexID = -1; _currentTex ...
4
public FwySegment(LpLink ml_link,LpLink or_link,LpLink fr_link, FundamentalDiagram fd, Actuator actuator){ // link references ml_link_id = ml_link==null?null:ml_link.getId(); or_link_id = or_link==null?null:or_link.getId(); fr_link_id = fr_link==null?null:fr_link.getId(); fr_nod...
9
public void fireAddNewMissilePressed() { new Thread(new Runnable() { @Override public void run() { // while (true) { String id = txtId.getText(); String dest = txtDest.getText(); String damage = txtDamage.getText(); String flyTime = txtFlyTime.getText(); if (id.isEmpty() || dest.isEmpty...
4
public String runMachineStep() { Character readSymb; // On the first iteration if(curReadSymb == null) { curState = cmds.get(0).getCurState(); readSymb = tape.get(0); } // On the following iterations else { readSymb = curReadSymb; ...
8
Value getValue() { switch (type) { case NULL: case UNDEFINED: return (Value)objValue; case BOOLEAN: return new BooleanValue(value!=0); case NUMBER: return new NumberValue(value); case STRING: return new StringValue((String)objValue); case OBJECT: return (ObjectValue...
7
@Override public String toString() { return name + " " + id; }
0
public double getMiddleDirection() { if (leftNeighbour == null || rightNeighbour == null) return -1024; double leftAngle = getDirection(leftNeighbour); double rightAngle = getDirection(rightNeighbour); if (rightAngle < leftAngle) rightAngle += Math.PI * 2; return (leftAngl...
3
public void add(int index, MatterInterval element) { if (index < 1 && fictitiousRegionReady) { throw new IndexOutOfBoundsException("Index must be from 1 to " + intervals.size() + " to add to MatterStack, but " + index + " inserted"); } processBack(); inter...
3
@Override public Object getValueAt(Object node, int column) { Object value = null; if (node instanceof DefaultMutableTreeTableNode) { DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node; Object o = mutableNode.getUserObject(); if (o != null && o instanceof Material) { Material...
8
public static void main(String[] args) throws Exception { if (args.length != 3 && args.length !=4) { System.err.println("usage: java edu.berkeley.nlp.classical.ChartParser [-verbose] lexiconFileName grammarFileName \"sentence to parse\""); System.exit(0); } if (args[0].equalsIgnoreCase("-verbose...
5
public void actionPerformed(ActionEvent e) { if (e.getSource() == pagoFacturaGui.getAceptar()) { if (pagoFacturaGui.getMonto().getText().equals("")) { JOptionPane.showMessageDialog(pagoFacturaGui, "Por favor ingrese el monto", "Error!", JOptionPane.ERROR_MESSAGE); } else ...
8
private void createWindow() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(880, 550); setLocationRelativeTo(null); contentPane = new JPanel(); contentPane.setBord...
2
public List<Player> getKickerList() throws IOException, ParseException { List<String> csvPlayers = retriveData(K_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); for (String playerString : csvPlayers) { String[] split = playerString.split("\t"); if (spl...
2
public JSONObject append(String key, Object value) throws JSONException { testValidity(value); Object object = this.opt(key); if (object == null) { this.put(key, new JSONArray().put(value)); } else if (object instanceof JSONArray) { this.put(key, ((JSONArray) obje...
2
@Override public void init(IViewSite site) throws PartInitException { super.init(site); initializeColorRegistry(); createActions(); createToolBars(); ResourcesPlugin.getWorkspace().addResourceChangeListener(new IResourceChangeListener() { @Override public void resourceChanged(IResourceChangeEvent e) {...
2
private static int pivot(int[] a, int low, int high) { int i1 = low, i2 = high - 1, i3 = (low + high) / 2; int a1 = a[i1], a2 = a[i2], a3 = a[i3]; int n = (a1 > a2) ? a1 : a2; int m = (a2 > a3) ? a2 : a3; if (m > n) { return (a1 > a2) ? i1 : i2; } else if (n...
8
protected void loadXRefStmIfApplicable() { if (m_CrossReferenceStream == null) { long xrefStreamPosition = library.getLong(entries, "XRefStm"); if (xrefStreamPosition > 0L) { // OK, this is a little weird, but basically, any XRef stream // dictionary is a...
3
public static void SetNames(){ String[] PlayerNames = new String[NumPlayers]; int[] RandOrd = RunFileGame.getRandomOrdering(NumPlayers); for(int i = 0; i < NumPlayers; i++){ int n = RandOrd[i]; boolean BadName = false; String Name; do{ Name = ui.inputName(); BadName = false; if(Name.equals...
6
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page = ConfigurationManager.getProperty("path.page.user"); try { Criteria criteria = new Criteria(); User currUser = (User) request.getSessionAttribute(JSP_CURRENT_USER); ...
3
public String getEncoding() { return encoding; }
0