text
stringlengths
14
410k
label
int32
0
9
public static void deleteQuizCreatedHistory(Quiz quiz) { try { String statement = new String("DELETE FROM " + DBTable + " WHERE qid=?"); PreparedStatement stmt = DBConnection.con.prepareStatement(statement); stmt.setInt(1, quiz.quizID); stmt.executeUpdate(); } catch (SQLException e) { e.printStackTra...
1
private void scan() { if (currentBlock >= 0) { return; } if (maxDistance != 0 && currentDistance > maxDistanceInt) { end = true; return; } if (end) { return; } currentDistance++; secondError += secondStep; ...
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Usuario other = (Usuario) obj; if (login == null) { if (other.login != null) return false; } else if (!login.equals(other.login)) ret...
9
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (str == null) { return; } char[] upper = str.toCharArray(); for (int i = 0; i < upper.length; i++) { upper[i] = Character.toUpperC...
2
public void changeStage(String ref, float x, float y) { //Ensemble.get().setFading(backgroundTrack, 3); if(!map.isTown()) { Save.get().saveTempField(this); } scene = ref; loadStage(ref); player.setX(x); player.setY(y); player.updateBox(); if(map.isTown()) Save.get().clearField(); //addScene...
2
private boolean fileIsAudiofileName(String fileName) { if(fileName.endsWith(".MP3") || fileName.endsWith(".mp3") || fileName.endsWith(".wav") || fileName.endsWith(".WAV")){ System.out.println("Sound found " + fileName); return true; } return false; }
4
public void login(ActionEvent actionEvent) { if (("test".equalsIgnoreCase(getUsername()) && "test".equals(getPassword())) || ("aslan".equalsIgnoreCase(getUsername()) && "aslan".equals(getPassword())) || ("fat".equalsIgnoreCase(getUsername()) && "fat".equals(getPassword())) ) { try { FacesCont...
7
public void start() { String line = null; StringBuffer sb = new StringBuffer(); try { while ((line = br.readLine()) != null) { if (cb != null) cb.onLine(line); sb.append(line); } } catch (IOException e) { } }
3
private DefaultMutableTreeNode findDescendantNode(DefaultMutableTreeNode node, Region region) { // GO THROUGH ALL OF node's CHILDREN for (int i = 0; i < node.getChildCount(); i++) { DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node.getChildAt(i); Region ...
4
public Holdable removeStackedItem(Character itemID, int count) throws InvalidKeyException { Holdable item; Holdable returnItem; if(weapons.containsKey(itemID)) { item = weapons.get(itemID); // If the item is stackable then just reduce the stack count returnItem = item.reduceStack(count); // Only if th...
8
public void subsample(int numberOfPoints, boolean averageY) { int xx[] = new int[numberOfPoints]; int count[] = new int[numberOfPoints]; int yy[] = new int[numberOfPoints]; for( int i = 0; i < x.length; i++ ) { int j = i * numberOfPoints / x.length; xx[j] += x[i]; yy[j] += y[i]; count[j]++; } ...
4
private boolean writePlane(int[] src, byte[] tmp, int width, int height) { try { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { tmp[x] = (byte)src[y * width + x]; } dos.write(tmp); } return true; } catch (Exception e) { e.printStackTrace(); return ...
3
@Override public void init (AbstractQueue<QueueElement> docq, Properties props) { this.docq = docq; this.props = props; outputProperties.setProperty(OutputKeys.INDENT, "yes"); outputProperties.setProperty(OutputKeys.METHOD, "xml"); outputProperties.setProperty(Output...
5
public EatAction(Being eater, Being victim) { this.victim = victim; this.eater = eater; }
0
public static void startupHttpServer() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/HTTP", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEXT$, ((Mo...
9
public boolean canJump(int[] A) { if (A.length == 1) return true; if (A[0] >= (A.length - 1)) return true; int maxlength = A[0]; for (int i = 0; i < A.length - 1; i++) { if (maxlength >= i && (i + A[i]) >= A.length - 1) return true; if (maxlength <= i && A[i] == 0) return false; if ((i + ...
8
public void buildTreePane() { if (tree != null && treePane != null) { rebuildTreeList(); return; } try { getTreeList(); createTree(); treeScroll = new JScrollPane(tree); treePane = new JInternalFrame("Children", false, false, false, false); treePane.setVisible(true); treePane.setSize(225, ...
3
@Override public void delete(Joueur obj) { PreparedStatement pst = null; try { pst = this.connect().prepareStatement("DELETE FROM Joueur where id=?;"); pst.setInt(1, obj.getIdJoueur()); pst.executeUpdate(); System.out.println("sup...
3
public static void main(final String[] args) throws Exception { int i = 0; int flags = ClassReader.SKIP_DEBUG; boolean ok = true; if (args.length < 1 || args.length > 2) { ok = false; } if (ok && "-debug".equals(args[0])) { i = 1; flags = 0; if (args.length != 2) { ok = false; } } if...
9
@SuppressWarnings("unchecked") List<Operation> getFeedbackOperationVerify(String coderId, String guesserId, String feedback, Map<String, Object> lastState) { List<Operation> guessMove = new ArrayList<Operation>(); guessMove.add(new SetTurn(coderId)); guessMove.add(new Set(CURRENTMOVE,VERIFY)); L...
1
public SudokuBoard getBoardSize(String sizeParameter) { if (sizeParameter.equals(Arguments.SIZE_4x4)) {return new SudokuBoard(SudokuBoard.SMALL); } if (sizeParameter.equals(Arguments.SIZE_9x9)) {return new SudokuBoard(SudokuBoard.REGULAR); } if (sizeParameter.equals(Arguments.SIZE_16x16)) {return new S...
4
public List<String> findItinerary(String[][] tickets) { if(tickets==null || tickets.length==0) return new ArrayList<String>(); Map<String,List<String>> reachablePoints=new HashMap<String, List<String>>(); Map<String,Integer> reachableCnt=new HashMap<String, Integer>(); for(int i=0;i<tick...
5
protected void installListeners() { super.installListeners(); if (AbstractLookAndFeel.getTheme().doShowFocusFrame()) { focusListener = new FocusListener() { public void focusGained(FocusEvent e) { if (getComponent() != null) { org...
6
public void Start() { if(m_isRunning) return; Run(); }
1
public void addField(Column c) { // Check if the column pk is already exist if(c.getName().equals(this.getNamePK())){ int i=0; while(!this.setNamePK(this.getNamePK() + String.valueOf(i))){ i++; } } // Check if any name is repeated List<Column> fields = this.getFields(); for(Column col: fields){...
4
public ConsoleData getConsoleData() { ConsoleData cd = (ConsoleData)extra.get(ConsoleData.signature); if (cd == null) { cd = new ConsoleData(); extra.put(ConsoleData.signature, cd); } return cd; }
1
public void ImprimirImp(){ NodosListaProceso aux = PrimerNodo; System.out.println("Nombre de laimpresora\n__\t__________________\n"); while (aux!=null) { System.out.println(aux.nombreProceso+" "); aux = aux.siguiente; } }
1
private static void compilerTest(File file) throws Exception { // Compile to .java try { JavaCompiler.compile(file, new PrintWriter(new BufferedWriter(new FileWriter("temp/Main.java")))); } catch (Exception ex) { System.err.println("Failed to compile to Java: " + file.getName()); ex.printStackTrace(Syste...
8
public int getGreen(){ return _green; }
0
public static void transform(Op opNew) { List<Op> redo = new ArrayList<Op>(); StateVector vecNew = opNew.getStateVec(); for (int i = hBuffer.size() - 1; i >= 0; i--) { Op op = hBuffer.get(i); StateVector vecTmp = op.getStateVec(); if (!isTotalOrdering(vecTmp, ...
6
@Override public void keyPressed( KeyEvent e ) { for( KeyListener listener : listeners( KeyListener.class )){ listener.keyPressed( e ); } }
1
public Image arithmetic(Image im1, Image im2, int width, int height, int op, boolean r, boolean g, boolean b, boolean clip) { /* im1 = source image 1. im2 = source image 2. width = width of images (they are the same size) height = height of i...
5
public String pad(Object obj, int len){ String str = obj.toString(); // if(len < str.length()){ StringBuilder sb = new StringBuilder(str); if(len > sb.length()){ while(len > sb.length()){ sb.append(asciiChar); } str = sb.toString(); // System.out.println(str); } else{ str = s...
2
public E delMin() { final E returnValue = (E) heap.get(0); heapSize--; heap.set(0, heap.get(heapSize)); heap.delete(heapSize); heapify(0); return returnValue; }
0
private String cleanFact(String catfact) { StringBuilder sb = new StringBuilder(); boolean escaping = false; boolean unicodeSeq = false; char[] unicodeDigits = new char[4]; int unicodeSeqCount = 0; for (int i = 0; i < catfact.length(); i++) { char c = catfact.charAt(i); if (!escaping) { if (c == '...
8
void outerHtmlHead(StringBuilder accum, int depth, Document.OutputSettings out) { if (accum.length() > 0 && out.prettyPrint() && (tag.formatAsBlock() || (parent() != null && parent().tag().formatAsBlock()) || out.outline()) ) //换行并调整缩进 indent(accum, depth, out); a...
8
private void setResponse() { try{ ButtonModel bm = AnswerButtons.getSelection(); String selectedind = bm.getActionCommand(); selectedAnswers.put(quiz.questionList.get(qIndex).dbId, Integer.parseInt(selectedind)); } catch (NullPointerException npe) { ...
1
public void run() throws CantRunRaidException { if (this.raidSettings.getDestination() == null) throw new CantRunRaidException(CantRunRaidBecause.DESTINATION_NULL); if (this.raidSettings.getTeam() == null || this.raidSettings.getTeam().isEmpty()) throw new CantRunRaidException(CantRunRaidBecause.NO_SURVIVORS...
4
private Hotelier createHotelier(HttpServletRequest request) throws Exception{ String email = request.getParameter("email"), motDePasse = request.getParameter("motdepasse"), motDePasse2 = request.getParameter("motdepasse2"), siteweb = request.getParameter("siteweb...
4
@Override public void actionPerformed(ActionEvent e) { String kp = e.getActionCommand(); switch (kp) { case "Host": System.out.println("Host Game"); InetAddress address = null; try { address = InetAddress.getLocalHost(); } catch (UnknownHostException e1) { e1.printStackTrace(); } I...
3
public static Direction selectDirection() { return Direction.values()[randomDirection()]; }
0
private static void registerSerializableClasses(ArrayList<Class<? extends ConfigurationSerializable>> serializable) { for(Class<? extends ConfigurationSerializable> clazz : serializable) { ConfigurationSerialization.registerClass(clazz); } }
3
public double[][] getGridD2ydx1dx2(){ double[][] ret = new double[this.nPoints][this.mPoints]; for(int i=0; i<this.nPoints; i++){ for(int j=0; j<this.mPoints; j++){ ret[this.x1indices[i]][this.x2indices[j]] = this.d2ydx1dx2[i][j]; } ...
2
public static void main(String[] args) { }
0
private String getReport(){ Factory f = new Factory(); StringBuilder sb = new StringBuilder(); try{ ArrayList<User> users = f.getUsers(); for(User u : users){ appendLine(sb, "User: " + u.toString()); if(u.isClient()){ ArrayList<WorkoutPlan> uPlans = f.getWorkoutPlansForUser(u); appendLi...
9
@Override public void execute() { final NPC bearSeller = NPCs.getNearest(Constants.BEAR_FUR_SELLER); if (bearSeller != null) { if (!bearSeller.isOnScreen()) { MCamera.turnTo(bearSeller, 50); } else { bearSeller.interact("Talk-to"); } } }
2
protected void showMainScreen(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, UnsupportedEncodingException { // set the encoding, otherwise database is encoded wrongly request.setCharacterEncoding("UTF-8"); HttpSession session = request.getSession(); AdminU...
8
public void projectileDie() { for (int i = 0; i < projectiles.size(); i++) { if (projectiles.get(i).x < 0 || projectiles.get(i).y < 0 || projectiles.get(i).x > 1260 || projectiles.get(i).y > 920) { projectiles.remove(i); } } }
5
private static int[] merge(int[] left, int[] right) { int[] merged = new int[left.length+right.length]; int leftHead =0; int rightHead = 0; for(int i=0; i<left.length+right.length; i++) { if(rightHead < right.length && leftHead<left.length && left[leftHead]<right[rightHead]) { ...
9
final private boolean jj_3R_19() { Token xsp; xsp = jj_scanpos; if (jj_3R_33()) { jj_scanpos = xsp; if (jj_3R_34()) { jj_scanpos = xsp; if (jj_3R_35()) { jj_scanpos = xsp; if (jj_3R_36()) { jj_scanpos = xsp; if (jj_3R_37()) { jj_scanpos = xsp; if (jj_3R_38()) { jj...
9
public void onEnable(){ blacklistLocation=new File(getDataFolder().getAbsolutePath()+"/words.txt"); whitelistLocation=new File(getDataFolder().getAbsolutePath()+"/whitelist.txt"); userdataLocation=new File(getDataFolder().getAbsolutePath()+"/userData.yml"); initConfig(); initUserData(); copyWordList(); co...
9
private Automaton readAutomaton(File file) { try { BufferedReader reader = new BufferedReader(new FileReader(file)); // Read the automaton type. String line = reader.readLine().trim(); if (line.equals(FINITE_AUTOMATON_CODE)) return readFA(reader); if (line.equals(PUSHDOWN_AUTOMATON_CODE)) retur...
6
private Assertion assertAreEqual(Stack<Command> expected, Stack<Command> actual) { boolean passed = false; String info = "Assertion failed for unknown reasons"; if (expected != null && actual != null) { if (expected.size() != actual.size()) { passed = false; info = "The act...
6
static String HardwareLiteral (String toParse, String label, byte wordLength) { byte decimalValue = 0; byte labelLength; byte significance; String binary32; StringBuffer expression; labelLength = (byte)label.length(); if (toParse.startsWith(label)) { try { decimalValue = Byte.parseByte(...
6
public Location getLocationAtDirection(Direction direction) { switch (direction) { case UP: return new Location(column, row - 1); case DOWN: return new Location(column, row + 1); case LEFT: return new Location(column - 1, row); ...
4
static private int jjMoveStringLiteralDfa7_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(5, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(6, active0); return 7; } switch(curChar) { cas...
5
private void removeOld() throws FileStorageException { final FileSystemService fileSystemService = new FileSystemService(); final Properties expirationDates = systemInformation.getExpirationDates(); final Set<String> keys = expirationDates.stringPropertyNames(); for (String key : keys) {...
6
private String createDelete() { String param = ""; for(Column col : keyColumns){ param += col.getColName() + " = #{" + col.getFldName() + "} AND "; } param = param.substring( 0, param.length() - 5 ); StringBuilder sb = new StringBuilder(); sb.append( "\...
1
public static void handleEvent(int eventId) { // Do nothing because same screen is being selected if(eventId == 1) { System.out.println("Exit Ship Shop Thrusters to Main Ship Shop Menu selected"); Main.ShipShopThrustersMenu.setVisible(false); Main.ShipShopThrustersMenu.setEnabled(false); Main.ShipSho...
8
public String getColors(){ String output = ""; if(white){ output += "W"; } if(blue){ output += "U"; } if(black){ output += "B"; } if(red){ output += "R"; } if(green){ output += "G"; } return output; }
5
private void checkBrowserLoading() { // браузер терминала if (( (new File("/usr/local/bin/chrome_ps.sh").exists()) && this.getRuntime("/usr/local/bin/chrome_ps.sh").equals("0"))) { this.doRuntime("sh "+ terminalDir+"/browser.sh"); this.ok = false; } // б...
6
public void paintLists() { for (int i = 0; i < spaceJunk.size(); i++) { SpaceJunk a = spaceJunk.get(i); if (distanceToShip((int) a.xPosition, (int) a.yPosition) < Game.RESOLUTION_WIDTH) { a.paint(offg, cameraOffsetX, cameraOffsetY); } ...
7
public int getStatus() { return status; }
0
protected boolean step() { controller.step(); return true; }
0
Byte getToken( char tokenChar ) { switch ( tokenChar ) { case 'l': lineCount++; endLf = true; return TKN_ALF; case 'L': return TKN_AL; case 'r': lineCount++; endLf = true; return TKN_ARF; case 'R': return TKN_AR; case 'c': lineCount++; endLf = true; return...
6
public void setTexture(String texturePath){ this.texturePath = texturePath; try { texture = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream(texturePath)); } catch (IOException e) { e.printStackTrace(); } }
1
@Override public void doIt() { // hole Log-Dateien File path = new File(this.path + Output.DIR_LOG); final Pattern pattern = Pattern.compile(".+" + Pattern.quote(LogFile.FILE_EXTENSION) + "$"); File[] list = path.listFiles(new FileFilter() { @Override public boolean accept(File filename) { re...
2
public static Reponse reponse(int id, Utilisateur utilisateur) { Reponse rep = ReponseRepo.get().un(id); if (rep != null && !rep.getSujet().peutConsulter(utilisateur)) throw new InterditException("Vous n'avez pas les droits requis pour consulter cette réponse"); return rep; }
2
public void generateChoiceKrit(int fahrplanID, String fahrplanName) { boolean szVorhanden = false; if (this.szenarienVerbergen.getOpacity() != 1) { FadeTransition fb = new FadeTransition(Duration.millis(1500), this.szenarienVerbergen); fb.setFromValue(0.0); fb.setToValue(1.0); fb.setAutoReverse(t...
5
public String getPassword() { return password; }
0
public static LinkedList<String> computeIntersection(LinkedList<String> A, LinkedList<String> B) { LinkedList<String> intersection = new LinkedList<String>(); for( int i = 0; i <A.size(); i++) { String item = A.get(i); if(B.contains(item)) { int...
2
public void recalculate(String IPkey, String IPComing, ArrayList<String> comingConnections){ ArrayList<String[]> tempArray = (ArrayList<String[]>)routingTable.get(IPkey); String[] tempStringArray = null; for(int i=0; i<tempArray.size(); i++){ tempStringArray = tempArray.get(i); ...
4
private void saveLinks(ArrayList<Link> linkMap) throws ForceErrorException { int iCounter = 0; for (Link link : linkMap) { if (iCounter > Bot.linksFromUrl) { break; } if (Bot.datamodel.saveLink(link.getUrl())) { iCounter++; } } }
3
public static void main(String[] args) throws InterruptedException { List<FutureTask<Integer>> list = new ArrayList<FutureTask<Integer>>( Arrays.asList(new FutureTask<Integer>(new WordLengthCallable()), new FutureTask<Integer>(new WordLengthCallable()), new Future...
3
public static void detectPressedKey(){ int[] keys = {Keyboard.KEY_1, Keyboard.KEY_2, Keyboard.KEY_3,Keyboard.KEY_4,Keyboard.KEY_5,Keyboard.KEY_6,Keyboard.KEY_7,Keyboard.KEY_8,Keyboard.KEY_9}; boolean found = false; for(int i = 0; i < keys.length; i++){ if(Keyboard.isKeyDown(keys[i])){ selectedSlo...
3
private void grow(int extra, int[] values, int[] max, boolean fill) { int count = 1 + (values.length - 1) / 2; int[] tv = new int[count]; int[] tm = new int[count]; for (int i = 0; i < count; i++) { tv[i] = values[i * 2]; tm[i] = max[i * 2]; } extra = distribute(extra, tv, tm); for (int i = 0; i < c...
8
@Override public void removeInheritence(String inher) { do { inheritence.remove(inher); } while (inheritence.contains(inher)); }
1
@Override public void init(boolean isServer) { if(!isServer) { PlayerEntity.loadResources(); PillarEntity.loadResources(); } tiles = new Tile[8][6]; for(int x = 0; x < tiles.length; x++) for(int y = 0; y < tiles[x].length; y++) tiles[x][y] = new Tile(this, x, y); entities = new ArrayList<Entit...
3
public static <T extends IComponent> void getAllChildrenTComponents(Entity entity, Class<T> clazz, List<T> componentList) { Children childrenComponent = entity.getComponent(Children.class); // Our base test, stop recursion if we no longer have children if (childrenComponent == null) { return; } for (Enti...
3
private int puolisonPaikallaToistaSukupuolta(boolean mies) { int pisteita = 0; try { if (paikka.getPuolisonPaikka() != null) { if (paikka.getPuolisonPaikka().getSitsaaja().isMies()) { if (mies == false) { pisteita += 500; ...
5
public static double getAtomicWeight(Atom currentAtom) { double atomWeight = 0; String atomType = Character.toString(currentAtom.getAtomType() .charAt(0)); String[] atomTypeArray = { "H", "N", "C", "O", "S" }; double[] atomWeightArray = { 1.00794, 14.0067, 12.0107, 15.9994, 32.065 }; for (int i = 0; i <...
2
public Node getViewWithoutRootContainer() { final ObservableList<Node> children = getView().getChildrenUnmodifiable(); if (children.isEmpty()) { return null; } return children.listIterator().next(); }
1
private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
7
private void printChessBoard(int rows,int columns, Cell[] boardCells){ String errorMsg; for(int currentRow = 0; currentRow < rows; currentRow++){ for(int currentColumn = 0; currentColumn < columns; currentColumn++){ int position = currentRow...
5
private void ParseElements(Node parentElement) { Node child = parentElement.getFirstChild(); while (child != null) { String nodeName = child.getNodeName(); if (nodeName == "condition") { conditions.add(new Condition(child)); } else if (nodeName == "print") { message = child.getFirstChild().g...
6
public boolean canHaveAsBalance(BigInteger balance) { return (balance != null) && (balance.compareTo(this.getCreditLimit()) >= 0); }
1
public T borrow() { initPool(); T object = queue.poll(); if (object == null) { object = create(); } return object; }
1
@Override public void fatalError(SAXParseException e) { System.out.println("SAXParserException Fatal Error: " + e.getMessage()); this.errorOccurred = true; }
0
public void kasitteleLauseke() throws IllegalStateException, IllegalArgumentException { while (paikkaSisaltyySyotteeseen()) { kasitteleSeuraava(); } lauseke.suljeLohko(); }
1
public ArrayList<ArrayList<Integer>> combine(int n, int k) { ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>(); int[] tmp = new int[k]; for (int i =0; i< k ;i++) tmp[i] = i + 1; while (true) { ArrayList<Integer> ele = new ArrayList<Integer>(); for (int i : tmp)...
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS-...
8
public synchronized void recordAndAddSequenceNumberToOutgoingPacket(Packet packet) { //ignore null packets if(packet == null) return; //add sequence number to packet lastSentPacketSequenceNumber = Packet.nextSequenceNumber(lastSentPacketSequenceNumber); packet.setSequenceNumber(lastSentPacketSequenceNumbe...
2
private static int findMax(boolean useX, ArrayList<Point> convexHull) { int max = 0; int index = -1; for (int i = 0; i < convexHull.size(); i++) { int val = useX ? convexHull.get(i).x : convexHull.get(i).y; if (max < val) { max = val; index = i; } } return index; }
3
public Items getItem() { return this.item; }
0
public void combat(Personnage heros, Personnage ennemi) { Random rand = new Random(); int randomDefensePercentage = rand.nextInt(50)+1; int defense = heros.getDef() - (heros.getDef()*randomDefensePercentage)/100; int degats = ennemi.getAtk(); int dommage = degats-defense; if(dommage>0) { heros.setV...
2
public static void printByteArray(byte[] bytes) { for (byte b : bytes) { System.out.print(Integer.toBinaryString(b & 255 | 256).substring(1) + " "); } System.out.println(); }
1
public Transition getTransitionForProduction(Production production) { ProductionChecker pc = new ProductionChecker(); String lhs = production.getLHS(); State from = getStateForVariable(lhs); /** if of the form A->xB */ if (ProductionChecker.isRightLinearProductionWithVariable(production)) { String[] varia...
2
public void checkfold() { for (Widget wdg = child; wdg != null; wdg = wdg.next) { if ((wdg == cbtn) || (wdg == fbtn)) continue; if (folded) { if (wdg.visible) { wdg.hide(); wfolded.add(wdg); } ...
9
public void run() { while(listening) { try { // listen on request as server // byte[] bufReceived = new byte[BUFFER_SIZE]; DatagramPacket serverPacket = new DatagramPacket(bufReceived, bufReceived.length); serverSocket.receive(serverPac...
7
@Override public void paintShape(mxGraphics2DCanvas canvas, String text, mxCellState state, Map<String, Object> style) { mxLightweightLabel textRenderer = mxLightweightLabel .getSharedInstance(); CellRendererPane rendererPane = canvas.getRendererPane(); Rectangle rect = state.getLabelBounds().getRectangl...
6