method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
c1422d78-c8f7-4388-9f26-97e6fb38f9ee
8
private boolean sendFile(java.nio.channels.FileChannel fchan, long pos, long lmt, FileWrite fw) throws CM_Stream.BrokenPipeException { final java.nio.channels.WritableByteChannel iochan = (java.nio.channels.WritableByteChannel)chanmon.iochan; final long sendbytes = lmt - pos; try { //throws on closed channel ...
15664758-2ca1-427f-810c-d6f7f2b3b51f
0
public String getAppenderName() { return appenderName; }
d68b19d1-be7e-4968-a0e5-0203fa8061bc
1
@Override public void addFilter(PropertyFilter filter) { if (filter != null) { filters.add(filter); } else { throw new IllegalArgumentException("Provided PropertyFilter was null."); } }
98401dc9-9712-4b60-85bd-d7735271d20c
7
public void run() { Player player = (Player) sender; if (arena.isIngame()) { player.sendMessage(OITG.prefix + ChatColor.RED + "A game is already in progress in that arena, choose another."); return; } if (arena.isClosed()) { player.sendMessage(OITG.pre...
5491be9f-2709-49e6-a70e-ac273faa8c73
1
public void setIcon() { try { ByteBuffer[] icons = new ByteBuffer[2]; icons[0] = loadIcon("Icon_16.png", 16, 16); icons[1] = loadIcon("Icon_32.png", 32, 32); Display.setIcon(icons); } catch (IOException ex) { ex.printStackTrace(); } }
b5edad7b-7ff1-470c-bc0f-e9913dbebb1b
9
public List<CartaFianza> buscarCartaFianza(String codCartaFianza, String strProveedor) { List<CartaFianza> listaResultado = new ArrayList<CartaFianza>(); for (CartaFianza bean : listaCartaFianza) { if (bean.getCodCartaFianza().equals(codCartaFianza)) { if (strProveedor == null || strProveedor.equ...
3610e983-eb74-43fc-872e-58bcaa3d3195
7
public void mergeList(Integer a[], int start1, int end1, int start2, int end2) { int temp[] = new int[end1 - start1 + end2 - start2 + 2]; int ptr1 = start1, ptr2 = start2, ptrmain = 0; while (ptr1 <= end1 && ptr2 <= end2) { if (a[ptr1] < a[ptr2]) { temp[ptrmain++] = a...
25961c29-63a9-4a32-b7a0-17c132d35758
3
public void doCommand( final Command command ) { final boolean changed = command.perform(); System.out.println( "CommandControl.doCommand(): " + command.getClass() + " " + changed ); if( changed && command instanceof UndoableCommand ) { final boolean oldCanUndo = canUndo(); undoStack.add( (UndoableComman...
637e2bf8-2d45-4602-8ffb-904de1303a53
1
@Override public void writeUIFile(UIFileTextVO uifile) throws IOException { if (uifile == null) { IllegalArgumentException iae = new IllegalArgumentException("The uiFile must not be null!"); Main.handleUnhandableProblem(iae); } UIFileWriter.writeUIFile(uifile, this.u...
ffd763ab-486a-482c-8cad-3b01e37fd79b
0
public void setName(String name) { this.name = name; }
1dddd5cd-325f-4091-800d-35a32a1e5257
7
@Override public Connection getConnection() throws SQLException { if (this.isClosed()) { throw new SQLException("Connection pool is closed"); } // Immediately return if a connection is available Connection conn = this.waitAndGet(0); if (conn != null) { ...
76e417ec-e758-4ba4-98f7-1b02e169df02
2
private void writeList() { for ( Column column : table.getColumns() ) { if ( column.isSearchId() ) { write( TAB + "public " ); write( "List<" + table.getDomName() + "> getListBy" ); write( toTitleCase( column.getFldName() ) ); write( "(...
d0c1fc78-0aea-42c9-a902-492234e5c023
2
public static List<String> findFile(String inFilepath, Filtro isFiltro) { List<String> fileFound = new ArrayList(); File directorioInicial = new File(inFilepath); File[] gdbArray = directorioInicial.listFiles(isFiltro); for (File archivo : gdbArray) { if...
0768f141-c8a3-45ff-907b-56f36f9fa16b
5
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // construct the query from the client's QueryString String picid = request.getQueryString(); String query; if ( picid.startsWith("thumb") ) query = "select thumbnail f...
09e739d8-4354-4d3d-9fd9-604dba57084f
3
public static boolean login(String username, String pass){ Employee bean = new Employee(); bean.setUsername(username); bean = (Employee)DatabaseProcess.getRow(bean); //if username cannot be found in the database if(bean == null){ System.out.println(username+" not found!"); return false; } if(...
76499629-415b-48ac-9e17-d67fa2820bfe
0
public static SameAsService createNew() { return new SameAsServiceImpl(); }
09774f95-3c2d-433c-b85b-8a891f2fd177
3
public void setPlaymodes(Playmode[] playmodes){ if(playmodes != null){ for (Playmode playmode : playmodes) { if(gameQueueMap.get(playmode.getPmID()) == null){ Queue<User> gameQueue = new LinkedList<>(); gameQueueMap.put(playmode.getPmID(), gameQueue); } } } }
b4275b79-4497-4e9d-bec1-7d730e86f330
1
public int getCreatedDimensions() { if (opcode == Opcode.MULTIANEWARRAY) return iterator.byteAt(currentPos + 3); else return 1; }
67e2c5f1-6274-4fb9-86df-4176e38826af
0
public InstructionDecoder(){ m=new MyMap(); //Labels=new HashMap<String,Integer>(); }
5ec94f7a-54ae-4acd-8131-9ccc730e9d43
7
@Override public Object invoke(Object proxy, Method m, Object[] args) { try { if (m == null || m.getName() == null) return null; Class entityClass = Class.forName(ReflectionUtils.getNMSPackageName() + ".Entity"); if (m.getName().equals("a") && args.length == 1 && args[0] != null && classInstance(args[0].ge...
3e1c4ed5-5d82-4aea-a194-8bb65d179495
5
private void refreshRec(File parentFile, TreeItem parentItem){ for(File child : parentFile.listFiles()){ if(child.isFile() && !isValidFormat(child.getName())){ continue; } FilePathTreeItem item = generateFileItem(child); parentItem.add...
dcc9a2ff-d2af-43bb-bf16-4a0e194ff3b6
8
public void endElement(final String namespaceURI, final String localName, final String qName) throws SAXException { charValue = charValue.trim(); if (t.findCriteria == C_FIND_ELEMENT_VALUE && t.b_TargetEntity && t.b_TargetNode){ ...
dc738e53-bcd9-4d68-ab40-d97875b34faf
7
public void printGroupDataPK(String fpath) { try { FileReader rd = new FileReader(fpath); BufferedReader br = new BufferedReader(rd); Map<String, String> typemap = new HashMap<String, String>(); Map<String, String> groupmap = new HashMap<String, String>(); ...
47d5ef6c-72bd-4c4c-85e0-e5d36f232539
7
@Override public void setValueAt(Object value, int row, int col) { Physician p = phys.get(row); int empID = p.getEmployeeId(); System.out.println("row: " + row + " col: " + col); switch (col) { case 0: p.setFirstName((String)value); ...
08d8634b-1382-4b80-8a01-8246627d781d
6
private boolean processPlayerCommand(MapleClient c, MessageCallback mc, String[] splitted) { DefinitionPlayerCommandPair definitionCommandPair = playercommands.get(splitted[0]); if (definitionCommandPair != null) { try { definitionCommandPair.getCommand().execute(c, mc, split...
3d9d322b-e6a5-4656-98d8-2a2ef69f56c9
7
public void updateProgress() { setStage(getStage() + 1); if (getStage() == 1) player.getInterfaceManager().sendSettings(); else if (getStage() == 2) player.getPackets().sendConfig(1021, 0); // unflash else if (getStage() == 5) { player.getInterfaceManager().sendInventory(); player.getHintIconsManage...
a9c2345c-019f-4c64-a69e-8ec1cd138533
0
@Override public String toString() { return "Taso: " + this.tasonNumero; }
c5a356c2-7586-41eb-9161-07480350cfd2
0
public void setPrpPosId(Integer prpPosId) { this.prpPosId = prpPosId; }
a4ec2070-8342-423b-9f37-18415ffbcceb
5
public int threeSumClosest(int[] num, int target) { int maxDiff = Integer.MAX_VALUE; int result = 0; Arrays.sort(num); for (int i = 0; i < num.length-2; i++) { int left = i + 1; int right = num.length - 1; while (left < right) { int su...
f74a0a2f-0cfd-48f4-a3aa-8e0ffde12f06
7
public long skip(long n) throws IOException { if(n == 0) return 0; if(n > 0 && n < _bufferSize/2 && _dataInStream != null){ // Es besteht eine gute Wahrscheinlichkeit, dass die Zielposition noch gepuffert ist int remaining = (int) n; while(remaining > 0) { int skipped = getDataInStream().skipBytes(rema...
132df485-fa86-4e6b-899b-5b7beee8adf6
4
public final WaiprParser.triggersource_return triggersource() throws RecognitionException { WaiprParser.triggersource_return retval = new WaiprParser.triggersource_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token char_literal32=null; ParserRuleReturnScope sender31 =null; ParserRuleRet...
8057b18d-c84d-4a56-a23a-ad85f450f688
7
private void refreshAlarmList() { List<Alarm> newList = new ArrayList<Alarm>(alarms); if(selectedRadioButton.isSelected()) { if(selectedHW != null) { for(Iterator<Alarm> alarmIter = newList.iterator(); alarmIter.hasNext();) { Alarm a = alarmIter.next(); if(!a.getTarget().getId().equals(selectedH...
958d73e3-51f4-4f8f-b61d-2400592244d3
0
public static void main(String[] args) { new Car().start(); }
789ac550-a688-4087-97a0-ededcd51291c
7
@Override public void drawOpenGl() { this.height = (int) Math.sqrt(RAM.MAX_LENGTH / 2); this.width = 2 * this.height; for (int i = 512; i < RAM.MAX_LENGTH; i++) if (ram.memory_count_read[i] > max_read) max_read = ram.memory_count_read[i]; for (int i = 512; i < RAM.MAX_LENGTH; i++) if (ram.memory_cou...
9af4555a-05c8-48f7-8ef3-b9dfe851338f
5
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof FragmentIonType)) return false; FragmentIonType that = (FragmentIonType) o; return !(label != null ? !label.equals(that.label) : that.label != null) && !(name != null ? !name.equals(that.name...
dccd7a9d-09d2-49bf-b0f2-ad12ba0b8999
7
public void getFirstLinks(ArrayList<Integer> theCodes) throws IOException{ boolean linkFound =false; String temp = null; String theUrl = "http://e-radio.gr/player/player.asp?sID="; Document doc; for(int code : theCodes){ linkFound=false; theUrl = "http://e-radio.gr/player/play...
00e5dacf-1d42-4b09-8309-234b69e0ddd5
7
private static int getMinElementInRotArrayHelper(int[] arr, int start, int end) { if (end < start) return arr[0]; if (start == end) { return arr[start]; } int mid = (start + end) / 2; if (mid < end && arr[mid+1] < ar...
9532d0ff-5f62-4c45-a062-6d0c55e65550
0
public PruebaFacade() { super(Prueba.class); }
320dfbd4-a571-4bd6-957c-55b424f2569f
1
public static boolean isDouble(String input) { try { Double.parseDouble(input); return true; } catch(Exception e) { return false; } }
2c60e109-8d64-4a3d-b934-c154fb45fb93
2
public void run() { String msg; try { // petla, ktora odczytuje wiadomosci z serwera i wypisuje je while ((msg = in.readLine()) != null) { System.out.println(msg); } } catch (IOException e) { System.err.println(e); } }
9ba17a71-09f7-4936-a8f5-4b6895c6fad1
5
static final void method560(Class318_Sub4 class318_sub4, int i) { try { anInt8652++; ((Class318_Sub4) class318_sub4).aClass318_Sub1_6410 = null; int i_11_ = (((Class318_Sub4) class318_sub4) .aClass318_Sub3Array6414).length; int i_12_ = 127 / ((i - 82) / 32); for (int i_13_ = 0; (i_11_ ^ 0x...
073b3b86-49c8-4e3f-b5ee-c123040bcba4
7
@FXML void onRepositoryChanged(ActionEvent event) { // TODO add your handling code here: try { String wrkDir = (String)ctrlRepository.getValue(); ResultSet rs = Repo.fetchByNeve(wrkDir); String branch = new String(); ObservableList<String> branchList = ctrlBranch.getItems...
4c2081d2-e93e-4b25-a6b8-2a114fe1eefe
9
private void calculateNextIndices() { Integer[] nextArr = new Integer[v.size()]; Integer target = 0; Integer startIndex = target; Set<Integer> usedIndices = new HashSet<>(); while (notAllFilled(nextArr)) { Integer nextIndex = null; Edge curEdge = new Edge(points.get(v.get(startIndex)), points.get(v.get(...
d2c5443a-1a94-412e-b22a-4943c652a0c6
3
public void askNbJoueur() { // Création de la fenêtre de choix WinMenu nbMenu = new WinMenu("Combien de joueurs pour cette partie ?"); nbMenu.newItem("2 joueurs", 2); nbMenu.newItem("3 joueurs", 3); nbMenu.newItem("4 joueurs", 4); // Affiche la fenêtre de choix int nbJoueur = nbMenu.open(); // Si...
529b2a95-1034-4469-a3ce-ce6cae54f72b
2
public static void main (String[] args) { Log.makeLog("Cyc-SOAP-client.log"); CycSOAPClient cycSOAPClient = new CycSOAPClient(); try { cycSOAPClient.helloWorld(); for (int i = 0; i < 10; i++) { Log.current.print((i + 1) + ". "); Log.current...
2ae4ae34-14c6-4892-9692-5d8b7b5e1754
2
public static String getJsonFromAssets(String filePath) { InputStream is; Writer writer = new StringWriter(); char[] buffer = new char[8 * 1024]; try { is = new FileInputStream(new File(filePath)); Reader reader = new BufferedReader(new InputStreamReader(is, "UTF...
098e955b-3493-4584-8ffb-b55201e9c663
2
@Override public void run() { Player player = Bukkit.getPlayer(playerName); if (player == null) { return; } player.setSleepingIgnored(false); BukkitTask task = plugin.getIgnoreSleepTasks().get(playerName); if (task != null) { task.cancel(); ...
0d3c1867-45c8-4ded-a349-23b40ff98f0a
4
private void moveIfInBounds(String s) { if (s == "left") { animationTimer.stop(); invalidate(); moveView(-movementDistance, 0); repaint(); animationTimer.start(); } else if (s == "right") { animationTimer.stop(); invalidate(); moveView(movementDistance, 0); repaint(); animationTimer.st...
6dfb4177-a1c2-41df-af12-c7ec06265cc4
5
public void updateQuality() { if (sellIn > 0) { quality++; } if(sellIn <= 10) { quality++; } if(sellIn <= 5) { quality++; } if (quality > 50) { quality = 50; } if (sellIn <= 0) { quality =...
861a3933-3795-4850-8526-d30c7b06d8eb
7
private void registerRenderer(IXMLElement xml) { String name=null,description=null, className = null; IXMLElement params=null; Enumeration children = xml.enumerateChildren(); while (children.hasMoreElements()){ IXMLElement child = (IXMLElement)children.nextElement(); if (child.getName().equals("name"))...
8db6d60f-fbb2-4d32-809a-7e341a003899
7
private static String relativizePath(final String dirStr, final String uriStr) { // Pfad an Schrägstrichen auftrennen, mehrere aufeinander folgende werden zusammengefasst. (/bla////foo ist gleich /bla/foo) final String[] dir = dirStr.split("/+", -1); final String[] uri = uriStr.split("/+", -1); int commonIndex...
0e988e53-3394-4854-a232-09ae12a68083
3
public Object deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (json.isJsonNull()) { return null; } else if (json.isJsonPrimitive()) { return handlePrimitive(json.getAsJsonPrimitive()); } else if (jso...
933ac3b5-f8a8-4125-9aca-3b4520897574
1
public void startSQL() { try { InputStream in = this.getClass().getResourceAsStream("/sols/Util/jdbc.properties"); Properties pp = new Properties(); pp.load(in); url = pp.getProperty("jdbc.url"); user = pp.getProperty("jdbc.username"); pas...
87fa5b4f-bff5-4476-a13d-249ce8a2c85a
0
private void placeInterpolationParameters() { interpolationParametersPanel.setLayout(gridBagLayout); //Create GridBagConstraints GridBagConstraints constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.NORTHWEST; constraints.insets = DEFAULT_INSETS; ...
21e50b4f-92c4-45a5-a25c-9fe56143ee8f
3
static double[][] multiply(double[][] A, double[][] B){ double[][] AB = new double[A.length][B[0].length]; for(int i = 0; i < A.length; i++){ for(int j = 0; j < B[i].length; j++){ for(int k = 0; k < B.length ; k++){ AB[i][j] += A[i][k]*B[k][j]; } } } return AB; }
252f8320-6767-4875-b044-4d2bb7641bea
3
public static final void notEquals(Object obj, Object another, String message) { isTrue((obj == null && another != null) || (obj != null && obj.equals(another)), message); }
6b01e928-b1f6-44c3-b0a9-603f99013aa6
8
private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { String eol = System.getProperty("line.separator", "\n"); StringBuffer expected = new StringBuffer(); int maxSize = 0; for (int i = 0; i < expe...
c2563f74-ed8b-4a52-9e32-2e672a15d2b0
3
public void run(){ while(true){ byte[] data = new byte[1024]; DatagramPacket packet = new DatagramPacket(data, data.length); try { socket.receive(packet); } catch (IOException e) { e.printStackTrace(); } this.parsePacket(packet.getData(),packet.getAddress(),packet.getPort()); String messa...
fead53c8-4031-44ad-828e-8d71a78dfa6f
3
public boolean equals(Object o){ if(this == o) return true; if(!(o instanceof VarDescr)) return false; VarDescr d = (VarDescr) o; return (this.addr == d.getAddr()) && (this.typ.equals(d.getTyp())); }
e9d6d11d-f031-46bc-b5e5-00748c73b8fd
7
@EventHandler public void onInteract(PlayerInteractEvent evt){ if(evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ if(evt.getClickedBlock().getType() == Material.SIGN || evt.getClickedBlock().getType() == Material.SIGN_POST || evt.getClickedBlock().getType() == Material.WALL_SIGN){ if(((Sign) evt.getClicked...
ac864a7a-41f4-4669-a97f-c7867a4f5e02
9
public static Object getMethodArrayValue(java.lang.reflect.Method _p, Object _o, int _i[]) { int n, k; Object o = null; n = (_i == null) ? 0 : _i.length; try { if (_p.getReturnType().equals(java.lang.Integer.TYPE)) { o = _p.invoke(_o); } else if (_p.getReturnType().equals(java.lang.Double.TYPE)) { ...
e0085da2-811a-434f-815a-f619f0f36b71
9
public void feedTable(Object[] list) { Object[][] data = { { "No Results Found!" } }; String[] columnNames = { "Error!" }; if (null != list && list.length > 0) { // get fields from the first object in array, one object required to // get columns, // unless class is added as a parameter? might look bette...
87dc1b2e-401a-4b03-a11d-78713aed3f04
6
private void handleInferenceAnswerResult(CycList data) { if (data.size() != 2) { throw new RuntimeException("Got wrong number of arguments " + "from inference result (expected 2): " + data); } Object newAnswers = data.get(1); if ((newAnswers == null) || (!(newAnswers instanceof CycList))) { ...
6643f468-4b13-45c9-ba4f-0ce4bade5637
6
public void toggleContainerHUD(HUD h) { HUD hud = null; boolean isOpen = false; //see if the hud is currently open for (int i = (huds.size() - 1); i >= 0; i--) { hud = huds.get(i); if (hud == h) { isOpen = hud.getShouldRender(); b...
e6ea4db0-ee38-4180-8a86-6ad181c4830d
4
public float retrieveSupplierAmount(String supName) throws SQLException{ float getAmount = 0; try{ databaseConnector=myConnector.getConnection(); stmnt=(Statement) databaseConnector.createStatement(); SQLQuery="SELECT Amount FROM familydoctor.supplier WHE...
5b198270-25bc-4d5e-89b6-a97aa0ebeaaa
2
public Element parseElement(CharSequence content) { Map<String,String> styles = new HashMap<String, String>(); Matcher matcher = META.matcher(content); if(matcher.find()) { parseStyles(styles, matcher.group(2)); content = matcher.replaceFirst(""); } Match...
28684933-c8e2-44fb-a0b3-cffc680683b7
5
public void paint(Graphics g){ g.setColor(Color.BLUE); g.fillRect(0,0,canvas_width,canvas_height); g.setColor(Color.BLACK); int count = 0; while(count < grid_lines+1){ g.setColor(Color.BLACK); g.drawLine(0,grid_size_y*count,canvas_height,grid_size_y*count); g.drawLine(grid_size*count,0,grid_size*coun...
f9ceab77-59fc-4d3a-9eda-e55ef9e303c7
1
public void addPatient(PatientCL newPatient){ if (this.nextPatient == patientListStart){ this.nextPatient = newPatient; } else { this.nextPatient.addPatient(newPatient); } }
d64d680f-b1da-4d1e-a2ca-d4aa903b5f2a
6
public void clearView(Class[] classesToIgnore) { YIComponent view = controller.getView(); ArrayList comps = YUIToolkit.getViewComponents(view); Iterator it = comps.iterator(); while (it.hasNext()) { Object obj = it.next(); if (obj instanceof YIModelComponent) { ...
9a99a0db-3a6b-4e07-8b50-f78cfba88c8b
1
public String nextValue() throws IOException { if (tokenCache == null){ tokenCache = lexer.getNextToken(); lineCache = lexer.getLineNumber(); } lastLine = lineCache; String result = tokenCache; tokenCache = null; return result; }
c52172f8-80a7-4da0-be39-f58f7ab9af6b
4
@Override public int flush(String path, Object fh) throws FuseException { FileHandle handle = (FileHandle)fh; if (handle == null) return Errno.EBADSLT; if (handle.hasClosed) return Errno.EBADSLT; //well... shouldn't happen, but it does happen... if (!handle.write) return 0; //return Errno.EACC...
01277eba-eba5-4bec-a35f-41d6dae4c8b6
0
public ConnectionLogger get_logger() { return logger; }
bc83e508-6d4a-45fe-bf00-7c33c09ab035
4
public Cell getCell(int[] cell) { if ((cell[0] < height && cell[1] < width) && (cell[0] >= 0 && cell[1] >= 0)) { return cells[cell[0]][cell[1]]; } else { return null; } }
50815b83-67c9-4771-86b0-f2ae14b8e8a0
3
public void broundMsg(Client sockector, Response msg) throws IOException{ byte[] msgs = CoderUtils.toByte(msg.getBody()); ClustersMessage messageFrame = sockector.getRequestWithFile().<ClustersMessage>getMessageHeader(msg.getRequestIndex()); if(messageFrame == null){ messageFrame = new ClustersMessage(); ...
a23ef71e-ae80-4ab4-b22d-e11eef5caa67
5
private static void Trigger(){ if(_cmd.getArgs().length == 0){ return; } if(_cmd.getArg(0).equalsIgnoreCase("reload")){ if(_cmd.isPlayer()){ if(!_cmd.getPlayer().hasPermission(_Permission + ".reload")){ if(!_cmd.getPlayer().isOp()){ sendMessage("You do not have permission to run this command"...
78ad87dc-114e-4f34-9f29-0687bf0e821d
7
public void update(long dt) { if (Config.use_wasd) { Coord newWASD = APXUtils.updateWASD(); if (!newWASD.equals(lastWASD)) { lastWASD = newWASD; map_click_ntf(lastWASD.x, lastWASD.y, 1, 0); } } Gob pl = glob.oc.getgob(playergob); Coord myCurrentCoord = null; if(pl != null) { myCurren...
885f8433-6ad9-4f7e-b562-8aa24fa45b9d
5
boolean readMessage(ObjectInputStream ips) { Message receive = null; String name = nickname; try { Object fromServ = ips.readObject(); if (fromServ instanceof Message) receive = (Message) fromServ; } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } if (receive instan...
25be6d7a-5d39-4ba8-9a72-7f67b2be3fa7
9
public LoginWindow(final MasterModel masterModel) { super("MyCMS Login"); // this.intro = intro; addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent windowEvent) { dispose(); masterModel.intro.rebirthIntro(); } }); // Changed t...
6e94dd36-738d-46bd-9d13-fff0002ab4e7
3
public static void main(String [] args) { //Create a starting time double startTime = System.currentTimeMillis(); String bigNum = "73167176531330624919225119674426574742355349194934" + "96983520312774506326239578318016984801869478851843" + "85861560789112949495459501737958331952853208805511" + "1254069874...
8fbbad0e-d9d6-4012-a1fd-e64496fb375b
8
@Override public void run(Request r) { if (!isStarted()) { return; } WebServer.logDebug("Site's Run Called on RequestID: " + r.getRequestID() + " For site " + getName()); boolean found = false; for (String defaultDocument : getDefaultDocuments()) { i...
4f54abd1-03e6-4082-bf7f-0a432fa62c70
0
public int getStartStop() { return this._startStop; }
5e78f245-8f97-40e7-a58b-9a32cd4ac035
2
private void setMarketPathToScale() { graphInterval = (frameW - 2 * SIDE_BUFFER) / (marketComparison.size() - 1); gridLines.clear(); float minimumPt = findMinimum(marketComparison.values()); float maximumPt = findMaximum(marketComparison.values()); // System.out.println("range: "+minimumPt+" --- "+max...
fb8d538d-ece8-4e01-bd11-a5a485783f7f
1
public static String getJmeterVersion() { String version = JMeterUtils.getJMeterVersion(); int hyphenIndex = version.indexOf("-"); int spaceIndex = version.indexOf(" "); return (hyphenIndex != -1 & spaceIndex == -1) ? version.substring(0, hyphenIndex) : ...
09f4158f-89b3-4396-a773-c7637bc2bab7
0
public double getHeight() { return height; }
00c4126c-70cc-4679-a826-27950e1f7c95
4
public static void main(String[] args) { String line = ""; String message = ""; int c; try { while ((c = System.in.read()) >= 0) { switch (c) { case '\n': if (line.equals("go")) { PlanetWars pw = new PlanetWars(message); DoTurn(pw); pw.FinishTurn(); message = ""; } e...
bd35c51c-4abe-474b-851b-2b5f291c084e
7
private void setRandomColor() { Random estrattore = new Random(); int estratto = estrattore.nextInt(7); switch (estratto) { case 0: jLabel4.setForeground(Color.BLACK); break; case 1: jLabel4.setForeground(Color.BLUE); break; cas...
3ce52e07-caa3-4c4f-9e04-af05e35a44ae
8
@Override public Model getRotatedModel() { Model model = animation.getModel(); if (model == null) return null; int frame = animation.sequences.frame2Ids[elapsedFrames]; Model animatedModel = new Model(true, Animation.isNullFrame(frame), false, model); if (!transformationCompleted) { animatedModel.c...
f549c1cc-5402-4352-9923-6ee5c22ebb98
7
protected void genDeity(MOB mob, MOB M, int showNumber, int showFlag) throws IOException { if((showFlag<=0)||(showFlag==showNumber)) { mob.tell(L("@x1. Deity (ID): '@x2'.",""+showNumber,M.getWorshipCharID())); if((showFlag==showNumber)||(showFlag<=-999)) { final String newName=mob.session().prompt(L(...
f79a1d4a-f1d2-470b-8d8f-e7e1a4de6ea4
6
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length == 1 && args[0].equalsIgnoreCase("help")) { showHelp(sender); return true; } if (args.length == 1 && args[0].equalsIgnoreCase("list")) ...
57ddaf6d-e7f1-4588-a487-19eedb1658fa
3
public static void garbageDisposal() { for (ArrayList orgs : organisms) { for (int i = 0; i < orgs.size(); i++) { Organism g = (Organism) orgs.get(i); if (g.life.isDead()) { g.life.kill(); orgs.remove(g); i--; } } } }
9998d782-247e-432d-b555-f334c4860746
5
private void consoleCommands(String cmd){ if(cmd.equals("night")) GameTime = 18000; else if(cmd.equals("day")) GameTime = 0; else if(cmd.startsWith("need")){ String [] split = cmd.split("\\s+") ; if(split.length == 3){ Item item = Items.getItemFromUIN(split[1]); if(item != null){ ItemStac...
c55a8ea8-4dc6-42d3-aaa1-b3f21c64ef1b
1
public Parser(String in, Library lib) { // init TOKENIZER this.in = in; read(); // init PARSER this.lib=lib; paramOPs=new Stack<OP>(); xchgOP=new Stack<OP>(); // initialize DV names accumulator if (lib.resolver!=null) accDV=new StringBuffer(); };
9e31fee3-7539-4c33-84f8-9d908bc95887
0
public String toCSV(){ return id+";"+date+";"+taille; }
2ea92d43-a085-4b3b-9da8-5524370fe5bf
4
public static void _drawHalfSphere(float r, int scalex, int scaley) { int i, j; float[][] v = new float[scalex * scaley][3]; for (i = 0; i < scalex; ++i) { for (j = 0; j < scaley; ++j) { v[i * scaley + j][0] = r * (float) cos(j * 2 * PI / scale...
c9891487-ff09-46e9-a9fb-4bfdd57aa573
7
@Override public void handle(MouseEvent event) { if (isSelected()) { if (event.getButton() == MouseButton.PRIMARY) { if (getGraphic() == null) { for (ButtonEventHandler buttonEvent : buttonEventList) { buttonEvent.onLeftClick(xPos, yPos); buttonEvent.onFirstClick(); } } else { s...
8654e7dd-959c-42a9-a645-3f109b1aea69
3
public static void incrementProgress(int progress) { if (GlobalDialogs.progressDialogStatusBar != null) { if (progress > 100 || GlobalDialogs.progressDialogStatusBar.getValue() + progress > 100) { GlobalDialogs.progressDialogStatusBar.setValue(100); } else { ...
ec2cad59-4f14-40ea-b50f-4062fcb3ad0c
6
public boolean getBoolean(int index) throws JSONException { Object object = get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String)object).equalsIgnoreCase("false"))) { return false; } else if (object.equals(Boolean.TRUE)...
f7ae1280-f989-4226-b086-f3f0927e4bd0
4
public static void Close(Connection a,Statement b){ if(b != null){ try{ b.close(); }catch(SQLException e){} } if( a!= null){ try{ a.close(); }catch(SQLException e){} } }
9ecfd278-797f-4065-a55f-c92fb05705e2
3
@Override public boolean equals(Object obj) { if (!(obj instanceof Card)) return false; Card cobj = (Card) obj; return card == cobj.card && x == cobj.x && y == cobj.y; }
654ab66c-5dfc-4db6-8578-2353f6954358
6
@EventHandler(priority = EventPriority.HIGHEST) public void chatEvent(final AsyncPlayerChatEvent event) { // Don't care about event if it is cancelled if(event.isCancelled() || event.getPlayer() == null) { return; } if(event.getMessage().charAt(0) == '#') { //...