text
stringlengths
14
410k
label
int32
0
9
private int runDvi(String fileName, int resolution) throws IOException, InterruptedException, ServletException { int depth = 0; String[] command = String.format(DVI_COMMAND, Integer.toString(RESOLUTIONS[resolution]), fileName + IMAGE_SUFFIX, fileName + ...
5
public void atualizar() { jComboBoxEdicao.removeAllItems(); jComboBoxAnoPublicacao.removeAllItems(); jComboBoxAutor.removeAllItems(); jComboBoxEditora.removeAllItems(); jComboBoxCategoria.removeAllItems(); jComboBoxPublico.removeAllItems(); jComboBoxFormato.remove...
8
private void setupDisplay() throws LWJGLException { try { DisplayMode displayMode = null; DisplayMode[] modes = Display.getAvailableDisplayModes(); for (int i = 0; i < modes.length; i++) { if (modes[i].getWidth() == WorldSettings.SCREEN_WIDTH && modes[i].getHeight() == WorldSettings.SCREEN_HEIGHT...
5
public void run() { while(true) { try { repaint(); Thread.sleep(5); } catch(InterruptedException ie) { stop(); } } }
2
public void modificarCliente(Cliente c){ try { int especial = 0; if(c.isEspecial()){ especial = 1; } Statement comando=connection.createStatement(); comando.executeUpdate("UPDATE Cliente SET " + "Nombre='"+c.getNombr...
2
private void initialiseSequencer() { try { // Attempt to locate the MIDE sequencer as one of the MIDI devices MidiDevice.Info[] midiDeviceInfo = MidiSystem.getMidiDeviceInfo(); int sequencerPos = -1; for (int idx = 0; idx < midiDeviceInfo.length; idx++) { ...
6
static Direction counterclockwise(Direction direction) { if (direction == NORTH) return WEST; if (direction == WEST) return SOUTH; if (direction == SOUTH) return EAST; return NORTH; }
3
public boolean isOptOut() { synchronized (optOutLock) { try { // Reload the metrics file configuration.load(getConfigFile()); } catch (IOException ex) { if (debug) { Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g...
4
public MClientCmdListener(String analyticsServerRef, String billingServerRef, ExecutorService mClientExecutionService) { this.analyticsServerRef = analyticsServerRef; this.billingServerRef = billingServerRef; this.mClientExecutionService = mClientExecutionService; // create EventListener Remote Object try ...
8
public StatistikZusammenfassung<Team> getStatistikZusammenfassung(String teamId) { Team team = eloPersistence.findById(Team.class, teamId); int anzahlSiege = 0; int toreGeschossen = 0; int toreGefangen = 0; int eloMinimum = Integer.MAX_VALUE; int eloMaximum = Integer.MIN_VALUE; for (EloPunktzahl punktza...
9
public int putRef(int tag, Reference ref) { String className = ref.getClazz(); String typeSig = ref.getType(); if (tag == FIELDREF) TypeSignature.checkTypeSig(typeSig); else TypeSignature.checkMethodTypeSig(typeSig); int classIndex = putClassType(className); int nameIndex = putUTF8(ref.getName()); ...
1
@Override public void setToNative(long i, Object o) { if (o == null) { stringLengths.setShort(i, (short) -1); } else { if (!(o instanceof String)) { throw new IllegalArgumentException(o + " is not a string."); } String s = (String) ...
6
public void txtToJson(String txtPath) { Json json = new Json(); json.prettyPrint(json); FileReader fileReader = null; BufferedReader br = null; try { fileReader = new FileReader(txtPath); br = new BufferedReader(fileReader); String strLine; // Read File Line By Line while ((strLine = br.readLin...
3
static final public void unary() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case MINUS: jj_consume_token(MINUS); element(); break; case CONSTANT: case 12: element(); break; default: jj_la1[5] = jj_gen; jj_consume_token(-1); throw n...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Field other = (Field) obj; if (x != other.x) return false; if (y != other.y) return false; return true; }
5
@Test public void adenAskStudentPriceTest(){ LocalDate date = LocalDate.now(); int dayOfWeek = date.getDayOfWeek(); boolean weekend = false; Canteen c3 = new Canteen(new CanteenData(CanteenNames.ADENAUERRING, 0)); int dayShift = (dayOfWeek + 2) % 7; if(dayOfWeek == 0 || (dayOfWeek == 6)) { // weekends ...
7
public Packing createPacking(String type){ Packing pack = null; if(type.equalsIgnoreCase("cloth")){ pack = new Cloth(); } else{ if(type.equalsIgnoreCase("cellophane")){ pack = new Cellophane(); } else{ if(typ...
5
@Test public void testUS36_consultationFicheVideo() { //intLgTitreVideo = Integer.parseInt(lgTitreVideo); String titreVideoC = null; String lgTitreVideo; int intLgTitreVideo; int intCptVideo; String cptVideo; String varVideoTitle; String varVideoTitleComplete; String pointSuspension; String ...
6
public static boolean closedPropositionP(Proposition self) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_CLOSED_PROPOSITIONp_MEMO_TABL...
7
public boolean useCard(int id) throws JSONException { // Würfel eine 2 (id = 6) // POST /bundesklatsche/get_data/0/3/2 HTTP/1.1\r\n // Freiwurf (id = 4) // POST /bundesklatsche/get_data/0/1 // refresh info(0); int field = getCard(id); if (field == 0) { return false; } Utils.getString("bunde...
1
@Override public void mouseReleased(MouseEvent e) { if (!potentialDrag) return; source.removeMouseMotionListener( this ); potentialDrag = false; if (changeCursor) source.setCursor( originalCursor ); if (destination instanceof JComponent) { ((JComponent)destination).setAutoscrolls( autoscrolls ); ...
5
public NondeterminismAction(Automaton automaton, Environment environment) { super("Highlight Nondeterminism", null); this.automaton = automaton; this.environment = environment; }
0
@SuppressWarnings("nls") @Override public String toString() { StringBuilder buffer = new StringBuilder(); if (getParent() == null) { buffer.append("FLOATING "); } buffer.append("Dock Container [x:"); buffer.append(getX()); buffer.append(" y:"); buffer.append(getY()); buffer.append(" w:"); buffer....
3
public long writeToOutputStream(OutputStream out) throws IOException { long documentLength = documentSeekableInput.getLength(); SeekableInputConstrainedWrapper wrapper = new SeekableInputConstrainedWrapper( documentSeekableInput, 0L, documentLength, false); try { wrap...
3
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Schedule schedule = (Schedule) o; if (id != schedule.id) return false; if (seqNumber != schedule.seqNumber) return false; return true;...
5
@Override public void keyPressed(int key, char character, GUIComponent component) { String entryString = entryText.getText(); if (GraphicalFont.isStandardChar(character)) { setEntryText(entryString + character); } switch (key) { case (Keyboard.KEY_RETURN) : ...
7
private byte[] encrypt(byte[] plain, byte[][] _iv){ if(passphrase==null) return plain; if(cipher==null) cipher=genCipher(); byte[] iv=_iv[0]=new byte[cipher.getIVSize()]; if(random==null) random=genRandom(); random.fill(iv, 0, iv.length); byte[] key=genKey(passphrase, iv); byte[] encoded=...
5
private void startConnectLoop() { connectLoop = new Thread() { @Override public void run() { final int numSlots = 20; int numAttempts = firstConnection ? 0 : 1; try { while(connectLoop != null) { Random random = new Random(); int upperBound = Math.min((int)Math.pow(2, numAttempts...
7
private boolean indexWithinCapacity(int index) { return index < array.length && index >= 0; }
1
public void prune() { ConstPool cp = compact0(); LinkedList newAttributes = new LinkedList(); AttributeInfo invisibleAnnotations = getAttribute(AnnotationsAttribute.invisibleTag); if (invisibleAnnotations != null) { invisibleAnnotations = invisibleAnnotations.copy...
5
@Override public Categoria ListById(int id_categoria) { Connection conn = null; PreparedStatement pstm = null; ResultSet rs = null; Categoria c = new Categoria(); try{ conn = ConnectionFactory.getConnection(); pstm = conn.prepareStatement(LISTBYID); ...
3
public static void menuprincipal() { Scanner input = new Scanner(System.in); System.out.println("--------------------------------------------------------------------"); System.out.println("------------------------ MENU PRINCIPAL ----------------------------"); System.out.println...
7
public void findRoomType(String roomType) { Query q = em.createQuery("SELECT t from TypeEntity t"); for (Object o : q.getResultList()) { TypeEntity p = (TypeEntity) o; if (p.getName().equals(roomType)) { typeEntity = p; } } }
2
public void run() { while(Project1.applicationRunning){ /** * Highest Priority is to send Clock Replies. * So sending them first. */ while(!sendClockReplyQueue.isEmpty()){ Message toSend=sendClockReplyQueue.poll(); //System.out.println(toSend.getRecieverAddress()+String.valueOf...
7
public static List<COIN> getCoinsForAmount(float amount) { List<COIN> coins = new ArrayList<COIN>(); /* Well, the canadian govt has decided to abandon 1 cent penny. So, we can't dispense exact change, but will do closest to 5 cent change. I am just implementing ...
6
@SuppressWarnings({ "deprecation", "unchecked" }) public List<ComponentOut> search(Map<String, String> criterias) { List<ComponentOut> results; Set<String> keys = criterias.keySet(); Session session = HibernateUtil.sessionFactory.getCurrentSession(); session.beginTransaction(); ...
7
public static void helium(String sourceFile, String targetFile) { Sound sourceObj = new Sound(sourceFile); //Construct a new Sound object called sourceObj. A sourceObject now represents the sourceFile object. Sound target = new Sound(sourceObj); ...
3
private static int[] getBestUsers(List<Map<Integer, Integer>> userMaps, int userID, int size) { int[] retVals = new int[size]; Map<Integer, Integer> nSimMap = new LinkedHashMap<Integer, Integer>(); if (userID < userMaps.size()) { Map<Integer, Integer> tags = userMaps.get(userID); for (int i = 0; i < userMap...
5
private void findNextPotentialReference(int startPosition) { nextPotentialReferencePosition = Math.max(startPosition, nextSemicolonPosition - MAX_REFERENCE_SIZE); do { nextPotentialReferencePosition = originalMessage.indexOf('&', nextPotentialReferencePosition); if (nextSe...
8
protected static int getInt(String key, JSONObject json) throws JSONException { String str = json.getString(key); if(null == str || "".equals(str)||"null".equals(str)){ return -1; } return Integer.parseInt(str); }
3
@Override public String toString() { return String.format( "annotatedWith(%s)", this.annotation ); }
0
public TimerTest() { super(); }
0
private String scanFlowScalarBreaks () { StringBuilder chunks = new StringBuilder(); String pre = null; for (;;) { pre = prefix(3); if ((pre.equals("---") || pre.equals("...")) && NULL_BL_T_LINEBR.indexOf(peek(3)) != -1) throw new TokenizerException("While scanning a quoted scalar, found unexpected docu...
6
public boolean isOptOut() { synchronized (optOutLock) { try { // Reload the metrics file configuration.load(getConfigFile()); } catch (IOException ex) { if (debug) { Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g...
4
@Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { final NBTRecord rec = (NBTRecord) value; final String chg = rec.hasChanged() ? "*" : " "; f...
4
public MemberBean getMemberInfo(String id) { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; MemberBean member = null; try { conn = getConnection(); pstmt = conn.prepareStatement("select * from member where id=?"); pstmt.setString(1, id); rs = pstmt.executeQuery(); ...
8
public void addToWealth(int val){ iMoneyInBank += val; if(iMoneyInBank < 0) iMoneyInBank = 0; }
1
public static boolean getImagesHaveBeenLoaded() { return imagesHaveBeenLoaded; }
0
public Date floor(Date date, int field) { Calendar cal = Calendar.getInstance(); cal.setTime(date); for (int currentField : fields) { if (currentField > field) { if (currentField == Calendar.DAY_OF_MONTH && (field == Calendar.WEEK_OF_MONTH || field == Calendar.WEEK_OF_YEAR)) { continue; } ...
7
private static void debug(String str) { if(debug) System.out.println(str); }
1
public void actionPerformed(ActionEvent arg0) { Object[] inputDetails = new Object[16]; int counter = 0; for(int i = 0; i < comps.length; i++){ if(comps[i].getClass() == JTextField.class){ JTextField compTemp = (JTextField) comps[i]; inputDetails[counter] = compTemp.getText(); counter++; } i...
8
@Override public IRemoteCallObject call(String command, Object params) throws Exception { checkInitiate(); final IRemoteCallObject rco = new RemoteCallObject(); synchronized (rco) { long callId = getNextCallId(); rco.setCallObjectId(callId); rco.setMetaDataObject(new RemoteCallObjectMet...
1
public int compareTo(Object obj) { if (obj instanceof Mark) { int pos = ((Mark)obj).position; return position - pos; } return -1; }
1
public Ligne jouer(LigneMarqueur marqVerif){ if(derniereCombiJouee != null){ // Si derniereCombinaison n'a pas été initilaisé, càd si l'IA joue pour la première fois listePossibles.supprimeCombiImp(derniereCombiJouee, marqVerif); } derniereCombiJouee = listePossibles.choixCombi(); ...
1
public String preProcess(String s){ int n = s.length(); if(n == 0) return ""; StringBuilder sb = new StringBuilder(); for(int i = 0; i < n; i++){ sb.append('#'); sb.append(s.charAt(i)); } sb.append('#'); return sb.toString(); ...
2
private boolean jj_3R_72() { if (jj_scan_token(IDENTIFIER)) return true; return false; }
1
public void testRead() { try { ConfigurationManager.init("src/test/resources/test.json"); try { Object[] test_array = ConfigurationManager.read.getArrayItem("test", "array"); assertEquals(123L, test_array[0]); Long test_long = ConfigurationManager.read.getLongItem("test", "long"); asser...
2
private void checkSpikes(){ int fromTileX = TileMap.pixelsToTiles(player.getPos().getX()); int fromTileY = TileMap.pixelsToTiles(player.getPos().getY()); int toTileX = TileMap.pixelsToTiles(player.getPos().getX() + player.getWidth()); int toTileY = TileMap.pixelsToTiles(player.getPos().getY() + player.getHeight...
5
static private Object interpretToken(String s) throws Exception{ if(s.equals("nil")) { return null; } else if(s.equals("true")) { return RT.T; } else if(s.equals("false")) { return RT.F; } else if(s.equals("/")) { return SLASH; } else if(s.equals("clojure.core//")) { return CLOJURE_SLAS...
6
private void ekskey(byte data[], byte key[]) { int i; int koffp[] = { 0 }, doffp[] = { 0 }; int lr[] = { 0, 0 }; int plen = P.length, slen = S.length; for (i = 0; i < plen; i++) P[i] = P[i] ^ streamtoword(key, koffp); for (i = 0; i < plen; i += 2) { lr[0] ^= streamtoword(data, doffp); lr[1] ^= st...
3
public boolean deleteTask(int id) throws SQLException { if (daoList.idExists(id)) { daoList.deleteById(id); return true; } return false; }
1
protected void addIndividualPath(String path, U target, boolean named, int defaultHttpMethods) { PathPattern<U> pattern = new PathPattern<U>(target, path, named, defaultHttpMethods); String key = pattern.getKey(); List<PathPattern<U>> list = map.get(key); if (list == null) { ...
1
@Override public void onUpdate(World apples) { if (!apples.inBounds((int)X, (int)Y)||apples.checkCollision((int)X, (int)Y)) { alive = false; //apples.explode(X, Y, 32, 8, 16); } for (Player p:apples.playerList) { if (apples.pointDis(X, ...
6
*/ public void testLargeReadWrite() throws Exception { ByteBuffer b = ByteBuffer.allocate(4000); log.info("getting all proper connections"); int size = 40; String[] methodNames = new String[size]; for(int i = 0; i < size; i++) { methodNames[i] = "connected"; } TCPChannel[] clients = new TCPChannel[...
7
public static Tile[][] read(File file){ BufferedImage paintImage = null; try{ paintImage = loadImage(file); }catch(Exception e){ Logger.logErr("Was not able to read image located at " + file.getAbsolutePath() + "\n Cause: " + e.getCause(),MapReader.class); } Tile[][] tileMap = new Tile[paintImage.get...
7
public void setValue(int x, int y, Pixel value) { if (x >= getWidth() || y >= getHeight() || x < 0 || y < 0) { return; } rawData[x][y] = value; }
4
public int executeWriteQuery(String sqlStatement) { int rc = 0; try { Class.forName(this.sqlDriver); con = DriverManager.getConnection(sqlURL, this.sqlUser, this.sqlPassword); Statement stmt = con.createStatement(); System.out.println("insertSQL: " + sqlStatement); rc = stmt.executeUpdate(sqlSt...
4
protected String[][] create_matrix(String plain) { ArrayList<String> s=new ArrayList<String>(); boolean dig; if(di_begin) { dig=true; } else { dig=false; } int string_index=0; int plain_size=plain.length(); while(string_index<plain_size) { if(dig) { if(string_index==plain_size-1...
7
public Event getNextEvent(){ Event a=this.ListCust.peek(); return (a!=null) ? this.ListCust.remove() : null; }
1
public void checkLogin(String msg){ try{ if(containsMoreThanNeeded(msg)){ CC.getDataTransfer().sendMessage("Sorry but that was an invalid username/password"); CC.Terminate(); return; } msg = msg.replaceFirst("Login ", ""); String[] usernpass = msg.split(":"); if(!ClientHandler.getClientMap(...
5
@Override public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception { Contexto oContexto = (Contexto) request.getAttribute("contexto"); oContexto.setVista("jsp/alumno/form.jsp"); AlumnoBean oAlumnoBean; AlumnoDao oAlumnoDao; oAlumnoBean ...
2
public static TFTPPacket fromOPCode(short opcode){ switch(opcode){ case 1 : return new RRQPacket(); case 2 : return new WRQPacket(); case 3 : return new DataPacket(); case 4 : return new AckPacket(); case 5 : return new ErrorPacket(); } ...
5
public String simplifyPath(String path) { if (path == null || path.length() == 0) return path; String[] paths = path.split("/+"); LinkedList<String> list = new LinkedList<>(); for (String tmp : paths) { if ("..".equals(tmp)) { if (!list.isEmpty()) { ...
9
public static void tpAll( String sender, String target ) { BSPlayer p = PlayerManager.getPlayer( sender ); BSPlayer t = PlayerManager.getPlayer( target ); if ( t == null ) { p.sendMessage( Messages.PLAYER_NOT_ONLINE ); return; } for ( BSPlayer player : Pla...
3
static private boolean glob0(byte[] pattern, int pattern_index, byte[] name, int name_index){ if(name.length>0 && name[0]=='.'){ if(pattern.length>0 && pattern[0]=='.'){ if(pattern.length==2 && pattern[1]=='*') return true; return glob(pattern, pattern_index+1, name, name_index+1); ...
6
private boolean parseFlags(String parameter) { boolean success = false; if (parameter.matches("-[^-]*v[^-]*")) { verboseMode = true; success = true; } if (parameter.matches("-[^-]*d[^-]*")) { devMode = true; success = true; } if (parameter.matches("-[^-]*n[^-]*")) { System.out.println("Disabl...
5
public boolean restartLevel() { GameState state = StateUtil.getGameState(proxy); if(state == GameState.WON || state == GameState.LOST) { proxy.send( new ProxyClickMessage(420,380));//Click the left most button at the end page System.out.println(" restart the level "); try { Thread.sleep(2000); } cat...
8
public static boolean is_integer(String str) { if (str == null) return false; if (str.equals("")) return false; Character c = str.charAt(0); if (!c.equals('-') && !c.equals("+") && !Character.isDigit(c)) return false; try { @SuppressWarnings("unused") Integer test = parseInt(str); } catch (NumberForma...
6
@Override public void happens() { // TODO: add movement to the patio for this case ArrayList<Character> characters = Game.getInstance().getCharacters(); for(Character character: characters){ if (character.getCurrentRoom().getNameEnum() == RoomName.GARDENS || character.getCurrentRoom().getNameEnum() == R...
8
@Test public void testCarbohydratePercentage() { MealRepartition mr = new MealRepartition(); try { mr.setCarbohydratePercentage(0.49); fail("A BadCarbohydratePercentageException should have been thrown."); } catch (BadCarbohydratePercentageException e) {} try { mr.setCarbohydratePercentage(0.56); f...
3
public boolean isPalindrome(int x) { //if nagetive if (x < 0) { return false; } //0~9 is palindrome if (x < 10) { return true; } //10, 100, etc. are not palindrome if (x % 10 == 0) { return false; } int ...
8
public void run() { try { //init IO-Stream from/to client and send Ready-Message inFromClient = new BufferedReader(new InputStreamReader( connectionSocket.getInputStream())); outToClient = new DataOutputStream( connectionSocket.getOutp...
7
@Override protected void buildModel() throws Exception { for (int iter = 1; iter <= numIters; iter++) { errs = 0; loss = 0; // for each rated user-item (u,i) pair for (int u : trainMatrix.rows()) { SparseVector Ru = trainMatrix.row(u); for (VectorEntry ve : Ru) { // each rated item i ...
9
@Override public void onMouseButtonPress(int buttonID) { for(GuiButton button : buttons) { if(button.isMouseOver()) { Sound.button_hit.play(); button.onClick(); } } }
2
public String getSerialNo() { return serialNo; }
0
public void sanitise() { if (this.modName == null || this.modName.length() < 1) this.modName = "all"; if (this.modVersion == null || this.modVersion < 0.0F) this.modVersion = 0.0F; if (this.remoteCacheTimeSeconds < 0) this.remoteCacheTimeSeconds = 600L; }
5
public void partActivated(IWorkbenchPart partArg) { if ((partArg == this.part) && (this.timestamp > -1L) && ((this.resource == null) || (this.resource.exists()) || (this.part .isDirty()))) { if (!readable()) { String[] buttons = { "Save", "Close" }; MessageDialog dialog = new MessageDialog( ...
9
public boolean contains(Vector2 point) { Vector2 min = this.getMinimumPoint(); Vector2 max = this.getMaximumPoint(); return (point.x >= min.x && point.x <= max.x && point.y >= min.y && point.y <= max.y); }
3
public List<Sailplane> getRecentSailplane() { try{ List<Sailplane> sailplanes = DatabaseDataObjectUtilities.getSailplanes(); List<Sailplane> recentSailplaneList = new ArrayList<Sailplane>(); if(instance == null) { return null; } ...
7
NodeListGraph(int vecticeCount) { if(vecticeCount <= 0) { throw new IllegalArgumentException(); } @SuppressWarnings("unchecked") LinkedList<EdgePair>[] nodeListArray = (LinkedList<EdgePair>[]) new LinkedList<?>[vecticeCount]; edges = new TreeSet<Integer>(); for(int i = 0; i < vecticeCount; i++) { ...
3
@Override public Optimus1Ddata FindMaxMin(ArrayID aid, PID pid, OptimusShape pshape, OptimusShape start, OptimusShape off) throws Exception { // TODO Auto-generated method stub OptimusData data = this.readDouble(aid, pid, pshape, start, off); if (data == null) return null; double[] fdata = data.getData(...
4
private void ValidateTag(Iterator<ITag> iter, Class<? extends ITag>... classes) { if (isValid) { while ((iter.hasNext()) && this.isValid) { boolean pass = false; ITag child = iter.next(); Class<? extends ITag> childClass = child.getClass(); for (Class<? extends ITag> type : classes) { if ...
8
@Override public void mouseEntered(MouseEvent e) { }
0
public static String findCollisions(ArrayList<Planet> planets) { String collisions = ""; for (int i = 0; i < planets.size(); i++) { for (int j = 0; j < planets.size(); j++) { if (i != j) { if (Planet.areColliding(planets.get(i), planets.get(j))) { ...
6
public RackRequestHandler(FilterConfig config) { log.info("Creating new RubyRequestHandler instance"); // Configure ignore paths String pathCfg = config.getInitParameter("ignorePaths"); if (pathCfg != null) { this.ignorePaths = pathCfg.split("\\s+"); } ...
7
@Override public int eval(int player, int alpha, int beta, int depth, int nt, int stackIndex, State4 s) { StackFrame frame = stack[stackIndex]; if(nt != SearchContext.NODE_TYPE_PV && depth <= 3 * Search34.ONE_PLY && !frame.pawnPrePromotion && !frame.alliedKingAttacked && frame.hasNonPawnMaterial ...
9
public String name() { if (this.tooltip != null) return (this.tooltip); Resource res = this.res.get(); if ((res != null) && (res.layer(Resource.tooltip) != null)) { return res.layer(Resource.tooltip).t; } return null; }
3
private static void buildBasicSet(Release set, List<SeperatorDefinition> seps) throws MalformedURLException { for(MagicColor c: MagicColor.values()) { if (!c.includeInDefaultSets()) continue; SeperatorDefinition def = new SeperatorDefinition(); ...
4
public Chord pickRandomWeighted(Chord chord){ String next =""; double total = 0; String chordString = chord.toString(); if(histogram.get(chordString).isEmpty()){ return null; } for(Integer i: histogram.get(chordString).values()){ total+=i; } int random = (int) (Math.random()*(total+1)); for ...
5
public List<List<Integer>> subsetsWithDup(int[] num){ Arrays.sort(num); int size = num.length ; int total = (int)Math.pow(2,size); List<List<Integer>> result= new ArrayList<List<Integer>>(); for(int i=0;i < total;i++) result.add(new ArrayList<Integer>()); for...
6