text
stringlengths
14
410k
label
int32
0
9
@WebResult(name = "GetAccountResponse", targetNamespace = "") @RequestWrapper(localName = "GetAccountDetailRequest", targetNamespace = "http://xstore.com/wsdl", className="com.xstore.services.web.model.GetAccountDetailRequest") @WebMethod(operationName = "GetAccountDetail") @ResponseWrapper(localName = "GetAccountDe...
2
public static ArrayList<Achievement> getAchievementsByUserID(int userID, int type) { ArrayList<Achievement> achievements = new ArrayList<Achievement>(); String statement = new String("SELECT * FROM " + DBTable + " WHERE userid = ?"); PreparedStatement stmt; try { stmt = DBConnection.con.prepareStatement(stat...
4
public Matrix plus(Matrix B) { Matrix A = this; if (B.M != A.M || B.N != A.N) throw new RuntimeException("Illegal matrix dimensions."); Matrix C = new Matrix(M, N); for (int i = 0; i < M; i++) for (int j = 0; j < N; j++) C.data[i][j] = new DataNode((char) (A.data[i][j].value() + B.data[i][j].value()))...
4
public void writeToBalance(Kunde kunde){ if(kunde != null){ Double fullPrice = 0.00; String productNames = ""; String pricelist = ""; for (model.Product product : kunde.getProducts()) { fullPrice = fullPrice + product.getPrice(); if(pricelist == ""){ pricelist = Double.toString(product.getPri...
4
public void actionPerformed(ActionEvent e) { if(e.getSource() == beendenButton){ System.out.println("button clicked"); spiel.getAktuellerSpieler().setZugZuende(true); lblNewLabel.setText("Aktueller Spieler: " + spiel.getAktuellerSpieler().toString()); rep...
1
public void setEmail(String email) { this.email = email; }
0
public DataBuffer getBuffer(CacheFileDescriptor descriptor) throws IOException { //System.out.println("Requesting file " + descriptor); int expectedIndexID = descriptor.index().id() + 1; DataBuffer fileBuffer = new DataBuffer(); int currentBlockID = descriptor.startBlock(); int remaining = descriptor.size...
5
private void rotate(){ if(stack.size() <= 1) return; else{ SplayNode n = stack.pop(); while(stack.size()>1){ SplayNode np = stack.pop(); SplayNode gp = stack.pop(); if((n == np.left && np == gp.left) || (n == np.right && np == gp.right)) n = zigzig(n, np, gp); else n = zi...
9
public int modificarOpcion(DTO.Opcion p) { try { if (con.isClosed()) { con = bd.conexion(); } Object ob = null; if (p.getdespuesDeOpcion().getCodigo() != 0) { ob = p.getdespuesDeOpcion().getCodigo(); } Strin...
7
public void close() { try { if (mResultSet != null && !mResultSet.isClosed()) { mResultSet.close(); } if (mStatement != null && !mStatement.isClosed()) { mStatement.close(); } if (mConnection != null && !mConnection.isClosed()) { mConnection.close(); } } catch (SQLException e) { ...
7
private void setAdjacent(Node node1, Node node2) { if (node1 == null || node2 == null) { throw new IllegalArgumentException("Need two non-null Nodes"); } // Create the Adjacent Nodes Set<Node> aN = new HashSet<Node>(); ...
2
@Override public void mousePressed(MouseEvent e) { if (contains(e.getX(), e.getY()) && enabled) { pressed = true; } }
2
public static TOObjectProperty setPropValue(TOObjectProperty prop, Object val, Integer type) { try { prop.setPropType(type); switch (type) { case TOPropertyType.TYPE_STR: { prop.setStrval(String.valueOf(val)); } break; ...
7
public void addActive(Component folha) { if (folha.getClass() != Job.class) { if (!folha.getState().equalsIgnoreCase("closed")) { this.addChild(folha); } } else { Job newChild = new Job(folha.getName(),folha.getDescription()); for (Componen...
6
public void calculateMoleculeID(int level, int val, int[] parentMolID){ initMoleculeID(level); if(level>1){ for(int i=0; i<level-1; i++){ setMoleculeID(i, parentMolID[i]); } } if(level!=0){ setMoleculeID(level-1, val); // Set child[0].moleculeID[last]=...
5
public void replaceWith(Node replacement){ if (parent == null) return; if (this == parent.left) parent.setLeftChild(replacement); else parent.setRightChild(replacement); }
2
public static void set(Properties properties, String filePath) { if (! filePath.endsWith(".properties")) { filePath += ".properties"; } try { OutputStream output = new FileOutputStream(filePath); // Open the file we are saving to. properties.store(output, ""); // Save the properties file to the output...
4
@Override public void process(Document doc) throws Exception { super.process(doc); this.subjects.clear(); if(doc != null) { NodeList paramNodes = Utilities.selectNodes(doc, "/dc:DCTransaction/dc:GetDataBySubjectRq/dc:SubjectIDs/dc:SubjectID", XMLLabels.STANDARD_NAMESPACES); for(int i = 0; i < paramNodes...
4
public void equip(){ isEquipped = true; window.activeLevel.thisLevelsItems.remove(this); createActionMessage(); if(this.itemType == 0){ panel.player.weapons[0] = this; }else{ panel.player.equipment.add(this); } }
1
public static String getUsuario() { return usuario; }
0
public void ThinkDamnYou(players.Base ply) { //TODO: Redesign it to allow the npc to grab if someone is in firing range faster and easier. if (finished) { finished = false; DoneCities = DoneUnits = false; UnitCount = CityCount = 0; if (ply.power>=ply.level2) {ply.UsePower(false);} else if (ply.power>...
7
public boolean pollInput() { if ((this.discoFlag) || (checkDisconnect(System.currentTimeMillis()))) { System.out.println("client schließt verbindung"); disconnect(); return false; } int counter = 0; try { for (; counter < messagesPerUpdate; ++counter) { ByteBuffer buf = ByteBuffer ...
7
public void run() { carPhysics.run(); }
0
public static Graph readGraph(InputStream is, int vertexNumber) { Graph result = new Graph(vertexNumber); Scanner fileScanner = new Scanner(is); int i = 0; while (fileScanner.hasNextLine() && i < vertexNumber) { String str = fileScanner.nextLine(); Scanner lineScanner = new Scanner(str);//default delimite...
7
short check_data_content(String new_serial_data) { short ret = check_scg_command(new_serial_data); if (MsgAnalyzerCmnDef.CheckSuccess(ret)) { boolean highlight = false; if (scg_command_status == SCG_COMMAND_STATUS.SCG_COMMAND_COMPLETE) { new_serial_data = scg_command_buf.toString(); highlight = ...
5
public void cancelMorphs() { final LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<MapleBuffStatValueHolder>(effects.values()); for (MapleBuffStatValueHolder mbsvh : allBuffs) { switch (mbsvh.effect.getSourceId()) { case 5111005: case 5121003: ...
6
private boolean isPlayerKingInCheckFromPieceHorizontallyRight() { for (int j=playerKingPiece.pieceColumn + 1; j<=8; j++){ BoardSquare boardSquare = chessBoard.getBoardSquare(playerKingPiece.pieceLine, j); if (boardSquare.containsBoardPiece()){ if (j==playerKingPiece.pieceColumn+1){ if (boardSquare.cont...
5
public void testPropertyCompareToSecond() { TimeOfDay test1 = new TimeOfDay(TEST_TIME1); TimeOfDay test2 = new TimeOfDay(TEST_TIME2); assertEquals(true, test1.secondOfMinute().compareTo(test2) < 0); assertEquals(true, test2.secondOfMinute().compareTo(test1) > 0); assertEquals(tru...
2
private static double limitM( double m ){ if( m < 0 ){ return -limitM( -m ); } if( m < 0.5 ){ return 0.5; } else if( m > 1.5 ){ return 1.5; } else{ return m; } }
3
@Override public Buildable create(Object name, Object value) { if (name.equals("step")) { Step step = new Step(steps.size() + 1); steps.add(step); return step; } else if (name.equals("rounds")) { rounds = (Integer) value; if (rounds < 1) { ...
8
public void EliminaFinal () { if ( VaciaLista()) System.out.println ("No hay elementos"); else { if (PrimerNodo == PrimerNodo.siguiente) PrimerNodo = null; else { NodosProcesos Actual =PrimerNodo; while (Actual.siguiente.siguiente != PrimerNodo) Actual = Actual.siguiente; Actua...
3
public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); for (String line; (line = in.readLine()) != null ; ) { if(line.trim().isEmpty()) sb.append("\n"); else{ int sum = 0; String...
7
protected void changedServerName(){ for(ModelChangeListener mcl : listeners){ mcl.changedServerName(serv_name); } }
1
public void setJournal(Journal journal) { this.journal = journal; }
0
public synchronized void printProcesses() { if (processes.size() == 0) { System.out.println("No processes running."); return; } for (int i = 0; i < processes.size(); i++) { MigratableProcessWrapper cur = processes.get(i).getMPW(); System.out.println(cur.getName()); } }
2
public void actionPerformed(ActionEvent evt){ //receives the start button event from the startPanel if (evt.getActionCommand().equals(START_APP_EVENT)) { displayHoustonSearch(); //receives the next button event from the QuestionPanel }else if (evt.getActionCommand().equals(QUE_NEXT_EVENT)){ ((Question) questio...
6
public void fetchFiles() { int returnVal = this.chooser.showOpenDialog(null); if(returnVal == JFileChooser.APPROVE_OPTION) { File[] directorys = this.chooser.getSelectedFiles(); for(int i = 0; i < directorys.length;i++){ if(directorys[i].isDirectory()){ String album = directorys[i].getName(); Fi...
9
private void startRun() { try { Thread.currentThread().getId(); levelLoader = new XMLLevelLoader(); frame = new TopFrame(this); frame.initLWJGL(); RenderEngine.setupOpenGL(); needsResize = true; SoundStore.get().init(); gameMusic = SoundStore.get().getOgg(Res.getResourceAsStream("res/music.ogg...
1
void parseJsonImageMap(String json) { String imageSrc = null; try { ImageMap imagemap = getImageMapFromJSON(json); createShapeList(shapeList, imagemap); if (shapeList.size() == 0) statusBar.setText("no imagemap found"); /* if (imagemap.getImagesource_id() > -1) { imageSrc = String.format("%si...
3
public void setLayoutMatchingMode(LayoutMatchingMode mode) { this.layoutMatchingMode = mode; }
0
@Test public void test_config_keys() { final StringBuffer s = new StringBuffer(); for (Iterator i = configKeys(); i.hasNext(); ) { s.append("<" + i.next().toString() + ">"); } Assert.assertEquals(s.toString(), "<b_remote_host><c_latency><b_latency><b_local_port><b_remote_port>"); }
1
public Collection<SpriteClip> getSpriteClips(BufferedImage image, BackgroundFilter filter) { int h = image.getHeight(); int w = image.getWidth(); Label[][] labelSheet = new Label[h][w]; for (int row = 0; row < h; row++) { for (int col = 0; col < w; ...
7
private void initView(Configuration[] configs, final Environment env, boolean blockStep) { this.setLayout(new BorderLayout()); // Set up the main display. SelectionDrawer drawer = new SelectionDrawer(automaton); AutomatonPane display = new AutomatonPane(drawer, true); // Add the listener to the display. ...
2
public static void findLongestSubPalindramic(String s) { char[] arr = s.toCharArray(); int begin = -1; int end; int temp_begin; int maxLength = -1; boolean[][] table = new boolean[1000][1000]; for (int i = 0; i < table.length; i++) { table[i][i] = true; } for (int i = 0; i < s.length() - 1; i++) {...
8
public HexDumpOutputStream createHexDumpOutputStream() { BasicType hexdumpFormat = this.getGlobalConfiguration().get( Constants.CKEY_HTTPCONFIG_HEXDUMP_FORMAT ); // System.out.println( "hexdumpFormat=" + hexdumpFormat ); int[] columns = null; String str_hexdumpFormat = null; if( hexdumpFormat != null && (str...
9
public RandomWords(int count) { this.count = count; }
0
public boolean intersect(float i, float j, float k) { return !(i <= x || i >= x + w || j <= y || j >= y + h || k <= z || k >= z + d); }
5
private final ArrayList<String> edits(String word) { ArrayList<String> result = new ArrayList<String>(); for(int i=0; i < word.length(); ++i) result.add(word.substring(0, i) + word.substring(i+1)); for(int i=0; i < word.length()-1; ++i) result.add(word.substring(0, i) + word.substring(i+1, i+...
6
public void selectLevel(){ Menu myWorld = (Menu) getWorld(); switch(state){ case 0: Greenfoot.setWorld(new Menu()); break; case 1: setImage("ShipCoordinatorInfo.png"); setLocation(500,300); myWorld.re...
5
public void testGetValue_int() { LocalDateTime test = new LocalDateTime(ISO_UTC); assertEquals(1970, test.getValue(0)); assertEquals(6, test.getValue(1)); assertEquals(9, test.getValue(2)); assertEquals(MILLIS_OF_DAY_UTC, test.getValue(3)); try { test.getValue...
2
public boolean deleteCircle(Circle circle) { if (this.next.data.equals(circle.data)) { if (circle.data.equals(start.data)) { start = next.next; this.next = start; return true; } else { this.next = next.next; return true; } } else { return this.next.deleteCircle(circle); } }
2
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Province other = (Province) obj; if (!Objects.equals(this.nom, other.nom)) { return false; ...
9
public void addToIpMap(ChannelHandlerContext ctx) { String clientIP = ((InetSocketAddress) ctx.channel().remoteAddress()).getHostString(); synchronized (ipMap){ if (!ipMap.containsKey(clientIP)) {//if IP is new --> put it in map with default count 1 and current time ipMap.put(client...
1
public void bubblesort(){ int count = 1; //To pass the first while while (count != 0){ count = 0; for (int i = 0; i < number-1; i++) { Class<? extends Object> c = objectsToSort[i].getClass(); Class[] cArg = new Class[1]; cArg[0] = objectsToSort[i].getClass(); Method lmethod; try { l...
9
public StructuredFloat buildByType(boolean isNegative, FloatNumberType doubleType, FloatNumberSpecialValue specialValue) { switch (doubleType) { case Nan: normalizedExp = config.MaxExp + 1; fraction = 1; negative = isNegative; break; case Infinite: { normalizedExp = config.MaxExp + 1; fractio...
9
@Override public void init(List<String> argumentList) { offset = Integer.parseInt(argumentList.get(0)); identifier = argumentList.get(1); }
0
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final BloomFilter<E> other = (BloomFilter<E>) obj; if (this.expectedNumberOfFilterElements != other.expectedNum...
8
public void paintPattern(Graphics2D g, Page parentPage) { if (patternPaint == null) { AffineTransform matrixInv = getInvMatrix(); Rectangle2D bBoxMod = matrix.createTransformedShape(bBox).getBounds2D(); int width = (int) bBoxMod.getWidth(); int height = (int) bBo...
7
private void resize(int capacity) { Item[] temp = (Item[]) new Object[capacity]; for (int i = 0; i < next; i++) { temp[i] = a[i]; } this.a = temp; }
1
@Test public void testSchemaCreation() throws SQLException { Star.setup(); }
0
public Upgrade getUpgrade(){ return upgrade; }
0
public void startAnimation() { if(interval == -1) {return;} if(animation == null) { frameIndex.add(0); animation = new Timer(interval, new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { for(int i=0; i<entity.size(); i++) { if(frameIndex.get(i) < frameTo...
5
@Override public void remove() { if(current == null) // empty iterator return; if(current.getPrev() != null) current.getPrev().setNext(current.getNext()); if(current.getNext() != null) current.getNext().setPrev(current.getPrev()); if(current.getPrev() == null) s.root = current.get...
4
public void removeBogusLegs() { Iterator<Leg> it = legs.iterator(); while (it.hasNext()) { Leg leg = it.next(); if (leg.isBogusWalkLeg()) { it.remove(); } } }
2
private boolean salvarConfigsImpressoraCaixa() { System.out.println("Configurando Impressora do Caixa:"); usarImpressoraCaixa = checkboxAtivarImpressoraCaixa.isSelected(); System.out.println("Usar impressora do caixa: " + usarImpressoraCaixa); switch (comboboxModeloCaixa.getSelectedIndex...
9
private void add_s(Buffer lbuf, LuaString news, int soff, int e) { int l = news.length(); for (int i = 0; i < l; ++i) { byte b = (byte) news.luaByte(i); if (b != L_ESC) { lbuf.append((byte) b); } else { ++i; // skip ESC b = (byte) news.luaByte(i); if (!Character.isDigit((char) b)) ...
4
public String genLargeDB() { String nextLine; URL url; URLConnection urlConn; InputStreamReader inStream; BufferedReader buff; this.largedb = ""; try { for (NEOCP neocp : neocpData) { url = new URL( "http://scul...
7
public final void setConfigValue(final String section, final String key, final String value) { synchronized (this.configOld) { synchronized (this.configNew) { if (value == null) { if (getConfigValue(section, key, null) != null) { final Map<String, String> map0 = this.configNew .get(sectio...
9
public void updateImage() { //we will update animation when delay counter reaches delay, then reset delay counter delayCounter++; if(delayCounter>delay) { delayCounter=0; frameNumber++;//updates frame to next frame //if surpass 3rd frame, back to frameNumber 0 if (frameNumber>=firstFrame+totalFrame)...
2
public void parseString(String inputLine) { System.out.println(inputLine); String tagRegex = "(beat|accel|heartrate|eeg|pressure)=(.*)"; Pattern pattern = Pattern.compile(tagRegex); Matcher matcher = pattern.matcher(inputLine); if (matcher.matches()) { String tag = matcher.group(1), value = matcher.grou...
8
public void printBoard() { System.out.print(" "); for(int c = 0; c < 8; c++) { if(flipped) System.out.print((char)('h'-c) + " "); else System.out.print((char)(c + 'a') + " "); } System.out.println(); System.out.println(" _________________ "); for(int r = 0; r < 8;...
9
public String map2QcTestSetName(ISuite suite) { return (this.qcTestSetName != null ? this.qcTestSetName : suite.getName()); }
1
public static CustomerGroup getByNumber(final String token, final Long number) { JSONArray fetchByNumber = null; try { fetchByNumber = fetchByNumber(token, object, number); } catch (IOException e) { e.printStackTrace(); } List<CustomerGroup> formatOutputs = formatOutputs(fetchByNumber); if (formatOutp...
2
public static List readWatchableObjects(DataInputStream var0) throws IOException { ArrayList var1 = null; for(byte var2 = var0.readByte(); var2 != 127; var2 = var0.readByte()) { if(var1 == null) { var1 = new ArrayList(); } int var3 = (var2 & 224) >> 5; int v...
9
public Object unmarshal(InputStream xml) { long start = System.currentTimeMillis(); Unmarshaller unmarshaller = unmarshallerPool.borrow(); try { BufferedInputStream bufXml = new BufferedInputStream(xml); SAXSource saxSource = new SAXSource(createNewXmlReader(), new InputSource(bufXml)); return unmarshall...
2
public static ArrayList<Object[][]> floydRoyWarshall(mxAnalysisGraph aGraph) throws StructuralException { Object[] vertices = aGraph.getChildVertices(aGraph.getGraph().getDefaultParent()); Double[][] dist = new Double[vertices.length][vertices.length]; Object[][] paths = new Object[vertices.length][vertices.len...
7
private void initialSpeciate(List<Organism> organisms) { if (getSpecies().isEmpty()) { /** * In the first generation, since there are no preexisting species, * NEAT begins by creating species 1 and placing the first genome * into that species. */ ...
1
public final A index(final int i) { if (i < 0) throw error("index " + i + " out of range on stream"); else { Stream<A> xs = this; for (int c = 0; c < i; c++) { if (xs.isEmpty()) throw error("index " + i + " out of range on stream"); xs = xs.tail()._1(); } ...
4
public void run() { while (true) { try { disp = mon.getDisplayData(); HW.display(disp.ticket, disp.counter); sleep(10000); } catch (InterruptedException e) { break; } } }
2
public boolean existsBooking(Booking booking) { List<Booking> bookings = this.getBookings(); Iterator<Booking> iter = bookings.iterator(); while (iter.hasNext()) { Booking b = iter.next(); if (b.getDate().equals(booking.getDate()) && b.getDiningHall().equals(booking.getDiningHall()) && b.getStuden...
4
public String toString() { String compoundString = ""; for(int k = 0; k < elements.length; k++) { if(elements[k] instanceof Compound && ((Compound)elements[k]).containsCompound()) compoundString += "[" + elements[k].toString() + "]" + ((subscripts[k] == 1)? "" : "" + subscripts[k]); else if(elements...
7
public ArrayList<ArrayList<Integer>> levelOrderBottom(TreeNode root) { ArrayList<TreeNode> s = new ArrayList<TreeNode>(); if (root == null) { return null; } s.add(root); int[] cou = new int[Integer.MAX_VALUE]; int cur = 0; int curcount = 0; ...
6
private void initialize() { GO = GUITreeLoader.reg.getText("goto_dialog_go"); GOTO_LINE_AND_COLUMN = GUITreeLoader.reg.getText("goto_dialog_line_and_column"); CANCEL = GUITreeLoader.reg.getText("cancel"); lineNumberTextField = new JTextField(10); columnNumberTextField = new JTextField(10); countDepthChe...
0
@Override public void updateView() { listModel.removeAllElements(); for (String s : controller.getModel().getSearchFormats()) { listModel.addElement(s); } formatList.setModel(listModel); }
1
private FileLoaderCor() { IMyProperties mp; FileLoaderAbstract lastOne = null; boolean ok = false; try { mp = MyPropertiesFactory.getInstance().getProp(); String[] classes = mp.getProperty("FileLoaderClasses").split(","); for(int i = (classes.length-1); i > -1; --i) { String curCl = classes[i]....
7
@SuppressWarnings("unchecked") public Relationship usingId(Id id) { if (this.id != null) { throw new IllegalStateException("Id already assigned!"); } this.id = id; return this; }
1
public String toString() { Object cl = null; if (clref != null) cl = clref.get(); return cl == null ? "<null>" : cl.toString(); }
2
private Type getCommonType(Type t1, Type t2) { if (!compatibleTypes(t1, t2)) { return BasicType.NOTYPE; } if (t1 instanceof ListType) { return t1; } if (t2 instanceof ListType ) { return t2; } if (t1 == BasicType.FLOAT || t2 ...
9
private void collect(TreeNode root, String prefix, LinkedList<String> q){ if(root == null)return; if(root.value != null)q.add(prefix); for(char c = 0; c < R; c++){ collect(root.next[c], prefix + c, q); } }
3
public static String getPrefix(final String name) { try { String s = ""; if (MonsterIRC.getHookManager() != null) { if (MonsterIRC.getHookManager().getChatHook() != null) { if (MonsterIRC.getHookManager().getChatHook().isEnabled()) { ...
5
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Library library = new Library(); request.setAttribute("patronResults", library.getPatronList(0)); } catch (SQLException e) { e.printStackTrace(); } request.getRequestDispa...
1
private void init() { try { setIconImage(new ImageIcon(AboutFrame.class.getResource("icon.png")).getImage()); } catch(NullPointerException e) { controller.displayError(bundle.getString("error"), e.getLocalizedMessage()); } setTitle(App...
5
public int getValue() { return i.get(); }
0
public static void collectDirectSuperClasses(Stella_Class renamed_Class, List parents) { { List directsupertypes = renamed_Class.classDirectSupers; List nondirectparents = List.newList(); { Surrogate supertype = null; Cons iter000 = directsupertypes.theConsList; Cons collect000 = null; ...
9
private void exportFramedSameCatsSimStructVsMoa(String path, int level) throws Exception { SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance()); DrugBank db = new DrugBank("data/tmp/drugbank.ser"); Brain atc = new Brain(); System.out.println("Learning ATC..."); atc.learn("data...
9
public JSONWriter object() throws JSONException { if (this.mode == 'i') { this.mode = 'o'; } if (this.mode == 'o' || this.mode == 'a') { this.append("{"); this.push(new JSONObject()); this.comma = false; return this; } t...
3
public int convertShape( String shape ) { defaultShape = 0; if( shape.equals( "box" ) ) { defaultShape = 0; } if( shape.equals( "cone" ) ) // 1 1 { defaultShape = 257; } if( shape.equals( "coneToMax" ) ) // 1 2 { defaultShape = 513; } if( shape.equals( "cylinder" ) ) // 1 0 { ...
6
@Test public void itShouldSerializeAPointWithAltitude() throws Exception { Point point = new Point(100, 0, 256); assertEquals("{\"coordinates\":[100.0,0.0,256.0],\"type\":\"Point\"}", mapper.toJson(point)); }
0
private static void merge(int[] A, int left, int middle, int right) { for (int i = left; i <= right; i++) { temp[i] = A[i]; } int leftEnd = middle - 1; int k = left; while (left <= leftEnd && middle <= right) { if (temp[left] <= temp[middle]) { ...
5
private void executeWaitForResultsJob(WaitForResultsJob job) throws IOException, JSchException { updateable.send(new StatusUpdate("VM " + id + " waiting for mid results", id, VMState.EXECUTING, JobType.WAITRESULT)); int expected = job.getExpectedCount(); while(new File("/").listFiles((new FilenameFilter()...
3