method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
1aaad3dc-2b90-4577-8679-9b3187aee407
0
private Colors(String name) { realName = name; }
b326041e-cdd1-4c1a-9414-103d2c66bd88
1
public void moveTo(int c, int r) { if (humanPlaying()) { gui.Sound.play("sound/move.wav"); } log.emit(currentUnit.type.name+" ("+currentUnit.getOwner().getColor().name+") ruszył się na pole ("+(r+1)+", "+(c+1)+")"); core.Point pos = p2u.get(currentUnit); p2u.remove(currentUnit); p2u.put(r, c, currentUni...
47b74c84-c3c8-46f4-9b11-7cb36cc70511
4
@SuppressWarnings("unchecked") private Class<IPlugin> loadOnePluginClass(String className) { try { logger.info("Request for loading class " + className + " by " + this); Class<?> loadedClass = loader.loadClass(className); // check that the class is of the right type if (ptype.isAssignableFrom(loade...
01858ec6-4142-4643-80ca-68107a345087
4
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((extendsProp == null) ? 0 : extendsProp.hashCode()); result = prime * result + ((properties == null) ? 0 : properties.hashCode()); result = prime * result + ((typeFormat == null) ? 0 :...
1a5b970d-2914-43b8-a861-3229582938d7
0
public void setPc(int branchTo) { pc = branchTo; }
06a10905-fe03-4c2a-90c4-69c7ad27cf67
3
public void searchOffline(String q) { searchResult.clear(); ArrayList<Product> off = Main.products; if(!q.equals("")) for (int i = 0; i < off.size(); i++) { if (off.get(i).getpId() == Integer.valueOf(q)) { searchResult.add(off.get(i)); break; } } }
7a4b49cd-699e-4ee9-a86b-0bc14c45f43d
3
public static ArrayList<bConsultaDef> getConsultaAsistec(String arg_prod, String arg_data) throws SQLException, ClassNotFoundException { ResultSet rs; ArrayList<bConsultaDef> sts = new ArrayList<bConsultaDef>(); Connection conPol = conMgr.getConnection("PD"); if (conPol == null) { ...
40c95f7c-0ea1-4fd6-ae60-b2e14026aa19
5
@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 Customer)) { return false; } Customer other = (Customer) object; if ((this.customerId == null && other.customer...
4c279ee0-6e50-4044-978a-e062e95e12b6
2
void makeLink(Match match) { match.prevHTM = match.prevATM = null; if (prevMatch.containsKey(match.homeTeam)) { match.prevHTM = prevMatch.get(match.homeTeam); } if (prevMatch.containsKey(match.awayTeam)) { match.prevATM = prevMatch.get(match.awayTeam); } ...
77b59b5e-212d-488b-b37a-7d2f4d80fd03
5
public String dailySalesReport() { ReportService service; try { service = new ReportService(); SimpleDateFormat date= new SimpleDateFormat("dd/MM/yyyy"); java.util.Date temp_date=date.parse(this.date); this.dailyReport=(ArrayList<Item>)service.generateDailySalesReport(temp_date); for...
3390c7eb-fd45-4793-9917-075a818f37b6
9
public static void main(String[] args) throws Exception { BufferedReader br1 = new BufferedReader(new FileReader( "res/kaggle_triplets.csv")); BufferedReader br2 = null; // train_triplets // kaggle_visible_evaluation_triplets BufferedWriter wr = null; long start = System.currentTimeMillis(); try { ...
ffb57e1f-602b-4aa1-b7f8-d91d133dd19e
9
@Override public Vector pickWordToFill(Crossword c, Direction direction) { Preconditions.checkNotNull(direction); if (direction == Direction.ACROSS) { for (int y = 0; y < c.getHeight(); ++y) { for (int x = 0; x < c.getWidth(); ++x) { String word = c.getWord(x, y, direction); if (word.length() > 1...
8a4d85b3-9b10-4653-bdf6-59af0bb670b2
3
public static void main(String[] args) { Scanner input = new Scanner(System.in); int cases = input.nextInt(); for (int q = 1; q <= cases; ++q) { int size = input.nextInt(); for (int i = 0; i < size; ++i) { int j = input.nextInt(); ...
cd99573d-38f8-4318-ae90-75745c3f7bb8
2
public BasicAction(String name, String longDescription, String actionCommand, ImageIcon small_icon, int mnemonic, KeyStroke keyStroke) { super(); actionListeners = new EventListenerList(); putValue(Action.NAME, name); putValue(Action.LONG_DESCRIPTION, longDescription); putValue(Action.SHORT_DESCRIPTION...
423e30c9-2091-45e5-ab20-9fb0b9f46e11
0
public void setPool(ITicketPool value) { this._pool = value; }
a1d3fe25-c2e3-4f69-80ee-60b424ddf6ea
1
public static void listEmployeesWithProject(EntityManager entityManager) { TypedQuery<Employee> query = entityManager.createQuery( "select e from Employee e join fetch e.projects", Employee.class); List<Employee> resultList = query.getResultList(); entityManager.close(); for (Employee employee : resul...
52f8d8fc-3e9f-4419-a829-0514427cd2e3
2
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page = ConfigurationManager.getProperty("path.page.order"); String prevPage = (String) request.getSessionAttribute(JSP_PAGE); showSelectedOrder(request); if(page == null ? prevPage ==...
434522dc-547a-49ec-b364-35f6fac27b9a
2
protected void handleProxyPost(HttpRequest request) { URL url = request.getUrl(); Socket socket; InputStream remoteInputStream = null; OutputStream remoteOutputStream = null; try { int port = url.getPort(); socket = new Socket(url.getHost(), port == -1 ? 8...
134e4b5b-f987-4f6f-a7b6-85f391a68819
3
public void SetAverageNumberOfPersons() { if(averageNumberOfPersons != 0) { if(Count() !=0) { averageNumberOfPersons = (averageNumberOfPersons + Count())/2; } //System.out.println("Bus-Stop: " +this.busStopNumber+", Average number of Persons: "+ave...
9d3425d9-ab46-4520-835a-f5e6b69a473e
7
private void loadIdCounts() { try { idCounts.clear(); if (saveHandler == null) { return; } File file = saveHandler.getMapFileFromName("idcounts"); if (file != null && file.exists()) { ...
3c676047-2788-49ef-b6b2-474d6dec2678
8
public static Stella_Object selectInstanceWithBacklinks(Cons instances, Surrogate relation) { relation = relation; { Stella_Object i = null; Cons iter000 = instances; for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) { i = iter000.value; if ((i != null) && (!false)...
a0ce094d-bf88-4091-a332-ad3fafa27ac4
8
private boolean readFeed() { try { // Set header values intial to the empty string String title = ""; String link = ""; // First create a new XMLInputFactory XMLInputFactory inputFactory = XMLInputFactory.newInstance(); // Setup...
b052fafd-5ad5-4a41-a12f-1e01921e9b6a
1
@Test public void testAddToEnd() throws Exception { List<String> list = new List<>(); list.addToEnd("test1"); list.addToEnd("test2"); list.addToEnd("test3"); for (String current : list) { assertTrue(list.exist(current)); } }
f8e197af-13f6-4dab-8954-729efd503d77
9
@Override public void keyPressed(KeyEvent e) { if (gameRunning) { /* * If the change in direction cannot be applied immediately, keep * track of the direction specified in case the change in * direction can be applied later. */ ...
c2ac9caf-0504-4488-9e3f-f5bf4c0f2bf6
8
public static void checkVersion(LauncherAPI api) throws Exception { boolean update = false; final List<Map<String, Object>> versions = api.getConfig().getMapList( "updater.versions"); for (final Map<String, Object> version : versions) { i...
d40336fe-e9c6-4528-8b79-f8bdfeaf6dde
9
private static TipusEquip llegirEquip(String msg) { TipusEquip equip = null; try { boolean ok = false; String s; int x = 0; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while(!ok) { System.out.print(...
faeda2c8-59c7-45bb-aaf8-585c4db44347
4
public String Ganador(boolean Estado, int opcion2, String jugador2, String jugador1, String turno2) { if (opcion2 == 5 && this.turno2.equals("j2") || opcion2 == 8 && this.turno1.equals("j1")) { return "Ganador de la partida" + ": " + jugador2; } return "Perdedor de la partida" + ": ...
a884a307-671a-40a4-b6ec-124c6b2788f1
4
@Override public void run() { try { while (true) { Object obj = in.readObject(); Server.s.handleMessage(clientNR, obj); } } catch (IOException e) { System.out.println("Client["+clientNR+"] quits"); try { out.close(); } catch (IOException e1) { e1.printStackTrace(); } ...
deda5613-fad0-40ec-a163-39b8d432ed35
7
public static boolean checkBipartite(Graph graph) throws Exception { // get all vertices ArrayList<Vertex> vertices = graph.getVertices(); // pick an initial color Color initialColor = Color.BLACK; // get initial vertex Vertex initialVertex = vertices.get(0); // paint initial vertex with initial color i...
e93d80ac-b6ce-49a6-a836-3d5352da964a
0
public X509DataType createX509DataType() { return new X509DataType(); }
3fb64e8a-5863-4997-bd43-dd9f48008621
0
public void input(String string) { myTarget=string; startParseInput(string, null); }
3b824dc0-c0f7-4e48-9b97-42671f1ec1fd
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SearchState other = (SearchState) obj; if (board == null) { if (other.board != null) retu...
ebccfa12-01c0-48cc-84d7-d570b8c7acb4
8
public Double getUnnormalizedDataPoint(String sample, String taxa) throws Exception { int x = -1; for (int i = 0; x == -1 && i < getSampleNames().size(); i++) if (sample.equals(getSampleNames().get(i))) x = i; int y = -1; for (int i = 0; y == -1 && i < getOtuNames().size(); i++) if (taxa.equals(...
92a54188-734e-4805-bbfa-090fbc2e6d6e
1
public PulsPlugin(String name, String password) { try { String pulsLogin= "https://puls.uni-potsdam.de/qisserver/rds?state=user&type=1&" + "asdf=" + name + "&fdsa="+ password + "&category=auth.login&startpage=portal.vm"; answer = new SimpleHttpReader().readURL(pulsLogin); } catch (Exception e){ answer...
34269838-8e07-45e2-8a58-ae6a12aeb5ee
8
private static int parseIntFragment(String str) { if (str == null) { return 0; } int parsed = 0; boolean isNeg = false; char[] strip = str.toCharArray(); char c = strip[0]; if (c == '-') { isNeg = true; } else if (c >= '0' && c <= '...
a26c578f-122e-4650-8b63-27f651de69a1
0
public FSATransition(State from, State to, String label) { super(from, to); setLabel(label); }
ef1bd0e8-832c-4a2a-8a57-e7cf8a42312c
0
public int getLargestCapture() { return largestCapture; }
4d440ea1-cab7-4fc7-a176-1d8f33ecbc3d
3
private void openConfig() { int returnVal = configChooser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { SPContainer spc = null; String fileName = ""; try { File file = configChooser.getSelectedFile(); String path = ...
831adb1d-92f2-4840-95df-b149c3203411
6
public boolean updateEdge(String edge_id, Map<String,String> params) { boolean isUpdated = false; int count = 0; try { while((!isUpdated) && (count != retryCount)) { if(count > 0) { //System.out.println("ADD...
9b4ca992-73f0-470d-b124-0895f483cfe9
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BankAccount other = (BankAccount) obj; if (balance != other.balance) return false; return true; }
316d8521-72c7-4b05-b803-b56e10bdbbd9
6
public Dimension getDimension(String text) { FAName fn = getFAName(text); if (fn != null) { return new Dimension(fn.width, fn.height); } int width = 0; for (int i=0; i<text.length(); i++) { FALetter fl = getLetter(text.charAt(i)); width += fl....
6d1c1fca-2120-497f-a30d-60a3db617635
9
public static boolean clashesWithFunctionPropositionP(Proposition nextproposition, Proposition referenceproposition) { { boolean alwaysP000 = true; { Stella_Object superarg = null; Iterator iter000 = referenceproposition.arguments.butLast(); Stella_Object subarg = null; Iterator iter0...
75b639b3-df34-41f0-aded-630211d7f1a9
7
@Override public boolean modificarDepartamento(Departamento departamento) { boolean correcto = true; EntityManager em = null; EntityManagerFactory ef =null; try { ef= Persistence.createEntityManagerFactory("MerkaSoftPU"); em = ef.createEntityMa...
30e19202-88d0-4a86-a059-af4bd8ef0bda
2
@Override public void paintOverlay( Graphics2D g ) { if( selection.isSelected() ) { Color color = Color.GRAY; if( selection.isPrimary() ) { color = Color.GREEN; } Point p1 = connection.getSourceEndPoint().getAttachement().getLanding(); Point p2 = connection.getTargetEndPoint().getAttachement().ge...
035d6dcf-799a-4bc8-9eeb-775765a5d3f1
7
private JPanel buildLoginPanel() { TransparentPanel panel = new TransparentPanel(); panel.setInsets(4, 0, 4, 0); BorderLayout layout = new BorderLayout(); layout.setHgap(0); layout.setVgap(8); panel.setLayout(layout); GridLayout gl1 = new GridLayout(0, 1); gl1.setVgap(2); GridLayout gl2 = new GridLa...
6c6908d0-98ee-49e8-b670-498ffc68db2f
1
public void testConstructor_ObjectStringEx2() throws Throwable { try { new LocalDateTime("1970-04-06T10:20:30.040+14:00"); fail(); } catch (IllegalArgumentException ex) {} }
a9d8ed41-e55e-4792-9d33-fe81418f9086
9
public String nextToken() throws JSONException { char c; char q; StringBuilder sb = new StringBuilder(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
a44c2cf6-697c-4cdf-8f32-dbc8e7ffa18e
1
private static void raiseOverflowException(Number number, Class<?> targetClass) { throw new IllegalArgumentException("Could not convert number [" + number + "] of type [" + number.getClass().getName() + "] to target class [" + targetClass.getName() + "]: overflow"); }
0ff284c7-d236-4507-ad74-2183e35817a5
0
public void printComponent(Graphics g) { treeDerivationPane.print(g); }
a305d557-2210-4b47-ac38-a3e326ebe17e
0
@Id @GenericGenerator(name = "generator", strategy = "increment") @GeneratedValue(generator = "generator") @Column(name = "item_id") public int getItemId() { return itemId; }
56a492ed-7107-4667-80a9-6dd259a253f0
0
public boolean isEmptyRunTimeStack() { return runStack.isEmpty(); }
adbccfc9-7d7f-4d74-b1cc-06b181d48c22
9
public void sort(int a[])throws Exception{ if(null==a||0>=a.length) throw new Exception("需要排序的数组不能为空"); //用来存储需要排序的 数组片段 Stack<NextData> nextDatas= new Stack<NextData>(); nextDatas.push(new NextData(0,a.length-1)); //首先将下标为[0,a.length-1]的字段片段放入到栈中 while(!nextDatas.empty())...
e70fe55a-5b06-4dbe-95d2-a782e2a2d55f
9
@Override public String toString() { return "BookEntity [" + (id != null ? "id=" + id + ", " : "") + (title != null ? "title=" + title + ", " : "") + (author != null ? "author=" + author + ", " : "") + (numberPage != null ? "numberPage=" + numberPage + ", " : "") + (imprintDate != null ? "imprint...
d85a2fc0-ff59-44a5-90b7-dd53b386142f
6
@Override public String toString() { int i, j; String str = " "; for (j = 0; j < tailleY; j++) { str += j % 10; } str += "\n ."; for (j = 0; j < tailleY; j++) { str += '-'; } str += ".\n"; for (i = 0; i < tailleX; i++)...
cc4c5a46-56a6-4308-b6e1-529335b321b3
3
@Override public DetailedAisTarget getTargetDetails(int id, boolean pastTrack) { DetailedAisTarget aisTarget = new DetailedAisTarget(); AisVesselTarget target = getById(id); if (target != null) { aisTarget.init(target); } if (pastTrack) { // Determine secondsBack based on source int secondsBack = 12...
bdf9f58b-d895-4cf7-86b6-b9b72ab3e764
2
private void DumpToStdOut(Map<String, Integer> someMap) { if (!useOutputDebugStuff){ return; } for (String key : someMap.keySet()) { String val = someMap.get(key).toString(); System.out.println(key + " ==> " + val); } System.out.printl...
a15ae2e1-5a68-483e-b6d9-4c1f68336e16
0
public int getHeldRsrceType() {return this.proffession.getHeldRsrceType();}
a7ff7924-0176-4b7b-b5e2-f8798fe997cd
9
@Override //takes in state and returns if that state is a valid successor state to the current state public void nextStates(Tree.Node node) { ArrayList<Integer> next = new ArrayList<Integer>(); if(node.state.get(0) == 0) { if(node.state.get(1) == 0 && node.state.get(2) != 0 && node.state.get(3) != 0) { nex...
beea0999-c136-4b59-beaa-f0a1a351f140
6
public ArrayList<ArrayList<ArrayList<String>>> erstelleDutyelementListAll( ArrayList<Dienstplan> dienstplanliste) { ArrayList<ArrayList<ArrayList<String>>> ListPlaeneGesamt = new ArrayList<ArrayList<ArrayList<String>>>(); int zaehler = 0; for (int i = 0; i < dienstplanliste.size(); i++) { ArrayList<ArrayL...
8fc7a9c2-0914-4948-8ee2-707d3ca91444
1
public void write(String data) { try { output.writeBytes(data); output.close(); } catch (Exception ex) { ex.printStackTrace(); } }
12f5ae40-298d-4c39-b4e7-35137531114a
9
private Item findFakeLimb(MOB tmob, String named) { if(named.length()>0) { named=named.toUpperCase(); if(named.startsWith("RIGHT ")) named=named.substring(6).trim(); else if(named.startsWith("LEFT ")) named=named.substring(5).trim(); for(int i=0;i<tmob.numItems();i++) { final Item I=t...
b1a1db4b-6898-483d-a0c1-5e9d20a29f6f
7
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityExplode(EntityExplodeEvent e) { if (Settings.world || WorldSettings.worlds.contains(e.getEntity().getWorld() .getName())) { if (Settings.expwr > 3 || Settings.expwr < 0) { writeWarn("[EM] Explosion level is i...
2b3f8788-2a6e-4e88-abf6-d4e5f79083df
8
public void trainByWholePool(Instance inst, int windowSize) { int instsInitSize = 0; int instsSecondarySize = 0; if (Insts == null) { ArrayList attList = Collections.list(inst.enumerateAttributes()); attList.add(inst.attribute(inst.classIndex())); Insts = new...
d82bf4e1-f383-458c-914c-40af97233a31
5
private String headerRep(final String pLength, final String pCode) { Date date = new Date(); String mimetostring; if (!pCode.substring(0, 1).equals("4") && !pCode.substring(0, 1).equals("5")) { // si erreur mimetostring = Mime.extractTypeMime(hostpath + headerQuest.getCible()); }...
18f4372f-db43-4988-b269-b66d6d9856e2
9
public void setup(final EvolutionState state, final Parameter base) { // What's my name? name = state.parameters.getString(base.push(P_NAME),null); if (name==null) state.output.fatal("No name was given for this function set.", base.push(P_NAME)); // Re...
dd6e4445-e148-44d3-93e6-dd4c584046b9
1
public static PlayerMovementServer getInstance() { if(instance == null) instance = new PlayerMovementServer(); return instance; }
52cdcc9e-22d7-4a4e-af49-42d72ea36224
5
public static void playSlideshow(){ SafetyNet.updateGui(); Transport.setDirectNavigationText(Integer.toString(currentSlideID)); if(Debug.engine) System.out.println("Engine -> playSlideshow -> Current Slide being viewed:" + currentSlideID); // If the current slide is a normal Slide, then call the renderer as u...
26609244-0017-40bd-a7f8-5defcf0d70e9
7
private static int[][] FileToWeightedGraphArray(String dat) { int[][] A = null; FileInputStream fis = null; try { fis = new FileInputStream(dat); } catch (Exception e) { System.out.println(dat + " konnte nicht geoeffnet werden"); System.out.println(e.getMessage()); } try { ...
c8edbb39-b826-42f2-9ebf-4a05e53735ba
0
private Set<Card> kingQueenNineSixFourThreeTwo() { return convertToCardSet("3S,6S,2D,QS,KD,4C,9H"); }
74c7139e-18d4-4c15-8f26-2908a245dd5f
2
public Line[] getDjs() { String l = Pattern.compile("djs:\\{").split(line)[1]; String data = l.substring(1, l.indexOf("}")); if (data.equals("")) { return new Line[] { new Line("null") }; } String[] djs = Pattern.compile("[0-9]\\: ").split(data); Line[] array = new Line[djs.length]; for (int i = 0; i ...
4475a4db-660d-43a1-a2c3-d2bb76b27cf6
9
void setHistogram(ImageStatistics stats, Color color) { this.color = color; histogram = stats.histogram; if (histogram.length!=256) {histogram=null; return;} for (int i=0; i<128; i++) histogram[i] = (histogram[2*i]+histogram[2*i+1])/2; int maxCount = 0; int mode = 0; for (int i=0; i<128; i++) { i...
5938e07b-3635-4bba-9a6d-ff2ac143d4dc
9
static void skipWhitespace(IXMLReader reader, StringBuffer buffer) throws IOException { char ch; if (buffer == null) { do { ch = reader.read(); } while ((ch == ' ') || (ch == '\t') || (ch == '\n')); } else { for (;;) { ...
aa71e2ce-ef9e-4311-8349-f1597e269c5d
7
public static void startupNeuralNetwork() { { 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$, ...
caeec3ae-7dc7-4cf4-9849-532b603f65b4
1
public void main() { System.out.println("Starting ..."); long start = System.currentTimeMillis(); Thread t1 = new Thread(new Runnable() { public void run() { process(); } }); Thread t2 = new Thread(new Runnable() { public void ...
13abe10c-05c6-43ea-8489-5ff91d84793e
2
public void update(){ counter++; if(counter % (60) == 0){ int x = random.nextInt(18) + 11; int y = random.nextInt(40); map.addMob(new Enemy(new Vector2(x * map.tileSize, y * map.tileSize), null, mobTextures)); } if(MainMenu.open){ menu.update(); }else{ map.update(); followPlayer...
867b9ae9-5097-4eed-92ec-b490d5deb66c
6
@BeforeTest @Test(groups = { "MaxHeapCharacters" }) public void testMaxHeapCharPushPop() { Reporter.log("[ ** MaxHeap Character Push ** ]\n"); testQueueChar = new MaxPriorityQueue<>(new Character[seed], true); try { Reporter.log("Insertion : \n"); timeKeeper = System.currentTimeMillis(); for (int ...
00af01d8-af3e-4d85-aba4-7c2cba757a52
7
public void renderInventory(GuiItems guiItems) { for(int y = 0; y < 133; y++) { for(int x = 0; x < 133; x++) { if(x < -133 || x >= width || y < 0 || y >= height) break; if(x < 0) x = 0; pixels[x + (133/2 + 10) + (y + 10)* width] = guiItems.pixels[x + y * 133]; } } }
64019586-0215-48a9-80df-43359863d580
2
public Message getMessageById(String id) { for (int i=0; i<messages.size(); i++) if (id.equals(messages.get(i).getId())) return messages.get(i); return null; }
fd1223d6-5a40-4232-b74d-8b7e010cadd7
9
@Override protected List<SearchResult<SequenceMatcher>> doSearchForwards(final WindowReader reader, final long fromPosition, final long toPosition) throws IOException { // Get info needed to search with: final SearchInfo info = forwardInfo.get(); final int[] safeShifts = info.sh...
8e918e0c-bc0b-42db-9825-54c104eae9eb
0
@Before public void setUp() { }
258c7ead-67b0-457c-a749-485f0ac7a445
6
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Null pointer"); } testValidity(number); // Shave off trailing zeros and decimal point, if possible. String string = number.toString(); if (string...
618113c2-2bd2-4d16-a6e3-12fc01f231a0
9
public static void sort(int ar[]) { int temp; System.out.print("Array Before Sorting :\t"); for (int element : ar) { System.out.print(element + " "); } // logic for increasing order for (int i = 0; i < ar.length; i++) { for (int j = i; j < ar.length; j++) { if (ar[i] > ar[j]) { temp = ar[i]; ...
3891e0f8-d29e-4966-9979-3a7dea89573a
0
public Clock getTimeStamp(){ return this.hostTimeStamp; }
bd152ab5-2b3d-4bb6-809e-3a3e222f50f3
4
private void element() throws CompilationException { // deciding between <LITERAL>, '(' conditional ')', <ID> invocation // there must be at least one of these switch (type) { case 60: // <LITERAL> paramOPs.push(new OPload(val)); nextToken(); break; case 41: // '(' ne...
3690c78e-8e17-4198-8f93-a6fe4e22f25a
6
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...
8ca054ea-cb0e-4300-a623-7dd5e546dc46
0
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
dd99af2e-27fc-481e-8299-fec7f60ae798
4
public static boolean attemptPlayerMove(Point dir) { HashMap<Integer, Tile> tiles = activemap.getTileMap(); HashMap<Integer, Actor> actors = activemap.getActorHash(); Point newloc = player.getPos().copy(); newloc.push(dir); int newkey = activemap.genKey(newloc.getX(), newloc.getY...
b3020c00-4d6c-4e14-b599-c5966b9f2304
3
@Override public CardImpl getRandomCard(int box) { CardImpl theCard = null; ArrayList<CardImpl> cardsForBox = new ArrayList<CardImpl>(); cardsForBox = getCards(box); if (cardsForBox.size() > 0) { Random random = new Random(); int min = 1; int max = cardsForBox.size(); int rndNumb = random.nextInt(m...
bb3cd80a-ce0e-4b7d-b7e2-eb7fbe10515f
5
private static Node minValue(Node n, int color, int depth, int alpha, int beta) { // Test if we have hit the max depth, or if the node has a state of solved if (depth <= 0 || n.b.gameIsOver()) { return n; } Node b = new Node(); b.evaluation = beta; int opponentColor = Board.opponentColor(color); Arra...
9d3e506b-3618-4619-835b-e71b23a7d77b
6
void setInterestRateCD(int duration, double newRate) { switch(duration) { case 0: BankGlobal.InterestRateCD6Month = newRate; break; case 1: InterestRateCD1Year = newRate; break; case 2: InterestRateCD2Year = newRate; break; case 3: InterestRateCD3Year = newRate; break; case 4: ...
689c2f8b-e4d7-422c-bf06-963d217f2412
0
public void setPrecio(double precio) { this.precio = precio; }
5ba3b1fc-4f4d-4f32-998d-6b54e9d7d028
2
public void loadDatabase() { ArrayList<String> getID = getTrackList(); for(int i = 0; i < getID.size(); i++){ Map<String,String> result = getEntry(getID.get(i)); Track newTrack = new Track(); for(Map.Entry<String, String> entry : result.entrySet()){ //make a track newTrack.put(entry.getKey(), resu...
bce9dd91-0d0c-4266-84bc-aba2838e2924
5
public void play_human() { Submission temp; for ( Player player : players_ ) { if ( player.is_human() ) { // Player will draw a card from the draw pile if (game_.turn_.draw()) { player.take_card(deck_.draw()); } ...
20f9319d-5dc0-4b44-919e-3c61678ce9b9
5
public static void transmit() { ObjectOutputStream out; BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); try { out = new ObjectOutputStream(socket.getOutputStream()); while (true) { String message = reader.readLine(); if (message.startsWith("\\")) { if (...
631b3c76-45cc-446c-8bc8-5df4177b7438
7
@EventHandler public void WitherWaterBreathing(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getZombieConfig().getDouble("Wither....
10d8082f-a381-4e1c-a5f3-fb43b2c7db39
3
@Override public void run() { long pretime, dif, sleep; pretime = System.currentTimeMillis(); while(running) { this.tick(); this.repaint(); //System.out.println(pretime); dif = System.currentTimeMillis() - pretime; sleep = 15 - dif; if(sleep < 0) { sleep = 1; } try { ...
00f53030-ca87-4f42-896d-55184645193a
0
public static double log(final double x, final double base) { return Math.log(x)/Math.log(base); }
842b60f4-52b0-4871-ad9d-02b82ce95f85
9
static void mark_sprites_palette() { //UBytePtr umap = &palette_used_colors[Machine.drv.gfxdecodeinfo[2].color_codes_start]; UBytePtr umap = new UBytePtr(palette_used_colors,Machine.drv.gfxdecodeinfo[2].color_codes_start); /*unsigned*/ int cmap = 0; UBytePtr pt = new UBytePtr(sf1_objectram , 0x20...
27c871ff-16db-4c53-b86f-76daf3a210f6
0
public void laitetaasPariPientaEstetta() { t = new Taso(10, 10); pe = new Pelaaja(); pe.setTaso(t); t.lisaaEste(new Este(0, 100, 1000, 200)); t.lisaaEste(new Este(400, 90, 600, 200)); }
1857826c-cb2e-43f0-b5d1-552774b70fb3
0
public void go(Point3 p){ pos.add(p); System.out.println("Go + " + pos); }