text
stringlengths
14
410k
label
int32
0
9
private void runLive() { TalkerTextWork localTalkerTextWork = this.dd.getTalkerTextWork(); TalkerLineWork localTalkerLineWork = this.dd.getTalkerLineWork(); long l1 = System.currentTimeMillis(); long l2 = l1 + 86400000L; long l3 = l1 + 3600000L; while (this.live) try { Thre...
9
static double normalizeAngle(double a) { while (a < 0) a += 2*Math.PI; while (a >= 2*Math.PI) a -= 2*Math.PI; return a; }
2
public void searchAvailableCells(){ int numB1 = 1 ; int numB2 = 1 ; int numB3 = 1 ; int numB4 = 1 ; for (int i = 0; i < 28; i++) { if (i < 7) { if (this.testAvailabe(numB1 * -1, numB1, i)){ numB1++; }else{ this.FilterAvailable(i, 7); i = 7 ; continue; } ...
9
public CheckResultMessage pass(String message) { return new CheckResultMessage(message); }
0
public void generateInOrderWire() { recursiveTraverse(this.root, new TraverseCallback() { private TreeNode previous; public void action(TreeNode current) { if (current.hasNoLeftSide()) { if (previous != null) { current.leftChild = previous; } current.leftIsWire = true; } ...
4
private static String encrypt(final int[] key, final String text) { String encryptedText = ""; logger.log(Level.INFO, "Plain text: {0}", text); logger.log(Level.FINE, "Key: {0}", Arrays.toString(key)); char temp[][] = new char[text.length()][key.length]; int order[] = new int[key...
8
private void checkCollision(){ if(r.intersects(StartingClass.hb.r)){ visible=false; if(StartingClass.hb.health > 0){ StartingClass.hb.health -= 1; } if(StartingClass.hb.health == 0){ StartingClass.hb.setCenterX(-100); StartingClass.score += 5; } } if(r.intersects(StartingClass.hb...
6
public YAMLConfig(InputStream configStream, File configFile, int comments, JavaPlugin plugin) { this.comments = comments; this.manager = new YAMLConfigManager(plugin); this.file = configFile; try { this.config = YamlConfiguration.loadConfiguration(new InputStreamReader(confi...
3
public AutomatonChecker() { }
0
@Override public void resetSettings() { settings.setDefault(); }
0
private void batchEstimateDataAndMemory(boolean useRuntimeMaxJvmHeap, String outputDir, int reduceBase) throws IOException { //File mDataOutputFile = new File(outputDir, "eDataMappers.txt"); //File rDataOutputFile = new File(outputDir, "eDataReducers.txt"); File mJvmOutputFile = new File(outputDir, "eJvmMapper...
8
public static void main(String[] args) { // TODO Auto-generated method stub int n = Integer.parseInt(args[0]); //n is between 3 and 1000; int k = Integer.parseInt(args[1]); //k is an integer between 0 and n; int v = Integer.parseInt(args[2]); //v is in {0,1,2,3}. N = n; K = k; /...
8
public static void Command(CommandSender sender) { if(sender.hasPermission("gm.adventure.all")) { for(Player player : Bukkit.getServer().getOnlinePlayers()) { if (player.getGameMode() != GameMode.ADVENTURE) { player.setGameMode(GameMode.ADVENTURE); if(sender instanceof Player) { ...
6
private void create(int[] init, Color bg, String fieldTitle) { setPreferredSize(new Dimension(GUIConstants.DEFAULT_FIELD_WIDTH, FIELDHEIGHT)); setBackground(bg); setBorder(BorderFactory.createTitledBorder(fieldTitle)); setLayout(new VerticalLayout(0, VerticalLayout.CENTER)); setT...
6
@Override protected void startServerLoop() { Runnable thread = new Runnable(){ @Override public void run() { while(running){ try { Thread.sleep(GAMEINTERVAL); updateServerGame(); } catch (InterruptedException e) { e.printStackTrace(); } } } }; (new Thread(thread...
2
@Override MessageExoType getMessageExoType(String arrow) { if (arrow.contains("<")) { return MessageExoType.FROM_RIGHT; } if (arrow.contains(">")) { return MessageExoType.TO_RIGHT; } if (arrow.startsWith("/") || arrow.startsWith("\\")) { return MessageExoType.FROM_RIGHT; } if (arrow.endsWith("\\...
8
private static ValuePtr readPtr(CompileInfo ci, String p) { if(p.charAt(0)!='['){ makeDiagnostic(ci, Kind.ERROR, "expect.ptr.start");//$NON-NLS-1$ }else if(p.charAt(p.length()-1)!=']'){ makeDiagnostic(ci, Kind.ERROR, "expect.ptr.end");//$NON-NLS-1$ } List<MiniScriptValue> values = new ArrayList<MiniScript...
8
public JPanel getLocaleBtnMenu() { if (!isInitialized()) { IllegalStateException e = new IllegalStateException("Call init first!"); throw e; } return this.localeBtn; }
1
public static CardStack createFromFile(String fileName) { InputStreamReader inStream; try { inStream = new InputStreamReader(new FileInputStream(fileName), CHARSET); } catch(IOException e) { return null; } BufferedReader bufferedReader = new BufferedReader(inStream); ArrayList<Card> newStack = new ArrayList<...
4
public int longestValidParentheses_2(String s) { // Note: The Solution object is instantiated only once and is reused by // each test case. Stack<Integer> stack = new Stack<Integer>(); int max = 0; int count = 0; for(int i = 0; i < s.length(); ++i){ if(s.charA...
3
@Override public boolean evaluate(T2 obj) throws Exception { return true; }
0
private boolean xIntersects(Vec3D var1) { return var1 == null?false:var1.y >= this.y0 && var1.y <= this.y1 && var1.z >= this.z0 && var1.z <= this.z1; }
4
public void update(int delta) { if(!entityAddList.isEmpty()) { for(Entity ent : entityAddList) { entityList.add(ent); } entityAddList.clear(); } if(!entityRemoveList.isEmpty()) { for(Entity ent : entityRemoveList) { if(ent instanceof EntityPlayer) this.lose(); entityList...
7
@BeforeClass public static void setUpClass() { }
0
@Override public String perform(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); String status = "Client not added, did you fill all required field?..."; //** 1. Retrieve the Form Input (Name-Value Pairs) from the HTTP Request *** String fName = request...
8
public boolean ModificarPunto(Punto p){ if (p!=null) { cx.Modificar(p); return true; }else { return false; } }
1
public DungeonFloor() { Random random = new Random(1000); int w = 6; int h = 8; double ws = 1.0 / (w); double hs = 1.0 / (h); for (int x = 0; x < w; x++) { for (int z = 0; z < w; z++) { for (int y = 0; y < h; y++) { double x...
4
public static String getFlightModeName(eMode mode) { if (mode == eMode.NORMAL_MODE) return "NORMAL"; if (mode == eMode.MUHA_MODE) return "MUHA"; if (mode == eMode.TAG_MODE) return "TAG"; return "UNKNOWN"; }
3
public static boolean onSegment(Point2d p1, Point2d p2, Point2d Q){ if(Q.sub(p1).crossProduct(p2.sub(p1))== 0 && Math.min(p1.x, p2.x)<=Q.x && Math.max(p1.x, p2.x)>=Q.x && Math.min(p1.y, p2.y)<=Q.y && Math.max(p1.y, p2.y)>=Q.y) ...
5
public void ShowAsBit() { System.out.print("["); for (int i = 0; i < _ListaDeObjetos.size(); i++) { if(_ListaDeObjetos.get(i) != null) { System.out.print("1"); if(i + 1 < _ListaDeObjetos.size()) { Sy...
4
public static void writeToCSV(String fileName, List<HashMap> dataMaps) { try (FileWriter writer = new FileWriter(fileName)) { System.out.println("Writing to file " + fileName); writer.append("_type,_id,name,type,latitude,longitude\n"); String typeS; String id; ...
7
private int getMaxSizeY(final JComponent[] components) { int max = 0; for (final JComponent component : components) { final Dimension dimension = component.getMaximumSize(); if (dimension != null) { if ((dimension.height > max) && (dimension.height != Integer.MAX_VALUE)) { max = dimension.hei...
4
public boolean isSet(String path) { Configuration root = getRoot(); if (root == null) { return false; } if (root.options().copyDefaults()) { return contains(path); } return get(path, null) != null; }
2
private Boolean load_last() { // We initialize pointer to root of document try { settings = document.getRootElement(); List listsections = settings.getChildren(); if (listsections != null){ Iterator i = listsections.iterator(); while(i.hasNext()){ Element current = (Element)i.n...
7
public void crackShotEventListener(WeaponDamageEntityEvent e){ if (e.isCancelled() || (e.getDamage() == 0)){return;} Player dmgr = e.getPlayer(); if(e.getVictim() instanceof Player){ Player tagged = (Player) e.getVictim(); if(plugin.entityListener.disallowedWorld(tagged.getWorld().getName())){...
8
@Override public void update(){ super.update(); if(prevX != this.getX() || prevY != this.getY() || prevZ != this.getZ() || prevAngle != this.getAngle()){ this.updateRenderPosition(); this.syncPreviousPosition(); } }
4
private void isiIC() { int count = 0; this.copyPapan[9][2]="C"; this.copyPapan[2][7]="C"; this.copyPapan[3][9]="C"; count=3; for (int i = 0; i < this.banyakIC; i++) { Random randrow = new Random(); Random randcol = new Random(); int row...
4
private static int inputCustomerChoice() { String choice = null; if (scanner.hasNext()) { choice = scanner.nextLine(); } isValidChoice(choice); return Integer.parseInt(choice); }
1
public void extractFeature(List<Article> artList, boolean isTraining) { final int SENT_LEN_MAX_CUTOFF = 15; final int SENT_LEN_MIN_CUTTOFF = 3; int sentCount = 0; for (Article art : artList) { if (sentCount >= 100) { return; } if (art.getLabel().equals("1")) { continue; } for (String sen...
7
Class323(AbstractToolkit var_ha, int i, boolean bool, Component component) { aBoolean4037 = false; aClass105Array4042 = new RasterToolkit[256]; anIntArray4039 = new int[256]; Font font = new Font("Helvetica", bool ? 1 : 0, i); FontMetrics fontmetrics = component.getFontMetrics(font); for (int i_19_ = 0; i_19_ < a...
7
public boolean getTalkable(Player other) { if ((other.getCurrentY()+1) == getCurrentY()) { if ((other.getCurrentX()) == getCurrentX()) { return true; } } if ((other.getCurrentY()-1) == getCurrentY()) { if ((other.getCurrentX()) == getCurrentX()) { return true; } ...
8
public String endSection(Marker marker) { StringBuilder sb = new StringBuilder(); // Add header? if (showHeader && (sectionNum == 0)) { String header = toStringHeader(); if (!header.isEmpty()) { sb.append(header); sb.append("\n"); } } // Add current line sb.append(toString()); sectionN...
4
@Override public int print(Graphics pg, PageFormat pageFormat, int pageIndex) throws PrinterException { pg.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY()); int wPage = 0; int hPage = 0; if (pageFormat.getOrientation() == PageFormat.LANDSCAPE) { wPage = (int)pageFormat.get...
7
private static String generateQuery(String query, Object... parameters) { assertThatParamsCanBeBound(query, parameters); int paramIndex = 0; while (query.contains(TOKEN)) { Object parameter = parameters[paramIndex++]; query = bindParamIntoQuery(query, parameter); } return query; }
1
public void dealerWon() { if (dealerHand.getHandRanks().contains("Ace") && (dealerHand.getHandRanks().contains("Ten") || dealerHand .getHandRanks().contains("Jack")) || dealerHand.getHandRanks().contains("Queen") || dealerHand.getHandRanks().contains("King")) { System.out.println("Dealer got...
5
private Token buildWordToken(String word){ TokenType tt = null; switch(word.toUpperCase()) { case "IF": tt = TokenType.IF_DECL; break; case "ELSE": tt = TokenType.ELSE_DECL; break; case "WHILE": tt = TokenType.WHILE_DECL; break; case "INT": tt = TokenType.INT_TYPE; break; case...
9
private void putRequiredOption( Collection<String> precedentSynonyms, OptionSpec<?> required, Map<Collection<String>, Set<OptionSpec<?>>> target ) { for ( String each : precedentSynonyms ) { AbstractOptionSpec<?> spec = specFor( each ); if ( spec == null ) throw ...
8
public boolean inside(MultiColor c) { for (int i = 0; i < min.length; i++) { if (c.data[i] == -1) continue; if (c.data[i] < min[i]) return false; if (c.data[i] > max[i]) return fal...
4
public int calculateLowestCost() { locked = true; // System.out.println(name + " is locked"); int lowestCostStorePrice; int lowestFusionCost; if (storePricesList.size() > 0) { lowestCostStorePrice = getLowestStorePrice(); if (lowestCostStorePrice < lowest...
4
void draw( ChartGraphics g, int[] xValues, double[] stackValues, int lastPlotType ) throws RrdException { g.setColor( color ); g.setStroke( lineWidth != 1 ? new BasicStroke(lineWidth) : DEF_LINE_STROKE ); Graphics2D gd = g.getGraphics(); int len = values.length; double value; int ax = 0, ay = 0, nx = ...
7
private void setBalance(BigInteger balance) throws IllegalArgumentException { if (! this.canHaveAsBalance(balance)) throw new IllegalArgumentException(); this.balance = balance; }
1
public State getStateByValue(String value){ for(State state : states){ if(state.mathByValue(value)) return state; } return null; }
2
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
0
private void processScalar() throws IOException { ScalarEvent ev = (ScalarEvent) event; if (analysis == null) { analysis = analyzeScalar(ev.getValue()); } if (style == null) { style = chooseScalarStyle(); } style = options.calculateScalarStyle(anal...
7
public void stop() { if (this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) { throw new IllegalStateException("Stopwatch is not running. "); } if (this.runningState == STATE_RUNNING) { this.stopTime = System.currentTimeMillis(); } this.runningState = STATE_STOPPED; }
3
public int get(byte[] data, int offset, int len) { if (len == 0) return 0; int dataLen = 0; synchronized (signal) { // see if we have enough data while (getAvailable() <= 0) { if (eof) return (-1); try { signal.wait(1000); } catch ...
8
private void onClear(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onClear if (spawnMenuItem.isEnabled()) { toggler.setState(false); game.reset(); repaint(); } }//GEN-LAST:event_onClear
1
@SuppressWarnings("unchecked") @Override public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); // Verify the validity of the configured socket factory try { if (isSSLEnabled()) { sslImplementation = (SSLImplementation<NioChannel>) SSLImplementation .ge...
9
@SuppressWarnings("deprecation") @EventHandler public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); // Player only moved to look around but didn't walk if (event.getFrom().getBlockX() == event.getTo().getBlockX() && event.getFrom().getBlockY() == event.getTo().getBlockY() ...
7
public void toggleEditingMode() { if(!Main.editingMode) { mySea.renderEditingShip = false; theirSea.renderEditingShip = false; } else { if(myTurnEditing) mySea.renderEditingShip = true; else theirSea.renderEditingShip = true; } if(!Main.editingMode) { mySea.reset(); theirSe...
3
@Override public int hashCode() { int prime = 31; int prime2 = 47; int tId = this.projectId; int tFCount = this.recordCount; int tYCoord = this.firstYCoord; int tFHeight = this.fieldHeight; int tTitle; if (tId == 0) { tId = prime; }...
5
public double[] rawPersonVariances(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.variancesCalculated)this.meansAndVariances(); return this.rawPersonVariances; }
2
public static double rayleighInverseCDF(double beta, double prob) { if (prob < 0.0 || prob > 1.0) throw new IllegalArgumentException("Entered cdf value, " + prob + ", must lie between 0 and 1 inclusive"); double icdf = 0.0D; if (prob == 0.0) { icdf = 0.0; } else { if (prob == 1.0) { icdf = Double.POS...
4
@Override public boolean isSameElementAs(Element<?> element) { ClassElement other = element.adaptTo(ClassElement.class); if (other == null) { return false; } return getClassName().equals(other.getClassName()); }
2
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String login = request.getParameter("login"); String password = request.getParameter("password"); String action = request.getParameter("action") == null ? "...
5
private void comparePDFHolder(PDFHolder pdfHolder1, PDFHolder pdfHolder2) { for (PDFPageHolder pdfPageHolder1 : pdfHolder1.getPageHolders()) { // get the same page from the other pdf document PDFPageHolder pdfPageHolder2 = pdfHolder2.getPageHolder(pdfPageHolder1.getPageNumber()); if (pdfPageHolder2 == n...
5
public int raw_seek(int pos) { if (!seekable) { return (-1); // don't dump machine if we can't seek } if (pos < 0 || pos > offsets[links]) { //goto seek_error; pcm_offset = -1; decode_clear(); return -1; } // clear out ...
8
private final void nullifyVideoFileTempData() { synchronized (this.videoFileTempLock) { if (this.videoFileTempGenerator != null) { this.videoFileTempGenerator.cancel(); this.videoFileTempIsGenerating = false; } if (this.videoFileTemp != null) { this.videoFileTemp.delete(); this.videoFileTemp ...
7
public Behaviour jobFor(Actor actor) { final Repairs b = Repairs.getNextRepairFor(actor, Plan.CASUAL) ; if (b != null) { final float priority = b.priorityFor(actor) ; if (priority * Planet.dayValue(world) >= Plan.ROUTINE) { return b ; } } if ((! structure.intact()) || (! person...
5
public static Stella_Object accessBinaryValue(Stella_Object self, Surrogate relation) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_AC...
6
public CommandNode parseScript( String script ) { File f = null; FileInputStream fis = null; InputStreamReader isr = null; BufferedReader reader = null; String line = null; int flag = 0; Stack< CommandNode > stack = new Stack< CommandNode >(); CommandNode current = null; CommandNode back = null; ...
9
public void setjComboBoxPraticien(JComboBox jComboBoxPraticien) { this.jComboBoxPracticien = jComboBoxPraticien; }
0
public void showLoginStats(CommandSender sender, ListType type, String since, int page, int itemsPerPage) { List<LoginEntry> rawList = new ArrayList<LoginEntry>(); ListPage<LoginEntry> pList = new ListPage<LoginEntry>(); int nPages = 0; switch (type) { case NEW: ...
4
public Tank call(){ Tank tank = null; try { // tank = (Tank)ois.readObject(); String recvBuf = in.readLine(); tank = Oz.getTank(recvBuf); } catch (IOException e) { e.printStackTrace(); } return tank; }
1
public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Experiment start:"); WriteFile wf = new WriteFile(new File("experimentFloydWarshall.txt")); WriteFile wf2 = new WriteFile(new File("experimentFloydWarshall2.txt")); for (int i = 10; i < 800; i++) { int N = i; ...
1
public static boolean analysisNSMXMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException { int idxVbSfix = VerbUtil.endsWithVerbSuffix(o.getStem()); if(idxVbSfix==-1) return false; o.setVsfx(o.getStem().substring(idxVbSfix)); o.setStem(o.getStem().substring(0,idxVbSfix...
9
public int getCantPerson() { return CantPerson; }
0
private JSONArray readArray(boolean stringy) throws JSONException { JSONArray jsonarray = new JSONArray(); jsonarray.put(stringy ? read(this.stringhuff, this.stringhuffext, this.stringkeep) : readValue()); while (true) { if (probe) { lo...
7
@Override @SuppressWarnings("unchecked") public void run() { DBPort connection = null; try { ServerDescription currentServerDescription = getConnectingServerDescription(null); Throwable currentException = null; while (!isClosed) { ...
9
private void method117(Stream stream) { stream.initBitAccess(); int j = stream.readBits(1); if(j == 0) return; int k = stream.readBits(2); if(k == 0) { anIntArray894[anInt893++] = myPlayerIndex; return; } if(k == 1) { int l = stream.readBits(3); myPlayer.moveInDir(false, l); int k1 ...
8
public SensorSingleData filter(SensorSingleData sensorSingleData) { if (sensorSingleData.getAccX() < Constants.NOISE_DELTA_ERROR && sensorSingleData.getAccX() > -Constants.NOISE_DELTA_ERROR) { sensorSingleData.setAccX(0); } if (sensorSingleData.getAccY() < Constants.NOISE_DELTA_ERROR && sensorSingleDa...
6
@Override public void actionPerformed(ActionEvent e) { LogLine selected = ((LogTableModel) mListLog.getModel()) .getItem(mListLog.getSelectedRow()); if (selected != null) { switch (e.getActionCommand()) { case Main.COMMAND_FILTER_THISTAG: setFilteredTag(selected.getTags()); break; case Main.C...
7
private ArrayList<Method> getAnnotatedMethodsRecursively(Class<?> klass) { if (klass == null || klass.equals(Class.class)) { annotatedMethodsByClass.put(klass, null); return null; } if (annotatedMethodsByClass.containsKey(klass)) { return annotatedMethodsByClass.get(klass); } ArrayList<Method> result...
8
private void outputStats(StateMap stateMap) { System.out.println("LCDC: " + lcdc.getSize()); SpriteStateRange minBefore = null; SpriteStateRange maxInFrame = null; SpriteStateRange minAfter = null; for (SpriteStateRange sprite : sprites) { if (sprite.notBeforeOrAt >= 0 && (minBefore == nu...
8
static ClassInterfacesType create(ClassInfo clazz, ClassInfo[] ifaces) { /* Make sure that every {java.lang.Object} equals tObject */ if (ifaces.length == 0 && clazz == null) return tObject; if (ifaces.length == 0) return tClass(clazz); if (ifaces.length == 1 && clazz == null) return tClass(ifaces[0]);...
5
private void playerMove(Player player, Location location, Reason reason) { // Check if he left the zone he currently is in List<Zone> zones = assignedZones.get(player.getName()); if(zones == null) { zones = new ArrayList<Zone>(3); assignedZones.put(player.getName(), zone...
8
public void winner(int winner) { if (winner == myID) { winnerField.setText(myName + " wins!"); } else if (winner == theirID) { winnerField.setText(theirName + " wins!"); } else { winnerField.setText("Draw!"); } }
2
public List<Tuote> haeTuotteet() throws DAOPoikkeus { ArrayList<Tuote> tuotteet = new ArrayList<Tuote>(); // avataan yhteys Connection yhteys = avaaYhteys(); try { // Haetaan tietokannasta tuotteet String sql = "select nimi, numero, hinta, tuoteID from Tuote"; Statement haku = yhteys.creat...
2
protected static void methodChoices() { if(getJRadioButton_FCFS().isSelected()){ choice=1; getJRadioButton_SSTF().setSelected(false); getJRadioButton_SCAN().setSelected(false); getJRadioButton_CSCAN().setSelected(false); getJRadioButton_LOOK().setSelected(false); getJRadioButton_CLOOK().setSelected(...
6
public List<CarrierInfo> findOFDMCarriers (double spectrum[],double sampleRate,int binCount,double multiFactor) { List<CarrierInfo> cList=new ArrayList<CarrierInfo>(); int a; double dPoint=-1.0; for (a=0;a<(spectrum.length-1);a++) { if (spectrum[a]>dPoint) dPoint=spectrum[a]; } dPoint=dPoint*multiFactor;...
6
public String extract(Element element) { return key != null && element.hasAttr(key) ? element.attr(key) : ""; }
2
public void loadFromFile() { if (!fileExists()) return; // Exit if file doesn't exist RmiData o = null; try { FileInputStream fileIn = new FileInputStream(FILE); ObjectInputStream in = new ObjectInputStream(fileIn); o = (RmiData) in.readObject(); in.close(); fileIn.close(); } catch (IOExceptio...
2
private int[] calculateExpectedAndStandardDev(int[] platter) { int[] bowl; int total_score = 0; int max_score = -1; int[] samples = new int[SAMPLE_NUM]; for (int i=0; i < SAMPLE_NUM; i++) { bowl = createBowl(platter); int bowl_score = scoreBowl(bowl); ...
3
public void update(GameContainer container, int delta) throws SlickException { if (container.getInput().isKeyDown(Input.KEY_Q)) { zoom += (delta * 0.01f); if (zoom > 10) { zoom = 10; } } if (container.getInput().isKeyDown(Input.KEY_A)) { zoom -= (delta * 0.01f); if (zoom < 0.1f) { zoom = 0....
8
private void buildMetadataElements(JoeTree tree, String line_ending, StringBuffer buf) { Iterator it = tree.getAttributeKeys(); StringBuffer readOnlyAtts = new StringBuffer(); if (it != null) { while (it.hasNext()) { String key = (String) it.next(); Object value = tree.getAttribute(key); if...
5
private void saveModified(){ if(modified){ if(JOptionPane.showConfirmDialog(null, "Scene modified, save it?", "Confirm", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){ saveScene(); } } }
2
private int gradient_optimize_with_step(double step) throws Exception { double grad[][] = { { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D } }; int i, j, l; int result = 0; double minDist = Double.MAX_VALUE; doub...
9
private void getParameters(String inputFileName){ /* try{ TextIO.readFile(inputFileName); }catch(IllegalArgumentException ee){ }*/ //GetComments assume to know how comments are written in the file. I use the ! (bang) symbol for them //For the moment, I do not store the comments new GetComment...
4
void createToolBar(final Composite parent) { final Display display = parent.getDisplay(); toolBar = new ToolBar(parent, SWT.FLAT); Listener toolBarListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.Selection: { if (event.widget == playItem) { ...
3
public ArrayList<HashMap<String, String>> getAnafores(){ /* * epistrefei tis anafores ths vashs se mia lista opou pairnei to onoma tou column kai thn timi tou */ ArrayList<HashMap<String, String>> anafores=new ArrayList<HashMap<String, String>>(); try { pS = conn.prepareStatement("SELECT * FROM anafor...
3