method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
aa3439a7-0681-4800-bee2-38eb1ca68f27
1
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" // <editor-fold defaultstate="collapsed" // desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { titreLabel = new javax.swing.JLabel(); nombreLabel = new javax.swing.JLabel(); nombreSpinner = new javax.swing.J...
cc3428e7-b454-4fc2-a2d6-170b012f5473
1
public synchronized void startDecompiler() { if (decompileThread == null) { decompileThread = new Thread(this); decompileThread.setPriority(Thread.MIN_PRIORITY); progressBar.setMinimum(0); progressBar.setMaximum(1000); progressBar.setString("decompiling"); progressBar.setStringPainted(true); dec...
c8481207-cac7-4c0f-88e7-d618010af17b
8
private void jButtonValidarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonValidarActionPerformed if (jTextFieldNome.getText() == null || jTextFieldNome.getText().equals("")) { jLabelErro.setErrorText(WORDS.getString("ERRO-CODIGO")); } else if (jTextFieldSenha.getPa...
911180c8-7b45-4aab-8147-1a333888db7d
2
public static void checkJumpPadConfig() { File config = new File(path + "JumpPads/config.yml"); if(!config.exists()) { try { config.createNewFile(); FileConfiguration c = YamlConfiguration.loadConfiguration(config); ArrayList<Integer> jb = new ArrayList<Integer>(); jb.add(19); c.set("SafeJump...
a5a9d55a-001f-4396-80e9-0c92ac458c8c
5
public Collection<TimeSlot> queryFreeTime(double startTime, int duration, int resID) { // check all the values first boolean success = validateValue(startTime, duration, 1); if (!success) { return null; } Collection<TimeSlot> resOptions = null; t...
d5fc04b7-0705-410a-82ab-bd97f648ee44
2
public Month(int theMonthNumber) { if (theMonthNumber >=1 && theMonthNumber <= 12) this.theMonthNumber = theMonthNumber; else {this.theMonthNumber = 1;} }
741a5dcd-2aa8-4807-87f3-07f47b71e1d7
7
public void updateRace(Integer lane, HoleType hole) { assertPositiveInteger(lane, Race.class.getSimpleName() + " - updateRace: lane is mandatory!"); if (hole == null) { throw new IllegalArgumentException("Setting the hole is mandatory!"); } if (!holeTypes.contains(hole)) { ...
91246d1a-bc88-4ae3-9987-bf431fb449cc
1
public int getHeight() { if (image != null) return image.getHeight(null); return 0; }
4982b4c9-1e17-48fc-9251-5e9e164de419
7
@Override public void keyTyped(KeyEvent key) { if(key.getKeyChar() == '\n'){ String selectedTextAreaName = ""; if(key.getSource() == tfSU){ selectedTextAreaName = "tfSU"; } else if(key.getSource() == tfGer){ selectedTextAreaName = "tfGer"; } else if(key.getSource() == tfUK){ selectedText...
b9752de5-b0f9-464e-b076-3d7dfd6cacf1
6
public void drawHex(Tile tile, Graphics2D g2) { int x = tile.getLocation().getXCoord(); int y = tile.getLocation().getYCoord(); Polygon poly = makeHex(findCenter(x,y)); String type = tile.getType(); switch (type) { case "DESERT": g2.setColor(new Color(0xFF, 0xFF, 0xA9)); break; case "BRICK": ...
cdde0119-1497-48c6-afd2-8ef2480ab166
6
private void jButtonFjernVareActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonFjernVareActionPerformed {//GEN-HEADEREND:event_jButtonFjernVareActionPerformed int a = modelVareTilOrdre.size(); for (int i = 0; i < modelVareTilOrdre.size(); i++) { try ...
6e5e0126-0cd0-4e08-b84c-879dc1165d98
8
final RasterToolkit createRasterForSprite(ImageSprite class207, boolean bool) { try { anInt7657++; int[] is = new int[(((ImageSprite) class207).indexWidth * ((ImageSprite) class207).indexHeight)]; int i = 0; int i_467_ = 0; if (((ImageSprite) class207).alphaIndex != null) { for (int i_46...
fae22a83-030a-4ff1-8ee6-963fc8b9af17
7
public int sendMessage(int priority, int receiver, int context, String content, int queue) { int status = -1; if (messageBroker == null) { log.error("There is no broker connecting to server"); } else { if (messageSenderBroker == null) { messageSenderBroker = messageBroker.createMessageSender(); ...
fce991d3-b700-4a92-ae30-b8c64de9f6cc
9
protected synchronized TCPSegment _handleIncomingSegment( TCPSegment s ) throws IOException { boolean sendSyn = false; this.outgoingSocketAddressPair = s.getInverseAddressPair(); if( s.isSyn() && !firstSynReceived ) { firstSynReceived = true; // syn => we are the server (and need to syn+ack back), syn...
bee33af6-003b-4c0a-a106-8fe3b92e8f9a
0
public String getName() { return this.name; }
7494f2a6-a7b9-404b-b32e-17fa43264cee
6
public static void main(String[] args) { double[][] teeest = new double[0][0]; System.out.println(teeest.length); //Neuron creation test with arbitrary inputs and weights. Neuron myFirstNeuron = new Neuron("min"); double input[] = {5,20,-1}; double weights[] = {0,1,1}; System.out.println(myFirstNeur...
03b567f6-7b0a-4679-af05-c8775dc8cb84
4
public static HashMap<ABObject[], ContactDimension> ExtractDimentsion() { HashMap<ABObject[], ContactDimension> CDDictionary = new HashMap<ABObject[], ContactDimension>(); HashMap<ABObject[], ERA[]> RADictionary = new HashMap<ABObject[], ERA[]>(); HashMap<ABObject[], ContactRelation> CRDictionary = new H...
88207f36-ce90-4c3f-8c98-681d65cb10ff
9
private void calcChromConfig(int c) { chrconf = new ChromConfig(); chrconf.chromseq = new int[popdata.ploidy]; if (popdata.ploidy == 2) { chrconf.chromseq = tools.shuffleArray(Tools.seq(2)); chrconf.quad = 0; } else { assert (popdata.ploidy>2);...
64bfb166-080d-432d-9eaf-5cb2ae53d04a
9
private static void disposeColors(Display display) { List toBeRemoved = new ArrayList(1); if (DEBUG) { System.out.println("Display map is " + displays.toString()); //$NON-NLS-1$ System.out .println("Color map is " + requiredFieldColorMap.toString()); //$NON-NLS-1$ } // Look for any stored colors th...
b84b3a0e-be6f-4c6f-8285-7f460c94cf3e
2
public String getSelectedProject() { if (model != null && list != null) { final ObservableList<String> selectedProjectItem = list.getSelectionModel().getSelectedItems(); final String selectedProject = selectedProjectItem.get(0); return selectedProject; } retur...
1f04b0d7-a379-481e-8c45-a491f42d8d3e
0
public Listar() { initComponents(); }
d8a89ed9-56a7-47b3-bd85-0966b2aa952e
0
@Test public void testFactoryMethod() { Person person = PersonImpl.personWithNameAndAge("test", 100); assertEquals(person.getName(), "test"); assertEquals(person.getAge(), 100); }
d5ea7b21-f538-4929-bef9-b0640daae13f
5
private OfficeWordContainer() { }
aa5b4f2a-03d2-4992-a937-e299cf74b567
8
public void actionPerformed(ActionEvent e) { // We need to get the current layout of the CardLayout panel // before we can change it. CardLayout cl = (CardLayout)(cardPanel.getLayout()); // This section of code finds out the button that has been pressed // and changes t...
e70f007c-9cf4-42eb-83ec-051f4b09b7e5
2
@Override public List<Article> getArticle(){ List<Article> result = null; //Создаем сессию, она нужна для использования транзакций Session session = HibernateUtil.getSessionFactory().openSession(); try { session.beginTransaction().begin(); //Criteria используется для запроса с ...
377fd0a1-8860-4996-9def-34a75ccb9f30
0
public double getCurrentKB() { double kb = Math.floor((currentBits / 1024.0) * 1000 + 0.001) / 1000;// 目前下載kb數 return kb; }
6fe1e3cb-6941-4ac9-9be7-e7ecbed96609
8
private boolean saveProjectToFile(File selectedFile){ try { String full = selectedFile.getAbsolutePath(); String partial = full; int index = full.lastIndexOf('.'); int index2 = full.lastIndexOf(File.separatorChar); if(index != -1 && index2 != -1 && index > index2){ partial = full.substring(0,inde...
3ff32671-7e50-4e69-b861-a1618c492227
4
@Override public HeightMap applyTo(HeightMap... heightMaps){ double[][] finalHeights = heightMaps[0].getHeights(); double[][] smoothedHeights = heightMaps[0].getHeights(); int xSize = finalHeights.length; int ySize = finalHeights[0].length; for(int iteration = 0; iteration<nu...
ad7fa4b5-a115-47fc-8113-20ced429cea5
7
public void execute() { m_random = new Random(m_rowNumber * 11); m_dataGenerator.setSeed(m_rowNumber * 11); m_result = new RemoteResult(m_rowNumber, m_panelWidth); m_status.setTaskResult(m_result); m_status.setExecutionStatus(TaskStatusInfo.PROCESSING); try { m_numOfSamplesPerGenerator =...
6630bf73-fe13-4f81-aa6d-62e18ee80c64
4
public void checkUpload(CommonsMultipartFile picture) { ParameterUtils.checkUploadEmpty(picture); boolean isPicture = false; try { FileType pictureType = FileTypeJudge.getType(picture.getInputStream()); FileType[] fileTypes = FileType.values(); for (FileType fileType : fileTypes) { if (f...
6a9da878-3aeb-417c-a1e1-ff2771b4bb7f
5
public String getType() { switch (type) { case (0): return "free/deleted record"; case (1): return "message coming from the network and read"; case (3): return "message coming from the network and still to be read"; ...
8dff3ee6-b4b3-45ae-823b-899bd569443a
2
public String getVia(long v) throws IOException{ InputStream inputStream = new FileInputStream(Config.get("UrbanoSHPDir") + "/CARVIA/CARVIA.DBF"); DBFReader reader = new DBFReader(inputStream); Object[] rowObjects; while((rowObjects = reader.nextRecord()) != null) { if ((Double) rowObjects[2] == (v)){ ...
e33efd5f-2cff-4ea9-a543-940ec515851c
6
public Suggestion( String asker , List<Card> askedCards , List<Reply> replies) { if (asker == null || "".equals(asker)) { throw new IllegalArgumentException("asker can't be null or empty"); } if (askedCards == null) { throw new I...
266e942c-9c09-4b91-8830-69de78af3d4e
4
public String levelorder() { ListQueue listqueue = new ListQueue(); BKnoop<E> temp = this; String levelorder = ""; while(temp != null) { levelorder = levelorder + temp.toString(); if(temp.getLeftChild() != null) { listqu...
9c97bc64-5b46-4a3f-94b5-27162f28729e
2
public List<Transition> getTransitionsByState(String stateValue){ List<Transition> tempList = new ArrayList<Transition>(); for(Transition tran: transitions){ if(tran.mathByStateValue(stateValue)) tempList.add(tran); } return tempList; }
e1397ac1-20d6-43b6-ac89-b1b0153c4a2f
6
@EventHandler public void IronGolemBlindness(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.getIronGolemConfig().getDouble("IronGo...
a9bca23f-911c-4dd4-bc35-cfb91ce9fa68
1
Tex nmeter() { if (ntext == null) ntext = new TexI(Utils.outline2( nfnd.render(Integer.toString(nmeter), Color.WHITE).img, Color.BLACK)); return (ntext); }
4af31062-a279-46d4-a656-f352d777633e
0
public void deposit(int amount) { this.balance = this.balance + amount; }
dc4b795f-a81a-4fc2-a0e9-21b259460162
2
public RegexTextArea() { super(); regexListeners = new HashSet<>(); getDocument().addDocumentListener(new DocumentChangeAdapter() { public void anyUpdate(DocumentEvent e) { try { String regexString = StringEscapeUtils.unescapeJava(getText()); pattern = Pattern.com...
2f9696cf-850c-4d88-b2a3-ec434839c4b0
3
@Test public void test() { // TODO Auto-generated method stub Vehicle bike = new Vehicle(); bike.speed = 20; bike.angle = 0; bike.ownerName = "Roger"; bike.id = 1; Vehicle car = new Vehicle(); car.speed = 60; car.angle = 0; car.ownerName = "Rafael"; car.id = 2; Vehicle trai...
8813721a-0bc6-47b6-b8e7-8901569516ec
0
public MyTableModel() { data = new ArrayList<NbrCostPair>(Setup.nbrList); refreshRoutes(); }
fc4bc860-6e09-4014-abde-eb08f41a6927
9
public String toString() { StringBuffer b = new StringBuffer(); for (int x = 0; x < FIELD_SIZE; x++) { for (int y = 0; y < FIELD_SIZE; y++) { FieldObject o = field[x][y]; if (o == null) b.append(' '); else if (o instanceof RockObject) b.append('R'); else if (o instanceof TreeObject) ...
e62cd107-22b4-4134-b6fb-7df479d2ca47
9
private TreeNode gT(int[] preOrder, int pStart, int pEnd, int[] inOrder, int inStart, int inEnd){ if(preOrder==null || inOrder==null || preOrder.length==0 || inOrder.length==0 || inStart>inEnd || pStart>pEnd){ return null; } int childRootVal = preOrder[pStart]; TreeNode child...
ab278679-aae2-4f52-8c6e-c64ec6f1d5fd
2
void saveFormToTransition() { ArrayList<String> alphabet = getTransitionsInputArray(textInput.getText()); if (alphabet.size() > 0) { int counter = sim.autocompleteDFATransitions(alphabet,jComboChooseState.getSelectedIndex()); setVisible(false); dFAMainWin.repai...
2e5836b2-2246-4fb1-a75b-fce4521a2e79
7
public static void main(String[] args) { HashSet<Integer> pandigital = new HashSet<Integer>(); // Test multiplication of 1 digit x 4 digit number for (int i = 1; i < 10; i++) for (int j = 1000; j < 10000; j++) { int product = i * j; if (isPandigital(concatenate(i, j, product))) pandigital.add(prod...
2b0b3f1d-87c2-43e9-8a18-7c200fd79a46
9
private void init(String x_label, String y_label, String window_title) { chart = ChartFactory.createScatterPlot("", x_label, y_label, data, PlotOrientation.VERTICAL, false, true, false); // turn off borders of the plot: XYPlot p = chart.getXYPlot(); p.ge...
498145f1-db6e-4d0b-8988-49b9c67f9078
8
private Place[] grabPlacesFor(Caching caching, final Section section) { ///I.say("Grabbing new places at: "+section.area) ; // // We scan through every tile in this section, and grab any contiguous // areas of unblocked tiles. (These must be flagged just after // acquisition, so that we know to ...
04b17774-9c99-4535-8b0d-8cdd7106c560
6
public final Pino etsiPolku(int alkuX, int alkuY, int loppuX, int loppuY) { kaymattomatNoodit = new PriorityQueue<Noodi>(11, noodiVertailija); kaydytNoodit = new LinkedList<T>(); kaymattomatNoodit.add(noodit[alkuX][alkuY]); valmis = false; T valittu; whi...
5f35f830-3f24-4f49-a01b-cabd431d1176
6
@Override public void valueUpdated(Setting s, Value v) { if (s.getName().equals(Selected)) { if (!__lock) { try { if (checkBox_ != null) checkBox_.setSelected(v.getBoolean()); } catch (Exception e) { e.printStackTrace(); } } else __lock = false; } else if (s.getName().equals(T...
0d7148ec-fc9e-4010-bf49-3c469dfd6ab0
6
private void setMines() { int cellAmount = this.high * this.width; Random rand = new Random(); int minesSet = this.minesNumber; while (minesSet > 0) { for (int iteration = 0; iteration < cellAmount && minesSet > 0; iteration++) { final int i = rand.nextInt(thi...
7d8201c3-2b87-40d7-97e3-5879f687e060
0
public final void setMode(String channel, String mode) { this.sendRawLine("MODE " + channel + " " + mode); }
c1c74825-9e2d-49bb-b774-db90ef51202d
5
private static int runToInputHiOrLoL(Gameboy gbL, Gameboy gbR, int limit, int joypadInputAdd) { int initialSteps = gbL.stepCount; int add = runToAddressL(limit, gbL, gbR, joypadInputAdd); while (true) { if (add == 0 || gbL.stepCount - initialSteps > limit) return 0; int lastVframe = gbL....
dd85abf5-ceda-4517-a690-4893d82d503d
9
private void showTip() { String text = null; tooltipowner = null; String classname = getClass(mouseinside); if (("tabbedpane".equals(classname)) || ("menubar".equals(classname)) || (classname == ":popup")) { if (insidepart != null) { text = getString(insidepart, "tooltip", null); } } else if (cl...
83320988-762b-49e3-8c93-cc66e13353fe
1
public static void save(GameData gD, File f) { DataFile dF = new DataFile(); try { f.createNewFile(); Main.currentGame.dir = f.getAbsolutePath(); FileOutputStream fileoutputstream = new FileOutputStream(f); dF.setProperty("mode", gD.mode + ""); dF.store(fileoutputstream, "Data File"); f...
2b685585-d85c-4661-a75d-4cde7796b8f9
9
@Override public void mouseDragged(MouseEvent e) { if (!e.isConsumed() && first != null) { gridEnabledEvent = graphComponent.isGridEnabledEvent(e); constrainedEvent = graphComponent.isConstrainedEvent(e); double dx = e.getX() - first.x; double dy = e.getY() - first.y; if (isLabel(index)) { ...
156c4c5d-cf32-4a52-b9e5-3e5db167b79b
9
public void renderSprite(int xp, int yp, Sprite sprite, boolean fixed) { if(fixed) { xp -= xOffset; yp -= yOffset; } for (int y = 0; y < sprite.getHeight(); y++) { int ya = y + yp; for (int x = 0; x < sprite.getWidth(); x++) { int xa = x + xp; if(xa < 0 || xa >= width || ya < 0 || ya ...
6fa87f66-1323-4797-bb11-e87883f75d4a
0
protected void onDccChatRequest(String sourceNick, String sourceLogin, String sourceHostname, long address, int port) {}
66ec40fb-7e54-4f77-bc0f-3f6b2a44c5e6
0
public static ComponentUI createUI(JComponent c) { return sharedInstance; }
da756374-b7d1-4acb-bd26-97961b05c975
0
private List<Chromo<T>> getElite(){ return individuals.stream() .sorted((i1, i2) -> Double.compare(i2.getFitness(), i1.getFitness())) .limit(NUM_ELITE) .collect(Collectors.toList()); }
17049537-8b42-4179-9201-1b539bad5c5e
5
public Main(List<Vertex> vertices) { int res = checkEuler(vertices); switch (res) { case 0: String result = calculateCircle(vertices); System.out.println("[INFO] Got result circle: "+result); if(Main.visua...
e1d7a578-1aa3-4400-be50-c684d30db31b
9
public boolean canFinish(int numCourses, int[][] prerequisites) { int edges = prerequisites.length; if (numCourses < 2 || edges < 1) return true; int[] prereqs = new int[numCourses]; // Count prerequisites for courses for (int i = 0; i < edges; i++) prereqs[prerequisites[i][0]]++; Queue<Integer> queue...
68262d81-2afc-4282-98d8-55c13d03a102
3
static final public Object nestedValue(Map map, String path){ Object val = null; String[] names = path.split("\\."); Map m = map; int lastIdx = names.length - 1; for (int i = 0; i < names.length; i++) { String name = names[i]; // assume the map have string Keys Object v = m.get(name); if (i == la...
171d1b8b-72c3-4b88-baf4-1a20d596cf27
6
private void setupBranchListener() { textbBranchListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e){ java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); JTextPane textPane = (JTextPane) e.getSource(); Point pt = new Point(e.getX(), e.getY()); int pos = textPane....
db9e365e-44ec-460c-b098-d5fd9ca58d04
4
public void schemeEditorDelInput() { if(ce_input.getSelectionIndex() == -1) return; String inputName = ce_input.getText(); Contact contact = new Contact(inputName, -1); List<String> sourceFor = new LinkedList<String>(); for(String circuitName : scheme.getCircuits().keySe...
b7afb5b0-4ef7-4de2-95fd-8f74afe524cf
2
public void mouseClicked(MouseEvent event) { ((AutomatonEnvironment)getDrawer().getAutomaton().getEnvironmentFrame().getEnvironment()).saveStatus(); if(event.getButton() == MouseEvent.BUTTON1) { State state = getDrawer().stateAtPoint(event.getPoint()); if(state == null) ...
11f2e42e-6a2c-4704-9a48-50a89918d304
7
@Override public DayInWeek getDayInWeek() { DayInWeek diwEnum = null; int day = calendar.get(Calendar.DAY_OF_WEEK); if (day == 1) { diwEnum = DayInWeek.SUN; } else if (day == 2) { diwEnum = DayInWeek.MON; } else if (day == 3) { diwEnum = D...
ff2ab86a-6d72-4abf-b61f-2f16f80fc5d7
2
public static void main(String[] args) throws InvalidFieldException { Contestant c = new data.Contestant("ad", "Jon", "silver", "booby"); try { System.out.println(c.toJSONObject().toString()); } catch (ParseException e1) { e1.printStackTrace(); } try { Contestant p = new data.Contestant(); p.fro...
dbd44905-6368-4d3b-b81e-142bb194ab5a
3
private void injectLyricsForPath(String path) { // Create a thread pool that will inject lyrics into audio files // Start up 3 times as many threads as logical processors this.lyricThreadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 3); // Get all of the audio files from the ...
5c36722f-df40-439e-8774-0325431a021c
3
void savePrefs() { Properties prefs = new Properties(); StringBuilder b = new StringBuilder(); for (int i = 0; i < workCombo.getItemCount(); i++) { String dir = ((File) workCombo.getItemAt(i)).getPath(); b.append(dir.replace('\\', '/')); if (i < workCombo.getI...
13c70adc-b01f-4aca-aad6-500f92e8ac47
9
private void displayPattern() { int l = 0, r = m-1, t = 0, b = n-1; int valuesRemaining = m*n; int i; while(valuesRemaining != 0) { for (i = l; i <= r && valuesRemaining != 0; i++) { valuesRemaining--; System.out.print(arr[t][i] + " "); } for (i = t+1; i <= b && valuesRemaining != 0; i++) { ...
88e3ae32-f53f-444a-917e-9b1b47fe569b
2
private String getAvailableShares(StockPriceProvider provider) { Share[] bufferShare = provider.getAvailableShare(); String s = ""; for (int j = 0; j < bufferShare.length; j++) { if(bufferShare[j].getExchange()!=null){ s += bufferShare[j].name +"<pre>"+ (float)bufferShare[j]...
273f5454-487d-49cc-96ea-31273f4af4ad
3
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int t = in.nextInt(); int c = in.nextInt(); int streak = 0; int result = 0; for(int i=0;i<n;i++){ int curr = in.nextInt(); if(curr<=t) streak++; else streak=0; if(streak >= c) result++; ...
215dcaa1-a570-468b-8ba0-aae9ebfccf5d
9
public boolean foundObjectInImage(WebPicture picture, String object) throws IOException { if(!this.supported) { //throw new RuntimeException("Your systeme doesnt support OpenCV Beta version."); return false; } Point[] locations; File folder = new File("images/" + object); String file ...
da7c6d47-6987-4680-bde4-7bb6a857d511
2
private void sendHeaders(HttpRequest request, PrintWriter remotePrintWriter) { Map<String, List<String>> clientHeaders = request.getHeaders(); for (String header : clientHeaders.keySet()) { List<String> values = clientHeaders.get(header); for (String value : values) { ...
cf112ab8-4131-4754-8250-893f229ee8d2
7
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
2bd3c92c-631d-4222-9f02-e82bc45e2dac
9
@Override public boolean eIsSet(int featureID) { switch (featureID) { case statePackage.STATE__PLAYERS: return players != null && !players.isEmpty(); case statePackage.STATE__COUNTRY_STATE: return countryState != null && !countryState.isEmpty(); case statePackage.STATE__TURN: return turn != null...
1a9edbf7-beda-408a-a775-6748a199aabd
9
public static Object invokeConstructor(Class c, Object[] args) throws Exception{ try { Constructor[] allctors = c.getConstructors(); ArrayList ctors = new ArrayList(); for(int i = 0; i < allctors.length; i++) { Constructor ctor = allctors[i]; if(ctor.getParameterTypes().length == args.length) ctor...
6126ef20-e48e-4c7f-9750-d80496780efa
3
private List<SnapshotFile> trainFiles(List<SnapshotFile> files) { for (int i=0; i<this.training; i++) { nextSnapshot(files); } // After the training, it is necessary to add modify files // for the correct execution of the dataset. List<SnapshotFile> initialFiles = new ArrayList<SnapshotFile>(); for...
fc283e4e-0304-4c8d-8674-b4f04935a1d1
2
private static int applyLetterScore(String passwd) { int letterScore = 0; // LETTERS Matcher mL = Pattern.compile(".??[a-z]").matcher(passwd); if ( mL.find() ) // [verified] at least one lower case letter { letterScore = 1; log.debug("1 point for a lower case character\n"); } Matcher mU =...
7989fdd0-76d9-4893-a213-359822e67c0e
2
public E pop() { Node<E> newHead; Node<E> oldHead; do { oldHead = head.get(); if (oldHead == null) { return null; } newHead = oldHead.next; } while (!head.compareAndSet(oldHead, newHead)); return oldHead.element; }
facdef59-d7ce-4140-9d73-113732a7d722
9
public static int sizeOf(int type) { switch ( type ) { case MatDataTypes.miINT8: return miSIZE_INT8; case MatDataTypes.miUINT8: return miSIZE_UINT8; case MatDataTypes.miINT16: return miSIZE_INT16; case Ma...
c736977a-1a6e-4321-ad03-c113d05308d2
5
public byte[] RMI_baj(String filename, String name, String key) throws RemoteException { addLog(name + " : baj " + filename); String[] dfile = new String[2]; dfile[0] = filename; dfile[1] = name; // Verifica que el archivo este en la lista de archivos validos en el servidor if (files.contains(dfil...
871e8797-b907-40fc-981e-38ffe5e7cb0b
7
public static void setNodesToVisible(ObservableList<Animation> animations) { for (Animation a : animations) { if (a instanceof ScaleTransition) { ScaleTransition st = (ScaleTransition) a; st.getNode().setScaleX(0); st.getNode().setScaleY(0); ...
a8e9e16c-5d1b-495f-85cc-0d2a452dc30d
8
public void updateList() { listModel.clear(); ArrayList<String> a = new ArrayList<>(); for (Course co : aList) { if (co.getInstructor() == null && co.getLab() == null) { listModel.addElement(co.getClassCode() + "," + co.getSection() + " : " + "n/a"); } el...
d18d9cea-0e12-4b6d-8923-2a34c4558ad6
1
public LineaAerea getLinea(int index){ if (index > 0) { return lineas.get(index); } return null; }
b53dcb7a-4cdd-44b6-9b40-a64d9faa1af4
2
public void drawPacDot( int y, int r, Graphics screen ) { screen.setColor( new Color(1.0f, 1.0f, 1.0f) ); for( double i = BLOCKSIZE+r; i < (double)((COLS*BLOCKSIZE) - 1+((double)r/2)); i+=3*r ) if( i > (PACX*BLOCKSIZE) ) //if pac hasn't passed - creates eating effect Circle( (int)(i), (int)(gameHeight-y), (...
17d201ab-5ecf-4746-8c70-63c7f48074dc
4
private Adherent creationAdherent(HttpServletRequest request) { Adherent adh = new Adherent(); adh.setLogin(request.getParameter("id")); adh.setPwd(request.getParameter("pwd")); adh.setNom(request.getParameter("ndf")); adh.setPrenom(request.getParameter("prenom")); String adresse = request.getParameter("ad...
15e3616b-668c-4cc1-ae31-6ba83a800701
6
public void render(Graphics2D g) { g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); g.setColor(Color.BLACK); double[][][] points = new double[sim.getHeight()][sim.getWidth()] [2]; for (int i = 0; i < sim.getHeight(); i++) { for (int j = 0; j < sim.getWidth(); j...
f252b970-53de-44e2-92f9-cb943ab2f01d
2
private static void output(int array[][]) { for (int i = 0; i < array.length; i++) { for (int j = 0; j < array.length; j++) { System.out.print(Integer.toString(array[i][j]) + " "); } System.out.println(); } }
a85e7a6d-54ed-40fe-9433-4139c1ec6d12
0
private ImageProcessor doMinimumSuppression(ImageProcessor in, ImageProcessor adjusted){ //Generate a mask with threshold 0.2*255 ImageProcessor adjImg = adjusted.duplicate(); adjImg.threshold(51); //now median filter with a 5x5 kernel to denoise filter.rank(adjImg, 2, RankFilters.MEDIAN); //ap...
3543b735-5886-4fe1-9772-6b42c0c9abf5
8
private int splitTreeNode(TreeNode currentNode, Set<Node> curCandidates, boolean isTrueChild) { Set<Integer> sampleList = null; if (isTrueChild) { sampleList = currentNode.sampleSetTrue; } else { sampleList = currentNode.sampleSetFalse; } Node chosenFeatu...
b65bf4db-28ce-4214-81ad-b6ea591ad472
7
boolean inBlockComment(int start, int end) { for (int i=0; i<blockComments.size(); i++) { int[] offsets = (int[])blockComments.elementAt(i); // start of comment in the line if ((offsets[0] >= start) && (offsets[0] <= end)) return true; // end of comment in the line if ((offsets[1] >= start) && (offsets[1] <=...
d243b8c1-16ae-4615-a1d9-1761ad9ff0cc
2
public void playBattleLoop() throws InterruptedException{ while(true){ try { in = new FileInputStream(battle); as = new AudioStream(in); ap.player.start(as); } catch(Exception e) { System.out.println("Got an IOEx...
6e1a689e-7a23-4e44-bee3-0151f06a5696
3
public static void write(String filename, PackedImage image) throws IOException { File out = new File(filename); FileOutputStream fos = new FileOutputStream(out); String header = "P6\n" + image.cols() + " " + image.rows() + "\n255\n"; fos.write(header.getBytes()); byte[] buf = new byte [image.cols() * image.row...
0a449408-08f5-4e16-97cc-8f0592907eb3
4
public final void update(Level level, int x, int y, int z, Random rand) { int var6 = level.getTile(x, y - 1, z); if(level.isLit(x, y, z) || var6 != Block.STONE.id && var6 != Block.GRAVEL.id && var6 != Block.COBBLESTONE.id) { level.setTile(x, y, z, 0); } }
d39dfe85-4f1e-4746-b196-8b04a3c96923
4
public void setCapacity(int newCapacity) { if (newCapacity == capacity) { return; } byte[] newBuffer; if (newCapacity > 0) { newBuffer = new byte[newCapacity]; if (capacity > 0) { int len = capacity; if (newCapacity < le...
05cbeb7f-e383-4994-8762-78f73b77d105
8
public static void sevendrome(int a, int b) { if(b <1000000) { return; } for(int d=1; d<10; d++) { for(int d2=0; d2<10; d2++) { for(int d3=0; d3<10; d3++) { for(int d4=0; d4<10; d4++) { int test = 1000000*d +100000*d2 + 10000*d3 + 1000*d4 +100*d3 + 10*d2 + d; if(isPrime(test) && test>=a && t...
6fb950d6-99b6-42cc-a352-e1e67a2ed82c
7
public void userDataEvent(VisualizePanelEvent e) { if (m_propertyDialog != null) { m_propertyDialog.dispose(); m_propertyDialog = null; } try { if (m_focus != null) { double wdom = e.getInstances1().numInstances() + e.getInstances2().numInstances(); if (wdom == 0) { w...
83122056-df45-4f4a-ad8a-e17d8848f129
4
public void mouseMoved(MouseEvent e) { if( e.getX() >= 5 && e.getX() <= 45 && e.getY() >= 5 && e.getY() <= 45){ this.returnBtnFlag = true ; }else{ this.returnBtnFlag = false ; } }
2a6ceddf-eb71-49ce-a9b8-bf99a6ea04dd
0
public static QuestionManager getInstance() { return instance; }