text
stringlengths
14
410k
label
int32
0
9
public FunDecl lookupFunc(String name, int len) { FunDecl funDecl = funDecls.get(name); if(funDecl==null) { if(parent!=null) { return parent.lookupFunc(name, len); } else { throw new RuntimeException("Function <" + name + "> undefined")...
2
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents protected void initComponents() { jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); btnNome = new javax.swing.JLabel(); jLabel...
1
public static Object load(String nom, String version) { // Controler la validité des paramètres // if (nom == null || version == null) { // Indiquer l'erreur // System.err.println("ConfigXML : Param�tre null !"); return false; } //...
4
public double standardizedPersonStandardDeviation(int index){ if(!this.dataPreprocessed)this.preprocessData(); if(index<1 || index>this.nPersons)throw new IllegalArgumentException("The person index, " + index + ", must lie between 1 and the number of persons," + this.nPersons + ", inclusive"); i...
4
public FrameDesc() { pageNo = new PageId(); pageNo.pid = INVALID_PAGE; dirty = false; pin_cnt = 0; } // end constructor
0
public int[] OrdenSeleccion(int arreglo[], String ordenamiento) { int indice = 0, indice2 = 0, menor = 0, posicion = 0, temporal = 0; if (ordenamiento.equals(arreglo)) { for (indice = 0; indice < arreglo.length; indice++) { menor = arreglo[indice]; posicion = ...
9
public static void main(String[] args) throws Exception { if (args.length != 2) { System.out.println("Usage: java " + RandomProjectionsAccuracy.class.getCanonicalName() + " train_file test_file"); System.exit(1); } String trainFile = args[0]; String testFile = ar...
4
public int getFuelTimer() { if(isFuel()) return fuelTimer; else return -1; }
1
private void cargar_Campos (int valor){ try{ this.vaciarCampos(); r_con.Connection(); PreparedStatement pstm = r_con.getConn().prepareStatement( "SELECT *"+ " FROM "+name_tabla+ " WHERE prod_codigo = ...
5
private void chosePotions() { if (Bank.getItem(RSC.EXTREME_RANGING_FLASK_IDS[5]) != null) { potionId = RSC.EXTREME_RANGING_FLASK_IDS[5]; } else if (Bank.getItem(RSC.EXTREME_RANGING_POTION_IDS[3]) != null) { potionId = RSC.EXTREME_RANGING_POTION_IDS[3]; } else if (Bank.getItem(RSC.RANGING_FLASK_IDS[5]) != nu...
8
public double getAngle(double a,double b,double c, double d){ if((a>=c&&b>=d)||(a>=c&&b<=d)) return Math.asin((b-d)/ Math.sqrt(Math.pow((a-c),2)+ Math.pow((b-d), 2))); else if(a<c&&b>=d) return Math.toRadians(90.0)+Math.acos((b-d)/ Mat...
6
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connection c = null; Statement stmt = null; String sql; PrintWriter out = response.getWriter(); response.setContentType("text/html"); String ID = request.getParameter("...
6
public SetupFrame() { super("Atoms Setup"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); try { setLayout(new GridLayout(0, 4)); for (final Field fld : AtomSetup.class.getDeclaredFields()) { add(new JLabel(fld.getName())); if (fld.getType() == AtomSetup.Packing.class) { final JComboBox cb = ...
9
private synchronized void doFileTransfer() throws IOException { try { int lengthOfSenderName = dis.readInt(); //II byte[] senderNameB = new byte[lengthOfSenderName]; dis.read(senderNameB); //III String sender = new String(senderNameB); int lengthOfFile...
7
public static String getSpellByAscii(int ascii) { if (ascii > 0 && ascii < 160) { // 单字符 return String.valueOf((char) ascii); } if (ascii < -20319 || ascii > -10247) { // 不知道的字符 return ""; } String spell = null; //key Integer asciiRang; //value String spellPrevious = null; //用来保存上次轮循环的key int as...
9
public BencodeTreeModel ( Value<?> root ) { this.root = root == null ? null : new BencodeTreeNode( root, null, null ); System.out.println( root ); }
2
@Override public boolean init(List<String> argumentList, DebuggerVirtualMachine dvm) { functionLines = new LinkedHashMap<String, Boolean>(); if (argumentList.size() > 0) { UserInterface.println("This command takes no arguments."); HelpCommand.displayHelp(this); r...
4
public void draw(Graphics2D g) { for (int r = rowOffset; r < numberOfRowsToDraw + rowOffset; r++) { if (r >= numberOfRows) // Stop drawing if we run out of rows to draw break; for (int c = colOffset; c < numberOfColsToDraw + colOffset; c++) { if (c >= numberOfCols) // Stop drawing if we run out ...
5
public final JSONObject getJSONObject(int index) throws JSONException { Object o = get(index); if (o instanceof JSONObject) { return (JSONObject)o; } throw new JSONException("JSONArray[" + index + "] is not a JSONObject."); }
1
public EncryptedKeyType createEncryptedKeyType() { return new EncryptedKeyType(); }
0
@Override public boolean equals(Object obj) { if (obj == null || this.getClass() != obj.getClass()) { return false; } if (this == obj) { return true; } if (obj.getClass() == this.getClass()) { Wesen w = (Wesen) obj;// typecast Object zu // Festkommazahl if (this.lebenspunkte == w.lebensp...
5
public static void downloadBlob(String blobUri) { String filePath = Connection.filePath; try { CloudStorageAccount storageAccount = CloudStorageAccount .parse(Connection.storageConnectionString); CloudBlobClient blobClient = storageAccount.createCloudBlobClient(); CloudBlobContainer container = blobCl...
2
public void start(StreamLoader streamLoader, client client1) { String as[] = { "model_version", "anim_version", "midi_version", "map_version" }; for(int i = 0; i < 4; i++) { byte abyte0[] = streamLoader.getDataForName(as[i]); int j = abyte0.length / 2; Stream stream = new Stream(abyte0); version...
9
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked // TODO add your handling code here: jList1.updateUI(); if (jList1.getSelectedIndex()>=0) { Field f = Game.fields.get(fieldsR.get(jList1.getSelectedIndex())); ...
8
public int compareClock(Clock otherClock) { LogicClock otherLocalClock = (LogicClock)otherClock; // thisClock < otherClock if (this.clock < otherLocalClock.clock) return -1; // thisClock > otherClock if (this.clock > otherLocalClock.clock) return 1; // thisClock = otherClock return 0; }
2
public boolean isExpired(SkiPass sp) { Date currentDate = new Date(System.currentTimeMillis()); return (currentDate.before(sp.getExpirationDate()) ? false : true); }
1
private static FileHandler getFileHandler(boolean devLog) throws IOException { FileHandler handler = null; Formatter formatter = null; String suffix = ""; switch (commandLineOptions.getLogFormat()) { case HTML: if(devLog) { formatter = new HTMLFormatter(false); suffix = "-dev.html"; } else { ...
5
@Override public void setReceiveMessage(IReceiveMessage receiveMessage) { this.receiveMessage = receiveMessage; }
0
public CheckCreditForm(int clientId) { //Fix clients id this.clientId = clientId; initComponents(); locateForm(); //Load to table all credita or credits for concrete user if (clientId != 0) { creditDAO.initTableModel(creditTable, creditDAO.ge...
1
public void writeErrorReport(String folder) { File dir = new File(folder); if (!dir.exists()) { dir.mkdir(); } File file = new File(dir.getAbsoluteFile()+"\\readingErrors.txt"); if (file.exists()) { file.delete(); } FileOutputStream fos = null; try { fos = new FileOutputStream(file)...
5
public void setUsed(Boolean used) { this.used = used; }
0
public Brick(int xPos, int yPos, int width, int height, int hp, boolean powerUpsEnabled, int difficulty) { this.xPos = xPos; this.yPos = yPos; this.width = width; this.height = height; this.hp = hp; this.powerUp = new PowerUp(powerUpsEnabled, difficulty); switch(hp) { case -1: this.color = Color.gray...
6
public static void main(String[] args){ routes[0][0]=1; for (int i=0;i<21;i++){ for (int j=0;j<21;j++){ if (i==0 && j==0) continue; routes[i][j] = sumOfPred(i, j); } } System.out.println(routes[20][20]); }
4
private void queueFile(int n) { int index = mp3list.getIndex(); if (index >= 0) { FramePanel fp = (FramePanel) tabbedPane.getComponent(n); fp.getCon().add(mp3list.get(index), fp.getSearchPanel()); fp.getMp3List().update(); } }
1
public static String getData(){ ObjectMapper mapper = new ObjectMapper(); List<Player> playersObj = new ArrayList<Player>(); for (Player player : plugin.getServer().getOnlinePlayers()) { playersObj.add(player); } Map<String,Object> servers = new HashMap<String,Object>(); Map<String,Object> data ...
7
private static JLabel getLabel(String string) { JLabel label = new JLabel(string); if (IMAGE != null) label.setForeground(Color.black); return label; }
1
private void DisplayLCS(int[][] b, char[] x, int max, int mIndex) { if (max == 0) System.out.println("no LCSubstring"); System.out.println("-----max: " + max); System.out.println("-----maxIndex: " + mIndex); int i = mIndex; while (max > 0) { System.out.print(x[i++]); max--; } System.out.println...
2
protected void createDefaultConfiguration(String name) { File actual = new File(getDataFolder(), name); if (!actual.exists()) { InputStream input = this.getClass().getResourceAsStream("/" + name); if (input != null) { FileOutputStream output = null; try { output = new FileOutputStream(act...
8
public void setFieldValue(_Fields field, Object value) { switch (field) { case FIRST_NAME: if (value == null) { unsetFirstName(); } else { setFirstName((String)value); } break; case LAST_NAME: if (value == null) { unsetLastName(); } else { ...
8
public void run() { ajpacket msg = null; try { while (run) { msg = (ajpacket) in.readObject(); // recieve messages if (cdata != null) { cdata.recv(this, msg); } } } catch (IOException e) { if (run) { System.err.println("ajclient: connection error"); this.close(); } } catch (...
6
public static String SQLdecrypted (String decrypt) { String decrypted = ""; try { // Encryption used DES. We can also use AES SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); DESKeySpec keySpec = new DESKeySpec(secretSalt....
1
public void func_40381_b(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { for (int var5 = 0; var5 < 16; ++var5) { for (int var6 = 0; var6 < 16; ++var6) { byte var7 = 1; int var8 = -1; byte va...
9
public static String getDescriptor ( byte multiplier, byte type ) { switch ( type ) { case 0: switch ( multiplier ) { case 1: return "" ; case 2: return "Double Letter Score" ; case 3: return "Triple Letter Score" ; default: ...
7
public void handleWindow(Window window, int eventID) { String setting = Settings.settings().getString("ExistingSessionDetectedAction", "manual"); if (setting.equalsIgnoreCase("primary")) { Utils.logToConsole("End the other session and continue this one"); if (!SwingUtils.clickBut...
8
public void printFund() { int total = 0; for(Konto k:accountList) { total += k.getSaldo(); } System.out.println("Total funds: " + total); }
1
void loadResources() { if (isEmpty()) return; String address = null; if (Page.isApplet()) { synchronized (mdList) { for (PageMd3d md : mdList) { address = FileUtilities.removeSuffix(page.getAddress()) + "$" + md.getIndex() + ".mdd"; URL url = null; try { url = new URL(address); ...
8
public void get(int key) { HashPrinter.tryGet(key); /** Run along the array */ int runner = 0; int hash = (key % table.length); while (table[hash] != null && runner < table.length) { if (table[hash].getKey() == key) { break; } runner++; hash = ((key + runner * runner) % table.length); ...
6
public void visitInsn(final int opcode) { if (mv != null) { mv.visitInsn(opcode); } execute(opcode, 0, null); if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN) || opcode == Opcodes.ATHROW) { this.locals = null; this.stack = null; } }
4
public boolean execute(CommandSender sender, String[] args, String label) { FileConfiguration messages = plugin.getMessageConfig(); final String notPlayer = messages.getString("info.warnings.playerCommand"); final String usage = messages.getString("commands.unfriend.usage"); final Stri...
9
public void hit() { for (int i = 0; i < Game.missiles.size(); i++) { if (hitBox.intersects(Game.missiles.get(i)) && Game.missiles.get(i).hit) { health -= Game.missiles.get(i).getDamage(); atPl = true; if (health < 1) { dropMana(Game.missiles.get(i).getDamage() * 5); Game.p.addXP(0.3); } ...
4
public void deleteHabitat(int id) { if (id <= 0) return; if (!existsHabitat(id)) return; try { PreparedStatement deleteHabitat = db.prepareStatement("DELETE FROM " + CuboidHandler.habitatTable + " WHERE cuboidid = '" + id + "';"); deleteHabitat.executeUpdate(); getHabitats().remove(id); ...
3
public List<EntidadBancaria> findByCodigo(String codigo){ try{ List<EntidadBancaria> ListaEntidades; Connection connection = connectionFactory.getConnection(); ListaEntidades = new ArrayList(); String buscarPorCodigo = "SELECT * FROM entidadbancaria where codigoEntidad = ?"; ...
2
public LocalVariable localAt(int index) { LocalVariable local = (LocalVariable) locals.get(new Integer(index)); if (local == null) { local = new LocalVariable(index); locals.put(new Integer(index), local); if (index >= maxLocals) { maxLocals = index++; // Dangerous? } } return (local); }
2
private BufferedImage twistImage() { double dMultValue = random.nextInt(7) + 3;// 波形的幅度倍数,越大扭曲的程序越高,一般为3 double dPhase = random.nextInt(6);// 波形的起始相位,取值区间(0-2*PI) BufferedImage destBi = new BufferedImage(buffImg.getWidth(), buffImg.getHeight(), BufferedImage.TYPE_INT_RGB...
6
public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new FileReader("addresses.list")); String line; ArrayList<String> lines = new ArrayList<String>(); while ((line = br.readLine()) != null) { lines.add(line); ...
9
@Override public void parse() { BufferedReader reader = new BufferedReader(new StringReader(getInput())); String line; Pattern nCount = Pattern.compile("n=(?<N>\\d+)"); Pattern person = Pattern.compile("(?<index>\\d+) (?<name>[a-zA-Z0-9-']+)"); Pattern preferences = Pattern.c...
9
public static void main(String[] args) { Game g = new Game(); Scanner in = new Scanner(System.in); while (true) { // display the board System.out.println(g.board); System.out.println("Player " + g.getCurrentPlayerIndex()); // display the player's hand Player p = g.getPlayer(g.getCurrentPlayerIndex...
6
public static void enregistrer_client(Client c) { SAXBuilder sxb = new SAXBuilder(); try { document = sxb.build(fichier); } catch (JDOMException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); ...
3
private boolean hasStraight() { if (cards[4].getRank() == CardRank.ACE && cards[0].getRank() == CardRank.TWO) { // Possible ace-low straight if ( cards[1].getRank() == CardRank.THREE && cards[2].getRank() == CardRank.FOUR && cards[3].getRank() == CardRank.FIVE) { return true...
9
public void start() { if(!(GameController.props.getProperty("os.name").contains("Linux") && GameController.props.getProperty("java.runtime.name").contains("OpenJDK"))) { lastSong = null; if(playList != null) { if(currentSongIndex >= playList.size()) { ...
4
public static void main(String[] args) throws IOException{ BufferedReader bi = new BufferedReader(new InputStreamReader(System.in)); String line; // while ((line = bi.readLine()) != null) // for (String numStr: line.split("\\s")) // sum += Integer.parseInt(numStr); int n= Integer.parseInt(bi....
8
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { BeanMa_train bm_train = null; try { bm_train = new BeanMa_train(); if("yahoo".equals(request.getParameter("datasource"))){ ...
5
public void initialize(Subject newSubject, CallbackHandler newCallbackHandler, Map<String, ?> sharedState, Map<String, ?> options) { log.trace("Initializing HTTP OATH OTP LoginModule"); this.subject = newSubject; this.callbackHandler = newCallbackHandler; this.protectedUrl = options.get(OPTION_HTTPOATHOTP...
9
@Override public int rowsX() { return isNotPlayerInventory() ? 3 : 5; }
1
int alphabeta(int alpha, int beta, int depth, int player, FieldContainer fc) { if (depth == 0) { return estimateComplex(fc.getField(), player); } int best, score; ArrayList<Field> moves = new ArrayList<Field>(); gen_moves(moves, fc.getField(), player); if (player == 2) { ...
8
@Override public void run(){ if(bidderListeners.size() > 0){ timer.start(); for(IAllowedBidsEventListener e : bidderListeners) e.onAllowedToBid(new AllowedToBidEvent(this)); while(currentTime > 0){ try { sleep(100); } catch (InterruptedException e1) { e1.printStackTrace(); } } for...
5
public String readLine() throws IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } line.clear(); //reuse // return null if end of stream has been reached if (lookaheadChar == END_OF_STREAM) { return null; } /...
6
public double getXCoordinate() { return xCoordinate; }
0
@Override public void enter(GameContainer gc, StateBasedGame game) throws SlickException { if(!musicRef.equals("")) { ResourceManager.getMusic(musicRef).setPosition(musicPos); ResourceManager.getMusic(musicRef).loop(); } System.out.println(musicRef); gc.getInput().clearKeyPressedReco...
7
public void setInterfaces(CtClass[] list) { checkModify(); String[] ifs; if (list == null) ifs = new String[0]; else { int num = list.length; ifs = new String[num]; for (int i = 0; i < num; ++i) ifs[i] = list[i].getName(); ...
2
@SuppressWarnings ({ "unchecked", "rawtypes" } ) public static <T> Reflect<T> create( Object o ) { if (o == null) { return (Reflect<T>)ReflectNull.INSTANCE; } else if (o instanceof Method) { return (Reflect<T>)addMethod( (Method)o ); } ...
8
private void populateToolBar() { String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment() .getAvailableFontFamilyNames(); mButtons = new HashMap(); Action clear = new AbstractAction("Clear", null) { /** * */ private static final long serialVersionUID = 1L; public void actionP...
4
public DefaultComboBoxModel getModeleJComboBoxLabo() { return modeleJComboBoxLabo; }
0
static boolean isVowel(char a){ return a=='A'||a=='E'||a=='I'||a=='O'||a=='U'||a=='a'||a=='e'||a=='i'||a=='o'||a=='u'; }
9
public int getQuantity(String str) { int lettersLength = getLetters(str).length(); if(str.length() == lettersLength) //if the string is too short for a quantity return 1; //default quantity is 1 if(Character.isDigit(str.charAt(lettersLength))) //if there are numbers after the letters { int b...
5
public void writeValue (final Value<?> value) throws IOException { if (value instanceof StringValue) { final StringValue sv = (StringValue) value; stream.print(sv.getValueLength()); stream.print(':'); stream.write(sv.getValue()); } else if (value instance...
9
@Override public Integer getIdFromDataBase() throws SQLException { Integer id = null; if(nameAnswer == null || nameAnswer.isEmpty()){ return id; } else if(question == null || question.getIdTest() == null){ return id; } Statement statement = ua.edu.odek...
5
public void test() throws Exception { MarketQuote quote = new MarketQuote( new Symbol("SIRI")); for(MarketQuotesResponseField f: MarketQuotesResponseField.values()) { if (quote.hasField(f)) { System.out.println(f.name() + " " + quote.getField(f)); } } }
2
public void run() { while (true) { String instruction = null; try{ instruction = replicas.poll(1, TimeUnit.SECONDS); if (instruction != null) { Replica replica = ReplicaFactory.buildReplica(this.getLocation(), instruction); //Auto digested if (replica.getOperations().name().equals("REPLY_CREA...
5
@Override public boolean importGroup27ReadingCO2(JSONObject toImport, String device_serial,String product_id) throws Exception { String latitude = __jdbcProperties.getProperty("sql.latitude"); String longitude = __jdbcProperties.getProperty("sql.longitude"); String method = __jdbcProperties.getProperty("sql.meth...
9
private EmailKontaktList readContacts() { JAXBContext context = null; if (!new File(EMAILCONTACTS_XML).exists()) return new EmailKontaktList(); try { context = JAXBContext.newInstance(EmailKontaktList.class); Unmarshaller um = context.createUnmarshaller(); EmailKontaktList emailContacts = (EmailKontak...
2
@Override public void mousePressed(MouseEvent arg0) { switch (arg0.getButton()) { case MouseEvent.BUTTON1: keymap.put(VK_MOUSE_1, true); break; case MouseEvent.BUTTON3: keymap.put(VK_MOUSE_2, true); break; case MouseEvent.BUTTON2: ...
6
public void setIsDeleted(Boolean isDeleted) { this.isDeleted = isDeleted; }
0
public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[41]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 18; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { i...
9
private void placeIntegrationParameters() { //Set layout to all internal panels integrationParametersPanel.setLayout(gridBagLayout); buttonsPanel.setLayout(gridBagLayout); //Create GridBagConstraints GridBagConstraints constraints = new GridBagConstraints(); constraints...
0
private void setMethod(Method m) { // Validate the method return if (!m.getReturnType().equals(Void.TYPE)) { throw new IllegalArgumentException("The target method must return null."); } // Validate the method modifier if ((m.getModifiers() & Modifier.STATIC) != 0) { throw new IllegalArgumentExcept...
8
private int getPosOfMinimumFromPos(int pos) { int min = get(pos), minPos = pos; for (int i = pos + 1; i < len(); i++) { if(get(i) < min) { minPos = i; min = get(i); } } return minPos; }
2
@Override public void run() { try { long startTime = System.currentTimeMillis(); long currentTime = startTime; Random r = new Random(); double amount = 1000.0; double percent = 20.0; while(isRunning()){ switch(operations){ case deposit: executeOperationInMessageQueue(); myBank.mul...
7
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "EncryptedData") public JAXBElement<EncryptedDataType> createEncryptedData(EncryptedDataType value) { return new JAXBElement<EncryptedDataType>(_EncryptedData_QNAME, EncryptedDataType.class, null, value); }
0
public Frame1() { try{ Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL,USER, PASS); statement = conn.createStatement(); }catch(SQLException se){ se.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } setTitle("KutaRaya, 1 - 18"); setDefaultCloseOperation(J...
8
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (rotation % 2 == 1) { g.drawOval(75, 75, 50, 50); g.drawLine(0, 100, 75, 100); g.drawLine(125, 100, 200, 100); } if (rotation % 2 == 0) { g.drawOval(75, ...
4
public String deleteMessage(String s) { if (s != null) { int count = 0; int suchMessageNummer = Integer.parseInt(s); File suchFile; for (File box : dir.listFiles()) { for (File file : box.listFiles()) { if (file.isFile() && fi...
7
public Result download() { Result back = Result.UPDATED; File updateFolder = this.plugin.getServer().getUpdateFolderFile(); String url = (String) this.latest.get(this.DL_URL); ReadableByteChannel rbc = null; FileOutputStream fos = null; try { URL call = new UR...
5
private void getExams() { try { Exam_DAO exam_DAO = new Exam_DAO(); ResultSet rs = exam_DAO.getList(""); exams = new ArrayList<sols.Model.Exam>(); while (rs.next()) { sols.Model.Exam examTemp = new sols.Model.Exam(); examTemp.setEx...
2
@Override public Operation simplify() { Expression L = Simplify.mod(this.L); Expression R = Simplify.mod(this.R); if ( "0.0".equals(L.getString()) || "0.0".equals(R.getString()) ){ return new Number(0); } else if ( "1.0".equals(L.getString()) ){ return R.operation; } else if ( "1.0".equals(R.getString(...
4
public home(int x,int y) { super(x,y); URL loc = this.getClass().getResource("/karel/themes/LTTPHome.png"); ImageIcon iia = new ImageIcon(loc); image = iia.getImage(); this.setImage(image); }
0
public synchronized void mouseClicked(MouseEvent me) { if(me.getButton() == MouseEvent.BUTTON1) { if(!player.getRelativeMouse()) { player.setRelativeMouse(true); canvas.hideCursor(); } else { ball.releaseBall(); Shooter shooter = player.getPaddleShooter(); if(shooter != null) ...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Course other = (Course) obj; if (catalogNumber == null) { if (other.catalogNumber != null) return false; } else if (!catalogNumber.equal...
9
private boolean jj_3R_51() { if (jj_scan_token(IF)) return true; if (jj_3R_9()) return true; if (jj_scan_token(THEN)) return true; if (jj_3R_9()) return true; if (jj_scan_token(ELSE)) return true; if (jj_3R_9()) return true; if (jj_scan_token(END)) return true; return false; }
7
public static BufferedImage parametrizedGaussBlur(BufferedImage input, double sigma) { // build blur kernel int size = (int) (((int) (Math.ceil(6 * sigma)) % 2) == 1 ? Math.ceil(6 * sigma) : (Math.ceil(6 * sigma) + 1)); double kernel[] = new double[size]; int sigmaIndex = size/2; ...
9