text
stringlengths
14
410k
label
int32
0
9
public NFA(Parser p, EpsilonNFA eNFA){ // Populate new array and figure out which states are initial for NFA eNFA.Reset(); for (int i = 0; i < eNFA.GetStates().size(); ++i){ StateNFA temp = new StateNFA(); temp.mIsInitial = eNFA.GetStates().get(i).mUsed; temp.mItem = eNFA.GetStates().get(i).mItem; tem...
7
public Filter nand( Filter other ) { return new Not( and( other ) ); }
0
public String readMulti(Key key, String valueName) throws RegistryErrorException { if(key == null) throw new NullPointerException("Registry key cannot be null"); if(valueName == null) throw new NullPointerException("Valuename cannot be null, because the default value is always a STRING! If you wan...
4
private static String[] argsEnsureSyntax(String[] argsA) { String[] argsC; // return value int qtyTrad = 0; // provisional # occurrences of "--traditional" in given args (oughta be 0 or 1, but we cope with 2+) for (int iA = 0; iA < argsA.length; iA++) { if (argsA[iA].equals("--traditional")) { qtyTrad++; ...
6
@Override public void run() { synchronized (this) { while (true) { try { wait(); } catch (InterruptedException ex) { System.out.println("ERROR DURMIENDO DISPOSITIVO"); return; } ...
5
public PlayerRender() { Image[] movementUp = null, movementDown = null, movementLeft = null, movementRight = null, movementUpIdle = null, movementDownIdle = null, movementLeftIdle = null, movementRightIdle = null, dashUp = null, dashDown = null, dashLeft = null, dashRight = null, dashIdle = null; try ...
3
public NPC(boolean player) { wPlayer = player; }
0
@RequestMapping(value = "/event-branch-speaker-list/{eventBranchId}", method = RequestMethod.GET) @ResponseBody public SpeakerListResponse eventBranchSpeakerList( @PathVariable(value = "eventBranchId") final String eventBranchIdStr ) { Boolean success = true; String errorMessage ...
1
private void readLuminance() { int type = sourceImage.getType(); if (type == BufferedImage.TYPE_INT_RGB || type == BufferedImage.TYPE_INT_ARGB) { int[] pixels = (int[]) sourceImage.getData().getDataElements(0, 0, width, height, null); for (int i = 0; i < picsize; i++) { int p = pixels[i]; int r = (p &...
9
public boolean midiSourcename( String sourcename ) { if( midiChannel == null || sourcename == null ) return false; if( midiChannel.getSourcename() == null || sourcename.equals( "" ) ) return false; if( sourcename.equals( midiChannel.getSourcename() ) ) r...
5
@Test public void testIterateActiveLevels() { ao.setActiveLevels(new ArrayList<ILevel>()); ILevel level = new LevelDecorator() { @Override public void conferAward() { } @Override public boolean hasPassedLevel() { return (...
7
void applyUndoSnapshot(OutlineModel owner, RowUndoSnapshot snapshot) { mOwner = owner; mParent = snapshot.getParent(); mOpen = snapshot.isOpen(); if (canHaveChildren()) { mChildren.clear(); for (Row child : snapshot.getChildren()) { mChildren.add(child); child.mParent = this; } } }
2
public int compareTo(WeightedDirectedEdge e) { if (weight < e.weight) return -1; else if (weight > e.weight) return +1; else return 0; }
2
@Override public boolean won() { return playerColor() == lastStanding() || getDay() > 30; }
1
public int getPieceIndex() { return this.piece; }
0
private void gameLoop() { final double TIME_BETWEEN_UPDATES = 1000 / UPDATES_PER_SECOND; final int MAX_UPDATES_BEFORE_RENDER = 5; double lastUpdateTime = System.currentTimeMillis(); double lastRenderTime; final double TARGET_FPS = 60; final double TARGET_TIME_BETWEEN_REN...
9
public static void printKifQuantifiedVariables(Vector variables, boolean includetypesP) { if (variables == null) { return; } { OutputStream stream = ((OutputStream)(Logic.$PRINTLOGICALFORMSTREAM$.get())); stream.nativeStream.print("("); { Skolem vbl = null; Vector vector000 = vari...
8
public boolean checkColumn(int col) { int i = 0, j = 0, count = 0; for(j = 0; j < 10; j++) { count = 0; for(i = 0; i < 9; i++) { if(j == Integer.parseInt(entries[i][col].getText()) ) { count++; } if(count >= 2) { System.out.println("checkColumn() returned false at i: " + i ...
4
@Test public void loadSomeArticles() throws Exception { ArticleLoader loader = new ArticleLoader(path); List<IArticle> articles = getArticleMocks(10); loader.load(articles); Thread.sleep(200); for (IArticle article : articles) { verify(article).getResources(); ...
1
private static void bulkCheckPrices(GameDEUS myDEUS, int testItemNum) { for (int i = 0; i < myDEUS.getItemList().size(); i++){ Item item = myDEUS.getItemList().get(i); item.calculateLowestCost(); item.unlock(); } System.out.println("lowest price bulk fusion ch...
6
public void EnterButton() { if (!userNameBoxFieldRE.getText().equals("")) { String tempName = userNameBoxFieldRE.getText().trim(); ClientGUI.userName = tempName; loginWindowRE.setVisible(false); output.println(tempName); output.flush(); } else { JOptionPane.showMessageDialog(null, "Ente...
1
protected void giveExploreXP(final MOB mob, final Room R, int amt) { if(((R.roomID().length()>0) ||((R.getGridParent()!=null)&&(R.getGridParent().roomID().length()>0))) &&(!CMath.bset(R.getArea().flags(),Area.FLAG_INSTANCE_CHILD)) &&(!mob.playerStats().hasVisited(R)) &&(mob.soulMate()==null) &&(CMLib.flag...
9
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
@Override public JSONObject main(Map<String, String> params, Session session) throws Exception { JSONObject rtn = new JSONObject(); Long id = Long.valueOf(params.get("id")); Venue venue = Venue.findById(id); if(venue == null) { rtn.put("rtnCode", this.getRtnCode(201)); return rtn; } venue.dele...
1
private IRemoteServerConnection getRemoteServerConnection() { return remoteServerConnection; }
0
private char nonZeroDigitToken(PositionTrackingPushbackReader par1PositionTrackingPushbackReader) throws IOException, InvalidSyntaxException { char c1 = (char)par1PositionTrackingPushbackReader.read(); char c; switch (c1) { case 49: case 50: case ...
9
private javax.jcr.Node addDirectory(String path) throws RepositoryException { if ("/".equals(path)) { return m_session.getRootNode(); } if (m_session.nodeExists(path)) { javax.jcr.Node dir = m_session.getNode(path); if (!dir.isNodeType(CATEGORY_TYPE)) { throw new RuntimeException("Not a directory: "...
8
public ControlPanel() { JPanel peoplePanel = new JPanel(); JLabel peopleLabel = new JLabel("People"); JSpinner peopleSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 20, 1)); peopleStatusLabel = new JLabel(" People still to remove"); JPanel taxiPanel = new JPanel(); JLabel taxiLabel = new...
4
public void testListNil1() { Term x = Query.oneSolution("X = []").get("X"); if (syntax.equals("traditional")) { assertTrue("empty list is text atom []", x.isAtom() && x.atomType().equals("text") && x.name().equals("[]")); } else { assertTrue("empty list is reserved atom []", x.isAtom() && x.atomType().equal...
5
private void gameLoop() { World.setDefaultThread(Thread.currentThread()); buffer=new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL); buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE); buffer.setBoundingBoxMode(FrameBuffer.BOUNDINGBOX_NOT_USED); buffer.optimizeBufferAccess()...
9
public void actionPerformed(ActionEvent e) { if ("New".equals(e.getActionCommand())) { //new createFrame(); }else if ("Close".equals(e.getActionCommand())) { this.close(); }else if("Closeall".equals(e.getActionCommand())) { this.closeall(); }el...
5
public String createOutput() { // ************* prepare the temporary tables *************** // ************ PERFORMANCE WATCH *************** long perfWatch; // ********************************************** // get a name for the temporary table tmpTabl...
7
public Boolean dropGraph(String graphURI) { if(graphURI==null){ log.warning("to be deleted Graph URI is null"); return false; } String query = "DROP SILENT GRAPH <"+graphURI+">"; if(autoCommit){ return updateIntern(query, true); } this.queries += query+="\n"; return null; }
2
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AccessModifire that = (AccessModifire) o; if (idAccessModifire != that.idAccessModifire) return false; if (name != null ? !name.equals(that.nam...
6
double rate(Board board) { int maxHeight =0; int minHeight = board.getHeight(); for(int x = 0; x < board.getWidth(); x++) { int height = board.getColumnHeight(x); if(height > maxHeight) maxHeight = height; if(height < minHe...
6
public static void main(String[] args) { Console console = System.console(); while(true) { String command = console.readLine("> "); String[] commandParts = command.split(" "); if(commandParts.length == 1) { // Reading doReading(commandParts[0]); } else { if(commandParts[1].equals("->"...
5
@Override public String toString() { String chaine = "L'equipe est composée de : "; for (int indice = 0; indice<this.nbPerso; indice++) { chaine += this.equipe.get(indice).getType().getNomType().obtenirLabel(); if (indice != this.nbPerso-1) chaine+=", "; else chaine+="."; } return chaine; ...
2
@Override public Object run() { for (Field field : mClass.getDeclaredFields()) { if ((field.isAnnotationPresent(Localize.class) || field.isAnnotationPresent(Localizations.class)) && (field.getModifiers() & MOD_MASK) == MOD_EXPECTED) { try { if (!mIsAccessible || (field.getModifiers() & Modifier.PUBLIC) =...
7
@Override public Object getData() { return data; }
0
public RemoteClientCall(String ip, int port) throws UnknownHostException, IOException { super(new EndPoint(port, ip)); sync = new ConcurrentHashMap<Long, IRemoteCallObject>(); }
0
public void cargarTabla(int perfil){ System.out.println("tabla"); String[] columnas = getColumnas(); Class[] tipoDatosColumnas=getTipoColumnas(); Vector<Vector<Object>> contenidoTabla = new Vector(); contenidoTabla = getContenidoTabla(perfi...
5
public AdministrarPregunta(DTO.Pregunta p, int sel) { initComponents(); setLocationRelativeTo(null); // archivos arch = new archivos(); this.p = p; this.seleccion = sel; /* File ar = new File(p.getUrl(),"descripcion"+p.getCodigo()+".txt"); try { ...
8
private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed UserModel userModel = new UserModel(); String maristID = maristUsernameTextField.getText(); String password = UserModel.encodePassword(new String(passwordTextField.getPassword())...
2
public static void changeName() { System.out.println("We understand that some people suffer from multiple " + "personality disorder. Which one are you?"); boolean valid = false; String playerName = null; Scanner keyboard = new Scanner(System.in); while (!valid) ...
3
final public void Assignment() throws ParseException { /*@bgen(jjtree) Assignment */ ASTAssignment jjtn000 = new ASTAssignment(JJTASSIGNMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFir...
8
public UserStory(String nom, double charge) throws IllegalArgumentException { if(nom != null && !nom.equals("")){ if(charge > 0){ this.setEtatUserStory(EtatUserStory.PLANIFIEE); this.setResteAFaire(charge); }else{ this.setEtatUserStory(EtatUserStory.NOUVELLE); } this.setCharge(charge); ...
3
private void unzip(String file) { final File fSourceZip = new File(file); try { final String zipPath = file.substring(0, file.length() - 4); ZipFile zipFile = new ZipFile(fSourceZip); Enumeration<? extends ZipEntry> e = zipFile.entries(); while (e.hasMoreE...
7
public void setProfile(ProfileBean pb) throws Exception{ Connection conn =null; Statement stmt = null; int rs; try{ Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection(url); stmt = conn.createStatement(); ...
5
public Element handle(FreeColServer server, Player player, Connection connection) { ServerPlayer serverPlayer = server.getPlayer(connection); Unit unit; try { unit = player.getFreeColGameObject(unitId, Unit.class); } catch (Exception e) { ...
7
Edge enter(Node branch) { Node n; Edge result = null; int minSlack = Integer.MAX_VALUE; boolean incoming = getParentEdge(branch).target != branch; // searchDirection = !searchDirection; for (int i = 0; i < graph.nodes.size(); i++) { if (searchDirection) n = graph.nodes.getNode(i); else n = gra...
8
private static boolean hasSpecialChars(String input) { boolean flag = false; if ((input != null) && (input.length() > 0)) { char c; for(int i=0; i<input.length(); i++) { c = input.charAt(i); switch(c) { case '<': flag = true; break; case '>': flag = true; break; ...
7
public static String toString(JSONObject jo) throws JSONException { boolean b = false; Iterator keys = jo.keys(); String string; StringBuffer sb = new StringBuffer(); while (keys.hasNext()) { string = keys.next().toString(); if (!jo.isNull(s...
3
@Override public BasicValue newValue(final Type type) { if (type == null) { return BasicValue.UNINITIALIZED_VALUE; } boolean isArray = type.getSort() == Type.ARRAY; if (isArray) { switch (type.getElementType().getSort()) { case Type.BOOLEAN: ...
9
public static void deleteLogFile() { if(DEBUG) { File file = new File(LOGFILE); if(file.exists() && file.isFile()) { if(file.length() > MAXSIZE ) { System.out.println("logFile size: " + Long.toString(file.length())); file.delete(); ...
4
public void checkSubscription() { PreparedStatement statement = null; java.util.Date current = new java.util.Date(); openConnection(); try { statement = connection.prepareStatement("SELECT subscriptionid, weekday FROM subscriptionplan"); ResultSet res = statement....
7
public boolean isFinished() { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols - 1; j++) { if (board[i][j] * board[i][j + 1] == 0) { // First return statement return false; } if (board[i][j] == board[i][...
8
public void actionPerformed(ActionEvent e) { if(e.getSource()==cl) { System.exit(n); } if(e.getSource()==gd) { JOptionPane.showMessageDialog(null,info); } if(e.getSource()==cop) { JOptionPane.showMessageDialog(null,"Wha...
9
public static JSONArray fetchById(final String token, final String objType, final String id) throws IOException { String url = ApiProperties.get().getUrl() + objType + "/id/" + id; String obj = fetchData(url).toString(); JSONObject jsonObject = new JSONObject(obj); JSONArray results = new JSONArray(); if (jso...
2
public Matrix subtract(Matrix m) { if(numRows != m.numRows || numColumns != m.numColumns) throw new IllegalArgumentException("Incompatible dimensions"); Matrix diff = new Matrix(numRows, numColumns); for(int i = 0; i < numRows; i++) for(int j = 0; j < numColumns; j++) diff.elements[i][j] = elements[i...
4
public static Boolean isPrime(long n) { if(n < 2) return false; if(n == 2 || n == 3) return true; if(n%2 == 0 || n%3 == 0) return false; long sqrtN = (long)Math.sqrt(n)+1; for(long i = 6L; i <= sqrtN; i += 6) { if(n%(i-1) == 0 || n%(i+1) == 0) return false; } ...
8
private void productionSleeveListSelectioner1() { try { managerStockItem.addObserver(this); modelStocklist = new StockList2TableModel(managerStockItem.getAll()); tblStockList.setModel(modelStocklist); managerOrder.addObserver(this); ...
7
public static void main( String[] args ) { final long clientEthernetAddress = 0x1234566; final GameClient client = new GameClient(); client.clientEthernetAddress = clientEthernetAddress; //// Server stuff //// final QueuelessRealTimeEventSource<DGTimer<?>> evtReg = new QueuelessRealTimeEventSource<DG...
9
public static void handleGetDiskSpaceReply(HTSMsg msg, HTSPClient client) { Collection<String> requiredFields = Arrays.asList(new String[]{"freediskspace","totaldiskspace"}); if (msg.keySet().containsAll(requiredFields)){ //TODO } else if (msg.get("error") != null){ //TODO } else{ System.out.println("F...
2
@Override public void startSetup(Attributes atts) { super.startSetup(atts); // Define the Bottom Panel BOTTOM_PANEL.setLayout(new FlowLayout()); BOTTOM_OK.addActionListener(this); BOTTOM_PANEL.add(BOTTOM_OK); BOTTOM_CANCEL.addActionListener(this); BOTTOM_PANEL.add(BOTTOM_CANCEL); BOTTOM_APPLY.a...
0
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; NullValues nl = (NullValues)obj; if (!nullValueStrategy.equalsIgnoreCase(nl.getNullValueStrategy())) { return false; } if (nextCode != nl.getNextCode()...
9
public static void calculateMostDesirableSuperregion(BotState state) { double biggestFractionOwned = 0; SuperRegion mostDesirableSuperRegion = null; for (SuperRegion superRegion : state.getVisibleMap().getSuperRegions()) { if (superRegion.getOwnedFraction() > biggestFractionOwned && superRegion.getOwnedFr...
9
public void update(){ if(selected){ if(Input.mouse){ setDestination((double) (Input.x + Base.render.xOffset), (double) (Input.y + Base.render.yOffset)); } } move(); }
2
@Override public void restoreLimb(String limbName) { for(int partNum=0;partNum<Race.BODY_PARTS;partNum++) { if(injuries[partNum]!=null) { for(Pair<String,Integer> part : injuries[partNum]) { if(part.first.equalsIgnoreCase(limbName)) { injuries[partNum].remove(part); if(injuries...
7
s_Sub2(OpenGlToolkit var_ha_Sub2, int i, int i_133_, int i_134_, int i_135_, int[][] is, int[][] is_136_, int i_137_) { super(i_134_, i_135_, i_137_, is); do { try { ((s_Sub2) this).aHa_Sub2_8272 = var_ha_Sub2; anInt8264 = ((s) this).anInt4588 + -2; anIntArrayArrayArray8245 = new int[i_134_][i_135_][];...
8
public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a, b, c; double biggestPerimeter = 0; boolean triangleIsFound = false; while (true) { System.out.println("Enter sides A, B and C of a triangle: "); a = sc.nextDouble(); b = sc.nextDouble(); c = sc.nextDouble(); ...
9
private void inJail(PlayerClass pPlayer){ if(pPlayer.addTimeServed()){ pPlayer.setFree(); pPlayer.cout.printTimeServed(); } else if(pPlayer.getFreedom() > 0){ pPlayer.cout.printFreedom(); pPlayer.setFree(); pPlayer.useFreedom(); } else{ if(pPlayer.cout.printPrisonBreak()){ pPlayer.account.addBalance...
6
public void render() { BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(3); return; } int xOffset = player.x - (screen.width / 2); int yOffset = player.y - (screen.height / 2); level.renderTiles(screen, xOffset, yOffset); for (int x = 0; x < level.width; x++) { i...
7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FertigungsauftragNr that = (FertigungsauftragNr) o; if (n != null ? !n.equals(that.n) : that.n != null) return false; return true; }
5
public void callForObject(MethodInvocation invocation) throws ClassNotFoundException{ // Config(); acxt = new ClassPathXmlApplicationContext("applicationContext.xml"); SpringConsumerBean consumerBean = (SpringConsumerBean)acxt.getBean("springConsumerBean"); Request request = new Request(); Object[] argsObject ...
3
Map getAllInterfaces(CtClass clazz, Map map) { if (map == null) map = new HashMap(); if (clazz.isInterface()) map.put(clazz.getName(), clazz); do { try { CtClass[] interfaces = clazz.getInterfaces(); for (int i = 0; i < interfa...
5
public static void doTheStuff() { try { openDatabase(); int input = -1; while (input != 0) { System.out.println("Create Items Database: 1\nInsert New Object: 2\nPrint Database: 3\nDelete Database: 6\nExit: 0"); input = scan.nextInt(); ...
6
public void suggestAxisPairs(MetaMetrics selectedMetric){ Collections.sort(metricsList, new SortMetrics(selectedMetric)); //instantiate suggested list suggestedAxisPairList = new ArrayList<AxisPairMetrics>(); // sublist for selecting axis pairs, we want to include the first and last axes but not the interm...
8
public void mouseReleased(MouseEvent e) { //if (e.isPopupTrigger()) Ne marche pas avec le JDK d'IBM if (e.getButton() == MouseEvent.BUTTON3) { popupSaveGraphic.show(e.getComponent(), e.getX(), e.getY()); } }
1
@Override public String addPlayersAndAccountsFromXML(String xmlBuffer, List<PlayerAccount> addAccounts, List<MOB> addMobs, Session S) { final List<XMLLibrary.XMLTag> xml=CMLib.xml().parseAllXML(xmlBuffer); if(xml==null) return unpackErr("PLAYERs","null 'xml'"); List<XMLLibrary.XMLTag> mV=CMLib.xml().getConte...
8
private synchronized AffineTransform bufferTransform(){ AffineTransform r=new AffineTransform(); for(int i=0;i<a1.size();i++){ int s1=a1.get(i);Object s2=a2.get(i);Object s3[]=null; if(s2 instanceof Object[])s3=(Object[])s2; if(s1==setTransform){r=makeTransform(s2); } ...
9
public void actionPerformed(ActionEvent event) { JMenuItem itemSelectionne = (JMenuItem) event.getSource(); if (itemSelectionne == this.MenuItemAPropos) { JOptionPane.showMessageDialog(this.fenetre, "Une application de jeu Othello codée par DUROT et SILVESTRE", "A propos", JOptionPane.INFORMATION_MESSAGE); ret...
3
public void ExportToMidi(File filename) { AtomicBoolean[][] temp; synchronized(_matrix) { temp = _matrix.clone(); } MidiFile mf = new MidiFile(_tempo.get()); mf.progChange(this.getInstrument().getSynthNum()); for (int i = 0;i<COLS;i++) { int counter = 0; for (int j=0;j<ROWS;j++) { if (temp[j...
8
public String execute() { UserService userService = ServicesFactory.getUserService(); try { User user = userService.getUserByNameAndPassword(userName, password); if(user == null){ this.addActionError("user or password error!"); user = userService.getUserByName(userName); int times = user.getErrorL...
8
private void postPlugin(final boolean isPing) throws IOException { // The plugin's description file containg all of the plugin data such as name, version, author, etc final PluginDescriptionFile description = plugin.getDescription(); // Construct the post data final StringBuilder data =...
9
public void onBlockHit(EntityPlayer var1, int var2, int var3, int var4, int var5) { if (var5 == 0) { --var3; } if (var5 == 1) { ++var3; } if (var5 == 2) { --var4; } if (var5 == 3) { ++var4; } if (...
7
public String parse(String text) { if(text.length() != 0) { //String lowerCase = text.toLowerCase(); //Convert string to lower case to avoid case mismatches String lowerCase= text; //Trim trailing spaces and remove duplicate whitespaces lowerCase = lowerCase.trim(); Pattern pattern = Pattern.com...
8
public JSONException syntaxError(String message) { return new JSONException(message + this.toString()); }
0
public Builder id(int receivedId) { if (receivedId < 0) { log.warn("Wrong ID. receivedId ={}", id); throw new IllegalArgumentException("Id must be integer value more than 0. Received value = " + receivedId); } this.id = receivedId; return t...
1
protected void readAttribute(String name, int length, ConstantPool cp, DataInputStream input, int howMuch) throws IOException { if ((howMuch & KNOWNATTRIBS) != 0 && name.equals("Code")) { bytecode = new BytecodeInfo(this); bytecode.read(cp, input); } else if (name.equals("Exceptions")) { int count = inp...
9
public int get(final int index) { final int i0 = index >>> 24; int[][] map1; if (i0 != 0) { if (map == null) return NOT_FOUND; map1 = map[i0]; if (map1 == null) return NOT_FOUND; } else map1 = map10; int[] map2 = map1[(index >>> 12) & 0xfff]; if (map2 == null) return NOT_FOUND; ...
4
void onResize (Event event) { clientArea = getClientArea (); /* vertical scrollbar */ ScrollBar vBar = getVerticalBar (); if (vBar != null) { int clientHeight = (clientArea.height - getHeaderHeight ()) / itemHeight; int thumb = Math.min (clientHeight, itemsCount); vBar.setThumb (thumb); vBar.setPageIncremen...
7
public String getShopUrl() { return shopUrl; }
0
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == configButton || e.getSource() == okButton) { // hides the config dialog parent.configAction.tap(); } if(e.getSource() == buildTurretButton){ addTurret(); } ...
4
private void comparePlayers() { for (Integer user1 : userRatedMovies.keySet()) { for (Integer user2 : userRatedMovies.keySet()) { if (user1 > user2) { double sim = computeSimilarity(user1, user2); if (similarities.containsKey(user1)) { similarities.get(user1).put(user2, sim); } else { ...
5
public ParticleEmitter(ParticleType type, int x, int y, int lifetime, int amount) { for (int i = 0; i < amount; i++) { switch (type) { default: /** * Falls through * */ case BASIC: particles.add(new...
2
@Override public void writeObject(Product obj) throws IOException { if(!connectionOutStatus) { startOutputConnection(); } if(connectionOutStatus){ try{ os.writeObject(obj); System.out.println("Das Produkt mit dem Namen : " + obj.getName() + " wurde gespeichert!"); } catch (IOException e)...
3
private int getHeuristicEstimate(State newState) { int count = 0; ArrayList<Box> usedBoxes = new ArrayList<Box>(); for (Goal g : level.goals) { BoxInState bestBox = newState.boxes.get(0); for (BoxInState b : newState.boxes) { if (!usedBoxes.contains(b.b) && g.getId() == Character...
7
private long getNextIdConnection() { final ReentrantLock l = lock; l.lock(); try { return ++connectionId; } finally { l.unlock(); } }
0
public void dumpExpression(TabbedPrintWriter writer) throws java.io.IOException { subExpressions[0].dumpExpression(writer, 201); writer.breakOp(); writer.print(" ? "); int subPriority = 0; if (!subExpressions[1].getType().getHint() .isOfType(subExpressions[2].getType())) { writer.startOp(writer.IMPL...
2
public void serviceActive(ReceivableService receivableService) { for(ReceivableEvent receivableEvent : receivableService.getReceivableEvents()) { Set<ServiceID> serviceIDs = eventID2serviceIDs.get(receivableEvent.getEventType()); if(serviceIDs == null) { serviceIDs = new HashSet<ServiceID>(); Set<Ser...
7