method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
61081453-9c48-4924-b2f2-5a66a417d5fd
7
public boolean tryOpen(Matrix matrix) { LinkedList<Node> neighbours = matrix.allNeighbours(x, y); for (Node neighbour : neighbours) { if (neighbour instanceof Door) { if (((Door)neighbour).isOpen()) { ((Door)neighbour).close(); if (inventory.containsValue(((Door)neighbour).getKey(...
a20b07cc-3564-4db5-b5c6-ef1aeb262616
7
public boolean getFile(String branch, String path, File file) { boolean b = true; Utils.logger.log(Level.INFO, "Getting file from github " + path + " to " + file.getAbsolutePath()); InputStream is = null; ReadableByteChannel rbc = null; FileOutputStream fos = null; try { URL url = new URL(APIBASE + "r...
ae7fdc4a-3a0d-4877-8978-613b93c52f6b
2
private void createSearchList() { searchList.clear(); for ( Column column : columns ) { if ( column.isSearchId() ) { searchList.add( column.getFldName() ); hasSearch = true; } } }
9e40c644-e1f5-4691-b653-11c1ba2f8671
2
static public Integer clampPriority(Integer priority) { if (priority.intValue() > MAX_PRIORITY.intValue()) { priority = MAX_PRIORITY; } else if (priority.intValue() < MIN_PRIORITY.intValue()) { priority = MIN_PRIORITY; } return priority; }
06763cb8-67ec-4d9d-87f0-2216c940d54e
9
private void createVitalSignjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createVitalSignjButtonActionPerformed // TODO add your handling code here: boolean isInputValid = true; if(this.respiratoryRatejTextField.getText().trim().compareTo("") == 0 && !...
96599372-d808-4fe7-aa11-7b5c42f0d86c
2
public void showPersonalPostsToFile(FileWriter f) throws IOException { for (TimedPosts post : posts) { long elapsedTimeInSec = (endTime - post.getTime()) / 1000000000; endTime += 1000000000; if (elapsedTimeInSec < 60) { int elapsedTime = (int) elapsedTimeInSec...
04e7d5e2-05e3-4940-ad31-b1f78e680916
9
public static ArrayList<String> walk(String ip, String comunidade, String objeto) throws IOException { System.out.println("\nSNMP Walk"); System.out.println("Objeto: " + objeto); System.out.println("Comunidade: " + comunidade); // Inicia sessaso SNMP TransportMapping transport =...
de13196e-8643-464d-a9b7-e1c9d0dbbae4
8
private DataCacheEntry fetchLine(int address) { int tag = address / (lineSize * (numberOfLines / associativity)); int set = (address / lineSize) % (numberOfLines / associativity); int offset = address % lineSize; int index = 0, oldest = 0; DataCacheEntry entry = null; for (int i = 0; i < associativity; i...
21cc301c-44d5-47d8-a501-668bb5f6b0ff
5
private void calculateDesiredVelocity() { float distanceToTarget = Maths.getDistance(this.getX(), this.getY(), this.targetX, this.targetY); double angleDifference = Maths.angleDifference(Math.toDegrees(angle), Math.toDegrees(desiredAngle)); if(!halting && distanceToTarget > 1) { ...
5382e825-64b7-480b-91a6-444c11d82d75
3
public boolean intersects(GameObj obj){ return (pos_x + width >= obj.pos_x && pos_y + height >= obj.pos_y && obj.pos_x + obj.width >= pos_x && obj.pos_y + obj.height >= pos_y); }
74e469ad-e6dd-46f0-81c3-04116f4e0ff2
3
public Token getNextToken(){ //mat.usePattern(space).find(); Token curToken = new Token(); curToken.type = TokType.UNKNOWN; curToken.value = ""; for(int i=0;i<patterns.length-1;i++){ if(mat.usePattern(patterns[i].pat).find()){ curToken.value = mat.grou...
e653324d-e465-4d0e-97ae-7b253ce622bf
2
public void init() { glMatrixMode(GL_PROJECTION); glOrtho(-4, 4, -4, 4, 20, -40); //gluPerspective(70f, 800f/600f, 1, 1000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(0, 0, Display.getWidth(), Display.getHeight()); glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEN...
8f0b72ed-9853-4544-9c05-f802a099dd6f
6
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
d6fa6291-49cb-43b9-91f9-34f76ace5890
9
public Data gen() { int ano = 1960 + g.nextInt(40); int mes = g.nextInt(12); int dia = 1; if (mes == 2 && ano % 400 == 0) { dia = 1 + g.nextInt(27); } else if (mes == 2 && ano % 4 == 0 && ano % 100 != 0) { dia = 1 + g.nextInt(28); } else i...
18030fd1-0994-4a47-9c08-14cf96c1ada3
1
public synchronized void editar(int i) { try { new InstituicaoSubmissaoView(this, list.get(i)); } catch (Exception e) { } }
94a53feb-052f-41f3-afd2-4084a8c198a8
5
public final String getUrl() { if (url == null) { return null; } String returnUrl = url; returnUrl += isUseExtraParams() ? "&cver=html5&ratebypass=yes&c=WEB&alr=yes&keepalive=yes" : ""; returnUrl += String.format("&range=%s-%s", String.valueOf(startRange), String.va...
48e2f355-0dfe-44f9-9519-3df4a13d942c
5
public static JsonElement parse(JsonReader reader) throws JsonParseException { boolean isEmpty = true; try { reader.peek(); isEmpty = false; return TypeAdapters.JSON_ELEMENT.read(reader); } catch (EOFException e) { /* * For compatibility with JSON 1.5 and earlier, we return a ...
74782a68-a400-4ebf-a70d-a70c3b76f45d
9
static String[] toStringArray(MatVar mv, boolean transpose) { if (mv.type() == MatVar.TEXT) { MatText mt = (MatText) mv; int[] dims = mv.getDim(); String[] out = new String[dims[transpose ? 1 : 0]]; for (int i = 0; i < dims[transpose ? 1 : 0]; i++) { ...
71f7efaf-805f-445d-a0f4-7d44f56840d9
6
private void writeObject(List<Byte> ret, TypedObject val) throws EncodingException, NotImplementedException { if (val.type == null || val.type.equals("")) { ret.add((byte)0x0B); // Dynamic class ret.add((byte)0x01); // No class name for (String key : val.keySet()) { writeString(ret, key); enco...
8c48d14e-075b-426f-9c5e-e032e89bcc4b
5
private Thread createAliveThread() { return new Thread() { public void run() { while(true) { try{ if (aliveNotificator != null) { aliveNotificator.iamAlive(rmiObjectName); ...
bd3be8ab-8e1a-4b6c-8641-58abd999fbad
8
private boolean isCollision(Entity e1, Entity e2) { // Hvis objektene er det samme, return false. if (e1 == e2) { return false; } // Er objektene vesener og er de i livet enda? if (e1 instanceof Creature && !((Creature) e1).isAlive()) { return false; ...
2afe7c33-6aff-4939-b76a-f11e3cc8a9ad
0
public void setAihao(String aihao) { this.aihao = aihao; }
751f7de5-4410-4d33-8f8e-7c5e6789e955
9
private static void bindByField(Object pojo, CommandLine cli, Field field) throws Exception { CLIOptionBinding cliBinding = field .getAnnotation(CLIOptionBinding.class); char shortOpt = cliBinding.shortOption(); String longOpt = cliBinding.longOption(); if (cliBinding.values()) { if (field.getType().is...
374dfbdd-fc2d-4633-afae-7263fcac5cbc
3
private static void printGridletList(GridletList list, String name, boolean detail) { int size = list.size(); Gridlet gridlet = null; String indent = " "; System.out.println(); System.out.println("============= OUTPUT for " + name ...
7e8be42b-a799-4e1e-94f8-d5bc20c3674a
7
private Holiday getHoliday(Element element) { String className = null; if (className == null) className = element.getAttributeValue("class"); if (className == null) { className = "nz.co.senanque.madura.datetime.holidays."+element.getName(); } H...
269bd39b-9c59-4095-b4b0-34dd7d281be2
1
int daysOfYear(int year) { if (isLeepYear(year)) { return 366; } return 365; }
eefed605-b1d6-4e47-beae-0c7a13beb7c8
2
@SuppressWarnings("unchecked") @Override public String displayQuestion(int position) { ArrayList<String> questionList = (ArrayList<String>) question; String questionStr = questionList.get(0); StringBuilder sb = new StringBuilder(); sb.append("<span class=\"dominant_text\">" + position + ".</span>\n"); sb.ap...
c9faf376-d42b-42c1-a065-a2a416405008
1
@Test public void testDisconnectOnce() throws Exception { final Properties config = new Properties(); final int min_uptime = 20; final int max_uptime = 2000; config.setProperty("min_uptime", "" + min_uptime); config.setProperty("max_uptime", "" + max_uptime); final...
dbbdf762-c808-4db7-96f1-7b5835d52785
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; }
91b7ec85-aa86-43f1-9fb6-e0b225a64d90
6
public List<StudentObj> getStudentBySubmitted(String classname, int objId, int topicId) { List<StudentObj> items = new LinkedList<StudentObj>(); String sql = "select Student.classname, Student.rollNo, fullname, email from Student inner join Result on Student.rollNo = Result.rollNo inner join Assignment...
646dbd48-149a-421f-8f66-0e57e36c9413
2
@Override protected boolean next() { switch(state()) { case size_ready: return size_ready (); case message_ready: return message_ready (); default: return false; } }
5cec8ca4-a8ae-4e00-a812-da4a3bfa7134
6
@EventHandler public void WitchRegeneration(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.getWitchConfig().getDouble("Witch.Regen...
7e372058-80b0-40fe-86cc-4deaed3d4fc6
3
private void close() { try { out.close(); } catch(Exception e) {} try { in.close(); } catch(Exception e) {} try { socket.close(); } catch(Exception e) {} System.out.println("Thread closed."); }
ff8d999d-6989-4fba-a383-042e5fb57016
8
public ArrayList<Integer> getAvailableRooms(String startTime, String endTime, int capacity){ ArrayList<Integer> availableRooms = new ArrayList<>(); ArrayList<Meeting> meetings = meetings().getMeetings(); for(Room room : rooms().getRooms()){ if(room.getRoomNumber() == -1) continue; ...
c7a27b8f-2b54-4e91-b1f0-03556195ad36
9
@Override public Party getEnemyParty(int level) { Party party = new Party(); Random gen = new Random(); if(level == 1) { if(gen.nextInt(2) == 0) party.add(new Goblin()); else party.add(new Rat()); } else if(level == 2) { if(gen.nextInt(2) == 0) party.add(new Orc()); else p...
019cfc73-168c-4e4c-9a1f-31067c288056
0
public byte[] getInfoHash() { return this.info_hash; }
9049e893-1c7a-475a-b432-d6c0ca797f8d
5
@Test public void testInitRandom() { try { System.out.println("initRandom"); int numberOfGenerators = 5; int numberOfLoadsForGenerator = 3; int R = 2; double xmean = 0.2; double delta = 0.2; PowerGrid instance = new PowerGri...
53358e53-5663-4083-a1e0-265d99582786
2
private <T> T[] copyElements(T[] a) { if (head < tail) { System.arraycopy(elements, head, a, 0, size()); } else if (head > tail) { int headPortionLen = elements.length - head; System.arraycopy(elements, head, a, 0, headPortionLen); System.arraycopy(element...
d642ab00-903b-4614-998a-b1c2f3538f6e
9
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect =...
42e5c6ec-5700-4c9f-aa5f-2e902c237fc2
5
public void prepare( Map<String,BasicType> optionalReturnSettings ) throws MalformedRequestException, UnsupportedVersionException, UnsupportedMethodException, UnknownMethodException, ConfigurationException, MissingResourceException, AuthorizationException, Heade...
530815a7-bbb2-4f81-ba6b-88085aa95718
9
public void run() { Socket incomingSocket = null; while(true) { try { incomingSocket = serverSocket.accept(); System.out.println("Parsing msg.."); Message msg = Utility.parseMessage(incomingSocket); msg.readMessage(); switch(msg.getType()) { case GET: //send peer response //sen...
256d8fd9-a121-413d-b019-8e1fc2f9cb00
0
@Before public void setUp() { view = new DialogWindowView("title"); view.addPropertyChangeListener(this); controller.addView(view); propertyChangeSupport.addPropertyChangeListener(controller); }
1374b574-5bd2-4e83-a397-86d4c0d8fa30
7
private Content getInheritedTagletOutput(boolean isNonTypeParams, Doc holder, TagletWriter writer, Object[] formalParameters, Set<String> alreadyDocumented) { Content result = writer.getOutputInstance(); if ((! alreadyDocumented.contains(null)) && holder instanceo...
8c49844a-3a69-4d65-873a-d8e1f036a1d9
5
static final void method1119(boolean bool) { anInt8381++; try { Method method = (aClass8389 != null ? aClass8389 : (aClass8389 = method1121("java.lang.Runtime"))) .getMethod("availableProcessors", new Class[0]); if (bool != false) method1118(false, false, null, -35); if (method != null...
a8cba7d1-529b-495d-80e2-02fcf589e758
5
public boolean equals(Packet p) { if((end-start) != (p.end - p.start)) { return false; } if(p.mask != mask || p.timeStamp != timeStamp) { return false; } int length = end-start; for(int cnt=0;cnt<length;cnt++) { if(buffer[(start+cnt)&mask] != p.buffer[(p.start+cnt)&mask]) { System.out....
ace216e8-63dc-4d77-a149-a0749d1fa3c0
6
public static void drawNetwork(Network network, Renderer renderer) { ArrayList<Layer> layers = network.getLayers(); int maxWidth = 0; /** * Calculate the maximum width of the layers. * This will later be used to center all layers that are smaller than the widest on...
7374b689-2b57-46bf-b0a4-ac60af3df2ea
0
public void addCode(ByteCode code) { bytecodes.add(code); }
1c9a251b-7a26-4816-8623-c85d99e3ae3e
9
public void incrementTime(int amount){ //increase elapsed time by one elapsed_time += amount; Process temp; //increase wait time for each process in ready queue Iterator<Process> it = readyQueue.iterator(); while(it.hasNext()){ temp=it.next(); if(cpuList.indexOf(temp) == -1){ temp.waitTime++; ...
6b30bdeb-fa40-481b-a6ed-d394f8623acb
9
synchronized void updateMap(int intLocX, int intLocY) { DuskObject objStore; LivingThing thnStore; int i=0, i2=0, i3; if (intLocX-viewrange<0) i = -1*(intLocX-viewrange); if (intLocY-viewrange<0) i2 = -1*(intLocY-viewrange); for (;i<mapsize;i++) { if (intLocX+i-viewrange<MapColumns) { for...
1574a842-e1b2-4c2b-ac3b-bdc71f40669b
2
public String getCollectionName(Object[] args) { if (collectionIndex == -1) { return globalCollectionName; } Object arg = args[collectionIndex]; if (arg == null) { return globalCollectionName; } else { return arg.toString(); } }
f48a3385-d13f-4c3c-ae71-497c286992fe
5
@Override public void drawShape(Graphics graphics) { int thick = super.getThick(); int radius; // x and y are the coordinates for the centre of the circle int x, y; // xn and yn is the first point the user clicked // xm and ym is the second point the user cl...
8c15b9ae-cfd3-4f9d-bd67-43f55bb58fbc
6
final boolean method2847(int i, Class348_Sub43 class348_sub43) { try { anInt8948++; int i_37_ = 47 / ((i - -62) / 36); if (((Class348_Sub43) class348_sub43).aClass348_Sub16_Sub5_7081 == null) { if ((((Class348_Sub43) class348_sub43).anInt7087 ^ 0xffffffff) <= -1) { class348_sub43.removeN...
d1dec875-3ae0-4276-9816-2be638f75e47
4
public boolean execute(CommandSender par1Sender, Command par2Command, String par3Args, String[] par4Args) { if (par1Sender instanceof Player) { String message; Player player = (Player) par1Sender; if (par4Args.length < 1) message = i18n._("genericreason_afk" + (AFKWorker.isPlayerAFK(player) ? "" : "_r...
b01b3845-72e6-40a5-b1e9-c7534faead3f
7
@Override public void createSomeObjects() { this.addUser(new User("worker", "password", GroupType.WORKER)); this.addUser(new User("Gumby", "MyBrainHurts", GroupType.WORKER)); this.addUser(new User("manager", "password", GroupType.MANAGER)); ProductType pt = new ProductType("Skumbananer"), pt2 = new ProductType...
f6c91e71-8782-4e61-83fa-fb65fcff9cd8
6
public void updateBookType(String typeName, BookType bt) { Connection conn = null; Statement st = null; //Do nothing if category is not properly instantiated if(bt == null || bt.getTypeName() == null) return; try { conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&p...
62dfafeb-448e-483f-9707-8cb065873257
7
public void run() { if (isRunning) { return; } autoRunEnabled = true; Object selectedItem = commandCombo.getSelectedItem(); String commandLine = null; if (selectedItem == null) { return; } else { commandLine = selectedItem.toStr...
21778376-0515-4c58-9fe6-868e0d18ffb2
5
public static Map getRandomMapExcluding(List<String> ex){ List<Map> notexcluded = new ArrayList<Map>(); for(Map m : maps){ boolean match = false; String name = m.getName(); for(String s : ex){ if(name.equals(s)) match = true; }if(match == false){ notexcluded.add(m); } } if(notexcluded.siz...
5cec08e7-608d-4990-ba3f-97190ad0b06d
0
public void setUnitPrice(double unitPrice) { this.unitPrice = unitPrice; }
5ed64b50-2d15-4d42-816c-eb2650d6ebb2
2
private void addTab(JPanel tab, String tabImagePath, int tabWidth, int tabHeight, int width, int height) { tab.setBounds(width-tabWidth,(height/2)-(tabHeight/2),tabWidth,tabHeight); BufferedImage TabImage; try{ if(tab.getComponentCount() == 0){ TabImage = ImageIO.read(new File(tabImagePath)); Image sc...
3f8a5ca0-58e9-4b4c-b5e9-d3532da8ec0c
0
@Override public void restoreCurrentToDefault() {cur = def;}
3e01ed67-2acc-4092-aa7c-622ca37f11da
8
public void updateGameSign() { if (signLoc == null) return; if (EventHandle.callGameSignUpdateEvent(this, signLoc).isCancelled()) return; Block block = null; try { block = plugin.getServer().getWorld(signLoc.getWorld().getName()).getBlockAt(signLoc); ...
ccb920f7-d9d3-4f1e-be65-b4b277e9b09d
5
@Override public String toString() { StringBuilder s = new StringBuilder(); for (int p=0 ; p<listeGroupes.size() ; p++) { Groupe groupe = listeGroupes.get(p); // Liste des moyennes (par matières) pour ce groupe float[] moyennesParMatieres = new float[20]; for (Integer numLigne : groupe.ge...
00fc6dda-9346-43fe-bed2-cd4a073e017f
0
public MyTimer() { setLayout(new GridLayout(3, 0, 0, 0)); JButton btnCountUp = new JButton("Count Up"); btnCountUp.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { MainFrame.cardLayout.show(getParent(), "MyTimerUp"); } }); add(btnCountUp); JButton btnCoun...
677a246f-c997-403b-b30e-6bab08d49835
4
public static void downloadfile(String DLURL, String DLDIR, String DLFILE) { //This downloads a mod given the url and the location/filename String DLOC = DLDIR+DLFILE; //The dir to download to new File(DLOC).getParentFile().mkdirs(); //Create parent dirs System.out.println("URL: "+ DLURL); System.out.println...
7f842a4c-d667-488f-8e17-3a154defc422
0
protected void initialize() { Robot.ledStrip.setColor(_red, _green, _blue); }
461bfae7-009b-4714-9f65-4eb1d1bfe809
9
public static void main(String[] args) throws IOException { String[] qps = {"22", "27", "32", "37"}; PsvdTest psvdTest = new PsvdTest(qps, args[0], args[1], args[2], args[3], args[4], args[5], args[6], new String("true")); //make directories psvdTest.makeDirectory("./common/bits"); ...
6740e8b7-79b9-4c5f-b838-2f911ba6ccf8
5
public static boolean isReservedLessThanOp(String candidate) { int START_STATE = 0; int TERMINAL_STATE = 1; char next; if (candidate.length()!=1){ return false; } int state = START_STATE; for (int i = 0; i < candidate.length(); i+...
6cd584ef-67e4-4dcc-9bc6-ba9d0bc2df1f
6
public void onPickupFromSlot(ItemStack par1ItemStack) { ModLoader.takenFromCrafting(this.thePlayer, par1ItemStack, this.craftMatrix); ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix); this.func_48434_c(par1ItemStack); for (int var2 = 0; var2 < this.craf...
daa51778-4a11-4cae-91c4-b60f321b878e
9
public void handleInteraction(Automaton automaton, AutomatonSimulator simulator, Configuration[] configs, Object initialInput) { JFrame frame = Universe.frameForEnvironment(environment); // How many configurations have we had? int numberGenerated = 0; // When should the next warning be? int warningGener...
c8b7c707-426f-4e27-bf5e-1e6daa6e89fe
6
private void freeResources(Socket socket, InputStream in, OutputStream out) { if (out != null) { try { out.close(); } catch (IOException e) { } } if (in != null) { try { in.close(); } catch (IOException e) { } } if (socket != null) { try { socket.close(); } catch (IOExcepti...
ef404c0f-53e5-49fd-a04e-cfbe050fcad9
5
private void addButtonsListeners() { btnAddPics.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { getSoundsPath(picsListModel); } }); btnAddSounds.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { getPicturesPath(soundsListM...
ce488e1c-a75e-432c-9b26-4588e0a4fac0
0
public void addPeople(ArrayList<Villager> newPeople) {people.addAll(newPeople);}
c1830336-9558-4591-88f3-3ee5da92b7eb
0
@Override public String toString() { return "FUNCTION " + functionName + " " + startLineNumber + " " + endLineNumber; }
76508097-9d34-4427-846d-a19c1c47c23d
9
public static void javaHelpOutputPrintStream(Stella_Object stream, Cons exps, boolean nativeWriterP, boolean endoflineP) { if (stream == Stella.SYM_STELLA_JAVA_STANDARD_OUT) { if ((Stella.string_getStellaClass("SYSTEM", false) != null) || Stella.inheritedClassNameConflictsP("SYSTEM")) { ((Ou...
fa3df9bd-afe8-4fe0-9fbd-3bf020046be5
0
public String getLocalhost() { return localhost; }
2ff46030-db6e-4273-97bc-c8006d88d207
9
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentLevel++; currentElement = true; currentValue = ""; String name = null; if (localName != null && localName.length() ...
2cca31a1-ae8d-49fc-ac67-e3981534025c
1
public void initAllCells() { initCells(); initBorders(); initInsideFences(); initEnemies(); initPlayer(1); if(p2) initPlayer(2); }
4b5de6df-77e6-4620-afbb-b3703402c1fa
7
public HashMap<String, Multimap<String, Double>> call() throws Exception { HashMap<String, Multimap<String, Double>> rt = new HashMap<String, Multimap<String, Double>>(); HypermodulesHeuristicAlgorithm ha = new HypermodulesHeuristicAlgorithm(this.stat, this.foregroundvariable, this.sampleValues, this.clinicalValues...
ab0441a4-8840-4c91-95e7-3087ee76e8cc
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; }
5da82cc1-43ac-40b3-a3aa-112cb5382992
1
private char[] charArrToUpperCase(char[] cArr) { for (int i = 0; i < cArr.length; i++) { cArr[i] = Character.toUpperCase(cArr[i]); } return cArr; }
87a1a704-b89b-40f4-8cac-c031db5a749a
0
@Override public void addPool(ITicketPool pool) { throw new UnsupportedOperationException(); }
912c4741-e991-4091-9082-f0bd7507d25a
9
private static String[] tokenizeTransformation(String transformation) throws NoSuchAlgorithmException { if (transformation == null) { throw new NoSuchAlgorithmException("No transformation given"); } /* * array containing the components of a Cipher transformation:...
a6b52ec8-ff96-4642-a02b-24f53eaf69e3
7
public int[] getInts(int par1, int par2, int par3, int par4) { int ai[] = parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); int ai1[] = IntCache.getIntCache(par3 * par4); for (int i = 0; i < par4; i++) { for (int j = 0; j < par3; j++) { ...
6cf564a5-fa39-4fc6-a014-27bbf618fbc0
9
public void addGateComponent(Component gateComponent) { if (flowLayout) { flowLayoutGatesPanel.add(gateComponent); flowLayoutGatesPanel.revalidate(); flowLayoutGatesPanel.repaint(); } else { Component[] components = nullLayoutGatesPanel.getComponen...
d221401a-68ac-4279-9626-2447f91a5576
0
public String getDirFilterInclude() { return this.dirFilterInclude; }
32ecbc22-51d6-4755-9bd3-7a0b8cad4899
2
public BPTreeNodeItem getItem(int index){ if(getItemCount() > 0 && index < getItemCount()) return leafItems.get(index); else return null; }
5d69e46b-629d-4d9e-a59e-b1255dcf7752
1
public void visit( final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.version = version; this.access = access; this.name = name; this.signature = sig...
118a9001-99ef-45f0-a8d4-0a59b342845e
9
* @param str the string to search for * @param start the index to start at (0 is good) * @return the index at which the search string was found in the string list, or -1 */ private static int strIndex(final Vector<String> V, final String str, final int start) { if(str.indexOf(' ')<0) return V.indexOf(str,...
a1bdfd2b-8366-467a-931b-3e00fb7167d7
3
public static int bin(int[] a, int from, int to, int key) { int left = from; int right = to - 1; while (left <= right) { int mid = (left + right) >>> 1; int mid1 = a[mid]; if (mid1 < key) { left = mid + 1; } else if (m...
316407c8-34ce-493f-af32-6760ca33903f
1
public void testProperty() { LocalDateTime test = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40, GJ_UTC); assertEquals(test.year(), test.property(DateTimeFieldType.year())); assertEquals(test.monthOfYear(), test.property(DateTimeFieldType.monthOfYear())); assertEquals(test.dayOfMonth(), t...
a7519015-b659-4134-8b24-b19e7daa4d26
8
public void disconnect() { if (state == CONNECTED) { try { mConnection.getOutputStream().write(Messages.disconnect()); // last_action = System.currentTimeMillis(); } catch (IOException e) { if (DEBUG) PApplet.println("Ohno! Something went wrong... IO Error, failed to send DISCONNECT message.");...
148f0ff2-4284-4bda-a8ae-04006e6bae4e
2
public Type getHint() { int hint = possTypes & hintTypes; if (hint == 0) hint = possTypes; int i = 0; while ((hint & 1) == 0) { hint >>= 1; i++; } return simpleTypes[i]; }
369ff0a6-56dc-4ec2-b53e-09be30dc5a76
6
public void unpackDat(File outFolder) throws IOException { log.trace("Unpacking dat file " + datFile.getPath() + " into " + outFolder.getPath()); byte[] buffer = new byte[4096]; int bytesRead; outFolder.mkdirs(); for (Map.Entry<String, InnerFileInfo> entry : innerFilesMap.entrySet()) { String innerPath =...
3b7078ac-ab6e-495d-8b4b-2d5ffb8765a0
8
public Vector getObjects(String prefix,int cidmask,boolean suspended_obj, JGRectangle bbox) { Vector objects_v = new Vector(50,100); int nr_obj=0; JGRectangle obj_bbox = tmprect1; int firstidx=getFirstObjectIndex(prefix); int lastidx=getLastObjectIndex(prefix); for (int i=firstidx; i<lastidx; i++) { JGO...
9662dadb-7df2-4431-805b-7b3cf2cd36d9
4
@Test public void test_addition() { int m = 2; int n = 3; Matrix m1 = new MatrixList(m, n); Matrix m2 = new MatrixList(m, n); Matrix m3 = new MatrixList(m, n); for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; j++) m1.insert(i, j, (double) (2 * i + j)); } for (int i = 1; i <= m; i++) { ...
de14ee1c-6140-4925-badc-e63cf34abdc0
3
public Tex draw(int h, long scale) { TexIM ret = new TexIM(new Coord(hist.length, h)); Graphics g = ret.graphics(); for(int i = 0; i < hist.length; i++) { Frame f = hist[i]; if(f == null) continue; long a = 0; for(int o = 0; o < f.prt.length; o++) { long c = a + f.prt[o]; g.setColor(cols[o]...
b766c285-e9cd-4532-9c69-1151c643183e
4
void paintOpacity(CPRect srcRect, CPRect dstRect, byte[] brush, int w, int alpha) { int[] opacityData = opacityBuffer.data; int by = srcRect.top; for (int j = dstRect.top; j < dstRect.bottom; j++, by++) { int srcOffset = srcRect.left + by * w; int dstOffset = dstRect.left + j * width; for (int i =...
227b010a-ef0b-48b2-a69e-22a51ca78efd
2
public int getScore(int player) { int score = 0; for (int piece : boardArray) if (piece == player) score++; return score; }
32196411-65ee-453a-bd36-6e40e3c48f53
7
void createColorAndFontGroup () { /* Create the group. */ colorGroup = new Group(controlGroup, SWT.NONE); colorGroup.setLayout (new GridLayout (2, true)); colorGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, false, false)); colorGroup.setText (ControlExample.getResourceString ("Colors")); colorAndFon...
8ba04b45-19f1-46a4-9a2b-9f9c0fb1b006
5
private boolean CharClass() { begin("CharClass"); if (!next('[') && !next("^[") ) return reject(); if (next(']')) return reject(); do if (!Char()) return reject(); while (!next(']')); Space(); sem.CharClass(); return accept(); }