method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
ecb28c45-eb32-483d-884e-44fbc6659682
6
@Override Object unpack(Info vi, Buffer opb) { int acc = 0; InfoResidue0 info = new InfoResidue0(); info.begin = opb.read(24); info.end = opb.read(24); info.grouping = opb.read(24) + 1; info.partitions = opb.read(6) + 1; info.groupbook = opb.read(8); ...
c5bffacb-10b5-4607-a9c1-ac297218bb13
4
public Matrix getL () { Matrix X = new Matrix(m,n); double[][] L = X.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (i > j) { L[i][j] = LU[i][j]; } else if (i == j) { L[i][j] = 1.0; } else { ...
69f131f3-16ac-4e72-88b3-5c7b4eadc1fe
7
private void primeCube(List<DefinedMove> path) { RubiksCube rc = this.initialRcConfig; // Pre requisite : we must prime the cube // Identify the upper right cubie of the front facelet and especially the color on the top face Cubie frontFaceUpperRightCubie = rc.getCubie(3, 3, 3); Facelet topFacelet = frontF...
05b20c8e-2a0f-48f9-9953-5d636d387d1c
4
public MediaTag load(RandomAccessFile raf,String versions) throws IOException { // todo: support Ogg Vorbis here if different int blockLen=FlacMetadataBlock.readBlockSize(raf); // standard vorbis stuff int vendor_length = (int)(MediaFileUtil.read32bitLittleEndianUnsignedInt(raf)...
f32da4c2-1761-4943-a4b4-86fe880790aa
3
void deleteSubTree( Node node ) { // recursion stopping condition if ( node != null ) { // recursive call for right sibling if ( node.rightSibling != null ) deleteSubTree( node.rightSibling ); // recursive call for first son if ( node.sons != null ) deleteSubTree( node.s...
d9d4b448-9032-4fbf-9b4e-bc849c8b7a70
1
public static void setHunterCreationProbability(double HUNTER_CREATION_PROBABILITY) { if (HUNTER_CREATION_PROBABILITY >= 0) Simulator.HUNTER_CREATION_PROBABILITY = HUNTER_CREATION_PROBABILITY; }
dc102ae0-a627-44af-b670-39e08d9620b3
3
public boolean saveQuesterListToFile() { if (broadcastSaving == true) { getServer().broadcastMessage( "[Hawox uQuest] Saving all players quests to file..."); } System.out.println("[Hawox uQuest] Saving all players quests to file..."); for(Quester q : theQuesterList) questPlayerStorage.setString(q.the...
2f83190f-18c5-4a76-8144-a3da166d2284
0
public static void main(String[] args) { int i = cal(5); System.out.println(i); }
e1ec3a06-ef8f-4804-bf0b-389c63abaf2d
5
private boolean contenuDansMap(HashMap<String, Double> map) { double gauche, droite, bas, haut; gauche = map.get("gauche"); droite = map.get("droite"); bas = map.get("bas"); haut = map.get("haut"); for(Point2D p:_coordonnees) { double x = p.getX(); ...
8cfd4894-8437-4fa7-82ba-8a086fc454d7
5
@Override public double getYRotation() { double lowest = 9001; double highest = 0; int y = 0; if (getRotationAngle() == 90) y = 20; if (getRotationAngle() == 270) y = -20; for (Block block : blockArray) { if (block.getYValue() > highest) highest = block.getYValue(); if (block.getYValue()...
2f3f7f23-f45f-4956-8b34-0c90909ba7e3
9
public void run() { byte[] packet_buffer; do { packet_buffer = new byte[1024]; try { DatagramPacket packet = new DatagramPacket(packet_buffer, packet_buffer.length); serverSocket.receive(packet); int packet_number = Utilities.getPacketNum(packet_buffer); InetAddress src_ip = pa...
df7a97bb-ced0-4190-9bef-f8213d7ffb1d
5
private boolean isFourOfAKind(ArrayList<Card> player) { ArrayList<Integer> sortedHand=sortHand(player); int quadCounter=0; for(int i=0;i<player.size()-3;i++) { if(sortedHand.get(i)==sortedHand.get(i+1) && sortedHand.get(i+1) ==sortedHand.get(i+2) && sortedHand.get(i+2)==sortedHand.get(i+3)) { quadCoun...
220da90d-a256-4452-a1a3-906be049574c
4
@Override public void courseSelected(CourseRec course) { selected = course; sortedElements.clear(); if (selected != null) sortedElements.addAll(selected.getOfferings()); Collections.sort(sortedElements, new Comparator<OffRec>() { @Override public int compare(OffRec o1, OffRec o2) { if (o1.getStart...
52f3b218-75d3-4a3f-b5b6-438d320040e7
8
public static Set<String> getAllTables(Connection conn, String[] tables, String[] exFilters) throws Exception { Set<String> result = new HashSet<String>(); Map<String, String> buf = new HashMap<String, String>(); if (tables != null) { for (String t : tables) { result.add(t); } } String sql = "sho...
1c66b198-f35b-4f72-b13e-46d75dc0576b
2
public Boolean isAdmin(Player player) { if(player.isOp() || player.hasPermission(admin) ) { return true; } return false; }
444b718c-0f80-4d38-97ce-0d3267631bec
8
public static String[] mnemonics(String numberStr) { if (numberStr == null) { throw new NullPointerException(); } if (numberStr.length() == 0) { throw new IllegalArgumentException("empty string"); } // Get array of chars to simplify code char[] chars = numberStr.toCharArray(); // First pass...
94838d55-aeb5-4141-b850-d01d6d071484
8
public static Object load(int addr, Class<?> type) { if(type == boolean.class) return load_i1(addr); if(type == byte.class) return load_i8(addr); if(type == short.class) return load_i16(addr); if(type == int.class) return load_i32(addr); if(type == long.class) return ...
d767eeed-be36-421a-82f9-8e298cd86ddd
7
protected void updateAppIcons() { boolean running = false; Project runningProject = null; for (Project p: this.arPrj) { if (p.isRunning()) { running = true; runningProject = p; break; } } // update frame-icon if (this.runningState != running) { this.updateIconImage(running); }...
fcb2e6bc-51f5-4a76-aee1-7dcc452451b0
1
public void WheelUp() { switch(Main.Screen) { case "inGame": Main.inGameManager.WheelUp(); break; } }
0445b162-3d1c-4b2b-8145-ce1aa808df3f
4
public void loadPlayerPermissions(Player player){ String playerName = player.getName(); //plugin.info("Loading permissions for " + playerName); //rankInfo info = getPlayerRank(player.getName()); int followers = plugin.getNumFollowers(playerName); for (int i = 0; i < rankList.size(); i++) { ...
639e6538-6ff1-4ba3-8377-ae141aaab5ea
6
public GUIController(WorldFrame<T> parent, GridPanel disp, DisplayMap displayMap, ResourceBundle res) { resources = res; display = disp; parentFrame = parent; this.displayMap = displayMap; makeControls(); occupantClasses = new TreeSet<Class>(new Comparato...
4f7f3a66-7f7d-40c7-b4d7-6411eb6e5cbe
8
protected static Level strToLevel(String level) { if(level == null) return null; level=level.toLowerCase().trim(); if(level.equals("fatal")) return Level.SEVERE; if(level.equals("error")) return Level.SEVERE; if(level.equals("warn")) return Level.WARNING; if(level....
3e3fd5eb-4da9-48bf-8bc4-10608cbc2e5f
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://download.oracle.com/j...
dae4c3eb-8c15-42b4-aa08-14b75c2cc3ad
6
@Override public String toString() { String str = ""; switch(minlogType) { case Log.LEVEL_TRACE: str += "[TRACE]"; break; case Log.LEVEL_DEBUG: str += "[DEBUG]"; break; case Log.LEVEL_ERROR: str += "[ERROR]"; break; case Log.LEVEL_INFO: str += "[INFO]"; break; case Log.LEVEL_WA...
ca98eb91-cefd-4950-87df-924263da068e
7
@Override public String toString() { String output = "\n"; for (int i = 0; i < _height; i++) { for (int j = 0; j < _width; j++) { boolean agentLocation = false; for (Agent a : _agents) { if (a.position.x == i && a.position.y == j) { output += a.getDisplayChar(); agentLocation = ...
f7af401a-14b8-4072-8d39-da855bf8b778
2
public OrderDirectedDFS(Digraph G) { marked = new boolean[G.V()]; reversePostOrder = new LinkedList<Integer>(); postOrder = new LinkedList<Integer>(); preOrder = new LinkedList<Integer>(); for (int v = 0; v < G.V(); v++) if (!marked[v]) dfs(G, v); }
79ab889f-55e2-4f6c-91e5-3bb27a7c90cf
3
public void setHmac(Key key){ Mac hmac = null; try { hmac = Mac.getInstance("HmacSHA256"); } catch (NoSuchAlgorithmException e) { System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage()); } try { hmac.init(key); } catch (InvalidKeyException e) { System.err.println...
ce4d758e-7ae7-48fc-8b33-d0ef2c5f2f2c
0
public String returnRoomId() { return roomId; }
12b15d9f-e64b-49e1-a0ee-7314981b22a1
5
public boolean getOptionOrdinalValue(EnumOptions enumoptions) { switch (EnumOptionsMappingHelper.enumOptionsMappingHelperArray[enumoptions.ordinal()]) { case 1: return this.invertMouse; case 2: return this.viewBobbing; case 3: ...
20feaf85-b24c-473b-891a-b913d9a12e4b
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 Projection)) { return false; } Projection other = (Projection) object; if ((this.id == null && other.id != null...
23109e4c-d95a-4d02-b768-a534feb07a71
5
public static String mid(String str, int pos, int len) { if (str == null) { return null; } if (len < 0 || pos > str.length()) { return EMPTY; } if (pos < 0) { pos = 0; } if (str.length() <= (pos + len...
d4a7b543-9755-4246-9075-2e258c5260e6
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Cell other = (Cell) obj; if (i != other.i) return false; if (j != other.j) return false; return true; }
93bcac21-daa8-46f6-8bd8-da59eb7810ba
8
public Void visitExecutableStatement(ExecutableStatementContext ctx) { if (ctx.lineLabel() != null) indent(ctx.lineLabel().getText()); else indent(); if (ctx.assignmentStatement() != null) visitAssignmentStatement(ctx.assignmentStatement()); else if (ctx.ifStatement() !...
a9e68c52-52a6-4f67-b717-788f00e48deb
0
public CommandCwban(CreeperWarningMain plugin) { this.plugin = plugin; this.pds = new playerDataSave(plugin); }
7040c980-70f4-41d9-ae99-9c1f3fa1ba3b
8
public void visitBaseType(final char descriptor) { switch (descriptor) { case 'V': declaration.append("void"); break; case 'B': declaration.append("byte"); break; case 'J': declaration.append("long"); break; case 'Z': declaration.append("boolean"); break; case 'I': declaration.app...
3c8e7049-9590-4d2e-9a86-7b531bbdc9a3
9
protected List<Framedata> translateRegularFrame( ByteBuffer buffer ) throws InvalidDataException { while ( buffer.hasRemaining() ) { byte newestByte = buffer.get(); if( newestByte == START_OF_FRAME ) { // Beginning of Frame if( readingState ) throw new InvalidFrameException( "unexpected START_OF_FRAME...
64c68a4f-7165-4762-bf04-60e4df4c8fde
1
void addToSubroutine(final long id, final int nbSubroutines) { if ((status & VISITED) == 0) { status |= VISITED; srcAndRefPositions = new int[(nbSubroutines - 1) / 32 + 1]; } srcAndRefPositions[(int) (id >>> 32)] |= (int) id; }
cede5263-03d9-4a9f-9502-872480bb6b31
1
public void replace(StructuredBlock sb) { outer = sb.outer; setFlowBlock(sb.flowBlock); if (outer != null) { outer.replaceSubBlock(sb, this); } else { flowBlock.block = this; } }
9a2a8939-ddff-4e71-b10a-f7382a85dbaa
5
@Override public boolean equals(Object object) { if (!(object instanceof Road)) { return false; } Road road = (Road) object; if (road.getSpeed() != speed) { return false; } return road.getCityIndex1() == cityIndex1 && road.getCityIndex2() == ci...
3707735f-3734-4260-8530-3df743c24c08
5
private LinkedList<String> extractKeywords(String filename) { LinkedList<String> keywords = new LinkedList<String>(); //remove file extension int posOfDot = filename.lastIndexOf('.'); if (posOfDot != -1) { keywords.add(filename.substring(posOfDot)); ...
77296657-45ae-4d4d-a243-4a34a99bb34b
5
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MyComparator)) return false; MyComparator myComparator = (MyComparator) o; if (age != myComparator.age) return false; if (name != null ? !name.equals(myComparator.name) : myComparator...
46fbc7f2-4346-4e6f-9100-aa9f6265714e
7
private static boolean isValid(int m, int d, int y) { if (m < 1 || m > 12) return false; if (d < 1 || d > DAYS[m]) return false; if (m == 2 && d == 29 && !isLeapYear(y)) return false; return true; }
735dec86-42c0-433e-8c7b-ac8999f38813
6
public static void main(String args[]) throws IOException, InterruptedException, JAXBException { long sleepTime = 0; VehicleDetailFetcher vFetcher= new VehicleDetailFetcherAndhraPradesh(); String [] DistrictCodeArray = (new HyderabadDistrictCodeGenerator()).generateDistrictCode(); ArrayList<String> Series = (...
d7a112a8-cecd-4d78-8ce6-bb68d522caee
9
public void Register(){ boolean alreadyRegistered = false; for(int i = 0; i < table.getRowCount();i++){ alreadyRegistered = false; if(table.getValueAt(i, 4).equals(Boolean.TRUE)){ //get participant based on the rest of their information String type = (String) table.getValueAt(i, 0); String first =...
85c1770e-812f-4403-b03b-4b4a11888364
7
public static BigInt koMul(BigInt A, BigInt B) { System.out.print("A: "); A.print(); System.out.print("B: "); B.print(); System.out.println("A.length: " + A.length()); System.out.println("B.length: " + B.length()); int n = Math.max(A.length(), B.length()); System.out.print...
7b26a68e-5810-4169-8f8e-b50ae58944dc
2
public List<MapName> sendRequest(String lang) { List<MapName> result = new ArrayList<MapName>(); RestTemplate rest = new RestTemplate(); String json = rest.getForObject("https://api.guildwars2.com/v1/map_names.json?lang="+lang, String.class); ObjectMapper mapper = new ObjectMapper(); try { JsonNode node = ...
8565f1db-d716-41a8-abcc-f6aba6fdbc07
9
public synchronized boolean equals(Object obj) { if (!(obj instanceof BatchSaveResult)) return false; BatchSaveResult other = (BatchSaveResult) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); ...
b4fc61da-77d6-416a-becb-667ed3251f2e
6
public void savePlayerData(KaramPlayer player) { String strName = player.player.getName(); String strFileName = String.format("%s\\players\\%s.yml", m_plugin.getDataFolder().getAbsolutePath(), strName); File playerFile = new File(strFileName); try { if (!player...
cc81434e-e15f-4b82-b7ef-6cdb2447ab97
1
@Override public void handleResult() throws InvalidRpcDataException { String result = getStringResult(); if (result.equalsIgnoreCase(STATUS_STRING_OK)) { EventBusFactory.getDefault().fire(new RemoteDownloadsChangedEvent()); } else { // TODO: handle Ariett...
82985c5b-c923-470f-bb8b-ca5b88560103
9
public List<Location> adjacentLocations(Location location) { assert location != null : "Null location passed to adjacentLocations"; // The list of locations to be returned. List<Location> locations = new LinkedList<Location>(); if(location != null) { int row = location.ge...
51b39752-5d58-4aad-a5c6-c9267b0b43d5
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Hunter)) return false; Hunter other = (Hunter) obj; if (hunterAID == null) { if (other.hunterAID != null) return false; } else if (!hunterAID.equals(other.hunterAI...
aa34c9ae-87fa-4072-ad09-acc2f16e18fe
3
private void transfer(Entry<V>[] newTable) { Entry[] src = this.table; int newCapacity = newTable.length; for (int j = 0; j < src.length; j++) { Entry e = src[j]; if (e != null) { src[j] = null; do { Entry next = e.next; int i = indexFor(e.hash, newCapacity); ...
b88c5909-8510-479c-bb6e-97bb76c407b4
2
private List<? extends TypeMirror> getTypeMirrors( List<AnnotationValue> annotationValues) { List<TypeMirror> list = new ArrayList<TypeMirror>(); for (AnnotationValue o : annotationValues) { list.add((DeclaredType) o.getValue()); } return list; }
83f6b944-76ae-47dd-8cdb-d28e0d67e481
5
private void loadProgramCode(ArrayList<ArrayList<String>> program) { InputTableModel model = (InputTableModel) tblInput.getModel(); model.setRowCount(0); if (program != null && program.size() > 0) { for (ArrayList<String> line : program) { Object[] data = new Object[line.size()+1]; data[0] = program.in...
381d89d0-0ad7-4406-89ec-710ba33ba342
5
public synchronized void uploadJmx(String userKey, String testId, String fileName, String filePath) { if (userKey == null || userKey.trim().isEmpty()) { BmLog.debug("JMX cannot be uploaded, userKey is empty"); return; } if (testId == null || testId.trim().isEmpty()) { ...
a3b6cb23-9890-4ebe-8d17-12c048e440d8
6
private void cycleFocusWithinLevel(boolean next) { List<View> focusableViews = getFocusableSiblings(); if (!focusableViews.isEmpty()) { int newFocusIndex = focusIndex + (next ? 1 : -1); int max = focusableViews.size(); if (newFocusIndex < 0) { newFocus...
895b2cd2-c7a9-4942-9d76-2cc9e565901f
6
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OpdrachtCatalogus other = (OpdrachtCatalogus) obj; if (opdrachten == null) { if (other.opdrachten != null) return false; } else if (!opdrachten.equ...
c0f30da3-962f-4ed2-a761-ef59e4d68972
9
public static String longestPalindrome2(String s) { String s1="#"; for (int i=0;i<s.length(); i++) { s1 += s.charAt(i) + "#"; } int[] P= new int[2*s.length()+1]; for (int i=0; i<=s.length()*2; i++) { int len=0; for(int j=1; ((i-j...
7bc928d4-95ac-4694-933e-e56dea92d562
3
@Override public void run() { long lastTime = System.nanoTime(); //nano is much preciser long timer = System.currentTimeMillis(); final double ns = 1000000000.0 / 60.0; //how many time to run the update methode double delta = 0; int frames = 0; int updates = 0; requestFocus(); // keep on doing whats...
fe757538-aab8-46d3-a908-36472e977c8f
9
@Override public TimeOfDay getTODCode() { if((time>=getDawnToDusk()[TimeClock.TimeOfDay.NIGHT.ordinal()])&&(getDawnToDusk()[TimeClock.TimeOfDay.NIGHT.ordinal()]>=0)) return TimeClock.TimeOfDay.NIGHT; if((time>=getDawnToDusk()[TimeClock.TimeOfDay.DUSK.ordinal()])&&(getDawnToDusk()[TimeClock.TimeOfDay.DUSK.ordin...
a048d02d-3fb9-4dc1-ba59-7e704249c02d
9
public void beginStep(List<Body> bodies, double dt) { for (Body b : bodies) { double k = b.getKineticEnergy(); Vector2d v = b.getVelocity(); Vector2d p = b.getPosition(); double x = p.getX(), y = p.getY(), r = b.getRadius(); if (x + r > wall) v = scale(v, v(v.getX() > 0 ? -damping : 1, 1)); ...
743649fb-0c07-4804-bdeb-aee52b53821a
4
public boolean isValidLocation(int c, int r) { if((c >= 0 && c < 8) && (r >= 0 && c < 8)) { return true; } else { return false; } }
ff1b33e1-b094-4af2-ab7d-7152763d88ca
9
@Override public void run() { WatchKey watchKey = null; try { watcher = FileSystems.getDefault().newWatchService(); watchKey = pathlocation.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); } catch(InvalidPathException e) { System.err.println("Invalid path: " + e.getMessage()); r...
30f50222-e392-4b8f-81b8-07aa2a00c4c4
9
public static void mayn() { boolean tancar = false; while(!tancar){ s = new Scanner( System.in ); System.out.println("Nom de la unitat docent: "); unitatDocent = s.next(); cd = new CtrDomini( unitatDocent ); ...
61d6b37c-6ac8-4759-a27f-e5f7e6d3d457
1
public void addToEnd(String value) { ListElement current = new ListElement(value); if (count == 0) { head = current; } else { tail.connectNext(current); } tail = current; count++; }
2d4ba0db-af3d-44e7-8d0b-6ed9309d6833
3
@Override public Intervention getIntervention() throws BadResponseException { Intervention i = null; JsonRepresentation representation = null; Representation repr = serv.getResource("intervention", interId); try { representation = new JsonRepresentation(repr); i = new Intervention(representation.getJso...
4be6a521-16b1-4c35-b00a-81a8930be234
5
static void loadOkraNativeLibrary() { String arch = System.getProperty("os.arch"); String okraLibraryName = null; String okraLibraryRoot = "okra"; if (arch.equals("amd64") || arch.equals("x86_64")) { okraLibraryName = okraLibraryRoot + "_x86_64"; } else if (arch.equa...
f1c12551-c774-45fa-9f86-b129f3a51725
2
public static PlanStatus fromInt(int code) { for (PlanStatus status : PlanStatus.values()) { if (status.code == code) { return status; } } return null; }
89abe380-7cf5-48f9-b15b-13818f7ed0c1
5
@SuppressWarnings({"unchecked", "rawtypes"}) @Override public void encode(Object bean, CodedOutputStream output) throws ConverterException { try { Object obj = field.get(bean); if (obj != null) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ...
4e168812-b632-4094-9d9f-6024b72743b0
2
public void doDead() { switch (ai.getDirection()) { case LEFT: setAnimation(new String[]{"goombaFlatLeft"}); break; case RIGHT: setAnimation(new String[]{"goombaFlatRight"}); break; } setDead(true); }
61c09836-fd2a-429d-854d-643a93213fac
7
@Override public boolean execute(CommandSender sender, String[] args) { if(!(sender instanceof Player)) { return true; } String name = args[0]; Group group = groupManager.getGroupByName(name); if(group == null) { sender.sendMessage("Group doesn't exist"); return true; } if(group.getPersona...
0667efe7-8c4e-4837-990f-f804a2522491
8
public String getStringFromButton(char c) { if(c == '2'){ return "abc"; } if(c == '3'){ return "def"; } if(c == '4'){ return "ghi"; } if(c == '5'){ return "jkl"; } if(c == '6'){ return "mon"; } if(c == '7'){ return "pqrs"; } if(c == '8'){ return "tuv"; } if(c == '9') ...
6cd9ffdc-0ae9-4e5e-93c5-12e71ec08b05
8
public boolean stateEquals(Object o) { if (o==this) return true; if (o == null || !(o instanceof MersenneTwisterFast)) return false; MersenneTwisterFast other = (MersenneTwisterFast) o; if (mti != other.mti) return false; for(int x=0;x<mag01.length;x++) ...
f804c390-5ddf-4d86-b4e1-2e55778fe0ef
6
private void drawCharacter(byte charPixels[], int x, int y, int width, int height, int color) { int offset = x + y * RSDrawingArea.width; int k1 = RSDrawingArea.width - width; int l1 = 0; int pixel = 0; if (y < RSDrawingArea.startY) { int offsetY = RSDrawingArea.startY - y; height -= offsetY; y = RSD...
819670a0-6071-49fb-a08f-45014cd38374
7
public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError { /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */ final double drift[][] = { { 37300.0, 0.0012960 }, { 37300.0, 0.0012960 }, { 37300.0, 0.00...
837435a6-c590-4df6-afe9-2f590c87843e
2
public void setPrismRefractiveIndex(double refInd){ super.prismRefractiveIndex = refInd; super.prismRefractiveIndex2 = refInd*refInd; this.setPrismRI = true; if(this.setMeasurementsPrism && this.setPrismAlpha)this.calcEffectiveRefractiveIndices(); }
acc1bf15-f1fa-4882-abe3-8cce26af3dbb
4
Watcher (File d, Hashtable b, Vector l) throws IOException, SecurityException // throws RuntimeException on any of several errors { dir = d; devices = new File (dir, "devices"); busses = b; listeners = l; if (!dir.exists () || !dir.isDirectory ()) throw new IOException ( "is usbdev...
88c68407-57ec-40f2-9515-9e13542baba2
3
@Override public void removePlayer(User user) { for (PinochlePlayer player : players) { if(player.getUser().equals(user)) { players.remove(player); currentRequest = Request.Null; break; } } if(players.size() == 0) super.removeGame(); Play(null); }
a1d35556-3cfd-48e3-b410-2afdcd64e65b
3
private void addMeasurementsIfStillInMethod(final String currentMethod, final long currentSample, final long currentCPUSample) { if (currentMethod.equals(lastMethod)) { MethodStatistics statistics = methodStatistics.get(currentMethod); if (statistics == null) { statistics = new MethodStatistics(currentM...
8ea58a66-fb5a-4a39-b389-8018ba353a07
8
private void erode(float smoothness) { for (int x = 1; x < width - 1; x++) { for (int z = 1; z < depth - 1; z++) { float d_max = 0.0f; int[] match = {0, 0}; for (int u = -1; u <= 1; u++) { for (int v = -1; v <= 1; v++) { ...
a91e85a8-907c-4cb8-bef2-431ff960aef0
3
public String editarUsuario(String code, String name, String surname1, String surname2, String username, String mail, String date, String position, String rol, String pass) { Usuario user = null; ArrayList<Usuario> dbUsuario = tablaDeUsuarios(); String result=""; int index=0; for...
eacc409f-2655-486c-8da6-d446dfbf88dc
7
public boolean handleCommand(Player player, Command cmd, String commandLabel, String[] args) { String commandStr = cmd.getName().toLowerCase(); for (String arg: args){ if (!arg.matches("[a-zA-Z0-9_\\-/:,]*")) { sendMessage(player, "arguments can be only alphanumeric with underscores"); return true; } ...
47b165a0-4822-4313-b4e3-0ff762cb6040
5
private void myRepaint() { Graphics2D graphics = (Graphics2D) canvas.getBufferStrategy().getDrawGraphics(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, //Enable antialiasing RenderingHints.VALUE_ANTIALIAS_ON); if (keys[0]) { yDraw -= MOVE_SPEED; } ...
00a2cbc3-0c93-4a4f-91f5-780c4439d056
0
public TuringToUnrestrictGrammarAction(AutomatonEnvironment automatonEnvironment) { super("Convert to Unrestricted Grammar", automatonEnvironment); // TODO Auto-generated constructor stub }
e4a98331-592e-4b0d-8561-452e14d1448b
5
public final void serialize(final SongDataEntry data) throws IOException { generateStream(data); this.songsParsed.incrementAndGet(); boolean update = false; synchronized (this) { if (this.crawlDone && this.deserialDone) { update = true; } } if (this.crawlDone && (this.songsParsed.get() == this.so...
9c19f316-c06f-4be7-be03-e35b92e1e859
9
private void writeExcel() throws IOException{ double[] phase0 = new double [64]; double[] phase1 = new double [64]; double[] phase2 = new double [64]; double base = 0; double sequence = 0; int pos = 0; int posY = 6; //on aditionne tout les excel chromosomes.xls des enfants for(int k = 0; k...
5ddddc4b-304a-4ef0-bd27-152fa455eb4d
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...
d6be9da2-5b9a-41ba-b93f-b3ec65276e9f
5
private void boutonRoyaumeDuFeuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonRoyaumeDuFeuMouseClicked // TODO add your handling code here: if (partie.getRdf().isActif()) { if (!partie.getDieuActuel().isaJouerEnRoyaumeDuFeu() || ((partie.getDieuActue...
dbe594f8-585f-4011-bb8c-23f7cccabe71
2
public boolean orgaEinheitAendern(String betroffenerBenutzer, int idorgaEinheit) { Benutzer benutzer =dbZugriff.getBenutzervonBenutzername(betroffenerBenutzer); if (benutzer != null){ try{ benutzer.setidOrgaEinheit(idorgaEinheit); return true; } catch (SQLException e){ System.out.println(e); }...
dd9e1a26-67c9-4d9e-8cb9-6d252ea922d1
8
private static double luDecompose (double[][] A, int[] p, int N) { // Initialize sign of permutation. double signum = 1.0; // Initialize permutation. for (int i = 0; i < N; ++ i) { p[i] = i; } // Do all colum...
52b09f08-050d-49ed-b51f-fc7c39d13ab6
8
public void createVillagePolygons() { int z = 0; for (CustomRelation vr : villageRelationsMap.values()) { setStatus("polygon: " + Integer.toString(++z) + "/" + Integer.toString(villageRelationsMap.size())); CustomPolygon vp = new CustomPolygon(); vp.setName(vr.getName()); CustomNode firstNode = new Cust...
6ebf6693-236f-4020-a0b3-32a666dbaa93
2
public void updateChampion (Champion c) { if (champion != c) { if (isLocked) oldChampion = champion; champion = c; championName.setText (champion.getName()); repaint(); } }
bc815f1b-8b72-466d-a3f9-dfdef33b08ab
6
public void run() { while (true) { initSocket(); try { outToMailbox = new DataOutputStream(clientSocket.getOutputStream()); inFromMailbox = new BufferedReader(new InputStreamReader( clientSocket.getInputStream())); } ...
7d574664-b14f-48ef-a693-5915658b0ca3
8
@EventHandler(priority = EventPriority.HIGH) public void onPlayerDeath(EntityDeathEvent e){ if(!(e.getEntity() instanceof Player)) return; Player victim = (Player) e.getEntity(); if(!(victim.getKiller() instanceof Player)) return; Player killer = victim.getKiller(); KarmaPlayer kVic = MaxPvP.instance.getK...
7b1c2432-f756-412b-b723-928b9f328cc9
6
public boolean getBoolean(String key) throws JSONException { Object object = get(key); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String)object).equalsIgnoreCase("false"))) { return false; } else if (object.equals(Boolean.TRUE) ...
b98a95ae-51d7-43fe-897f-0171d23889c7
7
void setMad(short mad, BitSet bsSelected) { boolean bondSelectionModeOr = viewer.getBondSelectionModeOr(); int[] atomIndices = polymer.getLeadAtomIndices(); // note that i is initialized to monomerCount - 1 // in order to skip the last atom // but it is picked up within the loop by looking...
eb082927-2163-48e7-8043-d7110faf86a7
5
public void load(InputStream is) { try { if (is != null) { InputStreamReader isr = new InputStreamReader(is); JSONParser parser = new JSONParser(); JSONObject json = (JSONObject) parser.parse(isr); Iterator<?> iter = json.keySet().iterator(); while (iter.hasNext()) { String key = (String)...
b5ce8f38-a7df-436a-b194-a241e2d916d6
1
public void setAddReplaceButtonsEnabled(boolean b) { myAddCase.setEnabled(b); if (myShowCase.isEnabled()) myReplace.setEnabled(b); }
ef5861c3-47d3-4300-9f34-36945c0c635c
6
public void readFromFile() throws ParsingException,IOException { Builder builder = new Builder(); Document doc = builder.build(new File(mPath)); Element root = doc.getRootElement(); Elements children = root.getChildElements(); mStrings = new ArrayList<StringDeclaratio...
dffc2899-a696-4e74-a88c-ecdc207afb3a
5
private void btnCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarActionPerformed ValidacaoEmail validacaoEmail = new ValidacaoEmail(); boolean valida = validacaoEmail.validaEmail(txtEmail.getText()); if (txtNome.getText().equals("") || txtE...