text
stringlengths
14
410k
label
int32
0
9
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { // Retrieve format tags. RasterFormatTag[] formatTags = getFormatTags(); RasterAccessor s1 = new RasterAccessor(sources[0], destRect, ...
9
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 void checkException () throws Exception { if ( this.exception != null ) { throw this.exception; } }
1
public static void save(Document doc){ try ( OutputStream file = new FileOutputStream(SAVE_PATH+doc.getName()); OutputStream buffer = new BufferedOutputStream(file); ObjectOutput output = new ObjectOutputStream(buffer); ){ output.writeObject(doc); System.out.println("Document saved."); } c...
1
public static Settings getInstance() { return settings; }
0
public void setOptions(String[] options) throws Exception { String tableString, inputString, tmpStr; resetOptions(); tmpStr = Utils.getOption("url", options); if (tmpStr.length() != 0) setUrl(tmpStr); tmpStr = Utils.getOption("user", options); if (tmpStr.length() != 0) ...
7
public void disconnectRejectPart() { rejectPartItems = new ShareableHashSet<Item>(); for (Item i : items) { if (i.production.usedForReject) { rejectPartItems.add(i); } } items.removeAll(rejectPartItems); rejectPartTransitions = new ShareableHashSet<Transition>(); rejectPartBridges = new Shareab...
8
public static int stringToInt (String st) { int res = 0; if (st.equals("integer") || st.equals("INTEGER")) res = INTEGER; else if (st.equals("float") || st.equals("FLOAT")) res = DOUBLE; else if (st.equals("text") || st.equals("VARCHAR") || st.equals("TEXT")) res = STRING; else if (st.equals("bool") || st.equ...
9
public void run() { int counter = 0; while (LazyHomer.noreply || counter<10) { if (counter>4 && LazyHomer.noreply) LOG.info("Still looking for smithers on multicast port "+port+" ("+LazyHomer.noreply+")"); LazyHomer.send("INFO","/domain/internal/service/getname"); try { slee...
5
@Override protected void channelRead0(final ChannelHandlerContext ctx, HttpRequest request) throws Exception { QueryStringDecoder decoder = new QueryStringDecoder(request.getUri()); String decodedUri = decoder.path(); statCollector.addProcessedConnection(ctx.channel(), ConnectionParameter.URI, decodedUri);...
5
@SuppressWarnings("empty-statement") @Override public void run() { while (true) { try { synchronized (guard) { }; if (sel.select() <= 0) { continue; } } catch (IOException e) { ...
8
void computeBoardScale() { Dimension target = new Dimension(1500, 1500); Dimension container = this.getSize(); Double s = 1.0; if ( ( target.width <= container.width ) && ( target.height <= container.height ) ) {} // It already fits in container else if ( (target....
8
private void quitChan(String user_name, CommandArgsIterator args_it) throws IOException { if (args_it.hasNext()) { String chan_arg = args_it.next(); if (!args_it.hasNext() && chan_arg.length() >= 2 && chan_arg.charAt(0) == '#') { String...
6
private void playGame() { System.out.println("Game initialing......."); this.initialGame(); System.out.println("Game starting..........."); System.out.println("> Select Game Mode :"); System.out.println(" > 1. Normal Mode"); System.out.println(" > 2. Intellligence Mode...
4
@Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D)g; Rectangle clip = g2.getClipBounds(); rowRenderer.paintBackground(g, this); for (int i=0; i<getModel().getRowCount(); i++) { Rectangle2D bounds = getRowBounds(i); if (bounds.intersects(clip)) { rowRenderer.pain...
7
public static void main(String args[]) { abTrajectory ar = new abTrajectory(); ImageSegFrame frame = null; GameStateExtractor gameStateExtractor = new GameStateExtractor(); TrajectoryPlanner trajectory = new TrajectoryPlanner(); while (true) { // capture image ...
6
private double calculateMantissa(int[] binaryNumber) { double mantissa = 1; int power = -1; for(int i = 9; i < binaryNumber.length; i++){ mantissa = mantissa + binaryNumber[i] * Math.pow(2, power); power--; } return mantissa; }
1
public void setMin(int min) { myMin = min; refresh(); }
0
@BeforeClass public static void setUpClass() { }
0
private double calcY(final double TOP, final double TOTAL_HEIGHT ) { switch (popupLocation) { case TOP_LEFT : case TOP_CENTER : case TOP_RIGHT : return TOP + offsetY; case CENTER_LEFT: case CENTER : case CENTER_RIGHT: return TOP + (TOTAL_HEIGHT- height)/2 - offset...
9
public int getWidth() { return width; }
0
public boolean pickAndExecuteAnAction() { // If there is a customer waiting //synchronized(Customers) { for (MyCustomer c : Customers) { if (c.state.equals(MyCustomer.State.waiting)) { // And an unoccupied table for (Table t : Tables) { if (! t.occupied) { // And at least...
7
static final void method407(float f, int i, int i_1_, float f_2_, int i_3_, float[] fs, int i_4_, int i_5_, int i_6_, int i_7_, int i_8_, float f_9_, float[] fs_10_, int i_11_) { i_4_ -= i_3_; anInt577++; i_1_ -= i_7_; i_6_ -= i_8_; float f_12_ = fs_10_[2] * (float) i_6_ + ((float) i_1_ * fs_10_[0] + fs_10_[1...
9
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { VMSMain vms = new VMSMain(); ReadErrorFile ref = new ReadErrorFile(); try { if (vms.checkForUpdate()) { Main frame = new Main(); frame.setVisible(true); } else { OldVer...
2
public Pid searchByURI(String uri) throws IOException { ClientResponse cr = wr.path(localPrefix) .queryParam(Strings.PID_RECORD_KEY_URL, uri.toString()) .header(Strings.HEADER_ACCEPT, MediaType.APPLICATION_JSON) .get(ClientResponse.class); if (cr.getStatu...
7
public void mostrarDatosDeIngreso(String campo, beansHistorial registro){ String descripcion = null, parametro = null; switch(campo.trim()){ case "downline": descripcion = "Nombre del downline nuevo "; parametro = registro.getDownline().getNombre(); break; case "upline": descripcion = "No...
7
private static boolean handleStaircases(Player player, WorldObject object, int optionId) { String option = object.getDefinitions().getOption(optionId); if (option.equalsIgnoreCase("Climb-up")) { if (player.getPlane() == 3) return false; player.useStairs(-1, new WorldTile(player.getX(), player.getY(), ...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RecipeStepData other = (RecipeStepData) obj; if (description == null) { if (other.description != null) return false; } else if (!description.equals(...
6
public boolean isAllowed(int patient_no, int test_id) { String selectNotAllowedQuery = "SELECT * FROM NOT_ALLOWED WHERE health_care_no = " + patient_no + " AND test_id = " + test_id; boolean isAllowed = true; try { rs = stmt.executeQuery(selectNotAllowedQuery); if (rs.next()) { isAllowed = false; ...
2
public void setModifiers(int mod) { ClassFile cf = getClassFile2(); if (Modifier.isStatic(mod)) { int flags = cf.getInnerAccessFlags(); if (flags != -1 && (flags & AccessFlag.STATIC) != 0) mod = mod & ~Modifier.STATIC; else throw new Ru...
3
@EventHandler public void onPlayerQuit(PlayerQuitEvent e) { Player p = e.getPlayer(); if (CTF.gm.isPlaying(p)) { PlayerInventory inv = p.getInventory(); inv.setHelmet(new ItemStack(Material.AIR, 1)); inv.setChestplate(new ItemStack(Material.AIR, 1)); i...
6
public void buildGui(Calculator calculator) { this.calculator = calculator; JFrame aFrame = new JFrame(TITLE); // Create a the main panel, with 4 lines JPanel mainPanel = new JPanel(new GridLayout(6, 1)); JPanel gridLines[] = { new JPanel(new GridLayout(1, 5)), new JPanel(new GridLayout(1, 5)), new ...
5
private void drawFields(Graphics g){ g.setColor(EMPTY_CIRCLE_COLOR); // Zeiche Sekunden-Felder: for (int a = 0; a < 2; a++){ for (int i = 0; i < Position.time_day[1].length; i++){ // x-Coorodinate y-Coordinate g.drawOval(Position.time_day[a][i][0], Position.time_day[a][i][1], EMPTY_CIRCLE, EMPTY_CIR...
6
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { if (mDrawFocus) { x = 1; y = height - 2; while (x < width) { g.drawLine(x, 1, x, 1); g.drawLine(x + 2, y, x + 2, y); x += 2; } x = width - 2; y = 1; while (y < height) { g.drawLi...
3
public static void main(String[] args) { Song s1 = new Song("Yellow", "Cold Play", 2.4); Song s2 = new Song("Clocks", "Cold Play", 3.56); System.out.println(s2); Playlist p = new Playlist("ColdPlayHits"); if(p.addSong(s1))System.out.println(s1+" added");; if(p.addSong(s2))System.out.println(s...
7
private void createPlayer(){ CategoryType kat; Track t; ArrayList<Track> tracks = rep.getTracks(); for(int i = 0; i < tracks.size(); i++){ t = tracks.get(i); kat = t.getKat(); switch(kat) { case BASS: bassPlayer.add(new Player(t)); break; case BEATS: beatsPlayer.add(new Pl...
6
private void checkCollision(PVector handAbsolute, DrumSingle myDrum, Player player, boolean left) { PVector handAbsoluteNormalized = handAbsolute.get(); handAbsoluteNormalized.normalize(); PVector ov = myDrum.ov(true); // Dot Product float dotProduct = handAbsolute.dot(ov); // Entfernung berechnen floa...
9
private static void prepareProfInfo(Player p, String prof, Professions plugin) { ArrayList<ArrayList<ArrayList<String>>> j = getProfData(prof, plugin); Integer i1; Integer i2; String temp; for ( i1 = 0; i1 <j.size(); i1++ ) { p.sendMessage(...
5
public int getAlignment() { checkWidget(); if ((style & SWT.ARROW) != 0) { if ((style & SWT.UP) != 0) return SWT.UP; if ((style & SWT.DOWN) != 0) return SWT.DOWN; if ((style & SWT.LEFT) != 0) return SWT.LEFT; if ((style & SWT.RIGHT) != 0) return SWT.RIGHT; return SWT.UP; } if ((st...
8
public AlgReader(File file) throws FileNotFoundException { if (!file.exists()) return; map = new TreeMap<String, String>(); this.file = file; String ext = file.getName().substring(file.getName().lastIndexOf('.')); setValue("Program", "path", file.getParent() + "/"); ...
5
public void setFamilienaam(String familienaam) { this.familienaam = familienaam; }
0
public Class<?> lookupType(String name) throws ClassNotFoundException { if (name == null) { throw new IllegalArgumentException("name must not be null"); } Class<?> type = typeRenames.get(name); if (type == null) { type = loadType(name); } return ty...
4
@SuppressWarnings({ "rawtypes", "unchecked" }) public static List Querybooks(String authorid){ List list=new ArrayList(); ResultSet restl=null; int i = 0; double d = 0; try{ contct=connector.getConnection(); Sttt=contct.prepareStatement("select * from bk where authorid= '"+authorid+"'"); ...
4
void addCall(final MethodEditor callerMethod, final MemberRef callee) { // Just maintain the calls mapping final MemberRef caller = callerMethod.memberRef(); Set callees = (Set) this.calls.get(caller); if (callees == null) { callees = new HashSet(); this.calls.put(caller, callees); } callees.add(calle...
1
public Reference getRef(int i) throws ClassFormatException { if (i == 0) return null; if (tags[i] != FIELDREF && tags[i] != METHODREF && tags[i] != INTERFACEMETHODREF) throw new ClassFormatException("Tag mismatch"); if (constants[i] == null) { int classIndex = indices1[i]; int nameTypeIndex = indi...
8
@Test public void testStrings(){ System.out.println(System.getProperty("java.library.path")); Strings strings = new Strings(); String s1 = "Hi"; String s2 = "Howdy"; String s3 = "Lollapalooza"; String s4 = "gg"; assertTrue(strings.allUniqueCharacters(s1)); assertTrue(strings.allUniqueCharacters(s2)); ...
6
public boolean mousedown(Coord c, int button) { if (button != 1) return (false); a = true; ui.grabmouse(this); return (true); }
1
public int compareTo(WildcardString arg0) { if(arg0==null) throw new NullPointerException("cannot compare WildcardString to null"); return compareWildcardString(string,arg0.toString()); }
1
public void update() { glLoadIdentity(); //reset field of view to position = rotation = 0 float dt = Time.dt; Vector3f velocity = new Vector3f(); //handle translation input if (Keyboard.isKeyDown(Keyboard.KEY_W)) { velocity.z += speed*dt; } if (Keyboard.isKeyDown(Keyboard.KEY_S)) { velocity.z -= speed...
8
public static void main(String... args) throws Throwable { final CountDownLatch connectLatch = new CountDownLatch(1); final AtomicReference<ConnectReturnCode> connectReturnCode = new AtomicReference<ConnectReturnCode>(); AsyncClientListener listener = new AsyncClientListener() { @Override public void publi...
6
public Object adjustParameterValueForEnumRefValue( Object aParameterValue, ParameterT aParameter, ControlT aControl ) { logger.debug("aParameterValue: " + aParameterValue + " aParameter: " + aParameter + " aControl: " + aControl ); if ( ( aParameterValue != null ) && ( aParameter != null ) && ( aControl != null ) ...
8
@Override public String getStylePref(String type) { if(type.equals("doctype")) { return DOCTYPE_COLOR; } if(type.equals("html")) { return HTML_COLOR; } if(type.equals("string")) { return STRING_COLOR; } if(type.equals("tag")) { return TAG_COLOR; } if(type.equals("expression")) { return...
8
@Override public boolean saveLog(String name) { // stringefy dataLog and save to file in readable // xml format String dump = ""; String ret = "\n"; dump += dataLog.size() + ret; Iterator<DataItem> it=dataLog.iterator(); while(it.hasNext()){ Dat...
3
public static void updateAPList () { for(int x = 0; x < chbxlist.size() ; x++) { String [] parse = chbxlist.get(x).getText().split("Sample Count: " ); chbxlist.get(x).setText(parse[0] + "Sample Count: " + PaintPane.Mac.get(x).getSampleCount() + "<br>" + "</html>"); } for(int x = chbxlist.size(); x <...
3
public Type getHint() { if (ifaces.length == 0 || (clazz == null && ifaces.length == 1)) return this; if (clazz != null) return Type.tClass(clazz.getName()); else return Type.tClass(ifaces[0].getName()); }
4
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerMove(PlayerMoveEvent event) { if (plugin.datacore.getBoolean("users." + event.getPlayer().getName() + ".frozen") == true){ Location from = event.getFrom(); double xfrom = event.getFrom().getX(); double yfrom = event.getFrom().getY(); ...
9
@Override public String perform(Company which) { int n = Random.getInstance().randomInt(6); String in = JOptionPane.showInputDialog(null, "You have landed on the Patents tile. " + "Enter 0-5 to try your luck!", "Patents Tile", JOptionPane.QUESTION_MESSAGE); try { ...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ScrollRestriction other = (ScrollRestriction) obj; if (itemslots == null) { if (other.itemslots != null) return false; } else if (!items...
9
private boolean r_un_accent() { int v_3; // (, line 215 // atleast, line 216 { int v_1 = 1; // atleast, line 216 replab0: while(true) { ...
8
public JSONArray toJSONArray(JSONArray names) throws JSONException { if (names == null || names.length() == 0) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } re...
3
protected ConfigurationSerializable deserializeViaMethod(Method method, Map<String, Object> args) { try { ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); if (result == null) { Logger.getLogger(ConfigurationSerialization.class.get...
3
public void updateReplicaState(Replica replica) { switch (replica.getState()) { case FAILED: case CANCELLED: case ABORTED: boolean anyRunning = false; for (Replica eachReplica : replica.getTask().getReplicas()) { if (ExecutionState.RUNNING.equals(eachReplica.getState())) { anyRunning = true; ...
6
@EventHandler public void EnderDragonJump(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.getEnderDragonConfig().getDouble("EnderDr...
6
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Paciente other = (Paciente) obj; if (!Objects.equals(this.idPessoa, other.idPessoa)) { return...
3
public SortedMap<Long, Boolean> berechneZustandsWechselZustand(Long von, Long bis, int jahr) { // Die Abfrage besitzt eine eigene Zustandsliste // ListeZustandsWechsel listeZustandsWechselAbfrage = new ListeZustandsWechsel(); listeZustandsWechsel = new ListeZustandsWechsel(); long time = 0; long ...
9
protected static long getLong(String key, JSONObject json) throws JSONException { String str = json.getString(key); if(null == str || "".equals(str)||"null".equals(str)){ return -1; } return Long.parseLong(str); }
3
public boolean matches(Item item) { if (item instanceof ToolItem) { ToolItem other = (ToolItem) item; if (other.type != type) return false; if (other.level != level) return false; return true; } return false; }
3
public List<String> getColumnTitles() { List<String> titles = new ArrayList<String>(); for (HeaderCell cell : cells) { titles.add(cell.getValue()); } return titles; }
1
public static void main(String args[]){ //Creating a colour scheme to test the renderer with int colourSize = 5; Colour[] colours = new Colour[colourSize]; for (int i=0; i<colourSize; i++) { switch (i) { case 0: Colour black = new Colour("#000000"); colours[i] =...
6
final void method3750(int i, Interface2 interface2) { try { if (i <= 39) ((OpenGlToolkit) this).anInt7782 = 120; if (interface2 != anInterface2_7852) { if (aBoolean7873) OpenGL.glBindBufferARB(34962, interface2.method10(true)); anInterface2_7852 = interface2; } anInt7552++; } catch (Ru...
5
public synchronized String getMessage() throws InterruptedException { notify(); while (messages.size() == 0) wait(); String message = (String) messages.firstElement(); messages.removeElement(message); return message; }
1
@Test public void MinMaxWithMultipleInserts() { l.insert(b); for (int i = 0; i < 10; i++) { l.insert(v); } l.insert(a); assertEquals(a, l.min()); assertEquals(b, l.max()); }
1
public void revalidatePieces() { int amountOfRemovedLooseSnakePieces = 0; for (int i = 0; i < looseSnakePieces.size(); i++) { Piece piece = looseSnakePieces.get(i); if (checkForOutOfBoundsForPiece(piece)) { looseSnakePieces.remove(i); amountOfRemovedLooseSnakePieces++; } } for (int i = ...
7
public AbstractPlay nextPlay(){ Huffer huffer = new Huffer(this); largestCapture = huffer.getLargestCapture(); FactoryOfPlaysForCpu factory = new FactoryOfPlaysForCpu(this,largestCapture); AbstractPlay play = factory.getBest(); return play; }
0
public boolean addPiece(Tetromino piece, int x, int y, int orientation){ boolean[][] tiles = piece.getTiles(); int count = 0; int width = piece.getTiles()[0].length == 9 ? 3 : 4; // get width (3 or 4) of piece width = piece.getTiles()[0].length == 4 ? 2 : width; for(int row = 0; row < width; ++row) { for(i...
6
public void insertFirst(int value) { if(isFull()) throw new ArrayIndexOutOfBoundsException(); for(int i = size; i > 0; i--) ListArray[i] = ListArray[i-1]; ListArray[0] = value; size++; }
2
public int getAnswerIndex() { if(answer == null || options == null || isSurvey || style != DROP_DOWN_QUESTION){ return -1; } for(int i=0; i<options.length; i++){ if(answer.equals(options[i])){ return i; } } return -1; }
6
protected static Class tryLoadMainClass(String jarFileName, String fileClassName) throws Exception { try { JarClassLoader loader; try { loader = new JarClassLoader(new URL("file:///" + jarFileName)); } catch (MalformedURLException exc) { throw new Exception("MalformedURLExcep...
4
public ListNode mergeKLists(ListNode[] lists) { if (lists.length == 0) return null; NavigableSet<ListNode> priorityQueue = new TreeSet<ListNode>( new ListNodeComparator()); for (ListNode node : lists) { if (node == null) continue; priorityQueue.add(node); } if (priorityQueue.isEmpty()...
7
@Override public void out() throws Exception { Object val = getFieldValue(); // Object val = access; if (ens.shouldFire()) { DataflowEvent e = new DataflowEvent(ens.getController(), this, val); // DataflowEvent e = new DataflowEvent(ens.getController(), this, access.to...
2
public boolean savemoreinfo() { BufferedWriter characterfile = null; try { characterfile = new BufferedWriter(new FileWriter("./moreinfo/"+playerName+".txt")); characterfile.write("[MOREINFO]", 0, 10); characterfile.newLine(); characterfile.write("character-clueid = ", 0, 19); characterfile.write(Intege...
6
private void jLabelUrlMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelUrlMousePressed if (evt.getButton() == java.awt.event.MouseEvent.BUTTON1 && jLabelUrl.isEnabled()) { if (java.awt.Desktop.isDesktopSupported()) { java.awt.Desktop desktop = java.awt.Desktop.ge...
6
public int nextSelectedIndex(int fromIndex) { int index = mSelection.nextSetBit(fromIndex); return index < mSize ? index : -1; }
1
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case boardPackage.BOARD__COUNTRIES: return ((InternalEList<?>)getCountries()).basicRemove(otherEnd, msgs); case boardPackage.BOARD__BORDERS: return ((InternalEList<?...
8
private List<ReducerEstimatedJvmCost> estimateReducersMemory(List<Reducer> eReducers, InitialJvmCapacity gcCap) { int fReducerNum = finishedConf.getMapred_reduce_tasks(); if(fReducerNum == 0) return null; List<ReducerEstimatedJvmCost> reducersJvmCostList = new ArrayList<ReducerEstimatedJvmCost>(); Re...
4
public int characterAt(int at) throws JSONException { int c = get(at); if ((c & 0x80) == 0) { return c; } int character; int c1 = get(at + 1); if ((c1 & 0x80) == 0) { character = ((c & 0x7F) << 7) | c1; if (character > 0x7F) { ...
8
public ChatRoom(String text, Client Client) { initComponents(); this.roomId = text; this.setTitle(text); this.client = Client; int screen_width = Toolkit.getDefaultToolkit().getScreenSize().width; int screen_height = Toolkit.getDefaultToolkit().getScreenSize().height; ...
1
@Override public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet) { if (npc.isScriptValue(0)) { int npcId = npc.getNpcId(); if (npcId != 20767) { for (int val : MINIONS.get(npcId)) { L2Attackable newNpc = (L2Attackable) addSpawn(val, npc.getX() + Rnd.get(-150, 150...
4
@EventHandler public void onGrowEvent(BlockGrowEvent evt){//FIXME if(evt.getBlock().getType().equals(Material.CROPS)){ if(((Crops)evt.getNewState().getData()).getState() == CropState.RIPE){ for(Farm farm : mainClass.farmList){ if(farm.containsBlock(evt.getBlock())){ evt.getNewState().update(); ...
6
@Override public void show() { System.out.println(name + ", here are your search results:"); Auction[] auctionResults = as.search(input); if(auctionResults.length > 0){ System.out.println(String.format("%-20s%-100s%-15s%-15s%-20s%-18s", "ID:", "Name:", "Current Bid:", "Bid Count:", "Owner:", "Ends By:")); }...
4
public int readPacketBytes( byte[] buf, int offset, int maxLength ) throws IOException { int b = read(); int i; for( i=0; b != -1 && (byte)b != END && i < maxLength; ++i ) { if( (byte)b == ESC ) { b = read(); if( (byte)b == ESC_END ) b = END; else if( (byte)b == ESC_ESC ) b = ESC; }...
6
byte[] buildBrushSoft(byte[] brush, CPBrushInfo brushInfo) { int intSize = (int) (brushInfo.curSize + .99f); float center = intSize / 2.f; float sqrRadius = (brushInfo.curSize / 2) * (brushInfo.curSize / 2); float xFactor = 1f + brushInfo.curSqueeze * MAX_SQUEEZE; float cosA = (float) Math.cos(brushInfo.curA...
3
public ListaSimpleProceso crearProceso(int cantProcesos) { String listadoProceso = ""; String nombre; int i = 1; while (i <= cantProcesos) { nombre = JOptionPane.showInputDialog("Nombre del proceso " + i); if (nombre.isEmpty()) { int j= cantProcesos; ...
2
private static Integer getNumber(String toBeFormatted) { StringBuilder sb = new StringBuilder(); char[] characters = toBeFormatted.toCharArray(); for (int i = 0; i < characters.length; i++){ if (characters[i] == '_') continue; else if (Character.isDigit(characters[i])){ sb.append(characters[i]); }...
3
@Test @Ignore public void test_AssociationListBulkDelete() { int liNumOfRecs = 3; // Setup AssociationList laAssocListData = associationListPost(liNumOfRecs); // End Setup // Bulk Delete DefaultResponse laResponse = laClient .postBulkDeleteAssociationList(laAssocListData); Assert.assertEquals(laRe...
1
public static JulianDate jauTaiutc(double tai1, double tai2) throws JSOFAIllegalParameter, JSOFAInternalError { boolean big1; int i; double a1, a2,dats1, ddats, dats2, datd = 0.0, as1, as2, da, d1, d2, fd; double utc1, utc2; /* Put the two parts of the TAI into big-first or...
7
private void completeInPlaceRestore(FileDTO file, VersionDTO version) throws DBException, IOException { Manager db = getDb(); Logger log = log(); ReplicaDTO replica = getCurrentReplica(); FileDAO fileDAO = db.findDAO(FileDAO.class); LastSyncDAO lsDAO = db.findDAO(LastSyncDAO.class); VersionDAO versionDAO...
7
public void setIsHostToZero(String hostName){ try { cs = con.prepareCall("{call SET_ISHOST_TO_ZERO(?)}"); cs.setString(1, hostName); cs.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } }
1
@Override protected EntityManager getEntityManager() { return em; }
0
private void test() { final String title = "PushTraps - Prueba"; final String body = "Esto es una notificación de prueba de Pushtraps. Si puedes ver este mensaje," + " la aplicación está funcionando"; BufferedReader bufferRead; Service service; int i; int option; try { UI.printHeader(); System....
2