method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
989ff214-959d-469b-ad75-34122eabc18e
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...
e32ebf78-acaf-47c9-be83-dc99919db6c4
5
public void buyStock(String symbol, int quantity) throws BalanceException, StockNotExistException { boolean buyStockSucsses = false; int stockSymbolIndex = 0; if (balance <= 0) { throw new StockNotExistException(symbol); } // find the index of symbol for (int i = 0; i < portfolioSize; i++) { if (s...
772a5c7d-dc8c-4200-83d2-d512495590b1
4
private String timeToString(long seconds) { long minutes = seconds / 60; seconds = seconds - minutes*60; if (minutes == 0 && seconds == 0) return "zero seconds"; else if (minutes == 0) return secondsToString(seconds); else if (seconds == 0) re...
c9445969-ab89-41e0-bdb4-a9d38c5eb7ab
6
@Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; Neuron neur; g2.setColor(Color.WHITE); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setPaint(Color.lightGray); for(int i=0;i<Data.ge...
8e7040a2-3abc-476e-baad-7f6abfdf9623
5
public void unzip(String zipFile, String id) throws Exception { downloadPack.passwordLbl.setText("Extracting Files"); Console.log("Extracting " + id.replace("_", " ") ); downloadPack.progress.setValue(0); int BUFFER = 2048; File file = new File(zipFile); Zi...
e51420d6-e2bf-4301-89dd-2f8d141547cb
5
public static File downloadFileTo(String urlString, String ext, File dir) throws IOException { InputStream in = null; OutputStream out = null; File file = null; if (!dir.exists()) { // If the download directory does not exist, we create it. dir.mkdirs(); } try { in = openURLStream(urlStrin...
9904b048-a49a-4c7a-be2c-302b5ff92edb
7
@Override public void run() { System.out.println("\tNew connection handler thread is running"); while (true) { HttpContext context = new BasicHttpContext(null); try { while (!Thread.interrupted() && this.conn.isOpen()) { this.h...
5d9210f2-ac93-4ced-92f3-117e0c1c58ed
0
@Override public Sala clone() { return new Sala(this); }
a5a723fb-efd3-404a-8d08-bed25939c3c8
5
private void pop(char c) throws JSONException { if (this.top <= 0) { throw new JSONException("Nesting error."); } char m = this.stack[this.top - 1] == null ? 'a' : 'k'; if (m != c) { throw new JSONException("Nesting error."); } this.top -= 1; ...
2765e524-59c8-46c0-bcca-bd6a753ac03d
0
public void setZip(String zip) { this.zip = zip; }
194a6de5-0d7d-4042-8dfa-fe0a631a7127
6
public Shape createStrokedShape( Shape shape ) { GeneralPath result = new GeneralPath(); shape = new BasicStroke( 10 ).createStrokedShape( shape ); PathIterator it = new FlatteningPathIterator( shape.getPathIterator( null ), FLATNESS ); float points[] = new float[6]; float moveX ...
7fbf79e6-2a72-4059-94d1-6a752edaa6e9
2
public double rawAllResponsesMinimum(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.variancesCalculated)this.meansAndVariances(); return this.rawAllResponsesMinimum; }
a98b3d3d-152e-4d68-9825-ba119fa0b762
6
@Override public Object getItem(){ parent.zoomSlider.setValueIsAdjusting(true); String editorText = editor.getText(); int newVal =0; if(editorText!=null){ if(editorText.toLowerCase().endsWith("fit")) parent.zoomSlider.setValue(0); else{ StringB...
ca8411a9-15aa-4ca1-b022-6d06ed478f41
1
public String toString() { StringBuilder s = new StringBuilder(); for (Planet p : planets) { // We can't use String.format here because in certain locales, the , // and . get switched for X and Y (yet just appending them using the ...
462f12c4-e3ba-4204-a03f-08807f9895c5
1
private boolean isBecomeFull() { // Was ready, but become not boolean wasReady = ready; ready = isReady(); return (wasReady && !ready); }
249815ed-26a0-4c21-9d41-8a738d5207fc
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 Listas)) { return false; } Listas other = (Listas) object; if ((this.iLista == null && other.iLista != null) ||...
59942976-0007-4272-8e48-f3dae67363d4
8
protected boolean collision(int xa, int ya) { boolean solid = false; if (getDir() == 0) { if (level.getTile((x + xa) / 16, (y + ya) / 16).solid()) solid = true; } if (getDir() == 1) { if (level.getTile(((x + xa) / 16) + 1, (y + ya) / 16).solid()) solid = true; } if (getDir() == 2) { if (level.getTi...
aaccde9b-bdfd-450b-9c8d-44befaef70da
8
public static void unhideNeighborEmptyCells(BoardModel boardModel, Cell currentCell) { currentCell.setVisible(true); for (int i = currentCell.getPositionX() - 1; i <= currentCell.getPositionX() + 1; i++) { for (int j = currentCell.getPositionY() - 1; j <= currentCell.getPositionY() + 1; j++...
80c8862a-620e-4605-b97f-cac599d56104
5
public static void main(String[] args){ // création des deux listes int i=0; List<AR> AR = new ArrayList<AR>(); List<AS> AS = new ArrayList<AS>(); Calcul.RepriseTableau(AR, AS); Saisie saisie = new Saisie(AR); boolean saisieOK = false; do { i =0; boolean trouve= false; while (!trouve && i < A...
c0047e46-20e2-46a3-b39e-56a7e7498e74
7
public void doGet(HttpServletRequest req, HttpServletResponse resp) { resp.setContentType("text/plain"); AppIdentityCredential credential = new AppIdentityCredential( AnalysisConstants.SCOPES); String bigqueryProjectId = AnalysisUtility.extractParameterOrThrow(req, AnalysisConstants.BIGQUERY_PROJECT_ID_...
30368100-8587-4903-a677-e2064df7f407
6
public static boolean hitPlane(SpaceRegion region, Direction plane, Vec3 position, Vec3 direction) { Vec3 normal = null; Vec3 p0; Vec3 p1; float D; //because math. Vec3 pointInPlane; //Extracting each plane can, for once, be done with some trickery. //also, notice how N and S have the same plane, wi...
8cd46db2-9d6c-4923-920a-0d8c0b471c44
0
public int getBiome() {return biome;}
6f7994a4-ebd3-4414-8ec6-b95c5e7b2970
3
public void draw(Graphics2D g) { drawAura(g); Shape ellipse = new Ellipse2D.Double(x - radius, y - radius, 2 * radius, 2 * radius); if (getInitial() != 0) { ellipse = new Rectangle2D.Double(x - radius, y - radius, 2 * radius, 2 * radius); } g.setColor(color); ...
2fd6d84a-2126-428a-930e-18bb83e53b59
1
public V remove(K key) { V val = get(key); if (val == null) { return null; } // removeAt(keys, currentIndex); // removeAt(values, currentIndex); checkEnoughCapacity(1); // Switch the chosen element and the last one exchangeWithLast(keys, cur...
cbbe0bd9-0728-4ac9-8e4d-342527e84ff0
0
public void start() { timer.start(); }
08d0f6b4-99a6-4eac-a149-6daf11f29541
4
@Override public Event next() { try { input = br.readLine(); } catch (IOException e1) { } if(input == null || input.equals("")) { return new UserHomeState(as, name); } else{ try{ as.bid(name, Long.parseLong(input)); } catch(Exception e){ return new SearchResultsState(as,...
1bfffa1a-50ed-48fc-9dd7-3e52053ceb28
6
@Override public void exec(CommandSender sender, String commandName, String[] args, Player player, boolean isPlayer) { String staffChatMessage = ""; if (!isPlayer) { sender.sendMessage(ChatColor.RED + "Run this command from ingame."); return; } if (!player.h...
8279f0d8-4f1c-4096-848a-8fae36fee5c2
6
public void blink() { if (getWorld().getObjects(Dolphin.class).size() != 0) { getXD = ((Dolphin) getWorld().getObjects(Dolphin.class).get(0)).getX(); getYD = ((Dolphin) getWorld().getObjects(Dolphin.class).get(0)).getY(); setLocation(getXD - 15 ,getYD - 25); } ...
d8ad78bf-9e2a-4849-ac4d-b5de3d157bfe
5
public void propagateValues(List<String> cliValues) { int argValueIdx = 0; int valueIdx = 0; while (argValueIdx < cliValues.size()) { if (argValueIdx >= values.size()) { // more data then values ... abort break; } else { IValue<?> value ...
e3d35f37-b38b-4d50-8965-b4f7aa7e29f9
1
private void loadPreferences() { Preferences preferences = BrainPreferences.getPreferences(); if (preferences != null) { String leftName = preferences.get(PreferencesNames.LEFT_NAME, ""); String rightName = preferences.get(PreferencesNames.RIGHT_NAME, ""); ...
104c379d-522b-4577-adbc-58886e19137a
4
private static void checkAndDeleteDir(FileSystem fileSystem, String directory) throws TestFailedException { try { if (fileSystem.pathExists(directory)) fileSystem.deleteDirectoryRecursively(directory); if (fileSystem.pathExists(directory)) throw new TestFailedException("I deleted the directory " + d...
337a8dc9-39c4-4220-b19f-45c4e71c79e3
9
private static boolean isAssignable(Class<?>[] formal, Class<?>[] actual) { if (formal.length != actual.length) { return false; } for (int i = 0; i < formal.length; i++) { if (actual[i] == null) { if ((formal[i].equals(int.class)) ...
2fa6f9ea-0d05-4db8-a4a3-a13c9c2a13c6
8
private void processBody(HttpURLConnection conn) throws Exception{ if(type == HttpResponseType.RAW){ data = conn.getInputStream(); }else{ final BufferedReader input = new BufferedReader(new InputStreamReader(conn.getInputStream())); switch(type){ //return raw input stream. case RAW: assert fal...
a59ba84d-6d61-49fb-a822-5eff7a39f207
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Parameter that = (Parameter) obj; i...
04e0abfe-02af-4afa-8346-68d39949b98e
9
protected boolean writeClass(ClassWriter classWriter, String className) throws IOException, ConstantPoolException { JavaFileObject fo = open(className); if (fo == null) { reportError("err.class.not.found", className); return false; } ClassFileInfo cfI...
c3a6280e-9f45-49fc-bba5-d6b6c5ce45cc
4
private static void writeMapObject(MapObject mapObject, XMLWriter w, String wp) throws IOException { w.startElement("object"); w.writeAttribute("name", mapObject.getName()); if (mapObject.getType().length() != 0) w.writeAttribute("type", mapObject.getType()); w....
3ec5d277-a702-440b-9aa2-70abea959137
7
private List<String> verifyBracketTokens(List<String> tokens) throws ParserException { List<String> newTokens = new ArrayList<String>(); int bracketType = -1; String[] brackets = null; for (int i = 2; i < tokens.size() && bracketType < 0; i++) { if (!"".equals(tokens.get(i))) bracketType = i; } switch (b...
d13777ac-8061-4d02-b1cf-81da59b7290c
6
private static void closeConnection() { try { if (resultSet != null) resultSet.close(); if (preparedStatement != null) preparedStatement.close(); if (preparedStatement2 != null) preparedStatement2.close(); if (preparedStatement3 !=...
d346131c-bca8-427c-a3dd-fe49c4cd1b40
7
private static Object findJarServiceProvider(String factoryId) throws ConfigurationException { String serviceId = "META-INF/services/" + factoryId; InputStream is = null; // First try the Context ClassLoader ClassLoader cl = ClassLoaderSupport.getContextClassLoader(); if (cl != ...
da758682-fc45-4737-a593-56fc15b4eed4
8
public static void main(String args[]) throws Throwable{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); for(int N;(N=parseInt(in.readLine().trim()))!=0;){ TreeMap<int[],Integer> mapa=new TreeMap<int[],Integer>(new Comparator<int[]>(){ public in...
7a955ea3-8d4f-4cdb-98fd-5ddb777d8d1b
9
public static List<Inaugurador> listaDeInauguradores() { ResultSet tr = null; String select = "SELECT * FROM cargo_inaugura"; ArrayList<Inaugurador> listaInaugurador = new ArrayList<Inaugurador>(); Connection conexion = null; Statement statement = null; try { ...
34b2d7a5-cb5b-4922-becb-df745c635be1
2
@Override public void shoot(){ for(Weapon<? extends actor.ship.projectile.Projectile> weapon : weapons){ weapon.shoot(this, Vector3f.newRandom(1)); } }
9718a773-cf14-40b4-a1df-aa9f449e6906
1
public Vector2D unitVector(){ float mag = magnitude(); if (mag == 0) return new Vector2D(0,0); float newX = x/mag; float newY = y/mag; return new Vector2D(newX,newY); }
10965c97-c0ef-4baa-abd0-efecc10d4dd3
4
public void loadSprite(String ref) { BufferedReader reader; try { reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/database/sprites")); String line; while((line = reader.readLine()) != null) { final String[] temp = line.split(";"); if(temp[0...
4756f574-f0db-42ec-ae1e-201c0750085f
8
public final Instances resampleWithWeights(Instances data, Random random, boolean[] sampled) { double[] weights = new double[data.numInstances()]; for (int i = 0; i < weights.length; i++) { weights[i] = data.instance(i).weight(); } Instances newData = new Instances(data, data...
30eaffad-aab2-4e9c-a243-b29b2497a5ad
7
public static List<CDDFeature> removeOverlaps(List<CDDFeature> features) { List<CDDFeature> newFeatures = new ArrayList<CDDFeature>(); CDDFeature lastFeature = null; Collections.sort(features); for (CDDFeature feature: features) { // System.out.println("Looking at "+hit); if (lastFeature == null || featur...
1753742e-51bb-48c3-b8f8-66b149a7730b
2
public static void seq_e(CompList<?> t) { for (Compound c : t) { c.execute(); } }
2f8d1346-222c-4925-b7f8-89c188833b6d
6
public void open() { System.out.println(WELCOME); System.out.println(USE_HELP); request = getCommand(); while (!request.equals(EXIT_COMMAND)) { if (request.equals(HELP_COMMAND)) { for(int i = 0; i < COUNT_OF_COMMANDS; i++) { System.out.pri...
2fe766f7-8372-4e47-a4a1-3766942c984a
1
public String retrieveTemplate(String catalogLink, String templateName) throws Exception{ String response = doGet(catalogLink); String catalogItemLink = findElement(response, Constants.CATALOGITEM, Constants.CATALOGITEM_LINK, templateName); response = doGet(catalogItemLink); String element = findElement(resp...
6d5f3144-5283-44ce-858b-b2e3ac107aa0
7
public ListNode reverseBetween(ListNode head, int m, int n) { if(m==n) return head; ListNode start = null; ListNode beforestart = null; ListNode curr = null; for(int i=0; i<m-1; i++) { beforestart = beforestart==null?head:beforestart.next; } start = be...
b256d1fd-8252-48b2-becf-fe79283aa7be
8
protected String compute() { if (element == null) return null; switch (element.getType()) { case OBJECT: return serializeObject(); case ARRAY: return serializeArray(); case STRING: return serializeString((String)element.getData()); ...
067f5254-a8f8-4015-93b3-1e7d89810788
0
private static File initMap() throws IOException { String map = "...?????...\n" + ".#.#?#?#.#.\n" + "..???????..\n" + "?#?#?#?#?#?\n" + "????.$.????\n" + "?#?#$$$#?#?\n" + "????.$.????\n" ...
00b77863-ffda-4b67-bfe4-267f28f53ed9
6
public static float[][] getSecondCenter(float[][] X, int min, int max) { int i = max - min + 1; float tempX[][] = new float[i][X[0].length]; float tempY[][] = new float[i][X[0].length]; // float temp = 0; for (int t = 0; t < i; t++) { for (int k = 0; k < X.length; k++) { // decide whether the point bel...
015d3aa9-e2b8-48a5-9c26-f233b7f1fdda
7
@Override public void actionPerformed(ActionEvent e) { Response response = null; if (messageForm.getFromTextField().trim().length() < 1 || messageForm.getToTextField().trim().length() < 1 || messageForm.getSubjectTextField().trim().length() < 1 || mes...
18c85411-abcf-41e1-bb35-13943ffb41ff
8
private void grabSequenceAndOutput() throws IOException{ BufferedWriter out = new BufferedWriter(new FileWriter(outputDirectory + "/" + "SEQ_" + annotationFile.substring(annotationFile.lastIndexOf('/') + 1, annotationFile.lastIndexOf('.')) + ".fasta")); Sequence_DNA seq = null; int currentSequence = 0; ...
7ef3ccb2-b191-45d2-a4cb-4a94f3a16bb0
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...
1bf05394-d7a3-43a9-a4de-e77987d039e7
6
private Client(int port) { String input = null; int inputOption = 0; boolean validInput = false; System.out .println("Wählen sie zwischen Host(1), Verbindung(2) oder Computergegner(3)."); while (!validInput) { try { input = Eingabe.getEingabe().getUserInput(); } catch (Exception e) { // N...
bc582a3d-d6d1-48be-a4cf-1f0d1330d015
4
public int getFlag(final OffsetPoint n) { final int x = n.getX() - offset.getX(); final int y = n.getY() - offset.getY(); if (x >= 0 && y >= 0 && x < flags.length && y < flags[x].length) { return flags[x][y]; } else { return -1; } }
79b29b2d-71ff-4339-a8c8-8d89bc0b6460
8
public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); StringBuilder out = new StringBuilder(); int times = in.nextInt(); for (int i = 0; i < times; i++) { int nCoins = in.nextInt(); int[] c = new int[nCoins]; for (int j = 0; j < c.length; j++) c[j] = in.ne...
e16ba637-7ddc-4c1b-b299-5e7223967d0c
6
@Override public void mouseClicked(MouseEvent e) { Point mouseGridPosition = board.getPosOnGrid(new Point(e.getPoint())); for (Enemy currentEnemy : board.getAllEnemiesInCurrentWave()) { if( currentEnemy.isWithinObject(new Point(e.getPoint())) && currentEnemy.isAlive()) { ...
d9259012-17ea-430f-a3bf-317d74cc3eca
7
* @return Returns true if the given edge may be splitted by the given * cell. */ public boolean isSplitTarget(Object target, Object[] cells) { if (target != null && cells != null && cells.length == 1) { Object src = model.getTerminal(target, true); Object trg = model.getTerminal(target, false); retu...
3ce1c9f5-4919-41bf-be60-9f19275c1e6e
2
public static void trackRemove(String tag) { if(!trackedTags.containsKey(tag) && !trackedTags.remove(tag)) { System.out.println("[Debugger] Tag " + tag + " was not being tracked."); } else { trackedTags.remove(tag); System.out.println("[Debugger] Tag " + tag + " is no longer tracked."); } }
9fd21ee4-899f-409b-b892-0919b8aca9ad
1
protected static Integer parseInteger(final Object obj, final String type) throws ParseException { final Integer result; try { result = Integer.valueOf(obj.toString()); } catch (NumberFormatException nfe) { throw new ParseException(obj + " is not a valid " + type + "."); } return result;...
69bf2a98-a13e-4da4-99ac-f7092bf0bd4a
4
public byte[] readBinaryFromFile( String filename ) { RandomAccessFile f = null; try { f = new RandomAccessFile( new File( filename ),"r"); } catch (FileNotFoundException e1) { e1.printStackTrace(); } byte[] b = null; try { b = new byte[ (int) f.length() ]; } catch (IOException e) { e.printStackTrace(); } ...
ee1c8cd6-bfd7-42a9-af9e-4ebb0e2b0d3d
7
public static MapaTuberias fromElement(Node tuberias, Mapa mapa, Dinero d) throws NoSeCumplenLosRequisitosException, FondosInsuficientesException, SuperficieInvalidaParaConstruir, CoordenadaInvalidaException { MapaTuberias mapaTuberias = new MapaTuberias(mapa); NodeList hijosDeRed = tuberias.getChildNodes(); for...
2048342b-dc6e-4d1c-9383-71fc947494e4
6
private static String cut_the_pattern(String lemma_sentence) { String[] lemma_sentence_tokens = lemma_sentence.split(" "); String final_pattern = ""; Boolean found = false; for(int i = 0; i < lemma_sentence_tokens.length; i++){ if(i+1 < lemma_sentence_tokens.length && lemma_sentence_tokens[i+1].equals("<S...
82211f27-3d29-40eb-9e76-e3088caf4561
1
public boolean testValue(double val) { return (mmin <= val && val <= mmax); }
bf33eeb3-51e1-498c-8d00-94afbdcb7431
5
public static int min (int[] element) throws IllegalArgumentException { if (element.length == 0) { throw new IllegalArgumentException ("tom samling"); } int[] sekvens = element; int antaletPar = sekvens.length / 2; int antaletOparadeElement = sekvens.length % 2; int antaletTankbaraElement = antal...
44010e85-d050-4fb3-967a-61e4d8dab218
3
public static void main(String[] args) throws Exception { // TODO Auto-generated method stub ArrayStack<Integer> temp = new ArrayStack<Integer>(15); Integer[] h= new Integer[3]; h[0]=8; h[1]=9; h[2]=10; System.out.println("Add elements:"); for(int i = 0; i <8; i++) temp.add...
f28231a2-c6da-49f3-9d48-5cc7d1b6423a
5
public static double getOperationDiscount(EditOperation editOperation, int previousEdits) { double discount = 1; if(previousEdits > 0){ int edits = previousEdits; switch (editOperation){ case Insert: discount = 0.33/ edits; ...
bdb78651-50df-4807-8a5a-df08fbadd8ef
7
private void readAbilities(String path, DataModel dataModel) { try { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(new File(path)); // normalize text representation d...
6efc70ec-a6c8-409e-a2d8-d62327bdc5b9
3
public void checkCollision() { for (int i = 0; i < people.length; i++) for (int j = i+1; j < people.length; j++) if (people[i].colliding(people[j])) people[i].collide(people[j]); }
1fbc28b7-1025-48cc-9577-11c69476228a
6
* @param unit The <code>Unit</code> to unload. * @param goods The <code>Goods</code> to unload. * @return An <code>Element</code> encapsulating this action. */ public Element unloadCargo(ServerPlayer serverPlayer, Unit unit, Goods goods) { ChangeSet cs = new Cha...
59e493ae-5127-43ee-80c5-ecd883b5e4fa
0
public Point3 multiply(double multiplier) { x *= multiplier; y *= multiplier; z *= multiplier; return this; }
b365a04b-a705-4e69-ab3b-2f0cb274b938
1
public void run() { Object[] i = this.getCars().toArray(); for(Object o: i) { Vehicle v = (Vehicle)o; remove(v); v.setDisposed(); v = null; } _ts.enqueue(_ts.currentTime() + MP.simulationTimeStep, this); }
26d21aec-b3fb-4b12-8323-837abab27066
8
private void mainRequest(){ final JSONHandler webHandle = new JSONHandler( this.MCAC ); final HashMap<String, String> url_items = new HashMap<String, String>(); url_items.put( "maxPlayers", String.valueOf( this.MCAC.getServer().getMaxPlayers() ) ); url_items.put( "version", this.MCAC.getDescription().getVersion...
150975d8-c7fa-4bc2-b9ad-89c71012b374
2
public LoginViewHelper getLoginViewHelper(HttpServletRequest req) throws UnsupportedEncodingException { LoginViewHelper loginViewHelper = new LoginViewHelper(); if (req.getParameter("email") != null) { loginViewHelper.setEmail(new String(req.getParameter("email") .getBytes("iso-8859-1"), "UTF-8"));...
6915eea2-6da6-4097-853f-847c9f8aaf3c
8
public static int test(Object channel, long action, Object ... args) { System.out.println("Sending action:" + action + " across channel:'" + channel.toString() + "'"); int returnCode = 0; if(args.length > 0) { System.out.println(" Arguments:"); for(Object arg:args) ...
f52466c7-f50e-4342-afea-1e8c7275f332
5
private static void lisaaOliotListoihin(HashMap<String, Kayttaja> kayttajat, String nimimerkki, Kayttaja kayttaja, HashMap<String, KenttaProfiili> profiilit, String kenttaProfiiliNimi, KenttaProfiili profiili) { if (!nimimerkki.equals("Anon") &&!kayttajat.containsKey(nimimerkki)) { kayttajat.put(nim...
8dc031c4-f367-4cbe-b858-4ae83cdfa156
1
private void updateEntities(double deltaTime) { for (Entity entity : entities) { entity.update(deltaTime); } }
2c477d2a-0ced-4cfa-9581-8a4082a64e1d
0
public void setDepartureEnd(int value) { this._departureEnd = value; }
02e06138-baf6-4d23-a13d-ecda27ca84b2
0
public static void main(String[] args) { // TODO code application logic here }
316d1814-0123-4cab-be82-9b7ecbc7f35b
3
public static File[] save(Saveable saveable) { if (saveable == null) { return new File[0]; } File file = saveable.getBackingFile(); if (file != null) { File[] files = saveable.saveTo(file); for (File one : files) { RecentFilesMenu.addRecent(one); } return files; } return SaveAsCommand.sa...
86fbdaee-7384-434d-a357-606fee627ce5
7
public MOB getAnyElligibleOfficer(Law laws, Area myArea, MOB criminal, MOB victim) { final Room R=criminal.location(); if(R==null) return null; if((myArea!=null)&&(!myArea.inMyMetroArea(R.getArea()))) return null; MOB M=getElligibleOfficerHere(laws,myArea,R,criminal,victi...
72c9f615-a8f2-4312-8094-9dff0e742b8b
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...
a0e7b458-7fbd-429d-bfad-e940eee52d8e
0
@Basic @Column(name = "FES_ID_FUNCIONARIO") public Integer getFesIdFuncionario() { return fesIdFuncionario; }
1a85f9ff-0f7e-4ba5-bdaf-e1169d597cbe
0
@Test @TestLink(externalId="testCreateTimeStamp") public void testCreateTimeStamp() { final TimeZone timeZoneUTC = TimeZone.getTimeZone("UTC"); TimeZone.setDefault(timeZoneUTC); final Calendar calendar = Calendar.getInstance(timeZoneUTC, Locale.US); calendar.setTimeInMillis(0); ...
d4b4e090-b448-4b52-a62c-4c0ca1329503
7
static PortWatcher getPort(Session session, String address, int lport) throws JSchException{ InetAddress addr; try{ addr=InetAddress.getByName(address); } catch(UnknownHostException uhe){ throw new JSchException("PortForwardingL: invalid address "+address+" specified.", uhe); } synch...
fa449693-e9e6-4900-9d20-505465537fb0
0
public Submit getSubmit() { return submit; }
c84bf718-1df0-41b8-9c0d-e99fc3f1b170
5
private static <T> String makePrimitiveStrings(String className, T value) { StringBuilder result = new StringBuilder(); if (className.equals("java.lang.Short")) return result + value.toString() + "S"; else if (className.equals("java.lang.Long")) return result + value.toString() + "L"; else if (className....
420ab22b-0842-4bf3-a23a-71324b20d80f
9
protected void computeFloor(final float[] vector) { int n=vector.length; final int values=xList.length; final boolean[] step2Flags=new boolean[values]; final int range=RANGES[multiplier-1]; for(int i=2; i<values; i++) { final int lowNeighbourOffset=lowNeighbours[i];//Util.lowNe...
78800db9-675e-4518-aa36-c02086b161c8
9
public static void normalizeExistsProposition(Proposition self) { { Proposition whereproposition = ((Proposition)((self.arguments.theArray)[0])); { Object old$Evaluationmode$000 = Logic.$EVALUATIONMODE$.get(); try { Native.setSpecial(Logic.$EVALUATIONMODE$, Logic.KWD_DESCRIPTION); ...
b2409f49-e0f3-4673-89ee-194045e0369f
5
private double doNamedVal(int beg, int end) { while(beg<end && Character.isWhitespace(expression.charAt(end))) { end--; } // since a letter triggers a named value, this can never reduce to beg==end String nam=expression.substring(beg,(end+1)); Double va...
3b870791-ce50-45c5-a97c-ddb707388829
9
@Override public boolean tick(Tickable ticking, int tickID) { if((affected!=null)&&(affected instanceof Room)) { final Room R=(Room)affected; if((R.myResource()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_VEGETATION) for(int m=0;m<R.numInhabitants();m++) { final MOB M=R.fetchInhabitant(m);...
e76de267-c425-4cce-ae11-409dc4f13182
6
public void run() { //this will be ran every 10 seconds //get difference in area //update hitpoints //if print count is 6 then print scores and set to 0 //if hitpoints = 0 or 100i am //declare a winner //else //set to call again another 10 seconds //set printcount to 0 ...
141a79b7-9765-46a7-a3ae-f5575b1396ba
9
private static Cell construct(Sequence s1, Sequence s2, float[][] matrix, float o, float e, byte[] pointers, int[] lengths) { logger.info("Started..."); char[] a1 = s1.toArray(); char[] a2 = s2.toArray(); int m = s1.length() + 1; // number of rows in similarity matrix int n = s2.length() + 1; // number ...
6debc367-7b8b-4241-afbf-e34583a2581b
6
public boolean nextMove(int row, int col) { HashMap<Integer, Coords> choices = new HashMap<Integer, Coords>(); //Returns true for a valid and successful move boolean result = false; int r = game.getBoard().board_row; int c = game.getBoard().board_col; int highest_flips = ...
cf88b317-ced6-4df5-9159-687cd9c72f7c
4
public static boolean validarLogin(Usuario[] usuarios) { Scanner sc = new Scanner(System.in); String user = ""; String password = ""; System.out.println("Digite seu login: "); user = sc.nextLine(); System.out.println("Digite sua senha: "); password = sc.nextLine()...
7e10518b-ed74-44fa-943b-67fbd8da85cf
5
public static String formatOutput(JSONObject obj) { String ausgabe = ""; JSONObject result = new JSONObject(); try { result = obj.getJSONObject("result"); // result ist unser Referenz // JSON-Objekt. von da aus // erreichen wir alle Daten ausgabe = getStringOutputLine("Produktname"...
30a919ca-2b0e-4b01-9ea2-55e70f63a465
8
public void tick(double time) { if (activationTime <= time && alive) { setActive(true); for (GameAction currentAction : getGameActions()) { currentAction.tick(this); } moveEnemy(enemyPixelMovement(enemyPathing.getCurrentPixelGoal())); ...