text
stringlengths
14
410k
label
int32
0
9
public static void main (String [] args){ int mark=50; System.out.println("The mark is " + mark); if (mark>=50){ System.out.println("PASS"); }else{ System.out.println("FAIL"); } }
1
private void jButtonSaveOrderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonSaveOrderActionPerformed {//GEN-HEADEREND:event_jButtonSaveOrderActionPerformed if (jTextFieldCustomerNo.getText().isEmpty()) { JOptionPane.showMessageDialog(null, "Der mangler et kunde n...
9
@Override public void actionPerformed(ActionEvent e) { if (e.getSource().equals(timer)) { if (ballMovement) { updateStatus(); ai.moveAi(ball.x, ball.y, ball.width, ball.height); moveBall(); repaint(); } } else if...
3
public int clear() { System.out.print("Distribution: "); for (int i = 0; i < 4; ++i){ System.out.print(distribution[i] + ", "); distribution[i] = 0; } System.out.println(); String response; for (SocketClient sClient : sClients){ try{ ...
4
private void editAmount() { setVisible(false); ArrayList<Booking> bookings = table.getSelectedObjects(); for (Booking booking : bookings) { Transaction transaction = booking.getTransaction(); Account account = booking.getAccount(); //TODO: or JournalGUI.table ...
2
public void recalc_matches() { try { int non_matches_map = 0; int non_matches_file = 0; int map_index = comboBoxMapLayer.getSelectedIndex(); int file_index = comboBoxFileLinkColumn.getSelectedIndex(); if( map_index < 0 || file_index < 0) { System.out.println("recalc: bad index"); return; } ...
9
@Override public String getDesc() { return "FrostDiver"; }
0
public void resume() {isPaused = false;}
0
@Override public void update(GameContainer gc, StateBasedGame sb, int delta) { float rotation = owner.getRotation(); float scale = owner.getScale(); Vector2f position = owner.getPosition(); Input input = gc.getInput(); if(input.isKeyDown(Input.KEY_A)) { rotation -= 0.2f * delta; } if(input.isKey...
4
protected static Ptg calcErf( Ptg[] operands ) throws FunctionNotSupportedException { if( operands.length < 1 ) { return new PtgErr( PtgErr.ERROR_VALUE ); } try { double lower_limit = operands[0].getDoubleVal(); double upper_limit = Double.NaN; //lower_limit; if( operands.length == 2 ) { ...
9
public JPanel getSecOptMenu() { if (!isInitialized()) { IllegalStateException e = new IllegalStateException("Call init first!"); throw e; } return this.secOptMenu; }
1
@Override public void actionPerformed(ActionEvent e) { if (e.getSource().equals(this.imageMenuItem)){ this.onInsertImageMenuItemClick(e); } else if (e.getSource().equals(this.scrollMenuItem)){ this.handleScrolling(); } else if (e.getSource().equals(this.spellCheckMenuItem)){ this.handleSpellChecki...
7
void drawLoadingText(int percentage, String s) { while (gameGraphics == null) { gameGraphics = getGameComponent().getGraphics(); try { getGameComponent().repaint(); } catch (Exception _ex) { } try { Thread.sleep(1000L); } catch (Exception _ex) { } } Font helveticaBold = new Font("Helv...
4
public void loadTag() throws Exception{ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(decompressedData)); byte tagType = stream.readByte(); if (tagType != NbtTag.TAG_COMPOUND) { throw new Exception("Top tag wasn't a compound!"); } tag = new NbtTagCompound(); tag.readName(stream); ...
5
public void remove(int key) { HashPrinter.tryRemove(key); /** Run along the array */ int runner = 0; int hash = (key % TABLE_INITIAL_SIZE); while (table[hash] != null && runner < TABLE_INITIAL_SIZE) { if (table[hash].getKey() == key) { break; } runner++; hash = ((key + runner) % TABLE...
4
public void setNumeroReal(TNumeroReal node) { if(this._numeroReal_ != null) { this._numeroReal_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node...
3
public MageView() { for (int j = 0; j < 4; j++) { String direction = ""; if (j == 0) { direction = "left"; } if (j == 1) { direction = "right"; } if (j == 2) { direction = "down"; } if (j == 3) { direction = "up"; } String f...
5
private void setRect(double minLat, double minLng, double maxLat, double maxLng) { if (!(minLat < maxLat)) { throw new IllegalArgumentException("GeoBounds is not valid - minLat must be less that maxLat."); } if (!(minLng < maxLng)) { if (minLng > 0 && minLng < 180 && maxLng < 0) { rects = new Re...
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof CategoriaChamado)) { return false; } CategoriaChamado other = (CategoriaChamado) object; if ((this.getId() == n...
5
void prepare() { System.out.println("Preparing " + name); System.out.println("Tossing dough..."); System.out.println("Adding sauce..."); System.out.println("Adding toppings: "); for (int i = 0; i < toppings.size(); i++) { System.out.println(" " + toppings.get(i)); } }
1
private String getType(String extension) { switch(extension) { case "gif": return "image/gif"; case "html": return "text/html"; case "jpeg": return "image/jpeg"; case "jpg": retu...
6
protected static String getCheckSum(File file) { MessageDigest messageDigest; try { messageDigest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new InternalError("MD5 not supported!"); } FileInputStream fis; try {...
5
public void paint(Graphics g) { super.paint(g); Graphics2D g2 = (Graphics2D)g; g2.setStroke(new BasicStroke(2)); for (int i = 0; i < next; i++) { if (RightObjects.get(i).getClass().equals(TickerPanel.class)) g2.setColor((((TickerPanel)RightObject...
7
public void loadImage(File file, int place) { System.out.println("loading image into [" + place + "]"); try { imageView[place] = ImageIO.read(file); imageArrays[place] = convertTo2D(imageView[place]); filterBody(imageArrays[place], place); // 1, 2, 3 imagePaths[place] = file.getPath(); System.out.pr...
1
public String getFrameScore(){ String score=""; String thirdPoint; checkS(); // 세번째 공을 던지지 않았을 때, 부모 클래스의 점수판 반환을 사용한다. if(pins.size()!=3) return super.getFrameScore(); // 세번째 공을 던졌을 때, 스트라이크 혹은 거터 여부를 확인한다. if(pins.get(2)==10) thirdPoint="X"; else if(pins.get(2)==0) thirdPoint="-"; els...
7
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); PrintWriter writer = resp.getWriter(); ResultStatus status = new ResultStatus(); Gson gson = new Gson(); String command = req.getParameter("command"); Stri...
5
public void printRAM() throws Exception { for(int i = 0; i < jList.size(); ++i) { Job tempJob = jList.get(i); System.out.println("ID: " + tempJob.getID()); System.out.println("Priority: " + tempJob.getPri()); System.out.println("Number of Instructions: " + tempJob.getJobs()); for(int j = 0; j < temp...
2
public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int msj_p, msj_c, num, num2, tmp1, tmp2, tmp3, tmp4, aux; boolean continua; do{ continua = false; System.out.println("Ingrese un numero entero de 4 digitos: "); msj_p = entrada.nextInt(); if(msj_p < 1000 || msj_p ...
8
private void showTeachingPlan() { content = null; head = null; Object fb = logic.showTPHead(); if (fb instanceof Feedback) { JOptionPane.showMessageDialog(null, ((Feedback) fb).getContent()); } else if (fb instanceof String[]) { head = (String[]) fb; fb = logic.showTPContent(); if ((fb instanceof...
9
public Player winner() { Player p = null; Player owner = null; Player owner1 = null; for(CityImpl c : this.game.getAllCities()) { if(Player.RED == c.getOwner()) { owner = c.getOwner(); } if(Player.BLUE == c.getOwner()) { owner1 = c.getOwner(); } } if(owner == null) { p = Player.BLU...
5
private List<DbTableRecord> getRecords(String sourceDB, DbDefinition dbDefinition, DbTableDefinition tableDefinition) { List<DbTableRecord> allRecords = new ArrayList<DbTableRecord>(); if (sourceDB.equals(AppConstants.CONN_STRING_BASELINE_DB)) { try { if (null == dbConnectionBaseline || dbConnecti...
7
protected void readImage() { ix = readShort(); // (sub)image position & size iy = readShort(); iw = readShort(); ih = readShort(); int packed = read(); lctFlag = (packed & 0x80) != 0; // 1 - local color table flag interlace = (packed & 0x40) != 0; // 2 - inte...
7
public void selectAttributesCVSplit(Instances split) throws Exception { double[][] attributeRanking = null; // if the train instances are null then set equal to this split. // If this is the case then this function is more than likely being // called from outside this class in order to obtain CV statis...
7
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof KeyedValues)) { return false; } KeyedValues that = (KeyedValues) obj; int count = getItemCount(); if (count != that.getItemCount()) {...
8
private String toRules(){ if (numInstances() == 0) return "No Rules (Empty Exemplar)"; String s = "", sep = ""; for(int i = 0; i < numAttributes(); i++){ if(i == classIndex()) continue; if(attribute(i).isNumeric()){ if(m_MaxBorder[i] != m_MinBorder[i]){ s += sep + m_MinBo...
8
private static int check(int value, int maxBits) throws NumberFormatException { if (value > (1 << maxBits) - 1) { throw new NumberFormatException(INVALID_VERSION_FORMAT); } return value; }
1
* @Description: TODO * @param: @param data_set * @param: @return * @return: SplitPair * @throws * @author UncleLee */ private SplitPair chooseBestFeature(List<DataEntry<double[], Double>> data_set, double error_sum){ int m = data_set.size(); if(m <= DEFAULT_MIN_NUM...
8
public void setSourceText(String sourceText) { if( !sourceText.equals(AlchemyAPI_NamedEntityParams.CLEANED) && !sourceText.equals(AlchemyAPI_NamedEntityParams.CLEANED_OR_RAW) && !sourceText.equals(AlchemyAPI_NamedEntityParams.RAW) && !sourceText.equals(AlchemyAPI_NamedEntityParams.CQUERY) && !sourceText.e...
5
public void togglePalettes() { if (hiddenFrames.isEmpty()) { for (CPPaletteFrame frame : paletteFrames) { if (frame.isVisible()) { for (CPPalette pal : frame.getPalettesList()) { showPalette(pal, false); } hiddenFrames.add(frame); } } } else { for (CPPaletteFrame frame : hidden...
7
private Dimension getHeadingSize() { Dimension s = new Dimension(); int c = getComponentCount(); for (int i = 0; i < c; i++) { Component comp = getComponent(i); TabWrapper tab = (TabWrapper) tabs.get(comp); if (tab != null) { int thw = (HORIZONTAL_GAP * 2) +...
9
@SuppressWarnings ("unchecked" ) @Override public Collection<?> get( ByteBuffer in ) { Integer size = Compress.getIntUnsignedNullable( in ); if (size == null) { return null; } Integer flag = Integer.valueOf( in.get() & 0xFF ); Constructor<?> cons...
7
private void makeSymbolTable( ) { for( SemanticAction def: startNode.getBranches() ) { String defName = def.getName(); if( defName.equals("print") ){ System.out.println( "User-defined print function not allowed." ); } else if( defName.equals("main") ){ mainCounter++; } ...
8
public static String getCPI(String date, String state) { DB db = _mongo.getDB(DATABASE_NAME); DBCollection coll = db.getCollection(COLLECTION_CPI); BasicDBObject query = new BasicDBObject(); query.put("year", "" + getYear(date)); query.put("quarter", "" + ((getMonth(date) % 4) + 1)); DBCu...
1
void invoke(Page page) { pageTextBox.setPage(page); page.deselect(); createContentPane(); if (needNewDialog(dialog, page)) { dialog = ModelerUtilities.getChildDialog(page, true); String s = Modeler.getInternationalText("CustomizeTextBoxDialogTitle"); dialog.setTitle(s != null ? s : "Customize text bo...
8
private AbstractNode createHigherLevels(List boundablesOfALevel, int level) { Assert.isTrue(!boundablesOfALevel.isEmpty()); List parentBoundables = createParentBoundables(boundablesOfALevel, level + 1); if (parentBoundables.size() == 1) { return (AbstractNode) parentBoundables.get(0); } return...
1
public ByteBuffer getData() { int size = getLength(); ByteBuffer buf = ByteBuffer.allocate(size); // write the offsets for (int i = 0; i < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } ByteBuf...
3
@Override public void putAll(Map<? extends String, ? extends Competicao> m) { throw new UnsupportedOperationException("Not supported yet."); }
2
public void escribirFichero(ArrayList<clsPersona> personas){ try{ FileWriter fichero = new FileWriter(rutaPrincipal); PrintWriter pw = new PrintWriter(fichero); for(clsPersona p : personas){ pw.println(p.getCodigo()+","+p.getNombre()+","+p.getTelefonoFijo()+",...
2
public Iterator getAttributes() { if (unknownAttributes != null) return unknownAttributes.values().iterator(); return Collections.EMPTY_SET.iterator(); }
1
public static Class infoClass(Class cmp) { Class info = null; try { info = Class.forName(cmp.getName() + "CompInfo"); } catch (ClassNotFoundException E) { // there is no info class, info = cmp; } return info; }
1
public void broadcastEvent(String eventName) { HashMap<Object, String> eventCallbacks = this.eventMap.get(eventName); try { if(eventCallbacks != null) { Set<Object> keys = eventCallbacks.keySet(); Iterator<Object> it = keys.iterator(); while (it.hasNext()){ Object objReference = it.next(); ...
4
private Object readArgument(char type) { switch (type) { case 'i' : return readInteger(); case 'h' : return readBigInteger(); case 'f' : return readFloat(); case 'd' : return readDouble(); case 's' : return readString(); case 'c' : return readChar(); case 'T' : return ...
9
protected JComponent initTreePanel() { treePanel=new SelectableUnrestrictedTreePanel(this); return treePanel; }
0
public void computeBoundingBox() { // TODO: Compute the bounding box and store the result in // averagePosition, minBound, and maxBound. // Hint: The bounding box is not the same as just minPt and maxPt, because // this object can be transformed by a transformation matrix. Point3 p1,p2,p3,p4,p5,p6,p7,...
7
public static void main(String[] args) { //Please input the value of "String[] args" from the settings of Java application. TypeDesc desc = new TypeDesc(); for(String name : args){ try { Class<?> startClass = Class.forName(name); desc.printType(startClass, 0, basic); } catch (ClassNotFoundException ...
3
public static void count_digits(String s) { int count = 0; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch >= '0' && ch <= '9') count++; } System.out.println(count); }
3
public static int getEndOfBrackets(String function, int posActuelle) { int nbrBracketsOpened = 0; int nbrBracketsClosed = 0; int endPosition = 0; for (int j = posActuelle; j < function.length(); j++) { if (function.charAt(j) == '(') nbrBracketsOpened++; else if (function.charAt(j) == ')') nbrBrac...
4
@Override public void actionPerformed(GuiButton button) { if(button.id == 0) holder.closeWindow(this); else if(button.id == 1 && holder instanceof GuiEditor) { GuiEditor editor = (GuiEditor)holder; editor.confirmOperation(new OperationSaveMap(editor,textField.text)); } }
3
@EventHandler public void SlimeMiningFatigue(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.getSlimeConfig().getDouble("Slime.Mini...
6
public String getName() { return name; }
0
private void onDownload(FileDownloadEvent event){ for(FileDownloadListener listener : listeners){ listener.onProgressChanged(event); } }
1
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int max = 0; String input = sc.nextLine().toLowerCase(); String[] words = input.split("\\W+"); TreeMap<String, Integer> wordsMap = new TreeMap<>(); for (int i = 0; i < words.length; i++) { if(!wordsMap.containsKey(words[i])...
5
public static ArrayList<Customer> showAll() { ArrayList<Customer> customers = new ArrayList<Customer>(); Database db = dbconnect(); try { db.prepare("SELECT * FROM customer WHERE bDeleted = 0 ORDER BY CID"); ResultSet rs = db.executeQuery(); while(rs.next()) { ...
2
public void onEnable() { sessions = new LinkedList<CTFSession>(); CTFPlugin.plugin = this; CTFPlugin.weplugin = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"); Bukkit.getPluginManager().registerEvents(this, this); CTFTypes.registerType(NoEditSession.class); CTFTypes.registerType(EditS...
3
static final void method449(String string, String string_1_, boolean bool, int i, boolean bool_2_) { do { try { anInt849++; BufferedPacket class348_sub47 = Class203.method1478(true); ((BufferedPacket) class348_sub47).buffer .putByte (((HandshakePacket) Class178.aClass29_2348).opcode); ((Bu...
8
public void run() { try { out = new PrintWriter(socket.getOutputStream(), true); in = new BufferedReader( new InputStreamReader(socket.getInputStream())); String inputLine = "" , outputLine; // Do the login name outputLine = "Please enter a username" ; out.p...
8
public void handleClassThatIsAttribute(ClassMeta c) { System.out.println("Handling: " + c.name); for(AssociationEndMeta ae : EntityMeta.all_association_ends.values()) { if(ae.target_id.equals(c.id)) { System.out.println("found an ae"); AssociationMeta assoc = EntityMeta.all_associations.get(ae.assoc_i...
5
public static void outputDisplay(List<Flight> SearchedFlights, FlightDTO dto) { if (SearchedFlights == null) { System.out.println("No Flights found for given Locations"); } else if (SearchedFlights.size() == 0) { System.out .println("Sorry No flight for this combination of Date and Class"); } else { ...
6
private Boolean find_driver() { try { if (driver_class == null) driver_class = Class.forName(driver_name); if (driver_class == null) driver_class = Class.forName(driver_name, true, ClassLoader.getSystemClassLoader()); return true; } catch (Exception ex) { ...
3
public void tick(boolean preview) { if(System.currentTimeMillis()-startTime < systemLength || systemLength == -1) { for(int x=0;x<maxSpawnRate;x++) spawnParticle(); } for(int x=0;x<particles.size();x++) { boolean despawn = !particles.get(x).tick(map); if(despawn) { particles.remove(x);...
5
public World(int numWater, int xMin, int yMin, int xMax, int yMax, int yMid) { this.xMin = xMin; this.yMin = yMin; this.xMax = xMax; this.yMax = yMax; this.yMid = yMid; // no need to generate air molecules, because that is adjusted every tick based on the temperature // generate Water molecules f...
1
public static void PROVJERI_naredba_grananja(){ String linija = mParser.ParsirajNovuLiniju(); // ucitaj KR_IF UniformniZnak uz_kr_if = UniformniZnak.SigurnoStvaranje(linija); linija = mParser.ParsirajNovuLiniju(); // ucitaj L_ZAGRADA UniformniZnak uz_l_zagrada = UniformniZnak.SigurnoStvaranje(linija); linija ...
7
public void selectHero(Object hero) { System.out.println("?! "+heroesSelected); WidgetChooserButton button = (WidgetChooserButton)(heroesInner.itemAt(heroesSelected).widget()); if (hero != heroes.get(heroesSelected)) { heroesSelected = heroes.indexOf(hero); button.setChecked(false); } else { button.se...
1
public void create(Fornecedor fornecedor) throws PreexistingEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); em.persist(fornecedor); em.getTransaction().commit(); } catch (Exception e...
3
private void preenceTabela(List<FormasPagamento> lista){ this.modelo = new DefaultTableModel(); modelo.addColumn("id"); modelo.addColumn("Nome"); for(FormasPagamento f : lista){ Vector valores = new Vector(); valores.add(0,f.getId())...
1
public void loadOrder(){ orderDataAccesor dataAccessOrder=new orderDataAccesor(); List<order> orderList=new ArrayList(); DefaultTableModel orderDataTable=new DefaultTableModel(); Object[ ] columnNames=new Object[5]; Object[ ] fieldValues=new Object[5]; //Patien...
4
public static void ChooseAllen () { if (Game.characterChoice == 1) { Game.CharacterOne = "Allen"; Game.CharacterOneHP = CharacterStats.AllenHP; Game.CharacterOneAttack = CharacterStats.AllenAttack; Game.CharacterOneMana = CharacterStats.AllenMana; Game.CharacterOneRegen = CharacterStats.A...
2
public SecuredTaskTriggerBean execute(SecuredTaskTriggerBean task) throws GranException { //String clientDataUDFName = KernelManager.getFind().findUdf(INCIDENT_CLIENTDATA_UDFID).getCaption(); String client = task.getUdfValue(INCIDENT_CLIENT_UDF); introduceNewClient(task, client); Secu...
6
public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { if (averageGroundLevel < 0) { averageGroundLevel = getAverageGroundLevel(par1World, par3StructureBoundingBox); if (averageGroundLevel < 0) { ...
8
@Test(expected = PersistencyException.class) public void WhenLoadingFromFileWithInvalidAddress_ExpectPersistencyException() throws PersistencyException { RoutingTable routingTable = new RoutingTable(); try { persistenceDelegate_.load(INVALID_ADDRESS_FILE, routingTable); } catch (...
1
public static String toString( double[][] matrix ) { String retVal = ""; int m = matrix.length; int n = matrix[0].length; for ( int i = 0; i < m; ++i ) { for ( int j = 0; j < n; ++j ) { retVal += fillString(Double.toString(matrix[i][j]), 24); } retVal += "\n"; } return(retVal); }
2
public static Change add(final CourseRec course, final OffRec offering) { offering.setCourse(course); Change change = new Change(course.getSource(), Change.ADD, offering) { @Override public String getDescription() { return "Offering"; } @Override public Object getTarget() { return "[" + cour...
9
static void skykid_draw_sprites(osd_bitmap bitmap) { int offs; for (offs = 0; offs < spriteram_size[0]; offs += 2){ int number = spriteram.read(offs) | ((spriteram_3.read(offs) & 0x80) << 1); int color = (spriteram.read(offs+1) & 0x3f); int sx = 256 - ((spriteram_2.read(offs+1)) + 0x100*(spriteram_3.rea...
9
public int getParameter(String paramname){ if(paramname == "HoodSize"){return map.getBrushLength();} if(paramname == "NextX"){return map.getNextX();} if(paramname == "NextY"){return map.getNextY();} if(paramname == "Age"){ return age;} if(paramname == "Fade"){ return fade;} if(paramname == "MirrX...
9
@Override public int hashCode() { int hash = 0; hash += (idLaptop != null ? idLaptop.hashCode() : 0); return hash; }
1
public static String escape(String string) { char c; String s = string.trim(); StringBuffer sb = new StringBuffer(); int length = s.length(); for (int i = 0; i < length; i += 1) { c = s.charAt(i); if (c < ' ' || c == '+' || c == '%' ...
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final MapleMessengerCharacter other = (MapleMessengerCharacter) obj; if (name == null) { if (other.name != null) return false; } else if...
6
public void resize(double scaleFactor){ scaleFactor = (double)(Gui.getSlidePanel().getWidth()) / (double)slideDimension.width; if (Debug.video) System.out.println("VideoPlayer -> resize -> resize called"); if ((null != player) && (realizeComplete) && (!Gui.isVideoFullScreenOn())){ // Calculate the new sca...
6
@Test public void testCreatingPhoneNumberWithNullNumberShouldFail() { try { new PhoneNumber("home", null); fail("Was expecting an Exception when no country code is provided."); } catch (IllegalArgumentException iae) { Assert.assertEquals("Please provide a value for Number as it is a non-nullable field.", ...
1
public int getID() { return this.id; }
0
public E dequeue(){ if(total == 0) throw new NoSuchElementException(); E e = first.e; first = first.next; if(--total == 0) last = null; return e; }
2
public boolean load(){ return false; }
0
public static void main(String[] args) throws Exception { if (args.length != 8) { System.err .print("Syntax error. Correct syntax:\n" + " <trainfile_supervised> <trainfile_semisupervised> " + "<supervised_weight> <observation_feature> <state_feature> " + "<modelfile> <numiterations> <see...
8
public AmmoPackItem retrieveAmmoPack(BulletType bulletType) { List<Item> list = inventory.getAll("ammopack."); AmmoPackItem ap = null; for (Item i : list) { AmmoPackItem pack = (AmmoPackItem) i; if (pack.getBulletType() == bulletType) { if ((ap == null || pack.getAmount() > ap.getAmount()) && pack.ge...
6
@Override protected void initConstraint() { if ( Theme.list == null ) { Theme.list = new HashSet<String>(); String jarPath = Window.class.getResource("game").getPath(); jarPath = jarPath.substring(5, jarPath.indexOf("!")); JarFile jar = null; ...
6
public static void rangeCheck(Object comp, boolean in, boolean out) throws Exception { ComponentAccess cp = new ComponentAccess(comp); Collection<Access> acc = new ArrayList<Access>(); if (in) { acc.addAll(cp.inputs()); } if (out) { acc.addAll(cp.outputs()...
9
@Override public void deserialize(Buffer buf) { super.deserialize(buf); year = buf.readShort(); if (year < 0) throw new RuntimeException("Forbidden value on year = " + year + ", it doesn't respect the following condition : year < 0"); month = buf.readShort(); if (...
5
public boolean tjekLogind(String brugernavn, String kode) { boolean tjek = false; ResultSet rs = null; PreparedStatement pst = null; String SQLString1 = "SELECT * from BRUGER_LOGIN_TBL WHERE BRUGERNAVN=? AND KODEORD=?"; try{ pst = con.prep...
4
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + day; result = prime * result + hour; result = prime * result + minute; result = prime * result + month; result = prime * result + second; result = prime * result + year; return result; }
0
private void initComponents() { setLayout(new GroupLayout()); add(getJLabel0(), new Constraints(new Leading(105, 10, 10), new Leading(22, 10, 10))); add(getJLabel1(), new Constraints(new Leading(70, 208, 12, 12), new Leading(89, 10, 10))); add(getJButton0(), new Constraints(new Leading(59, 10, 10), new Leading(...
0