text
stringlengths
14
410k
label
int32
0
9
@Override public int symlink(String from, String to) throws FuseException { try { if (fileSystem.isReadOnly()) return Errno.EROFS; /*if (!from.startsWith("/")) from = "/" + from;*/ if (!to.startsWith("/")) to = "/" + to; fileSystem.createSymbolicLink(to, from); } catch (PathNotFoundExcepti...
6
private void cancelKeys() { if (cancelQueue.isEmpty()) { return; } Selector selector = this.selector; for (;;) { CancellationRequest request = cancelQueue.poll(); if (request == null) { break; } ServerSocketCh...
6
@Override public void monsterAttackPlaceable(Monster source, Rectangle attackRect, int meleeDamage) { int dmg = 0; Placeable placeable = null; try { for (String key : placeables.keySet()) { placeable = (Placeable) placeables.get(key); dmg = placea...
3
public InputFrame(String source, Point sourcePoint){ this.frame = new JFrame(""); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocation(new Point(sourcePoint.x + 150, sourcePoint.y + 150)); this.source = source; switch(source){ case "artist": ArtistPanel aPanel = new ArtistPanel();...
6
public List getSaveList() { ArrayList var1 = new ArrayList(); File[] var2 = this.savesDirectory.listFiles(); File[] var3 = var2; int var4 = var2.length; for (int var5 = 0; var5 < var4; ++var5) { File var6 = var3[var5]; if (var6.isDirectory())...
7
static final private ArrayList<ThingVNode> argument_list() throws ParseException, CompilationException { ArrayList<ThingVNode> args = new ArrayList<ThingVNode>(); ArrayList<ThingVNode> value; Token t; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ACCESSOP: jj_consume_token(ACCESSOP); t = jj_con...
4
private boolean shouldWait(int txnId, Set<Integer> dependetTxns) { Set<BlockPtr> ptrList = blockPtrsInTxn.get(txnId); Iterator<Integer> iter = blockPtrsInTxn.keySet().iterator(); while (iter.hasNext()) { int txn = iter.next(); if (txn == txnId) { continue; } Set<BlockPtr> list = blockPtrsInTxn...
7
@EventHandler public void SpiderSpeed(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.getSpiderConfig().getDouble("Spider.Speed.Dod...
6
public static String checkPosition(String username, String pass){ Employee bean = new Employee(); bean.setUsername(username); bean = (Employee)DatabaseProcess.getRow(bean); //if username cannot be found in the database if(bean == null){ return "not found"; } if(bean.getUsername().equals(username...
3
@Override protected Authentication doAuthentication(Authentication authentication) throws AuthenticationException { if (!(authentication instanceof CustomAuthenticationToken)) { throw new IllegalArgumentException("Only CustomAuthenticationManager is supported"); } CustomAuthenticationToken authentic...
5
public void addToCanvas(Component comp, Integer i) { if (comp != statusPanel && !(comp instanceof JMenuItem) && !(comp instanceof FreeColDialog<?>) && statusPanel.isVisible()) { removeFromCanvas(statusPanel); } try { if (i == null) { supe...
7
@Override public boolean hasNext() { if (in == null) return false; // No file? => We are done if (binRead != null) return true; try { binRead = readerObject.read(in); if (binRead == null) close();// Nothing more to read? } catch (IOException e) { binRead = null; } return (binRead != null); }
4
@Override public void undo(UndoQueueEvent e) { if (e.getDocument() == Outliner.documents.getMostRecentDocumentTouched()) { calculateEnabledState(e.getDocument()); } }
1
public void GenerateIcons() { images = new ImageIcon[2]; for (int a = 0; a < 2; a++) { images[a] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR)); Graphics g; try { g = images[a].getImage().getGraphics(); } ...
7
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String string = Double.toString(d); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && ...
7
public void setContactList(ArrayList<EmailKontakt> contactList) { this.contactList = contactList; }
0
@Override public void execute(FileSearchBean task) throws Exception { final FileInputStream fileInputStream = new FileInputStream(task.getInputFile()); final BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream, bufferSize); try { // Naive substring ...
8
public static void addKampf(JSONObject fight, JSONObject data, String method) { if (isHtmlOutput()) { try { // Taktik speichern add(new TacticsLogFile(getInstance().htmlPath, data)); // Dateinamen generieren String filename = String.valueOf(new Date().getTime()) + fight.getJSONObject("o...
2
@Override public void paintComponent(Graphics g) { super.paintComponent(g); setBackground(this.c); try { switch(random) { case 0: image = makeImageIcon("/images/Ingress_Green.png").getImage(); ...
6
void clearLegacyEditingSetup() { if (!getControl().isDisposed() && getCellEditors() != null) { int count = doGetColumnCount(); for (int i = 0; i < count || i == 0; i++) { Widget owner = getColumnViewerOwner(i); if (owner != null && !owner.isDisposed()) { ViewerColumn column = (ViewerColumn) owner ...
9
public void draw() { if (y > -yNull && y < yNull && x < xNull && x > -xNull) { bits[(yNull - y) * pw + x + xNull] = GUIStandarts.figureColor; } }
4
@Override public List<? extends PictureI> searchfromTags(String search){ if(!(search.equals(""))){ List<Tag> tags = this.tagDao.findByLike("tag", search); List<? extends PictureI> pictures = new ArrayList<Picture>(); if(!(tags.isEmpty())){ for(TagI t: tags){ try{ for(TagI tag: this.tagDao.get...
8
public static void main(String[] args) { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (InstantiationException e1) { // TODO Auto-generated catch block ...
9
@Override public int compareTo(Object obj) { if (!(obj instanceof TimeInteger)) { return -1; } TimeInteger other = (TimeInteger) obj; if ((this.time < other.time) || (this.time == other.time && this.isStartingTime && !other.isStartingTime)){ return -1; } else if ((this.time > other.time)...
9
public void deal(Hand[] playerHand, int numPlayer, int numCard) { for (int i = 0; i < numCard; i++) { for (int j = 0; j < numPlayer; j++) { playerHand[j].add(dealCard()); } } }
2
public void setColumns(String ... columns) { columnNames = Arrays.asList(columns); for (int i = 0; i < columnNames.size(); i++) { info.put(i+1, new LinkedHashMap<String, String>(new HashMap<String, String>())); } }
1
public static void main(String[] args) { Scanner in = new Scanner(System.in); int inputCount = 0; Map<String, Integer> book = new HashMap<String, Integer>(); if (in.hasNext()) { inputCount = in.nextInt(); } for (int i = 0; i < inputCount; i++) { String callNumOri = in.next(); String callNum = decod...
6
@Override public void setValueAt(Object value, int row, int col) { Movement movement = rekening.getBusinessObjects().get(row); if (col == 1) { Calendar oudeDatum = movement.getDate(); Calendar nieuweDatum = Utils.toCalendar((String) value); if (nieuweDatum != null) movement.setDate(nieuweDatum); else s...
3
public void visit_invokespecial(final Instruction inst) { final MemberRef method = (MemberRef) inst.operand(); final Type type = method.nameAndType().type(); pop(type.paramTypes().length); pop(); // Pop receiver if (type.returnType() != Type.VOID) { push(inst); } }
1
public static Stella_Object walkVerbatimTree(Cons tree, Object [] MV_returnarray) { { PropertyList self000 = PropertyList.newPropertyList(); self000.thePlist = tree.rest; { PropertyList options = self000; Stella_Object verbatimtree = options.lookup(((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.g...
6
private void cssNthChild(boolean backwards, boolean ofType) { String argS = tq.chompTo(")").trim().toLowerCase(); Matcher mAB = NTH_AB.matcher(argS); Matcher mB = NTH_B.matcher(argS); final int a, b; if ("odd".equals(argS)) { a = 2; b = 1; } else if ("even".equals(argS)) { a = 2; b = 0; } else...
9
public static byte[] generatePELock( int serviceID, String PEList ) { if( PEList == null ) return null; if( PEList.length() == 0 ) return null; String[] pieces = PEList.split(","); //6567,451 int length = pieces.length; if(length == 0) return null; if( _longArray...
8
@Override public boolean equals(Object other) { if(other == null || !((other instanceof CaseInsensitiveString) || (other instanceof String))) { return false; } if(other instanceof String) { return value.equalsIgnoreCase((String)other); } else { return value.equalsIgnoreCase(((Cas...
4
private Object readResolve() throws ObjectStreamException { RectangleAnchor result = null; if (this.equals(RectangleAnchor.CENTER)) { result = RectangleAnchor.CENTER; } else if (this.equals(RectangleAnchor.TOP)) { result = RectangleAnchor.TOP; } el...
9
public static void checkCollision(ActorSet actors, int start, int stride){ // TODO it would be nice use a single list for all our threads List<Actor> actorsList = actors.getCopyList(); // Check our guy we stride to against all the others for(int i = start; i < actorsList.size(); i += str...
5
@Override /** * Verifica se o Tracker esta online */ public void run() { while (true) { if (!processo.knowTracker) { eleicao(); }else{ try { byte[] buf = new byte[1...
9
public static List<String> getPluginInventory() { List<String> pluginList = new ArrayList<String>(); try { File jarLocation = new File(ControllerEngine.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); String parentDirName = jarLocation.getParent(); // to get the parent dir nam...
5
public void getListDetails(String id) { float total = 0; float totalInterest = 0; float payment1 = 0; float payment2 = 0; try { String tempQuery = "select TO_DATE(amordate, 'YYYY-MM-DD') as monthly_schedule,mon_amort as monthly_payment,mon_interest as inte...
6
public static void main(String[] args) { InputStream r=null; OutputStream os = null; File file = new File("F://c.txt"); try{ r = new FileInputStream(file); // BOMInputStream bis = new BOMInputStream(r,false); os = new FileOutputStream("f://b.txt"); ByteArrayOut...
6
public static String convertTypeToLocation(ContactLocation type) { switch (type) { case DIALLED_CALLS: return "DC"; case MISSED_CALLS: return "MC"; case PHONE_ENTRIES: return "ME"; case SIM_ENTRIES: return "SM"; case ALL_ENTRIES: return "MT"; default: return ""; } }
5
public TeleporterGridFactory(Grid grid, FullGridFactory factory) { if (grid == null) throw new IllegalArgumentException("Grid can't be null!"); if (factory == null) throw new IllegalArgumentException("Factory can't be null!"); this.factory = factory; this.grid = grid; }
2
public void generate(String fileName) { try{ BufferedWriter bw = new BufferedWriter(new FileWriter(fileName)); bw.write("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">"); bw.newLine(); // Write the maze for(Edge e: svgLines){ bw.write("<line x1=\"" ...
2
private void checkFile() throws GOLException, IOException { if (fileTypeIsNotGol()) { throw new GOLException("Datei muss vom Typ .gol sein."); } if (fileSizeTooBig()) { throw new GOLException("Dateigröße darf maximal 250kb betragen."); } if (fileIsEmpty())...
4
boolean isSystemObjectDifferent(SystemObjectProperties property, SystemObject systemObject) { final SystemObjectType propertyType = getType(property.getType()); // Typ vergleichen if(propertyType != systemObject.getType()) { _debug.finer("Der Typ des konkreten Objekts " + systemObject.getPidOrNameOrId() + " p...
8
public Audio(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "autoplay": autoplay = Autoplay.parse(this, v); break; case "controls": controls = Controls.parse(thi...
7
@Override public void move(Excel start, Excel finish) { // TODO Auto-generated method stub for(int i=0;i<allex.size();i++) { if (start.getX() == allex.get(i).getX() && start.getY() == allex.get(i).getY()) { allex.remove(i); allex.add(i, finish); setColoredExes(); break; } } }
3
private void killPanda() { if (panda.getX()==fire.getX() && panda.getY()==fire.getY() && !fire.isHide() && !panda.isDied()) { panda.die(); spandadie.play(); } if (panda.getX()==arrow.getX() && panda.getY()==arrow.getY() && !arrow.isHide() && !panda...
8
public Object arbitrary(Random random, long size) { int arraySize = (int) Arbitrary.random(random, 0, Math.min(Integer.MAX_VALUE, size)); int[] dimensions = new int[dimension]; for (int i = 0; i < dimension; ++i) { dimensions[i] = a...
1
private int partition(int[] arrayIn, int lhs, int rhs, SorterParams.SortDirection sortDir) { int pivot = arrayIn[lhs + (rhs - lhs) / 2]; int i = lhs; int j = rhs; MemoryUsage.addMem(3); while(i <= j) { if(sortDir == SorterParams.SortDirec...
7
private static FrequencyTable getFrequencies(byte[] b) { FrequencyTable freq = new SimpleFrequencyTable(new int[3]); // InputStream input = new BufferedInputStream(new FileInputStream(file)); for (byte x : b) { freq.increment(x & 0xFF); } freq.increment(2); // try { // while (true) { // int b = ...
1
private void relockBootloader_fastbootButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_relockBootloader_fastbootButtonActionPerformed JOptionPane.showMessageDialog(null, parser.parse("relockBootldr:msg"), parser.parse("lockBootldr:msgTitle"), JOptionPane.INFORMATION_MESSAGE); Str...
3
public Set<Task> getTasks() { return tasks; }
0
public void insertRandom(List<Element> items){ firstFitItems(shuffleList(items)); }
0
private final void parseEndTag() throws IOException { int pos; read(); // '<' read(); // '/' mName = readName(); pos = mStack.size() - 1; if (pos < 0) { fail("element stack empty"); //$NON-NLS-1$ } if (mName.equals(mStack.get(pos))) { mStack.remove(pos); } else { fail("expected: " + mStack.g...
2
* The type of the LocalExpr */ public LocalExpr newStackLocal(final int index, final Type type) { if (index >= nextIndex) { nextIndex = index + 1; } return new LocalExpr(index, true, type); }
1
public void setUndefinedIds(Long id,long hash) { for (InsertionObject i : buffer) { if (i.getParentId() == null && i.getParentHash()==hash) { i.setParentId(id); } } }
3
public void spawnRateMedium() { if (spawnCounter > 300) { spawnCounter = 0; double spawnRandom = Math.random(); if (spawnRandom <= 0.33) { Boat b1 = new Boat(30,1,600,exit1); addObject(b1,800,61); } else if (spawnR...
4
public WorldChunk getChunkAt(int x, int y, boolean b) { int chunkID =(int) Math.floor(((float)x/16f)); WorldChunk chunk = this.chunksList.get(chunkID); if(chunk == null && b) { chunk = new WorldServerChunk(this, chunkID); ((WorldServerChunk)chunk).stopUpdate =...
8
private void handleKeys(ArrayList<KeyButtons> keyPressed, boolean setter) { if (keyPressed.contains(KeyButtons.LEFT)) { mario.setLeft(setter); } if (keyPressed.contains(KeyButtons.RIGHT)) { mario.setRight(setter); } if (keyPressed.conta...
9
public FileSystemFind() { crawler = new DirectoryCrawler(); }
0
void onArrowLeft (int stateMask) { if (horizontalOffset == 0) return; int newSelection = Math.max (0, horizontalOffset - SIZE_HORIZONTALSCROLL); update (); GC gc = new GC (this); gc.copyArea ( 0, 0, clientArea.width, clientArea.height, horizontalOffset - newSelection, 0); gc.dispose (); if (header.getVisib...
3
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { String[] queue = plugin.queue; if (args.length == 0) { if (sender.hasPermission("SimpleQueues.addself")) { if (Arrays.asList(queue).contains(sender.getName())) { sender.sendMessage("You are already in the queue.")...
7
@EventHandler(priority = EventPriority.MONITOR) public void adminJoin(PlayerJoinEvent event) { try { if(!enabled || !lock.compareAndSet(false, true)) return; Player p = event.getPlayer(); String[] out; if(needUpdate) { if(hasPermission(p, "autoupdate.announce")) { out = new String[] { ...
8
public static BufferedReader queryCDD (String dataType, String query) throws Exception { URL url = new URL(CDD_BATCH_URL); String queryString = CDD_BATCH_QUERY+"&tdata="+dataType+query; // System.out.println("Querying "+CDD_BATCH_URL+" with query: \n-->"+queryString); HttpURLConnection con = (HttpURLConnection)...
8
public static void addData(float x, float y, float size, int id) { data.put(id, new ChartItem(new PVector(x, y), size, id)); // Update MAX and MIN values minX = (x < minX) ? x : minX; minY = (y < minY) ? y : minY; minSize = (size < minSize) ? size : minSize; maxX = (x > maxX) ? x : maxX; maxY = (y > maxY...
6
public String[] copy(String[] board){ String[] newboard = new String[board.length]; for(int i = 0 ; i<board.length ; i++){ newboard[i] = board[i].substring(0); } return newboard; }
1
private void ensurePossible(int x, int y) { int newCharSize1 = charSize1; int newCharSize2 = charSize2; while (x >= newCharSize1) { newCharSize1 *= 2; } while (y >= newCharSize2) { newCharSize2 *= 2; } if (newCharSize1 != charSize1 || newCharSize2 != charSize2) { final char newChars[][] = new cha...
8
public Admin() { // initializing components setTitle("Conference Room Booking System"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); SpringLayout sl_contentPane ...
5
private final void acceptConnection(final SelectionKey key, MMOConnection<T> con) { ServerSocketChannel ssc = (ServerSocketChannel) key.channel(); SocketChannel sc; try { while ((sc = ssc.accept()) != null) { if ((_acceptFilter == null) || _acceptFilter.accept(sc)) { sc.configureBlocking(...
4
public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if (headA == null || headB == null) return null; ListNode tempA = headA; while (tempA.next != null) { tempA = tempA.next; } tempA.next = headB; ListNode fast = headA; ListNode slow = headA; while (fast != null && fast.next != nu...
9
private CoastlineNode getNodeInformation(Attributes attributes) { String idStr = attributes.getValue("id"); String latStr = attributes.getValue("lat"); String lonStr = attributes.getValue("lon"); // Avoid null pointer reference! if (idStr != null && latStr != null && lonStr != nu...
5
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 void dir(){ try{ if( file.exists() && file.isDirectory() ){ File files[] = file.listFiles(); int cf = 0, cd =0; long slengths = 0; for( File f : files ){ Date ultima = new Date( f.lastModified...
6
public void shrink(final Object o, final Method m, final Object[] args) { try { Object r = m.invoke(o, args); if(r instanceof SingleTestResult) { SingleTestResult result = (SingleTestResult)r; if(!result.isDiscarded && (result.expect != result.ok)) { } } } catch (I...
6
final public void run() { server.clientConnected(this); // This loop reads the input stream and responds to messages // from clients try { // The message from the client Object msg; while (!readyToStop) { // This block waits until it reads a message from the client // and then sends it for ha...
4
public static String dumpByteArray(byte[] bytes) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < bytes.length; i++) { byte b = bytes[i]; int iVal = b & 0xFF; int byteN = Integer.parseInt(Integer.toBinaryString(iVal)); sb.append(String.format("%1$02d: %2$08d %3$1c %3$d\n" , i, byteN, iVal));...
1
void notifyRefreshFiles(File[] files) { if (files != null && files.length == 0) return; if ((deferredRefreshRequested) && (deferredRefreshFiles != null) && (files != null)) { // merge requests File[] newRequest = new File[deferredRefreshFiles.length + files.length]; System.arraycopy(deferredRefreshFiles, ...
5
public void reset() { start(); }
0
public void draw(Graphics2D g2) { if (bImage == null) { File imageFile = new File(baseDir + imageFileName); try { bImage = ImageIO.read(imageFile); } catch (IOException e) { e.printStackTrace(); } } if(firing) frames = 2; else frames = 3; if (xIncrement > frames) { xIncrement ...
8
public void saveConfig() { if (fileConfiguration == null || configFile == null) { return; } else { try { getConfig().save(configFile); } catch (IOException ex) { plugin.getLogger().log(Level.SEVERE, "Could not save config to " + configFile, ex); } } }
3
public Location getCorner(int i) { switch (i) { case 1: return loc1; case 2: return loc2; case 3: return loc3; case 4: return loc4; } return null; }
4
public List<String> letterCombinations(String digits) { String[] mapping = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; List<String> result = new ArrayList<String>(); if (digits == null || digits.length() == 0) { return result; } int a = digits.charAt...
5
private String loginUser(String name, String cmd,String pass) throws InterruptedException, IOException { readUntil(GosLink2.prps("puser")); write(name); readUntil(GosLink2.prps("ppass")); write(pass+"\r\n"); readUntil(GosLink2.prps("pmenu")); if (ghost == 1){ write("=x\n"); ghost=0; return "reload"...
1
public int removexattr(ByteBuffer path, ByteBuffer name) { if (xattrSupport == null) { return handleErrno(Errno.ENOTSUPP); } String pathStr = cs.decode(path).toString(); String nameStr = cs.decode(name).toString(); if (log != null && log.isDebugEnabled()) { ...
4
private void writeImage() throws IOException { int pImage[] = new int[height * height]; for (int row = 0, count = 0; row < height; row++) { for (int col = 0; col < width; col++) { pImage[count] = rgbArray[row][col]; count++; } } img...
2
public ItemID setType(int t) throws ShellLinkException { if (t == TYPE_CLSID) { type = t; clsid = mycomputer; return this; } if (t == TYPE_FILE || t == TYPE_DIRECTORY || t == TYPE_DRIVE || t == TYPE_DRIVE_OLD) { type = t; return this; } throw new ShellLinkException("wrong type"); }
5
public String getDescription() { return description; }
0
public ArrayList<Pizza> haePizzat() throws DAOPoikkeus { ArrayList<Pizza> pizzat = new ArrayList<Pizza>(); // avataan yhteys Connection yhteys = avaaYhteys(); try { // Haetaan tietokannasta Pizzat ja täytteet String pizzaSQL = "select Tuote.nimi, Tuote.numero, Tuote.hinta, Tuote.tuoteID, Tuot...
4
public boolean setShutdownButtonWidth(int width) { boolean ret = true; if (width < 0) { this.buttonShutdown_Width = UISizeInits.SHD_BTN.getWidth(); ret = false; } else { this.buttonShutdown_Width = width; } somethingChanged(); return...
1
private void visitParameterLoad(Parameter parameter) throws JavaBytecodeCompilerException { if (parameter instanceof ObjectParameter) { Object value = parameter.evaluate(); Integer intValue = (Integer) value; switch (intValue) { case 0: met...
9
public static void main(String[] args) { if (System.getProperty("os.name").indexOf("Mac") == -1) { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); ...
5
public int getBoardCommentaryCount(int idx) throws Exception{ Connection conn = null; PreparedStatement pstmt = null; ResultSet rs =null; int result = 0; String sql = ""; try{ conn = getConnection(); sql = "select count(*) from foodcommentary where idx=?"; pstmt = conn.prepareStatement(sql); pst...
8
private static Set<Class<?>> getAllRelatedClassesOf(Class<?> c) { Set<Class<?>> a = new LinkedHashSet<>(); a.add(c); for (Class<?> class1 : c.getInterfaces()) a.addAll(getAllRelatedClassesOf(class1)); Class<?> superClass = c.getSuperclass(); if (superClass != null) ...
7
final private boolean jj_3R_25() { Token xsp; xsp = jj_scanpos; if (jj_3R_27()) { jj_scanpos = xsp; if (jj_3R_28()) { jj_scanpos = xsp; if (jj_3R_29()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) re...
9
public static String simpleFormatted(byte[] data){ if(data == null) return null; String simpleStr; simpleStr = ""; String binary = getBinary(data); String hex = getHex(data); byte[] bytes = data; int len = hex.length() / 2; int step = 4; int count = (int) Math.ceil(len / step); for(int i = 0; i < co...
8
public boolean sendMessage(String mobileNumber, String message) { if(message.length()>140) return false; Map params=new HashMap(); params.put("Token", this.token); nav.setReferer(nav.getCurrentDomain().toExternalForm()+"Main.action?id="+this.token); Response res...
8
public GUI(Sprinkles s){ super("Sprinkles"); this.s = s; this.setSize(200, 200); this.setTitle("Sprinkles"); this.setJMenuBar(createMenubar()); this.s = s; this.s.setGui( this ); left = new JScrollPane( new JPanel() ); right = new JScrollPane( new JPanel() ); left.setHorizontalScrollBarPoli...
4
@Override public String breakOutMaskString(String s, List<String> p) { String mask=""; int x=s.toUpperCase().lastIndexOf("MASK="); if(x>=0) { mask=s.substring(x+5).trim(); int i=0; while((i<p.size())&&(p.get(i).toUpperCase().indexOf("MASK=")<0)) i++; if(i<=p.size()) { final String pp=p....
7
@Override @RequestMapping(value = "/beers", method = RequestMethod.GET) @ResponseBody public BeerResponseList list() { Collection<Beer> beers = persistenceService.list(Beer.class); return BeerResponseList.create(beers); }
0
private void matchStereochemistryToAtomsAndBonds(Element stereoChemistryEl) throws StructureBuildingException, StereochemistryException { String stereoChemistryType =stereoChemistryEl.getAttributeValue(TYPE_ATR); if (stereoChemistryType.equals(R_OR_S_TYPE_VAL)){ assignStereoCentre(stereoChemistryEl); } else ...
9