text
stringlengths
14
410k
label
int32
0
9
@Override public void preform(int source) { if(source == 0) { openNewGui(References.GUI_LOBBY); }else if(source == 1) { Object ip = JOptionPane.showInputDialog("Set IP address to join."); if(ip != null && ip instanceof String) { Rocket.getRocket().properties.IP = (String) ip; } }else if(source ==...
5
private Region createRegion(Attributes atts) { String abbyyType = null; int i; if ((i = atts.getIndex(ATTR_blockType)) >= 0) { abbyyType = atts.getValue(i); } RegionType primaType = RegionType.UnknownRegion; if ("Text".equals(abbyyType)) primaType = RegionType.TextRegion; else if ("Table".equals(...
7
public int readB(int bits) { int ret; int m = 32 - bits; bits += endbit; if (endbyte + 4 >= storage) { /* not the main path */ ret = -1; if (endbyte * 8 + bits > storage * 8) { ptr += bits / 8; endbyte += bits / 8; ...
7
public static void main(String[] args) { Random rand = new Random(47); for(int i = 0; i < 100; i++) { int c = 'a' + rand.nextInt(26); System.out.print((char)c + ", " + c + ": "); switch(c) { case 'a': case 'e': case 'i': case 'o': case 'u': System.out.println("vowel"); break; c...
8
public void printUrkunden() { if (table.getSelectedRowCount() == 0) return; List<EinzelWettkampf> lewk = new Vector<EinzelWettkampf>(); List<MannschaftsWettkampf> lmwk = new Vector<MannschaftsWettkampf>(); for (int i : table.getSelectedRows()) { Wettkampf w = (Wettkampf) table.getValueAt(i, -1); if (w ...
9
public static String toString(JSONObject o) throws JSONException { boolean b = false; Iterator keys = o.keys(); String s; StringBuffer sb = new StringBuffer(); while (keys.hasNext()) { s = keys.next().toString(); if (!o.isNull(s)) { ...
3
public void mouseDragged(MouseEvent event) { if (myTrapState == null) return; myTrapState.setPoint(event.getPoint()); getView().repaint(); }
1
protected void save() { ImageSettings imageSettings = null; IndexerState indexerState = null; WindowSettings windowSettings = null; for (SaveSubscriber s : subscribers) { if (imageSettings == null) { imageSettings = s.saveImageSettings(); ...
5
public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st.nextToken()); int mod ...
9
public final void startElement(java.lang.String ns, java.lang.String name, java.lang.String qname, Attributes attrs) throws SAXException { dispatch(true); context.push(new Object[]{qname, new org.xml.sax.helpers.AttributesImpl(attrs)}); if ("edge".equals(qname)) { handler.start_edge...
8
@Override public void ParseIn(Connection Main, Server Environment) { Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom); if (Room == null) { return; } if((Room.Flags & Server.rmAllowPets) != Server.rmAllowPets && !Room.CheckRi...
7
*@param nick * @return resultado **/ public beansMiembro buscarDentroDownline(beansMiembro miembro, String nick){ for(beansMiembro busquedaInterior : miembro.getListaInterna() ){ if(busquedaInterior.getNick().equals(nick)){ return busquedaInterior; }else{ resultado = buscarDentroDownline(busquedaInte...
3
@Test public void toolsTest2() { userInput.add("hello"); userInput.add("daniel"); userInput.add("can you help me with cooking"); userInput.add("tell me the tools"); userInput.add("hamburger"); userInput.add("tools"); runMainActivityWithTestInput(userInput); assertTrue(nlgResults.get(2).contains("what")...
6
public boolean supprimerRessource(String typeRessource, int nombre) { if (nombre > 0) { if(typeRessource.equals(Constantes.RESS_NOURRITURE)) { if (nbNourriture - nombre < 0) { return false; } nbNourriture -= nombre; return true; } if(typeRessource.equals(Constantes.RESS_PIERRE)) { if...
7
public static PathwayElement createState( double relX, double relY, double width, double height, Color color, int lineStyle, int lnThickness, Color fillColor, IShape shapeType, int zOrder, DataSource database, String ID, List<String> bioPaxRefs, String graphId, String graphRef, String textLabel, String s...
3
public byte[] delete(InputStream is, int fStart, int fEnd) throws Exception{ int cont = 0; Manager reader = new Manager(is); if( fStart > fEnd ){ throw new Exception("fStart can't be greater than fEnd!!"); } FrameData fd ; fina...
5
private String getRemoteRecipe(long ID, String Title, String Brewer, int iteration) { try { String baseURL = Options.getInstance().getProperty("cloudURL"); if (!baseURL.startsWith("http://")) { baseURL = "http://" + baseURL; } URL url = new URL(baseURL+"/recipes/"+ID); ...
4
@SuppressWarnings("unchecked") private Map<MarketQuotesResponseField, String> getMarketQuotePaths(Document doc) throws UtilityException { Map<MarketQuotesResponseField, String> toReturn = new HashMap<MarketQuotesResponseField, String>(); for (MarketQuotesResponseField f : MarketQuotesResponseField.values()) { ...
8
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
8
@Override public UserDetails getValue(HttpContext context) { UserDetails userDetails = null; Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { userDetails = (UserDetails)SecurityContextHolder.get...
4
public DataOut getData(int index){ if(listDataOut != null) return listDataOut.get(index); else return null; }
1
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public SpriteSheet(String path, int tileWidth, int tileHeight, int gid) { this.firstGID = gid; Image img = null; try { img = new Image(path); } catch (SlickException e) { e.printStackTrace(); } int imgWidth = img.getWidth(); int imgHeight = img.getHeight(); numTilesX = (int) Math.floor(img...
3
public static int position(Byte[] jeu, byte player){ int val=0; byte opponent=0; Byte empty = 0; if (player == 1) opponent = 2; else if (player == 2) opponent = 1; else System.out.println("erreur IA"); /* POSITION IA */ int [] tabIA = {50, 15, 50, 1000, 40, ...
6
public static ArrayList<bConsultaCompo> getPesquisaCompoAt(String prod, String data_in) throws SQLException, ClassNotFoundException { ArrayList<bConsultaCompo> sts = new ArrayList<bConsultaCompo>(); Connection conPol = conMgr.getConnection("PD"); ResultSet rs; if (conPol == null) { ...
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final WorkPlace other = (WorkPlace) obj; if (!Objects.equals(this.workPlaceId, other.workPlaceId)) { ...
3
public CarBuilder setTintedGlass(boolean tintedGlass) { delegate.setTintedGlass(tintedGlass); return this; }
0
public void removeRange(int fromIndex, int toIndex) { int numMoved = size - toIndex; System.arraycopy(attributeLists, toIndex, attributeLists, fromIndex, numMoved); int newSize = size - (toIndex - fromIndex); while (size != newSize) { attributeLists[--size] = null; } }
1
public static GRESCAnswer fromText(String text) { GRESCAnswer gAnswer = new GRESCAnswer(); if (text != null && text.length() > GRE_ANSWER_INDICATOR.length()) { int answerIndex = text.indexOf(GRE_ANSWER_INDICATOR); if (answerIndex != -1) { String[] answers = text.substring(answerIndex + GRE_ANSWER_IN...
6
public void gen_where(final Map<String, Object> context, final QLSelect select, final PrintWriter out) { final Class<?> clazz = (Class<?>) context.get("class"); if (clazz == null) { throw new IllegalArgumentException("context not contains 'class'"); } final QLExpr where = s...
6
public static final void write(final Define define, final File directory) { if (define == null || directory == null) { return; } OutputStream outputStream = null; try { String fileName = define.getProxyClassName().replace('/', File.separatorChar).concat(".class");...
7
public boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock) { for (int i = 0; i < 2; i++) { if (subBlocks[i] == oldBlock) { subBlocks[i] = newBlock; return true; } } return false; }
2
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof ConsultantSales)) { return false; } ConsultantSales other = (ConsultantSales) object; if ((this.salesId == null...
5
private Point getPoint(int x, int y){ if (x < 0|| y < 0 || x >= FIELD_SIZE || y >= FIELD_SIZE){ return null; } return points[x][y]; }
4
public ArrayList<Integer> getNeighbors(int position) { ArrayList<Integer> neighborIndexes = new ArrayList<Integer>(); int x = position % columns; int y = position / columns; ArrayList<Point> neighbors = new ArrayList<Point>(); neighbors.add(new Point(x - 1, y - 1)); ...
5
@Test public void testCardTypes() { // make new sets (since they wont store repeats) Set<Card> personCards = new HashSet<Card>(); Set<Card> weaponCards = new HashSet<Card>(); Set<Card> roomCards = new HashSet<Card>(); // store all cards in correct set for(Card c : game.getCards()) { if (c.getType() == C...
4
@Override public void mousePressed(MouseEvent e) { if (e.getButton() != MouseEvent.BUTTON1) { System.out.println(e.getButton()); return; } ptPress = e.getPoint(); final Panel screen = (Panel) e.getSource(); try { win.getModel().add(getNewEl...
2
public static void generate(int[] result, int N, ArrayList<String[]> a) { if (result.length == N) { a.add(print(result)); } else { for (int i=0; i<result.length; i++) { result[N] = i; if (isConsistent(result, N)) generate(result, N+1,...
3
public void setRegEx(String regex) {this.regex = regex;}
0
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Position other = (Position) obj; if (this.x != other.x) { return false; } ret...
3
public int getPosition() { int position = lastPosition; AudioDevice out = audio; if (out!=null) { position = out.getPosition(); } return position; }
1
synchronized protected void negotiate() throws IOException { if(this.input != null) try { this.input.close(); } catch(IOException f) { } if(this.output != null) try { this.output.close(); } catch(IOException f) { } if(this.socket != null) try { this.socket.close(); } catch(IOException f) { }...
8
public static void convert_to_binary(Integer n) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 32; i++) { sb.append(n >> i & 1); } sb.reverse(); System.out.println(sb.substring(sb.indexOf("1"))); }
1
public void triggerSubscribe(final boolean isSource, final TransactionDataDescription dataDescription, final Collection<InnerDataSubscription> subscriptions) throws OneSubscriptionPerSendData { if (_attributeGroup == null || _receiveAspect == null || _sendAspect == null) { throw new IllegalStateException("Das verw...
8
public static void setField(Field field, Object target, Object value) { try { field.set(target, value); } catch (IllegalAccessException ex) { handleReflectionException(ex); throw new IllegalStateException( "Unexpected reflection exception - " + ex.getClass().getName() + ": " + ex.getMessage());...
1
public void changeDelimiter(char newDelim) throws BadDelimiterException { if (newDelim == delimiter) return; // no need to do anything. if (!charIsSafe(newDelim)){ throw new BadDelimiterException(newDelim + " is not a safe delimiter."); } updateCharacterClasses(delimiter, newDelim); // keep a record of the...
2
public static void main (String str[]){ //Ready Set Go! initialize(); //Trololololol int kappaX = -100; final int kappaY = EZ.getWindowHeight()-550; EZImage kappa = EZ.addImage("resources/kappa.png", kappaX , kappaY); //The object for the ball and paddle PongBall ball = new PongBall(Color.WHITE, Pon...
7
public void draw(Graphics g) { if (nextGlied != null) { nextGlied.draw(g); } Rectangle masse = getAbsoluteRect(); g.setColor(color); g.fillOval((int)masse.getX(), (int)masse.getY(), (int)masse.getWidth(), (int)masse.getHeight()); }
1
public void generater(int x, int w, byte type) { /* for (int i = 0; i <= 30; i++) { ClearCircle(x+random.nextInt(w),y+random.nextInt(h),random.nextInt(w/2)); } generateSandAndWater();*/ float vs = -random.nextInt(12...
6
@Test public void test() { try { MarketQuote quote = new MarketQuote(new Symbol("SIRI")); for(MarketQuotesResponseField f: MarketQuotesResponseField.values()) { if(quote.hasField(f)) { System.out.println(f.name()+"="+quote.getField(f)); } } assertTrue("Expected Field not in respons...
3
protected String compressJavaScript(String source) { //set default javascript compressor if(javaScriptCompressor == null) { YuiJavaScriptCompressor yuiJsCompressor = new YuiJavaScriptCompressor(); yuiJsCompressor.setNoMunge(yuiJsNoMunge); yuiJsCompressor.setPreserveAllSemiColons(yuiJsPreserveAllSemiColo...
4
public static boolean isPrimitive(Object obj) { Class[] primitives = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class }; for (Class<?> c : primitives) if (c.isAssignableFrom(obj.getC...
3
@Override public Object getValueAt(int rowIndex, int columnIndex) { LeverandoerDTO leverandoer = leverandoerList.get(rowIndex); Object value = null; switch (columnIndex) { case 0: value = leverandoer.getLeverandoerId(); break; case 1: value = leverandoer.getFirmaNavn(); break; case 2: value ...
5
private double f(double b) { double PrB=1, p=probLessThan(b); for (int i = 0; i < futureBowls; i++) { PrB*=p; } double PrA=1-PrB; double ExA=exptGreaterThan(b); double ExB=exptLessThan(b); double Ex2=PrA*ExA+PrB*ExB; return Ex2; }
1
public static Data getDataFromJson(String json){ ObjectMapper mapper = new ObjectMapper(); Data data = null ; try { data = mapper.readValue(json, Data.class) ; } catch (JsonGenerationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JsonMappingException e) { // TOD...
3
static final void method3060(byte b, boolean bool, boolean bool_1_, Node_Sub2 node_sub2) { anInt3073++; int i = node_sub2.interfaceId; int i_2_ = (int) node_sub2.aLong2797; node_sub2.method2160((byte) 55); if (bool_1_) { Node_Sub15_Sub6.method2571(i, false); } Class150_Sub3_Sub1.method1665((byte) -102,...
9
public View render(View convertView, Context context, FeedView webFeedView) { this.context = context; if (convertView == null) { convertView = getInflater(context).inflate(layout, null); holder = new ViewHolder(); holder.wrapper = (FrameLayout) convertView.findViewB...
7
public void move(int dx,int dy){ if(x+dx>=Level.SIZE || y+dy>=Level.SIZE || x+dx<=0 || y+dy<=0 || (l.world[x+dx][y+dy] != TileType.AIR && l.world[x+dx][y+dy] != TileType.FIRE && l.world[x+dx][y+dy] != TileType.TORCH)){ }else{ x+=dx; y+=dy; } }
7
private boolean rosterExists (Roster r) { for (Roster mr: getRosters()) { if ((r.getFamilyName().equals(mr.getFamilyName())) && (r.getGivenName().equals(mr.getGivenName()))) return true; } return false; }
3
public static void maxProductII(int[] input){ int max[] = new int[input.length]; int maxStart[] = new int[input.length]; int minStart[] = new int[input.length]; int min[] = new int[input.length]; max[0] = min[0] = input[0]; maxStart[0] = minStart[0] = 0; int ...
6
public void adjustBeginLineColumn(int newLine, int newCol) { int start = tokenBegin; int len; if (bufpos >= tokenBegin) { len = bufpos - tokenBegin + inBuf + 1; } else { len = bufsize - tokenBegin + bufpos + 1 + inBuf; } int i = 0, j = 0, k = 0; int nextColDiff = ...
6
public void beginUpgrade(Upgrade upgrade, boolean checkExists) { int atIndex = -1 ; for (int i = 0 ; i < upgrades.length ; i++) { ///I.sayAbout(venue, "Upgrade is: "+upgrades[i]) ; if (checkExists && upgrades[i] == upgrade) return ; if (upgrades[i] == null) { atIndex = i ; break ; } } ...
6
public void calculateBasicScore(ROB_entry entry) { // the baseline score, based only on instruction type (+mispredicted branch) if (entry.theUop.type == UopType.insn_CBRANCH){ // score for conditional branch entry.score += BRANCH_SCORE; if(heuristic.type != HeuristicType.heuristic_BASE_S...
7
public void actionPerformed(ActionEvent evt) { String Action = evt.getActionCommand(); String last_line = null; String tmp = ""; if (Action.equals("answer")) { if(state == -1) { return; //Unexpected notification } last_line = serial.readline(); Logtext = "<-- ["+last_line+"]"; caller.mylog(L...
8
public void refresh(){ if(!canrun) return; CGroupNode newDelete = dispCache; CGroupNode newDisp = Renderer.paintDialog(currentSeq, parent.gui.getBounds()); CGroupNode fadeGroup = new CGroupNode(fadeGroupName); for(ACItem item : newDisp.getChildrenCopy()){ if(!(item.getName().endsWith(bgsuffix) || item.g...
9
public SettingsDlg(Joculus j) { super(); app_instance = j; // read the settings from the preferences, or use defaults. dialog_settings = new Settings(); dialog_settings.load(); // set up the dialog. this.setLayout(new BorderLayout()); default_border = new EmptyBorder...
1
private void destroy(int x, int y) { int mouseX = x; int mouseY = y; int rowCount = genX / blockSize; int startY = (Math.round(mapY / blockSize))* rowCount + 1; int endY = (Math.round((mapY + screenHeight) / blockSize) - 1)* rowCount; if(startY < 0) startY = 0; if(endY > map.length) endY ...
9
public void movePlayer (int playerID, Location l) { Player p = playerIDs.get(playerID); if (board.canTraverse(l) && p != null && this.isFree(l)) { if (p.move(l)) { for (int id: playerIDs.keySet()) { server.queuePlayerUpdate(new MoveEvent(playerID, l), id); } } } }
5
public void update(double timestep) { if (this.state.equals("flipping")){ if(endPoint.getCenter().x()==flippedSpot.getCenter().x() && endPoint.getCenter().y()==flippedSpot.getCenter().y()){ //we are already in the flipped position state = "flipped"; } else { double deltaAngle = timestep*angularVelocity;...
9
public void windowDeiconified(WindowEvent e) { // TODO Auto-generated method stub }
0
public static void spielen() { int i; int versuche = Ratespiel.versuche; boolean erraten = false; char[] eingabe = new char[6]; char[] loesungswort = Ratespiel.woerter[Ratespiel.zufall(0, Ratespiel.woerter.length)].toCharArray(); while (!erraten && versuche>0) { System.out.println((Ratespiel.versuche-ver...
7
private void store_granule_info(){ // // for(int ch = 0; ch < max_gr; ch++){ // for(int gr1 = 0; gr1 < channels; gr1++){ // format.store_in_array(gr[gr1].ch[ch].part2_3_length, 12); // format.store_in_array(gr[gr1].ch[ch].big_values, 9); // format.s...
3
public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String linea; while(!(linea=bf.readLine()).equals("0 0")){ String[] numeros = linea.split(" "); tam = (numeros[0].length() > numeros[1].length()) ? numeros[0].length(): numeros...
8
public void schemeEditorDelContact() { if(ce_circuit2.getSelectionIndex() == -1 || ce_drain.getSelectionIndex() == -1) return; String circuitName = ce_circuit2.getText(); String contactName = ce_drain.getText(); scheme.getCircuits().get(circuitName).getContacts().remove(new Cont...
2
public static void decompressFile(String input, String output){ byte[] data = new byte[0];//All the bytes from the input //Read the input try{ data = Files.readAllBytes(Paths.get(input)); }catch(Exception e){ e.printStackTrace(); } ArrayList<Character> unique = new ArrayList<Character>();//Local uniq...
8
public void searchByName (LYNXsys system, String query, int page) { // search for students by by name for (int i = 0; i < system.getUsers().size(); i ++) { // loop through arraylist of students if ((system.getUsers().get(i).getFirstName().equalsIgnoreCase(query)) || (system.getUsers().get(i).getLastName().equalsIg...
8
@Override public synchronized Object read() throws NetworkException { if(toAppStream != null) { throw new NetworkException(this, "Receiving is done via input stream. Do not call Connection.read."); } if(toAppBuffer != null) { if(!toAppBuffer.isEmpty()) { // return data from buffer although the con...
4
public GuiDriver() { createGui(); imageChooser = new JFileChooser(); imageChooser.addChoosableFileFilter(new ImageFileFilter()); imageChooser.setAcceptAllFileFilterUsed(false); imageChooser.setCurrentDirectory(Paths.get(".").toFile()); loadImageButton.addMouseListen...
2
public Environment<K,V> createChild( String name ) { //System.out.println( "Creating new child: "+name ); // First: locate the container List<Environment<K,V>> tmpList = this.children.get( name ); // Create new container if none exists if( tmpList == null ) { tmpList = new ArrayList<Environment<K,V>>( 1...
3
final void method2439(int i, AnimatableToolkit class64) { try { anInt10205++; int i_115_ = ((Class264) aClass264_10315).anInt3370; if (i >= -110) ((Mob) this).anInt10325 = 90; int i_116_ = ((Class264) aClass264_10316).anInt3370; if (i_115_ != 0 || i_116_ != 0) { int i_117_ = class64.fa() /...
5
private final void timeOutStrayHandlers() { List<HTTPIOHandler> handlersToShutDown = null; synchronized(handlers) { // remove any stray handlers from time to time if(handlers.size() == 0) return; final Iterator<HTTPIOHandler> i; try { i=handlers.iterator(); } catch(java.lang.IndexOut...
9
public void addDoctor(Doctor doctor){ this.doctor.add(doctor); }
0
public static void main(String[] args) { new Circle(5); }
0
public ArrayList<PersonApplication> getPersonApplicantions() { return PersonApplications; }
0
public Component getRendererComponent(GraphColoring coloring) { final GraphColoring myColoring = new GraphColoring(coloring.graph); myColoring.vertexColors = new HashMap<Vertex, Integer>(coloring.vertexColors); myColoring.edgeColors = new HashMap<Edge, Integer>(coloring.edgeColors); myCo...
9
private boolean displayModesMatch(DisplayMode mode1, DisplayMode mode2) { if(mode1.getWidth() != mode2.getWidth() || mode1.getHeight() != mode2.getHeight()){ return false; } if(mode1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI && mode2.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI && mode1.getBitDepth()...
8
public boolean exists(String name) { Connection conn = null; ResultSet rs = null; PreparedStatement ps = null; boolean exists = false; try { conn = iConomy.getiCoDatabase().getConnection(); ps = conn.prepareStatement("SELECT * FROM " + Constants.SQLTable + " WHERE username = ? LIMI...
7
public void gainXP(int exp){ _xp += exp; while (_xp > 100){ _level++; //ding! _xp-=100; _health*=1.3; _damage*=1.3; _shield++; if (_level == 2) learnSkillOne(); if (_level == 5) learnSkillTwo(); if (_level ==...
4
/* package private */ ShallowTrace(final String name, final boolean hidden, final boolean systemHidden, final ResultType resultType, final String value, ...
9
public int getEventId() { return eventId; }
0
@EventHandler(priority = EventPriority.NORMAL) public void onSignChange(final SignChangeEvent event) { if (!event.isCancelled()) { if (ChatColor.stripColor(event.getLine(1)).equalsIgnoreCase( "[KarmicLotto]")) { boolean valid = false; if(plugin.getPerm().has(event.getPlayer(), Permission.CREAT...
5
public ArchiveData take() throws ClosedChannelException, InterruptedException, ProtocolException { // Das ArchiveData Objekt ist in dem Byte-Array kodiert. byte[] dataByteArray = _streamDemultiplexer.take(_indexOfStream); if (dataByteArray != null) { // Es wurde ein Datensatz empfangen InputStream in = ne...
9
private void reset() { synchronized (sequenceQueueLock) { if (sequenceQueue != null) sequenceQueue.clear(); } // Check if we have a sequencer: if (sequencer == null) { // nope, try and get one now: getSequencer(); } else { // We have a sequencer. Stop it now: sequencer.stop(); // rewind...
4
private boolean safeAdd(Token token) { //end{check} Token last = tokens.empty() ? null : tokens.peek(); boolean safe = true; if (last !=null && (last.isNumber() || last.isOperator(')'))) { safe = token.isOperator('+') || token.isOperator('-') || t...
8
public OutputStragegy getOutputStrategy(String simName) { OutputStragegy st = null; if (scheme == SIMPLE) { st = new SimpleDirectoryOutput(getDir(), simName); } else if (scheme == NUMBERED) { st = new NumDirectoryOutput(getDir(), simName); } else if (scheme == TIM...
3
@Test public void getAllRecipesTest() throws Exception { Recipe recipe = new Recipe(); recipe.setName("borscht"); recipe.setCategory(CategoryEnum.chicken); try { recipe.canSave(); } catch (SaveError e) { e.printStackTrace(); } }
1
private int sumValue(ArrayList<Piece> thePieces) { int answer=0; for(Piece p : thePieces) { if(p instanceof Pawn) { answer+=1; }else if(p instanceof Knight|| p instanceof Bishop) { answer+=3; }else if(p instanceof Rook) { answer+=5; }else if(p instanceof Queen) { answer+=9;...
6
public int GetInputBuffer() { return inputBuffer; }
0
private boolean readFiretrap(Element element, int houseNumber) { //declare variables int x = -1; int y = -1; //check for non-specified attributes NamedNodeMap trapAttr = element.getAttributes(); for(int i = 0; i < trapAttr.getLength(); i++) { Node attr = trapAttr.item(i); //get attribute //check i...
8
public String getTitle() { return this.title; }
0