text
stringlengths
14
410k
label
int32
0
9
public static void ChooseHarrish () { if (Game.characterChoice == 1) { Game.CharacterOne = "Harrish"; Game.CharacterOneHP = CharacterStats.HarrishHP; Game.CharacterOneAttack = CharacterStats.HarrishAttack; Game.CharacterOneMana = CharacterStats.HarrishMana; Game.CharacterOneRegen = Charac...
2
public void operateMatrix(Matrix[]... srcs) { Matrix[] srcU = srcs[0]; Matrix[] srcV = srcs[1]; for (int colNo = 0; colNo < super.matWidth; colNo++) { multiplyAndStackUV(srcU[0].getArray(), srcV[0].transpose().getArray(), super.arrY, colNo, srcV[0].getColumnDimension(), srcU[0].getRo...
2
public String getTooltipExtraText(final Province current) { // Default is to only show extra text for land provinces if (!editor.Main.map.isLand(current.getId())) return ""; final String prop = mapPanel.getModel().getHistString(current.getId(), name); if (prop == nul...
3
@Before public void setUp() throws Exception { }
0
public UpperCaseField(int cols) { super(cols); }
0
public static void main(String[] args) { // TODO code application logic here String cadena1 = ""; String cadena2 = ""; cadena1 = (JOptionPane.showInputDialog("Ingrese Cadena 1:")); cadena2 = (JOptionPane.showInputDialog("Ingrese Cadena 2:")); int longitud1 = cadena1.l...
5
public void setRap_num(int rap_num) { this.rap_num = rap_num; }
0
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(args.length == 0) { return false; } if(args[0].equalsIgnoreCase("create")) { doCreateCommand(sender, cmd, label, args); } else if(args[0].equalsIgnoreCase("list")) { doListCommand(sender, cmd, label...
6
public String getLyricsFromURL(String url) { InputStream lyricsPageInputStream = this.getInputStream(url); BufferedReader br = new BufferedReader(new InputStreamReader(lyricsPageInputStream)); StringBuilder sb = new StringBuilder(); String line = ""; try { while((line = br.readLine()) != null) { sb.app...
3
public final Result getUpdateStatus() { return this.result; }
0
private static Image getImage(String filename) { // to read from file ImageIcon icon = new ImageIcon(filename); // try to read from URL if ((icon == null) || (icon.getImageLoadStatus() != MediaTracker.COMPLETE)) { try { URL url = new URL(filename); ...
6
private boolean versionCheck(String title) { if (this.type != UpdateType.NO_VERSION_CHECK) { final String version = this.plugin.getDescription().getVersion(); if (title.split(" v").length == 2) { final String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get the ...
5
@Override public boolean abort() throws LoginException { if (debug) { LOG.debug("aborting authentication"); } if (!succeeded) { return false; } if (!commitSucceeded) { resetData(); succeeded = false...
3
private void removeReservation(ServerReservation res) { boolean inProg = res.getReservationStatus() == ReservationStatus.IN_PROGRESS; // returns the time slot to the profile profile.addTimeSlot(res.getStartTime(), res.getExpectedFinishTime(), res.getPERangeList()); LinkedList<Sch...
6
public boolean isFriend(User user){ for (int i=0; i<friends.size();i++) if (friends.get(i)==user) return true; return false; }
2
private LinkInfo getCachedInfo(String videoID) { for (LinkInfo li : cache) if ( li.hasVideoID(videoID) ) return li; return null; }
2
public boolean updatePosListaPrecioDisable(final PosListaPrecio itemOracle){ Session hbSessionOracle = getSession(); // SESSION ORACLE Transaction tsOracle = hbSessionOracle.beginTransaction(); boolean successOracle = false; try { getHibernateTemplate().execute(new HibernateCallback() { @O...
2
static final void method3189(int i, String[] strings) { if (i == 0) { anInt9537++; if (strings.length > 1) { for (int i_4_ = 0; i_4_ < strings.length; i_4_++) { if (strings[i_4_].startsWith("pause")) { int i_5_ = 5; try { i_5_ = Integer.parseInt(strings[i_4_].substring(6)); } catc...
5
static public String trimNumber(String s) { if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0) { while (s.endsWith("0")) { s = s.substring(0, s.length() - 1); } if (s.endsWith(".")) { s = s.substring(0, s.length() - 1); ...
5
public void testToStandardHours() { Days test = Days.days(2); Hours expected = Hours.hours(2 * 24); assertEquals(expected, test.toStandardHours()); try { Days.MAX_VALUE.toStandardHours(); fail(); } catch (ArithmeticException ex) { // e...
1
public char toLowCase(char c){ if(c>= '0' && c <='9') return c; else if(c>= 'A' && c<='Z'){ return (char) (c-'A'+'a'); } return c; }
4
public void dprint(){ System.out.println("-------"); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { int v = 0; if (grid.get(i).get(j) != null) v = grid.get(i).get(j).getValue(); if (v != 0) { System.out.print("|" + v + "|\t"); }else{ System.out.print("| |\t"); } ...
4
public static void main(String[] args) { Cups.cup1.f(99); }
0
protected void calcLaValue() { // 拉格朗日插值的运算 double t = 0.0; int i, j, k; double result = 0.0; double[] x = new double[Def.N]; double[] y = new double[Def.N]; try { t = Double.parseDouble(laTTextField.getText()); } catch (NumberFormatException e) { // t值输入格式错误 JOptionPane.showMessageDialog(null...
9
private void center() { float[] min = new float[] {Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE}; float[] max = new float[] {Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE}; for(Vertex v : vertices) { for(int a = 0; a < 3; a++) { min[a] = Math.min(min[a], v.data[a]); max[a] = Math.max(max[a], v...
5
public void buildrightomposite() { GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 1; gridLayout.marginWidth = gridLayout.marginHeight = 0; rightComposite.setLayout(gridLayout); Composite titleComposite = new Composite(rightComposite, SWT.NONE); GridData gd = new GridData(GridData.FILL_BO...
2
public String readCEWWBracket(Title title, Reader reader, String type) throws IOException { int val = 0; StringBuilder builder = new StringBuilder(); while ((val = reader.read()) > -1) { switch (val) { case ')': String data = builder.toString().tr...
7
public static final String removeMnemonics(final String text) { int index = text.indexOf('&'); if (index == -1) { return text; } int len = text.length(); StringBuffer sb = new StringBuffer(len); int lastIndex = 0; while (index != -1) { // ignore & at the end if (index == len - 1) { break; ...
9
protected GameElement(Rectangle masse, IntHolder unit) { super(masse); this.unit = unit; }
0
public static ResultSet _find(String tableName, String field, String value) throws SQLException { PreparedStatement statement = connect.prepareStatement(" select * from `" + tableName + "` where `" + field + "` = ? " ); statement.setString(1, value); ResultSet result = statement.executeQuery(); return result; ...
0
@Override public ArrayList<Move> generateMovesForThisPiece(Chessboard chessboard) { int toX = -1, toY = -1; final ArrayList<Move> moves = new ArrayList<Move>(); final String positionPiece = chessboard.getPositionPiece(this); final int getX = Helper.getXfromString(positionPiece); final int getY = Helper.get...
8
public static final boolean badPosition(int pos) { if (pos == -1) { new ErrorLog("Falsche Position\n\n" + Control.current.lastResponse); return true; } return false; }
1
@Override public void run() { MongoClient mongoClient = null; // First verify there is stuff to work with - this is hiding the bug // that this thread should not start unless the data is good to go if ((myDb == null) || (myCollection == null) || (myFilter == null)) { return; } try { // TODO - more ...
7
private void checkExistsPseudo(String psd) throws Exception { UserModel user = DataStore.getUserByPseudo(psd); if(user !=null) { throw new Exception( "Ce pseudo n'est pas disponible." ); } }
1
public static void outPutBlockToTrack(Track[] t){ try{ jxl.Workbook readWorkBook = jxl.Workbook.getWorkbook(new File("Output_File.xls")); //唯讀的Excel工作薄物件 jxl.write.WritableWorkbook writeWorkBook = Workbook.createWorkbook(new File("Output_File.xls"), readWorkBook); //寫入 jxl.write.WritableSheet writeSheet ...
7
public XMLReaderStAX getStAXReader() { if (staxReader == null) { staxReader = new XMLReaderStAX(); } return staxReader; }
1
public static void main (String [ ] args) { int x = 1; int y = 1; while (x < 5) { y = x - y; System.out.print (x + "" + y + " "); x = x + 1; } System.out.println ( ); }
1
private static boolean filtersAcceptComponent(EntityRef clientEntity, EntityRef entity, Class<? extends Component> componentClass, Iterable<? extends EntityComponentFieldFilter> componentFieldFilters) { for (EntityComponentFieldFilter componentFieldFilter : componentFieldFilters) { if (componentFiel...
4
public void setImageIcon(String name, ImageIcon icon) { Component comp = fetchComponent(null, name); if (comp instanceof JLabel) { JLabel label = (JLabel) comp; label.setIcon(icon); } }
1
public void processInput(String input) { String[] words = input.split(" "); if(words[0].equalsIgnoreCase("clear")) { td.clear(); } else if(words[0].equalsIgnoreCase("disablecomp")) { Application.get().getLogic().disableComponent(words[1]); } else i...
5
@Override public void sortedStructure() { for (int i = 0; i < data.kitSize(); i++){ Arrays.sort((String[]) data.getFromKit(i)); } data.setState("Sorted"); }
1
public Leaderboard(FileConfigurationWrapper fcw_, String name_, String header_, String countSuffix_) { name = name_; header = header_; fcw = fcw_; countSuffix = countSuffix_; playerNameList = getNames(); playerCountList = getCounts(); //If the topkillers board hasn't been made yet, then.... if (p...
3
private void initializeLogger() { this.log = Logger.getLogger(this.getClass().getName()); try { FileHandler fh = new FileHandler(this.getClass().getName() .replace("class ", "") + ".log"); fh.setFormatter(new SimpleFormatter()); this.log.addHandler(fh); } catch (SecurityException e1) { // TO...
3
@Override public void delete(Element element, String outerBlockNames) throws RemoteException { if((null == element.toString()) || ("" == element.toString())){ return; } // outerBlockNames is "" search all conf if("".equals(outerBlockNames.trim())){ confText = ReadConf(); ...
5
private boolean validOr(String filter, String value) { filter = filter.trim(); filter = filter.substring(1, filter.length() - 1);// clear ( ) String[] temp = filter.split(OR); int require = temp.length; int op[] = new int[temp.length]; String filterValue[] = new String[temp.length]; int cnt = 0; for (St...
6
private ChokeMessage(ByteBuffer buffer) { super(Type.CHOKE, buffer); }
0
public void populate(int input, int hidden, int output) { //add neurons for(int i=0;i<input; i++) { addInputNode(); } for(int i=0;i<hidden; i++) { Neuron newron = addHiddenNode(); //add connections from previous layer for(Neuron n : inputNeurons) { n.addConnect...
5
@Override public int compareTo(Object card2) throws ClassCastException{ if (!(card2 instanceof Card)) throw new ClassCastException("A Card object expected."); if(this.cmc == ((Card) card2).getCmc()) return this.cardName.compareTo(((Card) card2).getCardName()); return ((Card) card2).getCmc() - th...
2
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder out = new StringBuilder(); int t = Integer.parseInt(in.readLine().trim()); for (int i = 0; i < t; i++) { int n = Integer.parseInt(in.readLine().trim()); Item[...
9
public boolean nextP() { { QuerySolutionTableIterator self = this; { QuerySolutionTable table = self.theTable; QuerySolution cursor = self.cursor; QuerySolution previous = cursor; if (self.firstIterationP) { previous = null; cursor = table.first; self.fi...
6
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
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SKI", scope = X509DataType.class) public JAXBElement<byte[]> createX509DataTypeX509SKI(byte[] value) { return new JAXBElement<byte[]>(_X509DataTypeX509SKI_QNAME, byte[].class, X509DataType.class, ((byte[]) value)); }
0
@Override public void save(IArticle article) throws ArticleWriteException { try { em.getTransaction().begin(); persistResources(article); em.persist(article); em.getTransaction().commit(); } catch (IOException e) { throw new ArticleWriteExc...
1
private void login(String userName, char[] password){ //load login information logAc = logAc.load(logAc); if ((mode = Doctor.checkLogin(db,logAc,userName,password))!=0){ //when password match, saved mode : 1:Doctor 2:admin this.userName = userName; doctorID = userName; db = db.load(db); menuPage...
1
public Vector substitution(Matrix matrix, Vector b, SubstitutionDirection direction) throws ArithmeticException { Double term0 = 0d; Double term1 = 0d; Double term2 = 0d; Vector y = new Vector(); if (direction == SubstitutionDirection.FORWARD) { y...
5
public Sprite(BufferedImage ss, BufferedImage ds, BufferedImage cs, BufferedImage ts) { for(int i = 0; i < uROWS; i++) { for(int j = 0; j < uCOLUMNS; j++) { unit[i][j] = ss.getSubimage(j * Game.TILESIZE, i * Game.TILESIZE, Game.TILESIZE, Game.TILESIZE); ...
7
public void reset() { if(comboMaterial.getItemCount() > 0) { comboMaterial.setSelectedIndex(0); } if(comboMachine.getItemCount() > 6) { comboMachine.setSelectedIndex(6); }else { if (comboMachine.getItemCount() > 0) { comboMachine.setSe...
7
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //TilastointiService service = new TilastointiService(); ArrayList<Integer> vuodet; String vuosistr = ""; if(request.getSession().getAttribute("vuosi") != null) { vuosistr = (Str...
4
@Override public boolean exists() { try { URL url = getURL(); if (ResourceUtils.isFileURL(url)) { // Proceed with file system resolution... return getFile().exists(); } else { // Try a URL connection content-length header... URLConnection con = url.openConnection(); ResourceUtils.useC...
8
@Override public String getSVG( HashMap<String, Double> chartMetrics, HashMap<String, Object> axisMetrics, ChartSeries s ) { double x = chartMetrics.get( "x" ); double y = chartMetrics.get( "y" ); double w = chartMetrics.get( "w" ); double h = chartMetrics.get( "h" ); double max = chartMetrics.get( "max" );...
8
@Override public void saveOrder(List<FoodCombo> orderList) throws RuntimeException { try { List colDescriptors = new ArrayList(); List colValues = new ArrayList(); db.openConnection(FoodOrderDAO.DRIVER, FoodOrderDAO.URL, FoodOrderDAO.USER, FoodOrderDAO...
5
public static void checkForMIFUUpdate(){ //Check latest version available String latest = null; Download.downloadfile(CONSTS.FILEZ+"/mifuv.txt", CONSTS.MIFUDIRS, "/version.txt"); try { File file = new File(CONSTS.MIFUDIR+"/version.txt"); FileReader fileReader = new FileReader(file); StringBuffer string...
5
public boolean iterate(Board board) { if(board.getRemainingBlocks().isEmpty()) { return checkWinStatus(board); } Direction direction; for(Block b : board.getRemainingBlocks()) { for(int i = 0; i < 4; i++) { Board copy = board.copy(); ...
9
public List<Integer> findSubstring(String S, String[] L) { Map<String, Integer> numOfSubstrings = new LinkedHashMap<>(); for (int i = 0; i < L.length; i++) { if (numOfSubstrings.containsKey(L[i])) { numOfSubstrings.put(L[i], numOfSubstrings.get(L[i]) + 1); } else { numOfSubstrings.put(L[i], 1); } ...
8
@Override public void run() { arr_data = Ticket.showAll(); data = new Object[arr_data.size()][]; for (int i = 0; i < arr_data.size(); i++) { data[i] = arr_data.get(i).Array(); } this.fireTableDataChanged(); }
1
public Employee(String n, double s) { name = n; salary = s; }
0
public void reset() { state = STATE_RELEASED; amount = 0; }
0
private void setReadyButtonClick() { _view.active.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Map<String, Object> m = new HashMap<String, Object>(); m.put("action", "ready"); _model.sendMessage(m); _view.active.setEnabled(false); _view....
0
@Override public void stop() throws Exception { super.stop(); ConnectionPool.close(); }
0
public static int findPeakElement(int[] num) { if (null == num || 0 == num.length) return -1; int len = num.length; int low = 0, high = len - 1; int mid = 0; if (1 == len) return 0; while (low < high) { mid = (low + high) >> 1; if (num[mid] < num[mid +...
5
public static List<TestInstanceInfo> getTestInstances(HierarchicalConfiguration testsetData) { List<TestInstanceInfo> testInstances = null; List<HierarchicalConfiguration> testInstancesData = testsetData.configurationsAt(TESTINSTANCE_TAG); if (testInstancesData != null && !testInstancesData.isEmpty...
3
@Override public void putAll(CSProperties p) { super.putAll(p); for (String s : p.keySet()) { Map<String, String> m = p.getInfo(s); setInfo(s, m); } getInfo().putAll(p.getInfo()); }
1
private EnemyView getEnemyView(Enemy e) { for (EnemyView ev : enemies) { if (ev.getEnemy().equals(e)) { return ev; } } //if it's not already in the list create a new and add it EnemyView ev = new EnemyView(e); enemies.add(ev); return ev; }
2
public Vector2 getNextObj(Vector2 start, int direction){ MenuObj m = getObj(start); float x = projections.get(m).x; float y = projections.get(m).y; Vector2 next = start.cpy(); switch (direction){ case 1: // UP y = y > 0 ? y - 1 : vertical.size - 1; next = vertical.get((int) y).getMenuMapping(); ...
8
@Override public void paintComponent(Graphics graphics) { int xOrigin = (int) (xOffset - ((getCanvasWidth() * getScale()) / 2D)); int yOrigin = (int) (yOffset - ((getCanvasHeight() * getScale()) / 2D)); for (int x = 0; x < getCanvasWidth(); x += 8) { for (int y = 0; y < getCanvas...
9
public static void main(String[] args) { long startTime = System.currentTimeMillis(); int limit = 10000000; boolean[] isNotPrime = new boolean[limit+1]; for (int i=2;i...
5
private void SelectJButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SelectJButtonMouseClicked //if merchant was not selected then pop warning int[] rowsSelected = merchantJTable.getSelectedRows(); if(rowsSelected.length > 0 && rowsSelected.length < 2){ //store th...
4
@Override public void run() { try { while(!Thread.interrupted() ) { try { setupSocket(hostname, portNumber); } catch (IOException e1) { Thread.sleep(rand.nextInt(1000)); continue; } int numAttempts = rand.nextInt(10); for (int i =0; i< numAttempts; i++) { ...
8
public void addNgrambyup(Connection conn,Ngram ngram) throws Exception{ String wordAfterHandle = ""; for(int i=0;i<ngram.getWordGroup().length();i++) { char c = ngram.getWordGroup().charAt(i); if(c == '\'') { wordAfterHandle += "\\\'"; } else { wordAfterHandle += c; } } String sql...
2
private void comen1(char []codigo){ int let = 0; //Para eliminar el comentario sencillo while(let<codigo.length-1){ if(codigo[let]=='/' && codigo[let+1]=='/'){ codigo[let] = ' '; codigo[let+1] = ' '; let++; ...
5
public void endGame(){ String stillWalking = (s.whoseTurn() == "red")?"blue" : "red"; MyList blankPos = s.ownees(null); s.fill(blankPos,stillWalking,board); int redScore =s.getnRed() + ((stillWalking == "red")?s.getnEmpty():0); int blueScore = s.getnBlue() + ((stillWalking == "blue")?s.getnEmpty():0); boar...
8
public void onDisable(){ log.info("Saving open slots..."); for(Player p : getServer().getOnlinePlayers()){ if(bm.getSlot(p.getName()) != null){ try { loader.saveSlot(bm.getCurrentSlotContents(p.getName()), p.getName(), bm.getSlot(p.getName())); } catch (Exception e) { log.severe("ERROR: Failed ...
3
public void persistRuleSet(RuleSet ruleSet) { String sqlStatement; dao.connect(); sqlStatement = generateInsertStmt(ruleSet); if(dao.getErrorLogs().getErrorMsgs().size() == 0){ dao.executeUpdate(sqlStatement); } if(dao.getErrorLogs().getErrorMsgs().size() == 0){ dao.disconnect(); } }
2
public OceanLifeGui (String test, Ocean ocean) { super(test); width = ocean.getWidth(); depth = ocean.getDepth(); setLayout(null); setResizable(false); setLocation((((int)dim.getWidth() - width) / 2),(((int)dim.getHeight()- depth) / 2)); PaintArea oceanArea = new PaintArea(ocean); ocean...
3
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { buf.setLength(0); buf.append(tab).append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); ...
1
public Element build(ServerPlayer serverPlayer) { List<Change> c = new ArrayList<Change>(changes); List<Element> elements = new ArrayList<Element>(); List<Change> diverted = new ArrayList<Change>(); Document doc = DOMMessage.createNewDocument(); // For all sorted changes, if it ...
8
public void removeChar(String delStr) { int i; CharList tmpNode; CharList prevNode; firstNode = this; for (i = 0; i < delStr.length(); i++) { tmpNode = firstNode; prevNode = firstNode; while (tmpNode != null && tmpNode.ch == delStr.charAt(i)) { prevNode = tmpNode; tmpNode = tmpNode.next; ...
6
@Override public ClienteBean set(ClienteBean oClienteBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.initTrans(); if (oClienteBean.getId() == 0) { oClienteBean.setId(oMysql.insertOne("cliente")); } oMysql.up...
2
@Override public void layout () { float regionWidth, regionHeight; if (drawable != null) { regionWidth = drawable.getMinWidth(); regionHeight = drawable.getMinHeight(); } else return; float width = getWidth(); float height = getHeight(); Vector2 size = scaling.apply(regionWidth, regionHeight, wi...
5
public static HandlerList getHandlerList() { return handlers; }
0
public static Class convertPrimitiveClass(final Class obj) { if (!obj.isPrimitive()) { return obj; } if (obj == Boolean.TYPE) { return Boolean.class; } if (obj == Byte.TYPE) { return Byte.class; } if (obj == Character.TYPE) { ...
9
public List<Article> getItems() { System.out.println(baseUrl); List<Article> articles=new ArrayList<Article>(); try { URL feedUrl = new URL(baseUrl); /* SyndFeedInput: parser to process RSS feeds into SyndFeed instance*/ SyndFeedInput inpu...
4
public static void startupMemoize() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$); Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get()))); if (S...
7
@Override public void write(ICTMC ctcm, String pathname) throws Exception { BufferedWriter outputStrm = new BufferedWriter(new FileWriter(pathname)); Matrix tmpM; List<Matrix> tmpTra; int i = -1; int max = -1; int j = -1; int maxT = -1; try { tmpM = ctcm.getQ(); max = tmpM.getRowDimension(); ...
7
String indentMaker(String setting, double spaces) { String list = ""; if (setting.equals("total")) { int x = endInd; if (paragraphOn && !_endnoteMode) { x = parIndent + indent; } else if (paragraphOn && _endnoteMode) { x = endParInd + e...
9
@Override public void update() { try { if(currentAchievement == null) { currentAchievement = queue.removeFirst(); lastTime = System.currentTimeMillis(); x = BlockyMain.width/2-100; y=-80; } ...
5
public void setCipherKey(String cipherKey) { if (cipherKey == null || cipherKey.length() == 0) throw new IllegalArgumentException(); for (int i = 0; i < cipherKey.length(); i++) { if(cipherKey.charAt(i)<97 || cipherKey.charAt(i)>122) throw new IllegalArgumentException(); } this.cipherKey = cipherKey.toLowerC...
5
public void testSubstituteDestructive() { System.out.println("\n*** testSubstituteDestructive ***"); try { CycFormulaSentence sentence = getCyc().makeCycSentence("(#$likesAsFriend ?X ?Y)"); sentence = sentence.substituteNonDestructive(CycObjectFactory.makeCycVariable("X"), CycObjectFac...
1
private int[] genericActionListener() { int laCases = -1; int nycCases = -1; int chicagoCases = -1; int atlantaCases = -1; int denverCases = -1; int dallasCases = -1; int miamiCases = -1; //la try { laCases = Integer.parseInt(this.losAngelesTF.getText()); } catch (NumberFormatException nfe) { ...
7
public static void hypothesizeUseless(GrammarEnvironment env, Grammar g) { UselessProductionRemover remover = new UselessProductionRemover(); /* * Grammar g2 = remover.getUselessProductionlessGrammar(g); if * (g2.getProductions().length < g.getProductions().length) { * UselessPane up = new UselessPane(env,...
1