method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
9caab423-5089-40e9-90a5-70d1299d604c
0
@Override public String toString() { return "ID non reconnu"; }
8ab5d070-8fd3-4505-8260-94898a8f8cb9
4
static public RecipeIngredient makeRecipeIngredient(String input) throws NotConfiguredException, DataStoreException, ConnectionException { LOGGER.trace("called: makeRecipeIngredient( \"" + input + "\" )"); if(input == null){ LOGGER.warn("input was null, returning null"); return n...
5612f330-7c0c-4adc-8dac-ba3135f0686e
4
private void setOutline(int outline[][]) { int cx = 0, cy = 0; for (int i = 0; i < outline.length; i++) { cx += outline[i][0]; cy += outline[i][1]; } cx = cx / outline.length; cy = cy / outline.length; m_outline = new Path2D.Float(); int maxr = 0; for (int i = 0; i < outline.length; i++) { i...
0d14b3c0-bdb4-463e-a8b3-e53b2eaf5591
2
public void tick() { if (game != null) game.tick(); if (menu != null) menu.tick(input, this); }
8de2cd01-49d6-45df-9f53-1735a3bc9cf5
4
@Override public void onDisable() { Iterator<Injectable> it = injected.iterator(); while (it.hasNext()) { Injectable i = it.next(); if (i instanceof InjectablePlugin) { Bukkit.getPluginManager().disablePlugin((InjectablePlugin) i); } ...
4c9e1255-757c-4328-993b-3249d9709c18
8
public void setPicAddress(String r, String s) { boolean ifTen=false; char rankLetter=r.charAt(0); try{ if(r.charAt(1)=='0') { ifTen=true; }} catch(StringIndexOutOfBoundsException e) { ifTen=false; } char suitLetter=s.charAt(0); boolean faceCard=false; String ifFaceCard=""; suitLetter...
8fb971e4-23bf-4095-b3a7-1796fc593fcd
0
private Calendar getStartOfDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILL...
d49056a0-781c-47e7-a9b8-780eb56a6a09
0
public void setNovCodigoConcepto(String novCodigoConcepto) { this.novCodigoConcepto = novCodigoConcepto; }
afd6af14-e818-49b3-a49f-2da8225d92f9
8
private void initConfig() { if (VERBAL) System.out.println("Initializing Rubik's Cube configuration"); /** * Face avant : rouge * Face gauche : bleue * Face droite : verte * Face basse : blanche * Face haute : jaune * Face arrière : orange */ config = new ArrayList<Cubie>();...
809a1810-999a-4bf8-b8c1-a6924cd27224
6
public static void main(String[] args) { Method[] methods=BeansJavaConfig.class.getDeclaredMethods(); for (Method method : methods) { Annotation[][] annotations=method.getParameterAnnotations(); if(annotations==null) continue; for (Annotation[] annotation : annotatio...
71bc3b1d-ad83-48a8-9dc6-f2d886049795
1
public void run() { if (isAlive) { System.out.println(name + " running"); CCTimer.start(); Controller2.start(); // Controller.start(); hunger = new stats.Hunger(); health = new stats.Health(); social = new stats.Social(); } }
c618febe-d88b-4f59-bb45-f5adb8ba7b8b
8
private void jBRechercheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRechercheActionPerformed try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); } catch (ClassNotFoundException ex) { JOptionPane jOErreur = new JOptionPane("Driver non trou...
9675be8e-5c03-41ff-8934-f461be655de5
5
public void initBarComponents() { //read data from database curClient = init.getCurClient(); curBar = init.getCurBar(); multiplication = 1; paymentPanel.setLayout(new MigLayout("wrap 1, insets 0")); orderButtonPanel.setLayout(new MigLayout("wrap 1, insets 0")); keyPadPanel.setLayout(new MigLayout("wrap ...
790d14e8-16df-4b15-926e-1fb25a49f6e7
8
public static boolean runDoctorNurseScenario(Scanner input, int login_id){ int choice = 0; id = login_id; System.out.println("Please select an option:"); System.out.println("1. Find student medical records"); System.out.println("2. Add notes to existing appointment"); System.out.println("3. Create consulati...
83cca482-ae11-4056-bf68-1a9beaa37b22
3
public static String trimAllWhitespace(String str) { if (!hasLength(str)) { return str; } StringBuilder sb = new StringBuilder(str); int index = 0; while (sb.length() > index) { if (Character.isWhitespace(sb.charAt(index))) { sb.deleteCharAt(index); }...
1ca9a9b5-208d-47fe-987a-96c44b84df2c
1
protected int createProgram() throws LWJGLException { int program = GL20.glCreateProgram(); if (program == 0) throw new LWJGLException("could not create program; check ShaderProgram.isSupported()"); return program; }
c8288352-3516-4428-89e1-69b308c78e69
7
public static void main(String[] args) { if (args.length < 9) { System.out .println("usage: " + MainRep.class.getCanonicalName() + " time(sec) nthreads nkeys put(%) del(%) get(%) nauthors nkeywords nfindlist"); System.exit(1); } int time = Integer.parseInt(args[0]); int nthreads...
0a6354b7-7c5a-4b49-bb1f-c0c0fbab174d
9
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (TagType.ROOT.equals(qName)) { for (int i = 0; i < attributes.getLength(); i++) { if (BIND_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { ...
f7c3bb6c-b615-4d27-945f-0424177553d0
5
public SlenHud(Coord c, Widget parent) { super(new Coord((MainFrame.innerSize.width - sz.x) / 2, MainFrame.innerSize.height - sz.y), sz, parent); ui.slenhud = this; if (Config.new_chat) new ChatHWPanel(new Coord(0, MainFrame.getInnerSize().y - 300), ...
bb33a893-7c1a-4979-87fe-44a6568af7f3
1
public ReturnObject head() { ReturnObjectImpl output = new ReturnObjectImpl(); if (size() == 0) { output.value = ErrorMessage.EMPTY_STRUCTURE; } else { output.value = get(0).getReturnValue(); } return output; }
5f671774-b005-470a-ba92-5789c373e3a9
6
public DegradeDialog(final Panel panel, final boolean isColor) { setBounds(1, 1, 270, 190); Toolkit toolkit = getToolkit(); Dimension size = toolkit.getScreenSize(); setLocation(size.width / 3 - getWidth() / 3, size.height / 3 - getHeight() / 3); this.setResizable(false); setLayout(null); JPanel pan...
76705820-a1f0-433a-acef-a78bae9d40da
2
public void checkConsistent() { super.checkConsistent(); StructuredBlock sb = outer; while (sb != continuesBlock) { if (sb == null) throw new RuntimeException("Inconsistency"); sb = sb.outer; } }
7731b673-aebb-4a7c-8f72-2ec7629d3582
3
public int read() throws IOException { if (isEndOfStream) return -1; if (numBitsRemaining == 0) { nextBits = input.read(); // read one byte, but return an int. if (nextBits == -1) { isEndOfStream = true; return -1; } numBitsRemaining = 8; } numBitsRemaining--; return (nextBits >>> numB...
7d4a599d-8f44-4eec-a45c-d9a3ca05c45b
0
public ArrayList<String> getTechnicalTitles() { return technicalTitles; }
d7ee9c1e-e5ed-48d0-9298-c5a437fa58a2
0
public void setBlock(State state) { myBlock = state; }
c03b4c5d-2574-4ec3-8e54-1fd62218274d
0
public SimpleDoubleProperty wrapWidthProperty() { return wrapWidth; }
0959dc4a-1c00-41a5-b590-a2346958fc1a
3
public void addAreaObject(SVGOMPathElement graphic) throws XPathExpressionException, DOMException { String osmNamespace = xpath.getNamespaceContext().getNamespaceURI("osm"); SVGOMTextElement text = (SVGOMTextElement) xpath.evaluate("//svg:g[@id='map']/svg:text[@osm:id='"+graphic.getAttributeNS(osmNamespace, "id")+"...
7fc76061-8319-405e-99bf-3de733a3f48a
4
@Override public int compareTo(PossibleSol obj) { if (this.value > obj.value) { return -1; } else if (this.value < obj.value) { return 1; } if (this.area > obj.area) { return 1; } else if (this.area < obj.area) { return -1; } return 0; }
537abfa3-56e2-4b64-b4a2-0417131942c8
9
public void handlePropertyValue(Tag propertyValue) { try { if (currentPropertyHashCode == NO_PROPERTY_HASH_CODE) { //don't do anything... } else if (currentPropertyHashCode == LibraryProperty.MAJOR_VERSION_HASH_CODE) { //example property: <key>Major Version</key><integer>1</integer> ...
17da7201-222a-4e3c-8ebc-a5ff49a5108d
2
private void makeMaps() { final boolean[] inUse = this.data.inUse; final byte[] seqToUnseq = this.data.seqToUnseq; int nInUseShadow = 0; for (int i = 0; i < 256; i++) { if (inUse[i]) seqToUnseq[nInUseShadow++] = (byte) i; } this.nInUse = nIn...
93ba2f2f-3c54-4b8a-a506-713ca4241561
8
private boolean checkVertical(int j, int i, ConnectFourPiece[][] m_Pieces) { boolean gameWon = false; int secondPieceUp = i+1; int thirdPieceUp = i+2; int fourthPieceUp = i+3; if (i<COLUMN_FIVE && m_Pieces[j][i].getPieceColour() == m_Pieces[j][secondPieceUp].getPieceColour()) { if (i<COLUMN_FIVE && m...
b385c431-0e62-464e-be7f-e4ef552a552b
9
private static void executeCommand(PApplet p, String s[]) { if(s[0].equals("Fill")) { Integer c1 = new Integer(s[1]); Integer c2 = new Integer(s[2]); Integer c3 = new Integer(s[3]); p.fill(c1, c2, c3); } else if(s[0].equals("Translate")) { Integer c1 = new Integer(s[1]); Integer c2 = new Integer(s...
dd4e2026-9f94-41c8-9cb5-31ed53fbd600
0
public Rectangle getCardArea() { return cardArea; //You may need to change this }
ffd724fb-c360-4a00-a22a-05fc29ff5c43
8
int[] getMaxCardOrder(boolean[][] bAdjacencyMatrix) { int nNodes = bAdjacencyMatrix.length; int[] order = new int[nNodes]; if (nNodes==0) {return order;} boolean[] bDone = new boolean[nNodes]; // start with node 0 order[0] = 0; bDone[0] = true; // order remaining nodes for (int iNode = 1; iNode < nNod...
1f3fde79-2d18-4ae6-ad1e-e7db5fcb5f94
9
public Feature [] getMultiHorizons(Map<Point, Set<Integer>> geoTags, int srdsSrcID){ // the returned features object: ArrayList<Feature> features = new ArrayList<Feature>(); // ResultSet objects: ResultSet resultSet; // array of points: Point [] points ...
d469d742-3bb0-4d6c-a3b6-0d00d884558c
0
protected void onDeop(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {}
896c75eb-9407-4bbe-86b6-f9ab1f599a8e
1
public static Singleton getInstance() { if(instance == null) { instance = new Singleton(); } return instance; }
3266f9f7-a780-4ff9-8f5b-16d61f249a93
0
@Override public void setNote(String text) { note.setText(text); }
a97f835b-5db6-465c-a9cf-7af45367aca4
8
public void compileAllClasses() { try { String[] directories = getSubdirectories(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); StandardJavaFileManager fileManager = compiler .getStandardFileManager(null, null, null); for (final String d : directories) { File sourceFile = new Fi...
a3e4908b-27d7-4fb1-8119-fc6e87f24c94
5
private boolean fight(Command command) { if(!command.hasSecondWord()) { // if there is no second word, we can't fight System.out.println("Fight what?"); return false; } // Check if the character is in the room if(player.getRoom().isInRoom(command.g...
5a84c16a-1c6c-4ed7-9f96-7d0b54a8ac6f
1
public void visit_f2d(final Instruction inst) { stackHeight -= 1; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 2; }
bdb36dda-6b34-4771-b008-ed6e58865df1
3
private final void testStatus(String s) { if (s.indexOf("/Bilderx/arbeiten.jpg") != -1) { User.setStatus(User.Status.work); Output.printTabLn("Du bist gerade am Arbeiten", 2); } else if (s.indexOf("/Bilderx/train.jpg") != -1) { User.setStatus(User.Status.training); Output.printTabLn("Du bist gerade am T...
39db3fe1-8c6b-4bcc-8bbc-b08b8d740698
0
@Override public void setErrorMessage(String message) { this.errormessage = message; }
84c173e5-4c77-4947-b209-9ecb7f2a01ad
4
public boolean LoadData(String fileName) throws FileNotFoundException { Scanner dataScanner = new Scanner(new File(fileName)); int numInputs = dataScanner.nextInt(); numHidden = dataScanner.nextInt(); int numTargets = dataScanner.nextInt(); int numRows = dataScanner.nextInt(); ...
ff78a54f-458a-4588-ac38-fd5acb0c59a4
6
public static Node<Integer> add_HeadOnesDigitData(Node<Integer> num1, Node<Integer> num2) { Node<Integer> p1 = num1; Node<Integer> p2 = num2; Node<Integer> resHead = new Node<Integer>(null); Node<Integer> currRes = resHead; int carry = 0; while (p1 != null && p2 != null)...
9f1b2d36-c4d9-4b50-b5ec-75f2f5dff82b
2
public static void println(String s, int level) { if(level <= debugLevel) if(printToStd) System.out.println("[DEBUG " + level + "] " + s); else System.err.println("[DEBUG " + level + "] " + s); }
702503c7-7372-4ba5-97df-d77eb1e27732
6
public boolean getBoolean(int index) throws JSONException { Object object = this.get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equal...
22fa4b47-5b6a-4ca4-94b0-d17c2678bff5
7
public String execute() { Map<String, Object> session = ActionContext.getContext().getSession(); User user = (User) session.get("USER"); String actionResult = ""; reportBusinesService = new ReportBusinesService(); list = reportBusinesService.createStoppage(user, startDate, end...
dabf20b0-23fc-46c7-ba03-d6e2a9da95a3
2
public void prepare(String stmt){ try { ps = con.prepareStatement(stmt); } catch (SQLException e){ if( debug ) { System.out.println("Error in DBComm.prepare(): "+e.getMessage()); System.out.println(" |-->"+stmt); } } }
43938abf-ebf9-4add-aea4-f55cb196d7ae
2
public boolean deleteShow(String name){ for (Show show : shows) { if(show.getName().equals(name)){ shows.remove(show); return true; } } System.err.println("Could not remove show, name does not exist."); return false; }
78372c92-67b0-49d9-8cc4-b812ce342533
8
public void checkCollisions() { // check collision and call a something // or make an Event derived class to do so // TODO: how to define own events? // collisionCallback(); if(action == null) return; //test if(snakeHead.collidesWith(rat)) ...
c71ce58e-79f0-48ce-8430-aae63db3197c
9
private Node<K,V> ceiling( V value ) { if( value == null ) { return null; } Node<K,V> node = mRoot; Node<K,V> ret = null; if( mValueComparator != null ) { Comparator<? super V> comp = mValueComparator; while( node != null ) { ...
4acfe6a9-b23f-4e16-88bc-2ab72f557616
6
public void paintComponent(Graphics g) { switch(status) { case 1: paintBackgroundAndStuff(g); break; case 2: paintBackgroundAndStuff(g); g.setColor(Color.WHITE); g.setFont(new Font(Font.MONOSPACED, Font.BOLD, 24)); g.drawString("(click to continue)", 300, 400); break; case 3: ...
76968fb0-7387-47fe-8975-b9627a1164ed
0
public void setXWidth(double width) { this.width=width; }
a08de19f-c9e5-4f14-98c9-ab874dcd9520
5
static private boolean jj_3R_17() { if (jj_scan_token(NEW)) return true; if (jj_scan_token(INTEGER)) return true; if (jj_scan_token(LSQPAREN)) return true; if (jj_3R_25()) return true; if (jj_scan_token(RSQPAREN)) return true; return false; }
357509ae-7a6b-49e9-a7e6-2ce757c2cc5b
9
private NouveauMessage(Personne personne, boolean isRepondre, final String dest, final String obj, String cont) { user = personne; frmMessage = new JFrame(); frmMessage.setVisible(true); frmMessage.getContentPane().setForeground(new Color(0, 0, 0)); frmMessage.g...
0fdccabe-9206-40b5-9012-b93e1c95d501
1
public void pipelineFlush() { ((PipelinedFetchDecodeStage) fetchDecodeStage).setPipelineFlush(true); //Allows for differentiation between reset and flush fetchDecodeThread.interrupt(); getIR().clear(0); //Clear index 0 of IR registers used by f/d stage (WB stage may be using third IR index). while (fetchDecodeT...
45e10a79-5dff-44f7-b837-dbbe3a3db25e
4
private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged // TODO add your handling code here: try{ switch (jList1.getSelectedIndex()){ case 0: OpenFile(1);break; //loading a primary video ...
db9c7d3e-92ef-422c-b208-ce765088c852
6
boolean existInDictionary( String word, Dictionary dictionary, SpellCheckerOptions options, boolean isFirstWordInSentence ) { boolean exist = dictionary.exist( word ); if( !exist && !options.isCaseSensitive() ) { exist = dictionary.exist( Utils.getInvertedCapitalizion( word ) ); } el...
788be426-bf3a-4225-b7a6-fee1080180d3
2
public void run() { try { while (polling) { Thread.sleep(10000); log.info("Request Status....."); sendMessage(MessageProtocols.STATUS_REQUEST); } } catch (Exception e1) { log.error("[" + name + "] Group Owner Listener failure.", e1); } }
9526afe0-0eb2-4de4-97ae-996d540164f7
9
public NodoArbolBinAVL<T> eliminar( T aEliminar ) { if(izquierda==null&&derecha==null) return null; if(elemento.compareTo(aEliminar)==0){ if(izquierda==null) return derecha; if(derecha==null) return izquierda; NodoArbolBinAVL<T> x=derecha.darMenor(); derecha=derecha.eliminar(aEliminar); ...
149c1813-2f14-4ffc-9dba-9883935e045f
6
static boolean findTab(HuffmanNode tmp, int len, long bits) { if(tmp == null) { System.out.println("Huffman init error: no huff node"); return false; } if(tmp.zero != null) { if(tmp.one == null) { System.out.println("Huffman init error: no one in node"); return false; } if(len >= 32...
a496caad-38ae-461c-90c0-a256c4ec55f3
7
public Usuario selectGerente(String Nome, String Tipo) throws SQLException { Connection conexao = null; PreparedStatement comando = null; ResultSet resultado = null; Usuario user = null; try { conexao = BancoDadosUtil.getConnection(); comando = conexao....
1b1d2042-5d09-4afe-954e-c5b2b2aad2ec
2
public final void setDiscount(double discount){ if(discount > maxDiscount|| discount < minDiscount){ throw new IllegalArgumentException(); } this.discount = discount; }
9a84c047-cd4d-4534-ade7-1bce5d51e3d8
9
public String minWindow(String S, String T) { // Start typing your Java solution below // DO NOT write main() function String res = ""; char[] tMap = new char[256]; char[] sMap = new char[256]; for (int i = 0; i < T.length(); i++) tMap[T.charAt(i)]++; int start = 0; int count = 0; int min = Integer...
48119bfd-2178-42d4-bfac-622eeff4ba73
0
public T2 getFoo2() { return foo2; }
693bd509-eac4-49b0-97b8-9e05d88ee0ec
0
@Test(expected = ParkException.class) public void out_by_right_ticket_twice_when_in_a_car() { Park park = new Park(10); Car car = new Car(); Ticket ticket = park.in(car); Assert.assertSame(car, park.out(ticket)); park.out(ticket); }
ce4faf8a-1d95-4c63-a7c1-c82e84086efc
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
ff80374c-8eba-47d0-9b94-2f735379ece8
5
@Override public void update() { if (!GameServer.users.isEmpty()) { double dist = Math.sqrt(Math.pow(targetX - x - 30, 2) + Math.pow(targetY - y - 30, 2)); if (dist < startAttackDistance) { GameServer.sendToAll(this.toString() + " ATTACK"); attack = t...
5c918581-6874-422b-b980-b2e6f1b12302
7
private void validateField() throws Exception { if (txtNumber.getText().equals("")) { throw new Exception("Please enter Employee Number"); } KeyValue department = (KeyValue) cmbFromDepartment.getSelectedItem(); if (department.getValue().equals("")) { throw new Ex...
398d0c00-0efa-428f-95cc-ed4560b47688
0
public CarBuilder setBrakes(int brakes) { delegate.setBrakes(brakes); return this; }
f6257841-d2c9-4935-91da-467825db7c08
1
public void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) { mv.visitTableSwitchInsn(min, max, dflt, labels); if (constructor) { popValue(); addBranches(dflt, labels); } }
7a3ec7d5-e517-4805-9ef7-9ff9a3d31de7
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
02a6b92e-4b4a-4fb4-a438-5cea7c83ee57
7
protected void generateMetaLevel(Instances newData, Random random) throws Exception { m_MetaFormat = metaFormat(newData); Instances [] metaData = new Instances[m_Classifiers.length]; for (int i = 0; i < m_Classifiers.length; i++) { metaData[i] = metaFormat(newData); } for (int j = 0; j <...
ee31f35f-6d24-473d-bed2-8e145d29d13d
6
private static void merge(int[] array, int start, int mid, int end) { int[] auxArr = new int[end-start+1]; int auxIdx = 0; int i = start; int j = mid+1; for(; i<=mid&&j<=end; ) { if(array[i]<array[j]) { auxArr[auxIdx++] = array[i++]; } else { auxArr[auxIdx++] = array[j++]; } } while(i<...
64e99c0c-4f5c-4914-83ac-476258d8814b
9
public Server() throws IOException { // ======== INITIALIZATION ======== // try { if( Settings.OS == Settings.OS_ENUM.WINDOWS ) Settings.loadLibrary("DLLInterface" + System.getProperty("sun.arch.data.model") + ".dll"); } catch (UnsatisfiedLinkError e) { // If we can't find the dll then don't error } ...
8f8f862c-a7f8-4920-acbd-ff3e3864ccf5
6
public static void main(String[] args) { System.out.println("Creating a context for the camera."); createPGContext(); System.out.println("\nThere are " + getNumCameras() + " camera(s) connected to the system"); System.out.println("Connecting to the default camera."); connectCamera(); System.out.println("Co...
5575745b-8430-46c2-9873-d76348c942b5
5
public boolean select(int x, int y){ if (isSelected()) if(this.getSelected()== map[x][y].getSoldat()){ this.selected = null; return false; }else actOn(x, y); if (map[x][y].estLibre()) return(false); els...
dd753063-ba38-4d68-9531-5a1ec39a205a
3
public int[] twoSum(int[] numbers, int target) { int length = numbers.length; int[] result = new int[2]; for (int i = 0; i < length - 1; i++) { for (int j = i + 1; j < length; j++) { if (numbers[i] + numbers[j] == target) { result[0] = i + 1; ...
4b6f7ab9-1c27-42fc-a3a4-bd1cc7c1eb9d
8
public void createMap() throws Exception { File osmarenderedFile = invokeOsmarenderXsltProc(); Map map = new Map(); map.load("file:" + osmarenderedFile.getAbsolutePath()); osmarenderedFile.delete(); NodeList pointNodes = map .getNodes("//svg:g[@id='map']/svg:circle[@osm:id=../svg:text/@osm:id]"); Syst...
a294ceeb-42b3-4130-93f9-cad32870985c
6
public static String getName(Neuron n){ switch(getType(n)){ case 1: return "Input Neuron :: "; case 2: return "Output Neuron :: "; case 4: return "DTC :: "; case 5: return "PitChecker :: "; case 6: return "HorizontalChecker :: "; case 7: re...
162baff0-51a6-4a71-ab2d-53a283e3ae5f
5
public void run() { byte [] buff = new byte[1024]; try { while ( inputStream.read(buff) > 0 ) { String t = new String(buff); String [] tokens = t.split("\n"); for ( String s : tokens ) { //e...
413e2233-7ddf-4b09-a402-0a13809357d5
4
public static Vector AssignOneClass(char cNum, Vector unAssigned, Integer tIndex) { Vector a27Class = new Vector(); System.out.println("Assigning 27 of: " + cNum); int i = 0; int count = 0; while (count < 27 && i < unAssigned.size()) { System.out.println("i " + i + "\tcount: " + count); if (((String)...
a90d071f-6908-4bab-b5af-0353dd96956d
5
public static void main(String[] args) { try{ Calendar calendar = Calendar.getInstance(); boolean trace_flag = true; // mean trace GridSim events int num_user = 3; int num_resource = 2; int num_gridlet = 3; // First step: Initialize the GridSim package. It should be called ...
2372da93-4cda-495b-8f8b-4763e4efa5f0
7
@Override public void combine(final int[] rows, final int[] columns) { if (isOutOfBounds(rows, columns)) { return; } final int rowSpan = rows.length; final int columnSpan = columns.length; final int startRow = rows[0]; final int startColumn = columns[0]; for (int i = 0; i < rowSpan; i++) { for (in...
28a0c8f1-e5ca-40a1-aa9e-72bfab93eb2e
8
@SuppressWarnings("RedundantIfStatement") @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SvnLogFileContent that = (SvnLogFileContent) o; if (!charset.equals(that.charset)) return false; if (!filePath.equals(that.filePath)) ...
a15b9ffe-be06-417e-bce1-864eb8d1acb6
8
public XInstCall(int line, String[] kws, int unpackList, int unpackMap, int params) { super(line, kws==null || kws.length==0?unpackList==-1?unpackMap==-1?XOpcode.CALL:XOpcode.CALL_MAP:unpackMap==-1?XOpcode.CALL_LIST:XOpcode.CALL_LIST_MAP:unpackList==-1?unpackMap==-1?XOpcode.CALL_KW:XOpcode.CALL_MAP_KW:unpackMap==-1?X...
52960d5b-ef8b-46f4-bf45-53ec4936b810
5
public Periods readPeriods(JsonReader reader) throws IOException { String currency = null; String id = null; String name = null; Number pricekWh = null; reader.beginObject(); while (reader.hasNext()) { String key = reader.nextName(); if (key.equals("currency")) { ...
37da8f25-b763-4f71-94f0-aa62ee39fb65
1
private void switchMap() { if (mode == 1) { mode = 0; } else { mode = 1; } }
a5ef758c-a500-4da4-b88e-f8059cd714ad
3
@Override public void endElement(String uri, String localName, String qName) throws SAXException { stack.pop(); if("姓名".equals(qName)) { System.out.println(qName + ":" + name); } if("性别".equals(qName)) { System.out.println(qName + ":" + sex); } if("年龄".equals(qName)) { System.out.println(q...
39899a17-6cf0-4e90-a285-f038e5771d91
3
public void mousePressed() { if (isMouseOver() && mySketch.mouseButton == PApplet.LEFT) { changeLabel(); clickedClusterId = mouseOverClusterId; if (mouseOverClusterId != -1) { MainTutorQeA.SKETCH_BOTTOM .updateQuestionsByCluster(mouseOverClusterId); } } }
9587d927-aa26-46f8-9262-34a7db915209
1
public void lisaaTiedote(Tiedote tiedote) throws DAOPoikkeus { // Avataan ensin tietokantayhteys Connection yhteys = avaaYhteys(); try { // Suoritetaan haku String sql = "INSERT INTO Tiedotteet(pvm, otsikko, tiedote) values(NOW(), ?, ?)"; // Alustetaan sql-lause PreparedStatement lause = yhteys.prepare...
bda33744-7865-43e0-b6e9-b88ccd4e3740
2
* @param contentType the content type * @return this */ public Request withContent(String content, String contentType) { try { StringEntity stringEntity = new StringEntity(content); if (contentType != null) { stringEntity.setContentType(contentType); ...
012c0ee7-bd91-47f7-a556-df4af85946a1
4
public void writeBigInteger(BigInteger v) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("writeBigInteger = " + v); } // If the absolute value of the BigInteger is less than 2^31, it can to be // transmitted as a CFASL Fixnum. Why do we use v.a...
837a50c3-5f0c-4de3-9432-330cd8906623
6
public void renderTo(Rendering rendering) { // First, we need to determine what the 'perp' angle should be (as in, // perpendicular to the line of the beam, as perceived by the viewer.) perp.setTo(line.setTo(target).sub(origin)) ; line.normalise() ; rendering.port.viewMatrix(perp) ; perp....
a518eefc-4032-4fc4-9506-58d906e97bcb
2
public static String genericRawOutput(String region, String service, String operation, Object[] args) { LoLRTMPSClient client; try { client = LoadBalancer.returnClient(region); } catch (NullClientForRegionException e1) { return "Connection to " + e1.getRegion() + " failed. This may be because that ...
a133906a-c682-4e74-a86d-40cda5310ad0
9
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SparseMatrix)) { return false; } SparseMatrix other = (SparseMatrix) obj; if (wordid1 == null) { if (other.wordid1 != null) { return false; } } el...
eab6bbb0-3536-4e1b-aa52-61cb8eb64fe9
6
public boolean store(int user,int isbn) throws IOException { int flag=0; for(int i=0;i<3;i++) { if(new User().checkUserId(user)) { flag=1; break; } } if(flag==0) {System.out.println("Invalid User ID"); ...
1cd12305-aebb-4985-8be8-aa36b1868914
8
private static String keyToEnglish(String key2) { String pieces[] = key2.split("\\+"); //$NON-NLS-1$ if (pieces.length == 0) { return null; } int mods = 0; if (pieces.length > 1) { if (pieces[0].contains("C")) { //$NON-NLS-1$ mods |= InputEvent.CTRL_DOWN_MASK; } if (p...
0791d8a7-73bc-426d-b9b7-094908f4d4ae
5
public boolean is_free(int x, int y) { if (needStart) { return true; } if (pos_x == x && pos_y == y) { return false; } updatePosition(); if (pos_x == x && pos_y == y) { downdatePosition(); return false; } downdatePosition(); return true; }