text
stringlengths
14
410k
label
int32
0
9
public static void main(String[] args) throws Exception { int choice = -1; while (choice < 4) { System.out.println("Please Enter your choice\n"); System.out .println("1. Create New Array \n2. Search Element \n3. Delete Element \n4. Exit\n"); BufferedReader reader = new BufferedReader(new InputStreamRe...
8
private void init() { try { // Setup Parser factory = SAXParserFactory.newInstance(); factory.setValidating(true); reader = factory.newSAXParser().getXMLReader(); reader.setErrorHandler(new SimpleSAXErrorHandler()); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAX...
2
private static double readNum(String[] tokens,int[] st,int end,boolean allowNeg,int lnum,String line) throws IOException{ if(st[0]==end) throwMe("syntax error",lnum,line); String s=tokens[st[0]++]; boolean neg=s.equals("-"); if(neg){ if(!allowNeg) throwMe("envelope durations must be positive",lnum,line); ...
6
private void addFirst(Item item) { if (item == null) throw new NullPointerException(); if (isEmpty()) { first = new Node<Item>(); last = new Node<Item>(); first.item = item; last = first; } else { Node<Item> node = new Node<...
2
public void setParameterDefs(ArrayList<Attribute> paramDefs) throws Exception { if (paramDefs.size() != m_parameters.size()) { throw new Exception("[DefineFunction] number of parameter definitions does not match " + "number of parameters!"); } // check these defs against the optypes of ...
7
public static void main(String args[]){ String[][] dateExamples = new String [][]{{"24-04-2013", "27-04-2013"},{"24-10-2014","27-10-2014"},{"29-03-2014","31-03-2014"},{"01-04-2014","31-03-2014"}} ; for (String[] testData : dateExamples) { int num = DateTimeComparisonSampler.numberOfDaysWro...
3
@Override public String putString(Rider R) { switch(rideBasis) { case Rideable.RIDEABLE_AIR: case Rideable.RIDEABLE_LAND: case Rideable.RIDEABLE_WAGON: case Rideable.RIDEABLE_WATER: case Rideable.RIDEABLE_SLEEP: case Rideable.RIDEABLE_ENTERIN: return "in"; case Rideable.RIDEABLE_SIT: case Ridea...
9
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, DataAccessException, Exception { response.setContentType("text/html;charset=UTF-8"); // app initialization parameters String email = this.getServletContext()....
8
public int getY(Board board, int x) { for (int y=0; y<6; y++) { if (board.get_state(x, y) == 0) { return y; } } return -1; //return -1 if column is full }
2
final public void BraExp() throws ParseException {/*@bgen(jjtree) BraExp */ SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTBRAEXP); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { jj_consume_token(LEFTB); Expression(); jj_consume_token(RIGHTB); } catch (Throw...
8
public GraphPanel(int width, int height) { this.setPreferredSize(new Dimension(width, height)); requestFocus(); requestFocusInWindow(); addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { ctrl = e.isControlDown(); ...
9
public final void method65(int i, int[] is, int i_8_, int i_9_, int i_10_, byte i_11_, int i_12_) { if (Class108.aClass304_1662 != ((Class310_Sub2) this).aClass304_3896 || ((Class310_Sub2) this).aClass68_3895 != Class68.aClass68_1183) throw new RuntimeException(); if (i_11_ != 112) ((Class310...
6
public void updateStatus(){ if(jobState == JobState.MAP_RUNNING || jobState == JobState.REDUCE_RUNNING){ int numTaskComplete = 0; Map<Integer,Task> runningTasks = null; if (jobState == JobState.MAP_RUNNING){ runningTasks = this.mapTasks; } else ...
9
public static PastPane getPastPaneNoScroll(Configuration configuration) { return new PastPane(configuration); }
0
private void doLog(String msg){ if(toConsole) { System.out.append(msg); System.out.flush(); } if(toFile) { try { fw.append(msg); fw.flush(); } catch(IOException e) { e.printStackTrace(); log.log(Level.SEVERE, "IOException while writing to LogFile!"); //<_may cause loop!? } } if(...
5
@Override public void tActionEvent(TActionEvent event) { Object source = event.getSource(); if (source == newSimButton) { mainMenu.setX(0); newSimMenu.setX(640); simWidth = (int) simWidthSlider.getValue(0); } else if (source == resumeSimButton) { if (Hub.simW...
8
public void randomRoom(Rectangle bounds) { Point bstart = bounds.start; Point bend = bounds.end; int max_x = (int) (bend.x - bstart.x - min_size.x + 1); int max_y = (int) (bend.y - bstart.y - min_size.y + 1); int x = Rand.randRange(1, max_x); int y = Rand.randRange(1, max...
1
public void processFile() { LOG.info("processFile ... " + file); // final Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); // LOG.info("Locale : " + locale.getDisplayName()); if (file != null) { try { final InputStream is = file.getIn...
3
public void printImplements(final PrintWriter out, int indent) { // There are multiple roots to the implements graph. indent += 2; final Iterator roots = this.implementsGraph.roots().iterator(); while (roots.hasNext()) { final TypeNode iNode = (TypeNode) roots.next(); indent(out, indent); out.println(i...
1
@Override public void printAnswer(Object answer) { if (!(answer instanceof int[])) return; int[] choices = (int[]) answer; for (int i=0; i<choices.length; i++){ System.out.println(i+"). "+choices[i]); } }
2
private void btnRestartSyncActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRestartSyncActionPerformed // Make sure we ended current synch process // If not, ask user what to do with current synch process if (this.syncState != SyncState.COMPLETE) { if (JOptionPan...
2
private static Map<String, DPermission> groupPagesByPermissions(String source) { //convert input to array List<DPermission> list = new ArrayList<DPermission>(); String[] array = source.split("\n"); for (String s : array) { String[] perArray = s.split(","); DPermis...
8
public static String getDirectory(){ String relativeWdPath,workingDirectory; String inputFileName; //Folder workingDirectory; //Because userHome is a public static field, it can be used without having initialized any instance of Folder: //This because the static variables have their own memory sp...
5
private void moveNewZipFiles(String zipPath) { File[] list = listFilesOrError(new File(zipPath)); for (final File dFile : list) { if (dFile.isDirectory() && this.pluginExists(dFile.getName())) { // Current dir final File oFile = new File(this.plugin.getDataFol...
7
public Component getListComponentForDataSection(TaskObserver taskObserver, String dataSectionName, List list, Iterator indexIterator) throws InterruptedException { if ( (GameVersion.MM6 == outdoorDataMap.getGameVersion()) && (dataSectionName == DATA_SECTION_TERRAIN_NORMAL_DATA) ) return getNonApp...
7
public void sumMatrix() { // Sums the matrix and places the result in the Division Factor text box float sum = 0; int size = Integer.parseInt(windowSizes[jComboBox1.getSelectedIndex()].substring(0,1)); int start_position = 0; switch(size) { case...
7
private boolean canTrim() { if(!(s.endsWith(")")&&s.startsWith("("))) { return false; } int grade=1; for(int i=1;i<s.length()-1;i++) { if(s.charAt(i)==')') { grade--; } else if(s.charAt(i)=='(') { grade++; ...
6
public void preiseAnpassen() { int unterschiedMehl = this.mengeMehlEnde - this.mengeMehlAnfang; int unterschiedKorn = this.mengeKornEnde - this.mengeKornAnfang; // wenn der Mehlendbestand sich um min. 50% des Anfangsbestandes erhöht // hat wird das Mehl ggf. billiger if ( unterschiedMehl >= ( (int) ( this.m...
8
public void run() { //WHILE loop for game commands while (AL_ManagerCommands.size() > 0) { //Checking which command to pick // ::: ::: ::: ::: ::: /* DESTROY * * Format: [COMMAND #], object ID * */ if (AL_ManagerCommands.get(0)[0] == REMOVE) { DestroyByID(AL_ManagerCommands.ge...
5
public static String getFolder() { os = OS.getOS(); String path = ""; switch (os) { case LINUX: path = System.getProperty("user.home", ".") + File.separator + ".minecraft" + File.separator; break; case WINDOWS: String appdat...
5
public int getAttributes() { int perms = 0; if (archive) perms |= net.decasdev.dokan.FileAttribute.FILE_ATTRIBUTE_ARCHIVE; if (compressed) perms |= net.decasdev.dokan.FileAttribute.FILE_ATTRIBUTE_COMPRESSED; if (encrypted) perms |= net.decasdev.dokan.FileAttribute.FILE_ATTRIBUTE_ENCRYPTED; ...
8
public void closeTag(LangProfile profile) { if (profile != null && tag_ == target_ && buf_.length() > threshold_) { NGram gram = new NGram(); for(int i=0; i<buf_.length(); ++i) { gram.addChar(buf_.charAt(i)); for(int n=1; n<=NGram.N_GRAM; ++n) { ...
5
private void addMenuItemForFileToMenu(DocumentInfo docInfo) { RecentFilesListItem menuItem = null; // switch on nameform to create a menu item String path = PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PATH); switch (currentDisplayNameForm) { case FULL_PATHNAME: default: ...
5
public DrawableTree getCurrentTree() { DrawableTree tree = null; if (currentLine == null) return null; try { int index = currentLine.indexOf("("); int parenDepth = 1; int lastIndex = 0; StringBuilder treeStrBuilder = new StringBuilder(); treeStrBuilder.append("("); //If the tree spans multip...
9
public SimulationWorkerResult(double[] wins, double[] ties, double[] loses) { if (wins == null || ties == null || loses == null) { throw new NullPointerException(); } else if (wins.length != ties.length || ties.length != loses.length) { throw new IllegalArgumentException(); ...
5
public Serializable call(Class<?> iface, Serializable param, long receivedTime) throws IOException { try { Invocation call = (Invocation) param; //调用参数 Invocationd对象包含方法名称 形式参数列表和实际参数列表 if (verbose) log("Call: " + call); //从实例缓存中按照接口寻找实例对象 Object instance = INSTANCE_CACHE.get(iface); if ...
9
@Override public void handle(String dataDir, String arg) throws Exception { if(inputDataDir == null || inputDataDir.length() == 0) { inputDataDir = dataDir; } File queryFile = new File(arg); if(queryFile.exists()) { if(queryFile.isDirectory...
9
@Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : ""; if((!mob.isAttributeSet(MOB.Attrib.AUTOLOOT) && (parm.length()==0))||(parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB.At...
8
private void generateClassifierForNode(Instances data, Range classes, Random rand, Classifier classifier, Hashtable table) throws Exception { // Get the indices int[] indices = classes.getSelection(); // Randomize the order of the indices for (int j = ind...
8
public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); n = Integer.parseInt(br.readLine()); cost = new int[n]; StringTokenizer st = new StringTokenizer(br.readLine()); for(int i=0; i<n; i++){ ...
8
public static void main(String[] args) throws Exception { String env = null; if (args != null && args.length > 0) { env = args[0]; } if (! "dev".equals(env)) if (! "prod".equals(env)) { System.out.println("Usage: $0 (dev|prod)\n"); ...
8
public static double findNetworkDistance(NeuralNetwork one,NeuralNetwork two){ ArrayList<Node> oneNodes=Node.sort(one.getAllNodes()); ArrayList<Node> twoNodes=Node.sort(two.getAllNodes()); double distance=0.0; int i=0; int f=0; int oneIn=oneNodes.get(i).getInnovationNum(); int twoIn=t...
6
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed if(this.jTextField1.getText().isEmpty()){ Error np = new Error(this,true); np.ready("Debe ingresar su nombre de usuario"); np.setVisible(true); } else{ ...
2
private void compute_new_v_old() { // p is fully initialized from x1 //float[] p = _p; // pp is fully initialized from p //float[] pp = _pp; //float[] new_v = _new_v; float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure 3-A.2 in ISO DIS 11172-3 float[] p = new float[16]; float[]...
1
public String toString() { return id + ": " + "i4 = " + i4 + ", INT_5 = " + INT_5; }
0
public void buttonClicked(String actionCommand) { if (MANAGE.equals(actionCommand)) { showAccountManager(accounts, accountTypes); } else if (DETAILS.equals(actionCommand)) { AccountDetails.getAccountDetails(lijst.getSelectedValue(), journals, journalInputGUI); } else if (...
3
public FoodFileBean getFileName(int idx) throws Exception{ Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; FoodFileBean fileBean = null; String sql = ""; String filename = ""; String fileTmp = ""; try{ conn = getConnection(); sql = "select * from foodfile where idx=?";...
9
private static boolean isHexString(String str) { if (str == null || !(str.startsWith("0x") || str.startsWith("0X")) || str.length() <= 2) return false; for (int i = 2; i < str.length(); i++) { if ("0123456789ABCDEFabcdef".indexOf(str.substring(i, i+1)) < 0) { ...
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Game other = (Game) o; if (getQuestionsCount() != other.getQuestionsCount() || !getName().equals(other.getName())) { return false; }...
7
private boolean mouseOverBottomArrow(int mx, int my) { if (!isVisible) return false; if (mx < positionX || mx > positionX + width) return false; if (my < positionY || my > positionY + height) return false; return (my >= positionY + height - 16); }
5
public double pow(double x, int n) { if (n == 0) return 1; if (n == 1) return x; if (n == -1) { if (x != 0) { return 1 / x; } else { return Integer.MAX_VALUE; } } // n>=2 || n<=-2; double square = x * x; if (n > 0) { int powerForSquare = n / 2; int restPower = n % 2; re...
5
public void testXML2JSON(){ String generatedJson = "{\"response\":{\"ip_addresses\":{\"ip_address\":\"66.249.17.251\",\"domain_names\":[\"DMAINTOOLS.COM\",\"DOAMINTOOLS.COM\"],\"domain_count\":52}}}"; String originalJson = "{\"response\":{\"ip_addresses\":{\"ip_address\":\"66.249.17.251\",\"domain_count\":52,\"doma...
3
@Override public int mover() { Partida.Pantalla pantalla = Partida.getPantalla(); //cambiamos el estado del disparo si saliera del panel del Juego if(x < -width) return -1; if(x > pantalla.getX()*2 + pantalla.getWidth()) return -1;//sale por...
4
public void test_add_RP_int_intarray_int() { int[] values = new int[] {10, 20, 30, 40}; int[] expected = new int[] {10, 20, 30, 40}; BaseDateTimeField field = new MockStandardBaseDateTimeField(); int[] result = field.add(new TimeOfDay(), 2, values, 0); assertEquals(true, Arrays.e...
4
public Boolean http_status_filter(String url){ HttpResponse response; try { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpGet httpget=new HttpGet(url); httpget.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 3000); resp...
3
private boolean shouldIgnorePacket(DatagramPacket packet) { boolean result = false; InetAddress from = packet.getAddress(); if (from != null) { if (from.isLinkLocalAddress() && (!_BoundAddress.isLinkLocalAddress())) { // Ignore linklocal pack...
5
public BookBuilderSpec<P> paperColors(Map<PaperBuilderSpec<?>, ColorBuilderSpec<?>> paperColors) { verifyMutable(); if (this.paperColors == null) { this.paperColors = new HashMap<PaperBuilderSpec<?>, ColorBuilderSpec<?>>(); } if (paperColors != null) { for (Map.Entry<PaperBuilderSpec<?>, ColorBuilderSpec...
9
public String apply(String s) { if (s == null) { if (matchesNull()) { if (!replace.contains("$1")) { return replace; } } return null; } Matcher m = pattern.matcher(s); StringBuffer sb = new StringBuff...
5
public void setOpponentSkin(int character) { String s; s = character == 0 ? "/Characters/TestChar.png" : "/Characters/TestChar2.png"; // load sprites try { final BufferedImage spritesheet = ImageIO.read(getClass() .getResourceAsStream(s)); sprites = new ArrayList<BufferedImage[]>(); for (...
4
@Override public boolean equals(Object other) { if (other instanceof BackpackData) { return ((BackpackData) other).isRegistered() == this.isRegistered() && ((BackpackData) other).getType().equals(this.getType()) && ((BackpackData) other).getOwner().equals(...
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TextAnalyzer other = (TextAnalyzer) obj; if (averageSentenceCharLength != other.averageSentenceCharLength) return false; if (averageSentence...
9
@Override public List<ByteBuffer> transfer(List<ByteBuffer> elements) { List<ByteBuffer> denied = new ArrayList<ByteBuffer>(); // Calculate how much memory is transfered to this factory, and build // a list of the buffers denied for caching. for (ByteBuffer b : elements) { // If the buffer can be cached,...
3
@Override public int hashCode() { int result = _name.hashCode(); result = 31 * result + (_hidden ? 1 : 0); result = 31 * result + (_systemHidden ? 1 : 0); result = 31 * result + _resultType.hashCode(); result = 31 * result + (_value != null ? _value.hashCode() : 0); result = 31 * result + (_...
7
private void ParseHtml(StringBuffer buffer, ITag root) throws HtmlParseException { int startIndex = 0; // Iterate as long as there are children while (true) { int startTagStartIndex = 0; int startTagEndIndex = 0; int endTagStartIndex = 0; int endTagEndIndex = 0; // Find the beginning of the ne...
8
public static void main(String args[]) throws Exception, CannotProduceDateParser, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { String xmlPath = "monitor.xml"; if (args.length > 0) xmlPath = args[0]; xmlPath = new File(...
4
public int maximumGap(int[] nums) { if (nums.length < 2) { return 0; } int max = 0; int min = Integer.MAX_VALUE; for (int n : nums) { max = Math.max(max, n); min = Math.min(min, n); } int len = (max - min) / nums.length + 1; int size = (max - min) / len + 1; int buckets[][] = new int[size][2]...
8
public String getSuperclass() { if (cachedSuperclass == null) cachedSuperclass = constPool.getClassInfo(superClass); return cachedSuperclass; }
1
private Dimension layoutSize(Container target, boolean preferred) { synchronized (target.getTreeLock()) { // Each row must fit with the width allocated to the containter. // When the container width = 0, the preferred width of the container // has not yet been calculated so lets ask for the maximum. int ...
8
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Null pointer"); } testValidity(number); // Shave off trailing zeros and decimal point, if possible. String string = number.toString(); if (string...
6
public void test_append_nullPrinter() { try { DateTimeFormatterBuilder bld2 = new DateTimeFormatterBuilder(); bld2.append((DateTimePrinter) null); fail(); } catch (IllegalArgumentException ex) { // expected } }
1
public void render() { try { buffer = createImage(720, 720); Graphics g = buffer.getGraphics(); Graphics i = image.getGraphics(); g.drawImage(board.getImage(), 0, 0, 720, 720, this); i.drawImage(board.getImage(), 0, 0, 720, 720, this); g.setColor(Color.BLACK); g.drawRect(x - 25, y - 25, 50, 5...
8
public static void main(String[] args) { // Create a variable for the connection string. String connectionUrl = "jdbc:sqlserver://localhost:1433;" + "databaseName=AdventureWorks;integratedSecurity=true;"; // Declare the JDBC objects. Connection con = null; Stateme...
7
public void setLeaves(final List leaves) { if (SSAPRE.DEBUG) { System.out.println("setting leaves of " + this + " to " + leaves); } this.leaves = new ArrayList(leaves); }
1
public static void print(int[][] table, CustomLogic logic) { int padding = String.valueOf(table[table.length - 1][table[0].length - 1]).length(); String strFmt = " %" + padding + "s |"; String dgtFmt = " %" + padding + "s |"; String sep = "+"; for (int i = 0; i < padding + 2; i++...
6
public boolean quitChecker(String input) { boolean okToQuit = false; if(input != null && input.equals("bye")) { okToQuit = true; } return okToQuit; }
2
private String DDCRET_String(int retcode) { switch ( retcode ) { case DDC_SUCCESS: return "DDC_SUCCESS"; case DDC_FAILURE: return "DDC_FAILURE"; case DDC_OUT_OF_MEMORY: return "DDC_OUT_OF_MEMORY"; case DDC_FILE_ERROR: return "DDC_FILE_ERROR"; case DDC_INVALID_CALL:...
7
@Override public void show() { // Lazy Instantiation if (!initialized) { initialize(); initialized = true; } OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(); documentTitleValue.setText(doc.getTitle()); int lineCount = doc.tree.getLineCount(); lineCo...
1
public void enable() throws IOException { // This has to be synchronized or it can collide with the check in the task. synchronized (optOutLock) { // Check if the server owner has already set opt-out, if not, set it. if (isOptOut()) { configuration.set("opt-out", ...
2
public void close() throws IOException { //init(); isInited = true; internalIn.close(); }
0
@RequestMapping(value = "del", method = RequestMethod.POST) @ResponseBody public Map del(@RequestParam int[] id) { Map<String, Object> map = new HashMap<>(); List<String> l1 = new ArrayList<>(); List<String> l2 = new ArrayList<>(); List<String> l3 = new ArrayList<>(); f...
5
@Override protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { DatabaseManager manager=DatabaseManager.getManager(); try { MultipurposeRoom room = manager.getMultipurposeRoomDao().queryForId( Integer.parseInt(request.getParameter(ID))); if(r...
6
public ByteBuffer formatCommand(String format, Object... args) throws IOException { Preconditions.checkNotNull(format); for (Object arg : args) { Preconditions.checkNotNull(arg); } int argidx = 0; ByteBuffer result = BufferUtils.EMPTY; ...
7
void setProperty(String propertyName, Object value, BitSet bs) { if ("color" == propertyName) { isActive = true; short colix = Graphics3D.getColix(value); if (bsColixSet == null) bsColixSet = new BitSet(); byte pid = JmolConstants.pidOf(value); for (int i = atomCount; --i >= 0;...
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Project_eXceed)) return false; Project_eXceed other = (Project_eXceed) obj; if (id != other.id) return false; if (project_Name == null) { if (other.project_Name != ...
8
@Override public void caseADeclAvalieDefinicaoComando(ADeclAvalieDefinicaoComando node) { inADeclAvalieDefinicaoComando(node); if(node.getAvalie() != null) { node.getAvalie().apply(this); } if(node.getLPar() != null) { node.getLPar().apply(...
8
@Override public int compareTo(SASRunner compareTarget) { if (this.priorityLevel != null || compareTarget.getPriority() != null) { if (this.priorityLevel > ((SASRunner)compareTarget).getPriority()) { return -1; } else if (this.priorityLevel < ((SASRunner)compareTarget).getPriority()) { ret...
4
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final int dirCode=CMLib.directions().getDirectionCode(CMParms.combine(commands,0)); if(dirCode<0) { mob.tell(L("Climb where?")); return false; } if((mob.location().getRoomInDir(dirCode)==...
9
@Override protected void lock() { while (true) { if (!calcLocker.isWriteLocked() && calcLocker.writeLock().tryLock()) if (calcLocker.getWriteHoldCount() != 1) calcLocker.writeLock().unlock(); else if (hasAdjustment() == PRO_ADJ_PAR ...
6
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final BinaryNode other = (BinaryNode) obj; if (left == null) { if (other.left != null) { return false; } } el...
9
public static BufferedImage buildCostume(Object[] form) { int width = ((Number)form[0]).intValue(); int height = ((Number)form[1]).intValue(); int depth = ((Number)form[2]).intValue(); int[] bitmap; try { bitmap = decodePixels((byte[]) form[4]); } catch (IOException e) { System.err.println("Fail...
7
public int plusDILookback( int optInTimePeriod ) { if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) ) optInTimePeriod = 14; else if( ((int)optInTimePeriod < 1) || ((int)optInTimePeriod > 100000) ) return -1; if( optInTimePeriod > 1 ) return optInTimePeriod + (this.unstab...
4
@SuppressWarnings("unchecked") public Transition usingId(Id id) { if (this.id != null) { throw new IllegalStateException("Id already assigned!"); } this.id = id; return this; }
1
public synchronized void preDraw(Graphics2D g) { if (!updated) { dw = dh = 0; lines.clear(); for (Information info : list) { dw = Math.max(dw, (double) info.wrap(g, maxWidth, lines)); // Mala medzera medzi spavami dh -= g.getFon...
7
@Override public LinkedList<Tuple<Sentence_tree, Tuple<String, String>>> interesting_subtree(Hashtable<String,Boolean> voc, Hashtable<String, Boolean> subvoc){ LinkedList<Sentence_tree> keyword_list = bfs_name(voc); LinkedList<Tuple<Sentence_tree, Tuple<String, String>>> interest = new LinkedList<Tuple<Sentence_tr...
7
public String compileDetail(){ myCompiler.compileSource(pass_code); return SUCCESS; }
0
@SuppressWarnings("unchecked") @Override public void drop(DropTargetDropEvent event) { Transferable tr = event.getTransferable(); if (tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { event.acceptDrop(DnDConstants.ACTION_COPY); final List<File> files; try { files = new LinkedList<File>((List...
6
public int maximalSquare(char[][] matrix) { if (matrix.length == 0) { return 0; } int height = matrix.length; int width = matrix[0].length; int dp[][] = new int[height][width]; for (int i = 0; i < height; i++) { dp[i][0] = Character.getNumericValue(matrix[i][0]); } for (int i = 0; i < width; i++...
8
private void resize() { size = getSkinnable().getWidth() < getSkinnable().getHeight() ? getSkinnable().getWidth() : getSkinnable().getHeight(); if (size > 0) { for (Region led : leds) { led.setPrefSize(size, size); } ...
3
public boolean checkCollision(int r, int c) { if (row == r && column == c) { alive = false; return true; } return false; }
2
@Override public void execute(FileSystem fs, String[] parts) { if (parts.length > 2) { throw new IllegalArgumentException("too much arguments, use only file name"); } String name = parts[1]; boolean nonexistent = true; Locker.lock(Thread.currentThread().getId()); ...
7