Dataset Viewer
Auto-converted to Parquet Duplicate
method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
8905281e-c3a3-4c34-8be7-feaac26638c1
0
public int getNowYear() { return Integer.parseInt(sysNowTime[5]); }
c873dac2-1d74-43dd-9bce-f176f2eebcd3
6
public static void main(String[] args) { if (args.length >= 2 && args[0].endsWith("output:xml")) { File in = new File(args[1]); if (!in.exists()) { printUsage(); System.exit(1); } File out; if (args.length >= 3) { ...
542f1977-1c46-4920-b1ef-6337f2bc3f55
7
public void updateItem(HttpServletRequest arequest) throws Exception { for (int idx = this.getCount()-1; idx >= 0; idx--) { CNonadItem myitem = (CNonadItem) this.getItem(idx); String datid = "Ndate" + myitem.nonadmid; String serid = "NonSeries" + myitem.nonadmid; Strin...
043aabdc-6c10-423a-bf84-b0a788e53321
2
public List<Player> getPlayersInRegion() { List<Player> rangeList = new ArrayList<Player>(); for (Player p : FFA.getServer().getOnlinePlayers()) { Location loc = p.getLocation(); Vector vec = new Vector(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); if (this.contains(p.getWorld(), vec)) { rangeLis...
184e539c-8f43-4682-b469-cf642b3c5e4c
5
@Override public List<Framedata> translateFrame( ByteBuffer buffer ) throws InvalidDataException { buffer.mark(); List<Framedata> frames = super.translateRegularFrame( buffer ); if( frames == null ) { buffer.reset(); frames = readyframes; readingState = true; if( currentFrame == null ) currentFra...
62682731-6960-4e40-9fb6-b5475d6ff80c
8
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (!f.hasTag(FUNCTION_TAG)) { return super.execIdCall(f, cx, scope, thisObj, args); } int id = f.methodId(); switch (id) { ...
3c66754a-f412-4c5e-bb9f-69d505d0a16f
5
public void showPage(int page) { if (!hasPage(page)) page = 1; int start = elementsPerPage * (page - 1); System.out.println("====[" + title + " Page " + page + "/" + pages + titleContainer + "]===="); if (subtitle != null && !subtitle.isEmpty()) System.out.println(subtitle); for (int i = start; i < star...
0b8d67de-a6d0-4d79-b7b2-4823fbf9e1a4
6
public int largestRectangleArea(int[] height) { Stack<Integer> stk = new Stack<Integer>(); int index = 0; int result = 0; while (index<height.length) { if (stk.isEmpty()||height[stk.peek()]<=height[index]) { stk.push(index); index++; ...
3245157d-5556-466b-b18a-77a06c6b5bdf
3
private String getHeaderCaseInsensitive(String name) { Validate.notNull(name, "Header name must not be null"); // quick evals for common case of title case, lower case, then scan for mixed String value = headers.get(name); if (value == null) value = header...
d240ab83-c487-4121-917a-62c291bdefdd
7
public static void startupPropositions() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEXT$, (...
cb823820-b34d-4672-823e-fc1e08d1fd1d
8
public void GenerateTiles(){ for(int l=0;l<WrittenBlockID.length;l++){ for(int h=0;h<WrittenBlockID[l].length;h++){ for(int w=0;w<WrittenBlockID[l][h].length;w++){ if(l==0){ WrittenBlockID[l][h][w]=1; }else{ if(h==0){ WrittenBlockID[l][h][w]=2; }else if(h==WrittenWorldH-...
35e1512f-cd58-4777-94d5-76a934422188
2
private void displayReview() { ArrayList<Task> tasks = calendar.getTasks(); for (Task t : tasks) { if (TaskService.isTaskToday(t)) { System.out.println(t.toString()); } } }
e9b3a467-9db9-4064-aa74-a774aaa3412e
5
public ArrayList moves(Point point) { ArrayList a = new ArrayList(); Iterator it = point.neighbors().iterator(); while(true) { if (!it.hasNext()) break; Point point1 = (Point) it.next(); if (isInBounds(point1) && isOpen(point1) && !...
a36eb3c4-f54e-4778-b491-248ebf95e645
0
public void setEmail(String email) { this.email = email; }
b9b40b43-d5c2-4e6c-9b14-acefa5be0b4b
4
private static void writeTextFile(Path path){ BufferedWriter bufferWriter=null; try{ //apertura del stream. StandardOpenOption.CREATE->si el fichero no existe se crea bufferWriter=Files.newBufferedWriter(path, java.nio.charset.StandardCharsets.UTF_8, java.nio...
ef535a66-3951-4e9a-8b0d-05dcffd4a4e4
4
private String assembleAuthority( String host, int port, String userInfo, String authority ) { if (authority != null) { return authority; } StringBuffer buf = new StringBuffer(); // UserInfo if (userInfo != null) { buf.append(userInfo); buf.append(USERINFO_DELIM); } // Host. Not...
8d6abf97-b3d7-413f-bf97-9933a89cd06e
2
public int yCoordToRowNumber(int y) { Insets insets = getInsets(); if (y < insets.top) return -1; double rowHeight = (double)(getHeight()-insets.top-insets.bottom) / rows; int row = (int)( (y-insets.top) / rowHeight); if (row >= rows) return rows; else retu...
f2cb1062-da61-4edb-95b0-35ea63d99088
8
public TSValue abstractRelationalComparison(final TSValue right) { TSNumber ny = right.toNumber(); // if nx is NaN return undefined if (Double.isNaN(this.getInternal())){ return TSUndefined.value; } // if ny is NaN return undefined else if (Double.isNaN(ny.getInternal())) { return TSUndefined.va...
a7faa15a-693a-462a-9cdb-c6cb32243c00
1
private static int parseInt(String s) { if (s.startsWith("0x")) { return Integer.parseInt(s.substring(2), 16); } else { return Integer.parseInt(s); } }
54c663bf-35fb-4175-a4c8-720ae9cca3c7
6
public static void render(Entity e, Graphics2D g) { Color oldColor = g.getColor(); Font oldFont = g.getFont(); if (e instanceof Asteroid) { renderAsteroid((Asteroid) e, g); } else if (e instanceof Ship) { renderShip((Ship) e, g); } else if (e instanceof Bullet) { renderBullet((Bullet) e, g); } e...
1f5c5021-c4b3-423c-b36e-5f992da9d71c
4
private void activateRow() { // Make sure the file exists (and that something is selected) if(MainFrame.getInstance().selectedFile != null && MainFrame.getInstance().selectedFile.toFile().exists()) { // Go into directories if(MainFrame.getInstance().selectedFile.toFile().isDirectory()) { logger....
06138f5e-3c39-46ca-a9c4-a0336cdcd66e
3
public boolean resetPasswordWithToken(Token t, User u, Map<String,String> parameters) { if (!parameters.containsKey("password") || !parameters.containsKey("reset_token")) { GoCoin.log(new Exception("Invalid parameters for resetPasswordWithToken!")); return false; } //TODO: pull out map keys a...
b7e9ab2f-4872-49ee-b561-0e34223d1a50
8
public boolean hasChild(String child_key) { String[] split = child_key.split("[.]", 2); // This should never occur but just in case if (split.length == 0) { return false; } else if (split.length == 1) { // child key was a single name return children.containsKey(child_key); } else if ((split.length ...
5d9d30c6-6d9b-4d67-8f69-808213b4157b
6
public final double nextDouble() { if(mti >= 624) { int i2; for(i2 = 0; i2 < 227; i2++) { int i = mt[i2] & 0x80000000 | mt[i2 + 1] & 0x7fffffff; mt[i2] = mt[i2 + 397] ^ i >>> 1 ^ mag01[i & 1]; } for(; i2 < 6...
2719a998-60a9-4f52-ab78-7e8f7def766a
2
public void launch(int threads){ service = Executors.newFixedThreadPool(threads); for (int i = 0; i < tblData.size(); i++) { String url = tblData.get(i)[0]; Runnable worker = new WebWorker(url, i, frame); if (!Thread.interrupted()) { service.submit(worker); } else { break; } } service....
bb2849f0-b01b-4481-ac82-726289792d99
7
public void put(String key, Object value) { // если корня нет - вставить в корень if (root == null) { Node newNode = new Node(key, value); root = newNode; } else { boolean inserted = false; Node currentNode = root; while (!inserted) { int compare = key.compareTo(current...
a1f5a1ea-3264-4194-910c-69bdfde2a788
0
private int hash(PageId pageNo) { return (pageNo.pid % HTSIZE); } // end hash()
4dda6dc7-2d02-4d12-a207-ee6a6f920232
5
public int threeSumClosest(int[] num, int target) { Arrays.sort(num); int mx =num[0]+num[1]+num[2]; int sum =0; int length = num.length; for (int i = 0; i < length-2; i++) { int j = i + 1; int k = length - 1; while (j < k) { sum...
446472aa-9179-4408-87fb-a47c79864557
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Prescale other = (Prescale) obj; if (moduloDivide == null) { if (ot...
f79ec0f9-83e2-4ff0-a976-1b402e23eb0f
3
private void grow() { Bucket[] oldBuckets = buckets; int newCap = buckets.length * 2 + 1; threshold = (int) (loadFactor * newCap); buckets = new Bucket[newCap]; for (int i = 0; i < oldBuckets.length; i++) { Bucket nextBucket; for (Bucket b = oldBuckets[i]; b != null; b = nextBucket) { if (i != Math....
1a7ea957-91fc-41fd-89e2-fe1ed26edc0d
0
public World getCurrentWorld() { return currentWorld; }
19516f90-8356-4327-b587-8ec0f61a9624
5
private void noloteFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_noloteFieldKeyTyped // TODO add your handling code here: if (!Character.isLetterOrDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && evt.getKeyChar() !='-' && evt.getKeyChar() != '.') {...
c1aa3f06-1db0-44bf-9ab5-87c5d9b86236
9
public static void inputFleet(Player p){ String nameBoat = ""; for(int i=0; i<GameConfiguration.gameConfiguration_NBSHIP; i++){ boolean add = false; while(!add) { Ship s = null; System.out.println(Game.display(p.myGrid.displayOwnGrid())); switch(i) { case 0: nameBoat = "Get ready...
412919f0-2a9d-45f2-83b8-8a07933be9d4
2
public void optionsChangedListener() { volume = Application.get().getOptions().soundVolume(); musicVolume = Application.get().getOptions().musicVolume(); for(IntBuffer source : sources) { AL10.alSourcef(source.get(0), AL10.AL_GAIN, volume); } if(currentMusic ...
df0158f6-721f-4b95-b02d-c2845331ebb3
5
public static void main(String arguments[]){ try{ if(arguments != null && arguments.length > 0 && "--help".equalsIgnoreCase(arguments[0])){ log.info(ArgsParser.help); return; } Args args = new ArgsParser().parse(arguments); printArg...
617fb295-4d67-48a0-a791-7bd198730436
8
final public Sort[] CobSortsDecl(Module module) throws ParseException { Sort[] sorts; Vector vec = new Vector(); Sort sort; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SORT: jj_consume_token(SORT); break; case SORTS: jj_consume_token(SORTS); break; default: jj_...
8fd5e788-bba8-4e74-a34e-c2a1dc7905f3
3
TetrisPiece() { int type = (int) (NumBrickTypes * Math.random() ); //rand() % globals.NumBrickTypes; int pose = (int) (NumPoses * Math.random() );//rand() % globals.NumPoses; brickType = type; brickPose = pose; width = bricks[type][pose].w; height = bricks[type][pose].h; xposition = COLS/2 - 1; yposit...
b0b457f1-b088-4751-9157-8af8ef45c068
0
public FileChangeEvent(Environment environment, File oldFile) { super(environment); this.oldFile = oldFile; }
3727a1d1-fe34-48b7-a0a5-ccf0ba3f38f1
4
@Override //public int getDistribution(double standardDeviation) public int getDistribution() { //********************* //mean = this.mean(); //********************* //keeps track of packets created int PacketCounter = 0;...
1891e73b-9743-4d43-847c-e7f75ef86820
5
@Override public void keyPressed(KeyEvent paramKeyEvent) { int id = paramKeyEvent.getKeyCode(); if (id == KeyEvent.VK_Q) { currenth = "blackmage"; } else if (id == KeyEvent.VK_W) { currenth = "ninja"; } else if (id == KeyEvent.VK_E) { currenth = "warrior"; } else if (id == KeyEvent.VK_R) { ...
1b14a3fd-38f1-439d-a28a-89f9d8dae3f0
3
public Server() { ExecutorService executor = null; ServerSocket serverSocket = null; try { /** * Создание сокета сервера для заданного порта * */ serverSocket = new ServerSocket(PORT); System.out.println("Waiting"); /** * Создание пула с числом потоков, равному AMOUNT_OF_THREADS * *...
e024aefd-e4b5-454d-b6a3-96cc495ed277
7
private List<Itemset> aprioriGen(List<Itemset> seed, int k) { List<Itemset> candidateList; // Populate candidate large itemsets by either a sql query // or hand-written main-memory join algorithm if (usesql) { DBAccess db = new DBAccess(); //this returns a new candidate list candidateList = db.po...
d673a4ec-61e0-4ce7-96d7-42b4cdd0614c
9
protected TextIDPair readNextDocText(BufferedReader docIn) throws IOException{ String line = docIn.readLine(); // find the beginning of the document while( line != null && !line.startsWith(".I") ){ line = docIn.readLine(); } if( line == null ){ return null; }else{ // figure out what the...
50da1fe7-8969-48c5-ab29-bfcd07d36f75
1
public CharSeqHelper(CharSequence... charSequences) { s = new StringBuilder(); for(CharSequence c : charSequences) { s.append(c); } }
ada63c9b-9d16-4438-be73-1218ef3e9a52
2
public static void main(String[] args) throws Exception { //Verify arguments if (args.length != 5) { usage(); } DatagramSocket mailbox = null; String serverHost = null; int serverPort = 0; String clientHost = null; int clientPort = 0; String name = null; try { //Create the socket ...
bd428144-9f3b-4419-839e-86a4e65f6a2f
2
public synchronized void bake() { if (events != null) return; // don't re-bake when still valid List<RegisteredListener> entries = new ArrayList<RegisteredListener>(); for (Entry<Priority, ArrayList<RegisteredListener>> entry : muffinbag.entrySet()) { entries.addAll(entry.getValue()); } events = entries.to...
3a1b6955-4333-49ab-8f13-22d96b1bb314
2
public JDBCConnect() { String driver = "com.mysql.jdbc.Driver"; String artlcle_url = "jdbc:mysql://localhost:3306/zhangyu_sca"; String user = "root"; String password = "root"; try { Class.forName(driver); Connection article_conn = DriverManager.getConnecti...
f0079496-5237-4709-8636-b4c9825035ce
2
private void CheckViolentSpeech(String message, String sender, String channel) { for(String word: m_ViolentWords) { if(message.toLowerCase().contains(word)) { sendMessage(channel, "Nana, sowas sagt man aber nicht, " + sender); break; ...
bd87b567-09f7-4c94-9a6e-8756f8f05e56
9
public boolean exist2Rec(char[][] board, String word, int pos, int i, int j){ if(pos == word.length()) return true; if(isValidIdx(i, j) && !visited[i][j] && pos < word.length() && board[i][j] == word.charAt(pos)){ visited[i][j] = true; if(exist2Rec(board, word, pos+1, i-1, j)) re...
5a7d91d7-4dbe-432d-9707-706451df5317
9
static protected void FillBuff() throws java.io.IOException { if (maxNextCharInd == available) { if (available == bufsize) { if (tokenBegin > 2048) { bufpos = maxNextCharInd = 0; available = tokenBegin; } else if (tokenBegin < 0) bufpos...
d1debce1-1402-427a-9cc1-ad23c04d4fc2
2
public Pair getCrossoverPoints(int delta){ Pair pair = new Pair(); int len = this.bins.size(); if(len == 0) return null; pair.x = randRange(0, len - 1); if(pair.x == (len - 1 )){ pair.y = len; } else { pair.y = randRange(pair.x, pair.x + delta); } return pair; }
4bcaab73-b9fb-4007-987a-827446b67b1c
2
public void InsertaInicio (int ElemInser) { if (VaciaLista()) { PrimerNodo = new NodosProcesos (ElemInser); PrimerNodo.siguiente = PrimerNodo; } else { NodosProcesos Nuevo = new NodosProcesos(ElemInser); NodosProcesos Aux = PrimerNodo; while (Aux.siguiente !=PrimerNodo) Aux = Aux.siguiente; ...
5bceb4d0-e248-47f4-89e6-94a6c94b13c5
9
public Causa ingresoTestigoPorTeclado(){ @SuppressWarnings("resource") Scanner scanner = new Scanner (System.in); String texto; int expediente; Long dni; Causa causa = new Causa(); try { System.out.println("Agregar Testigo a Causa"); System.out.println("-----------------------"); while (true) { ...
f63c9fd2-0bd3-40b9-aaf4-015d52ae673e
9
public static TextBuffer listToJava(List<Exprent> lst, int indent, BytecodeMappingTracer tracer) { if (lst == null || lst.isEmpty()) { return new TextBuffer(); } TextBuffer buf = new TextBuffer(); for (Exprent expr : lst) { TextBuffer content = expr.toJava(indent, tracer); if (conten...
72c32312-df75-45aa-9c05-bea762e9d809
1
@GET @Path("/{repoName}/prime") @Produces(MediaType.TEXT_PLAIN) public String primeRepositoryCache( @PathParam("repoName") String repoName, @Context HttpServletRequest request) { try { dao.primeCache(getBaseUrl(request), repoName); } catch (Except...
73929c19-7073-4fca-81fe-85b358d00e33
1
@Override public void displayLog(String[] presentStatusLog) { for (String s : presentStatusLog) { logModel.addElement(s); } }
8b4b1131-db43-406b-b742-456e99f802fd
8
public boolean validBlackMovement(double x1, double y1, double x2, double y2, Square newSquare) { boolean move = false; if( ((x2 == x1) && (y2 == y1 - PAWN_MOVEMENT_RESTRICTION)) && newSquare.getPiece().getPieceType() == "-") { move = true; super.setHasMoved(true); } else if( ((x2 == x1 && (y1 == B...
1559d585-b756-4d11-bc14-c708ebc15fd9
5
@Override public void mouseDragged(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && first != null) { mxRectangle dirty = current; current = new mxRectangle(first.x, first.y, 0, 0); current.add(new mxRectangle(e.getX(), e.getY(), 0, 0)); if (dirty != null) { ...
e66405ae-967a-4717-8d6e-85daf4c5dd75
6
protected void onUpdateTetris( int keyCode ) { long time = System.currentTimeMillis(); if ( keyCode != 0 ) { int dir = Block.DOWN; switch ( keyCode ) { case KeyEvent.VK_LEFT: dir = Block.LEFT; break; case KeyEvent.VK_RIGHT: dir = Block.RIGHT; break; case KeyEvent.VK_D...
d0e2302a-f7c1-43b7-a04f-8208839d84e4
8
protected double[] makeDistribution() throws Exception { double total = 0; double[] distribution = new double[m_TrainBags.numClasses()]; boolean debug = false; total = (double)m_TrainBags.numClasses() / Math.max(1, m_TrainBags.numInstances()); for(int i = 0; i < m_TrainBags.numClasses(); i++)...
f31c579e-83d6-4675-a745-d00dd2835699
8
private QueueInterface<T> checkPostfix(QueueInterface<T> postfix) throws DAIllegalArgumentException, DAIndexOutOfBoundsException, BadPostfixException { if(postfix.getSize() < 3 && (postfix.getSize()%2) == 1)//makes sure the size of infix is greater than 3 and is an odd number { throw new BadPostfixException(); ...
2e922368-4380-43be-9a1f-ff48f5f0edb9
9
public boolean checkPasswd(String id, String passwd) { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = getConnection(); pstmt = conn .prepareStatement("select password from member where id=?"); pstmt.setString(1, id); rs = pstmt.executeQuery(); if ...
7e1308ae-8c7a-4859-a031-738fb941bbbe
4
private void initializeArrayField(JimpleBody new_body, SootField f, String type, Local local2, Value prev_val) { if( type!= null && type.equals("int")){ Stmt assStmt = Jimple.v().newAssignStmt( prev_val, Jimple.v().newInstanceFieldRef(local2, f.makeRef())); SootMethod m = Scene.v().getMethod("<java.uti...
fd9a6abe-6971-4cb2-8e1c-e9d49530451c
4
public void print_classifier() { int c, f, i, j; for (c = 0; c < classes; c++) { System.out.println(data.classlist[c]+":"); for (f = 0; f < features; f++) { System.out.print(" "+f+"{"); for (i = 0; i < iterations; i++) { System.out.print(i+"["); for (j = 0; j < classifiers[c][f][i]....
596bddbb-a73c-4874-a1bb-180239130c3f
1
public void addPointObject(SVGCircleElement graphic) throws XPathExpressionException, DOMException { String osmNamespace = xpath.getNamespaceContext().getNamespaceURI("osm"); SVGOMTextElement text = (SVGOMTextElement) xpath.evaluate("//svg:g[@id='map']/svg:text[(@k='species' or contains(@class, 'caption-core') or c...
164795a0-24db-4efd-8df0-6c9753e347c0
3
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == submit) { // Window work game.getControlPanel().setSubmitted(true); HumanPlayer humanPlayer = (HumanPlayer) game.getPlayers().get(0); humanPlayer.setHumanMustFinish(false); setVisible(false); game.getBoard().unhighl...
83344468-ae22-4a39-ae4a-6de45942cdd8
8
private float calculateTBonds() { int n = model.tBonds.size(); if (n <= 0) return 0; TBond tBond; float energy = 0; synchronized (model.tBonds) { for (int i = 0; i < n; i++) { tBond = model.tBonds.get(i); atom1 = tBond.getAtom1(); atom2 = tBond.getAtom2(); atom3 = tBond.getAtom3(); ...
8058abf3-b452-44a1-91db-de1660f2ab1b
8
public Frame3() { try{ Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL,USER, PASS); statement = conn.createStatement(); }catch(SQLException se){ se.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } setTitle("KutaRaya, 19 - 31"); setDefaultCloseOperation(J...
4b30c71e-d0a0-49d6-a2d5-e3ee02b95c14
6
public Boolean parse(final boolean current) { for (String s : TOGGLE_VALUES) { if (string.equalsIgnoreCase(s)) { return !current; } } for (String s : POSITIVE_VALUES) { if (string.equalsIgnoreCase(s)) { return true; ...
cb70bcbd-463e-4e62-9712-da88edb072e9
8
private long readNumber ( int side, int l, boolean FF ) { long r = 0, b = 1; int q=0; byte[] g = new byte[l]; try { fcdx.read(g); } catch (IOException e) { e.printStackTrace(); } if(side>0 && l>1) b<<=((l-1)<<3); for(int i=0;i<l;i++) { q = g[i]; if(q<0) q+=0x100; if(q!=0xff) FF=false; r|= ...
561eb515-95df-4136-bbf2-f61edb47896d
2
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page = ConfigurationManager.getProperty("path.page.directions"); String prevPage = (String) request.getSessionAttribute(JSP_PAGE); resaveParamsShowDirections(request); formDirectionLi...
49501e62-c753-4098-b5a4-3492569676c1
9
public ArrayList<Move> whiteUrgentMoves(ArrayList<Move> allWhiteMoves) { ArrayList<Move> rez = new ArrayList<Move>(); // if black king isn't near any pieces, it can't eat them if (this.piecesNearPosition(this.piecePosition[28]).size() == 0) { return rez; } for (Move currMove : allWhite...
85438b4b-8043-43f8-a921-41b0ad3b3ea6
3
public Info() { setTitle("Info"); //this.setLocationRelativeTo(null); this.setIconImage(new ImageUtil().getLogo()); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setBounds(100, 100, 575, 409); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5))...
c8f8d00b-8660-4b37-a8b2-f77f1ad6bf21
4
public static void main(String[] args) { int t; int SIZE = 5; int[] inputArray = new int[SIZE]; //-----------Take user input---------------// Scanner element = new Scanner(System.in); System.out.println("Enter Element : "); for (int i = 0; i < SIZE; i++) { inputArray[i] = element.nextInt(); } ...
4cebf230-f824-4081-a1e9-37acd1b78b3b
4
private static int getOlympianNumber(String pathToFile) { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader( pathToFile)); } catch (FileNotFoundException e1) { e1.printStackTrace(); System.out.println("file not found"); } String line = null; int i = 0; try {...
65ad3ab6-435d-4ccc-bcbb-78a3dbeadd70
2
public void obfuscateProject() { if (variablePanel.getVariableListSize() == 0) { MessageDialog.displayMessageDialog(this, "INFORMATION_DIALOG", "NO_VAR_TO_OBF"); return; } if (!destinationDirectory.equals("")) { setActionButtonsEnabled(false); tabbedPanel.setSelectedComponent(variablePanel); Thread...
35452fa8-e501-4ae7-8ba3-0b1e35f790f0
1
public void exec(){ try { ArrayList<String> erg = util.networkCommand("ps -e | wc -l"); count = Integer.parseInt(erg.get(0)); System.out.println(count); } catch (Exception e) { System.out.println(e.getMessage()); } }
91db6bad-7daf-4c94-b780-00cb4045fa29
7
public void move() { Random generator = new Random(); int num1 = generator.nextInt(4); if (num1 == 0) { x -= 5; y -= 5; } else if (num1 == 1) { x -= 5; y += 5; } else if (num1 == 2) { x += 5; y -= 5; ...
fdefba67-5d97-42fb-8a85-f32d19377091
2
public int etsiVasenX(){ int vasX = 9; for (Palikka palikka : palikat) { if (palikka.getX() < vasX){ vasX = palikka.getX(); } } return vasX; }
bd3c7f34-0e0a-4f89-b3ae-23cfaca7d1e1
7
@Override public boolean isValid(Object value, ConstraintValidatorContext context) { if (!new RequiredValidator().isValid(value, context)) { return true; } Date dateValue = (Date) value; if (!util.isValid(annotation, dateValue, context)) { if (annotation.message().isEmpty()) { buildConstraintViolat...
9b846cf7-b118-448e-bb00-d5aec1d87163
0
public List<Step> getSteps() { return steps; }
7d872e57-6bd0-4417-8205-4b943179260a
3
private void addWordTop(String word, int occur) { if (occur > 255) occur = 255; char firstChar = word.charAt(0); int index = indexOf(roots, firstChar); if (index == -1) { CharNode newNode = new CharNode(); newNode.data = firstChar; newNode.freq = occur...
b1c2e579-1691-4895-94b6-9d734257b97f
9
public void manage() { super.manage(); List<Evenement> events = new ArrayList<Evenement>(); List<Incendie> incendies = this.donnees.getIncendies(); List<Robot> robots = this.donnees.getRobots(); long dateSimulation = this.simul.getDateSimulation(); int indiceIncendie = 0; while(indiceIncendie < incendies...
f2ee36bc-f9b7-493e-96d9-2cbdc0548569
3
public final void waitForTasks() { synchronized (this.taskPool) { while ((this.runningTasks > 0) || !this.taskPool.isEmpty()) { try { this.taskPool.wait(); } catch (final InterruptedException e) { this.master.interrupt(); } } } }
a7d452ce-a121-41e5-991a-696e58580798
5
@Override public void actionPerformed(ActionEvent e) { // If the new game button was pushed, reinitialize everything and repaint if (e.getSource() == newGame){ fPanel.proj = new Projectile(90,400); fPanel.targetLeft.setHit(false); fPanel.targetMid.setHit(false); fPanel.targetRight.setHit(false);...
ee802272-cfee-462e-8b34-652366bbf423
7
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TCPAddress other = (TCPAddress) obj; if (inetAddress == null) { if (other.inetAddress != null) { return false; ...
42490f41-8818-494f-a688-80a9d548f598
6
public Map<String, Integer> getGenreCounts() throws Exception { Connection connect = null; Statement statement = null; ResultSet resultSet = null; // Each element of the collection genreMap contains the name of a genre and its count Map<String, Integer> genreMap = new HashMap<String, Integer>(); tr...
4f77a324-57f5-427b-a450-29687a6ae870
3
public void visitIfCmpStmt(final IfCmpStmt stmt) { stmt.left().visit(this); // search the left branch if (!found) { // if nothing has been found exchangeFactor++; // increase the exchange factor, if (stmt.left().type().isWide()) { exchangeFactor++; // twice to get } // around wides if (exchangeFa...
b113229f-45b5-468d-8a22-ba4a7a31efb3
4
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub String outputJson = ""; PrintWriter out = response.getWriter(); try { String method = request.getParameter("method").toLowerCase( Locale.ENGLISH); ...
0b6d50c9-ecf8-43b1-9bf2-a7f261cf70fd
9
public void setTooltipZeroText(String zeroTip) throws IllegalStateException { if ((ttip_text == null) && (zeroTip != null)) throw new IllegalStateException("Must call setTooltipText first"); boolean isZero = (intValue == 0); ttip_text_zero = zeroTip; // Remember new ze...
6eb5e79c-d67e-41b6-a30e-3e82bf8a54e3
4
public TestArray7x7(){ arr7x7 = new Array7x7(); colLeftPanel = new JPanel(); colRightPanel = new JPanel(); arrayPanel = new JPanel(); commandPanel = new JPanel(); moveLeftButton = new JButton("moveLeft"); moveRightButton = new JButton("moveRight"); colLeft = new JTextField[7]; colRight = n...
d6fafe96-4230-4563-ab9b-853ad50620a9
9
public void svgPath(double x, double y, UPath path, double deltaShadow) { manageShadow(deltaShadow); ensureVisible(x, y); final StringBuilder sb = new StringBuilder(); for (USegment seg : path) { final USegmentType type = seg.getSegmentType(); final double coord[] = seg.getCoord(); if (type == USegment...
ba55ef52-0c91-43cd-9d18-1b5a9ddba5ac
2
public static void handle(String[] tokens, Client client) { if(tokens[1].equals("-")) { try { Thread.sleep(1); } catch (InterruptedException e) { /* Do Nothing */ } client.send(PacketCreator.pong()); } }
7baaa615-0e3c-49e0-ac05-f3893a13a3bd
1
@SuppressWarnings("deprecation") @EventHandler(priority=EventPriority.LOWEST) public void onItemDrop(final PlayerDropItemEvent event) { if(opposite.containsKey(event.getPlayer().getName())) { event.setCancelled(true); Bukkit.getScheduler().runTaskLater(instance, new Runnable() { public void run() { ...
eb1e3760-8d6f-43bb-9eb1-60b640506321
7
public void run() { try { s = new ServerSocket(port); synchronized (this) { notifyAll(); } while (!quit) { try { r = s.accept(); final BufferedReader in = new BufferedReader(new InputStreamReader(r.getInputStream())); String str = in.readLine(); for (; str !...
c0d3eca0-a1f8-4bb4-aa01-5d42fdcdad27
7
public static void startupUnitSupport() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/UNIT-SUPPORT", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTE...
d407035f-b3af-449c-8a3b-afccec851b4f
2
public void repondre(HttpServletRequest requete, HttpServletResponse reponse, String action) throws ServletException, IOException { Utilisateur u = UtilisateurService.utilisateur(requete); Role roleUtilisateur = u != null ? u.getRole() : Role.Visiteur; if (roleUti...
16b4bba5-ccc7-481a-adcb-45393812416b
8
private void removeListener() throws NoSuchMethodException, SecurityException, IllegalArgumentException, IllegalAccessException { Class<?> guiType = getGui().getClass(); Class<?> type = guiType; while (type != null && !type.equals(Object.class)) { for (Field field : type.getDeclaredFields()) { if (JCom...
77e424a4-fda1-448f-9a52-31e21f4ccaf1
8
public static void main(String[] args) throws IOException { ArrayList<Img<Color>> els = new ArrayList<Img<Color>>(); Random r = new Random(/*2413*/); String[] FONTS = { "Times", "Georgia", "Optima", "Times New Roman" }; for (int i = 0; i < 200; i++) { TreePredict.Img<Color> timg = TreePredict.getImg("a", new...
f7fb652d-03ca-42d0-a690-ed0a51d207f2
1
public void visitAttribute(final Attribute attr) { super.visitAttribute(attr); if (fv != null) { fv.visitAttribute(attr); } }
End of preview. Expand in Data Studio

YAML Metadata Error:"language[0]" with value "java" is not valid. It must be an ISO 639-1, 639-2 or 639-3 code (two/three letters), or a special value like "code", "multilingual". If you want to use BCP-47 identifiers, you can specify them in language_bcp47.

YAML Metadata Error:"pretty_name" must be a string

README.md exists but content is empty.
Downloads last month
582