method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
70016f0e-f111-4ec7-b9fd-943b679ea980
6
void jbInit() throws Exception { this.contentPane = (JPanel) this.getContentPane(); this.contentPane.setLayout(this.gridBagLayout2); this.setDefaultCloseOperation(0); this.setJMenuBar(this.menuBar); this.setSize(new Dimension(759, 553)); this.setTitle("Truth Table Editor"); JComboBox<String> inPinBox =...
b999fdf1-3a58-4079-812d-d4244b6b0d02
5
protected void resizeCell(MouseEvent e) { mxGraph graph = graphComponent.getGraph(); double scale = graph.getView().getScale(); Object cell = state.getCell(); mxGeometry geometry = graph.getModel().getGeometry(cell); if (geometry != null) { double dx = (e.getX() - first.x) / scale; double dy = (e.g...
9c7f6c7e-0e17-4f1b-b130-f20375fcd838
4
public void unreadFrame() throws BitstreamException { if (wordpointer==-1 && bitindex==-1 && (framesize>0)) { try { source.unread(frame_bytes, 0, framesize); } catch (IOException ex) { throw newBitstreamException(STREAM_ERROR); } } }
2f0dbb72-8ba7-4f28-9ce7-509e8b42ca4a
5
public boolean cantoFaltaEnvido(){ boolean error = true; int respuesta = 0; while(error){ Scanner sc = new Scanner(System.in); System.out.print("\n1-Quiero -- 2-No Quiero \nRespuesta:"); try{ respuesta = sc.nextInt(); if((respuesta<1)&&(respuesta>2)){ System.out.println("\nError, el valor ...
7246e603-36f9-44ac-912b-39c08b07f94a
4
public Image getTile(int x, int y) { if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) { return null; } else { return tiles[x][y]; } }
bded21e0-797f-4de8-bd5b-8ae045384801
8
public static Technique getTechnique(int id){ for(Technique t: techniquesBack){ if(t.ID == id) return t; } for(Technique t: techniquesForward){ if(t.ID == id) return t; } for(Technique t: techniquesUp){ if(t.ID == id) return t; } for(Technique t: techniquesDown){ if(t.ID == id) return t; } ...
902274c7-7eef-4545-93d6-59dbc5c1f428
9
public boolean writeResourcePredictionsToFile(String filename, int trainSize, int neighborSize) { List<String> resourceList = this.reader.getResources(); Map<Integer, List<Integer>> resourcesOfTestUsers = this.reader.getResourcesOfTestUsers(trainSize); try { FileWriter writer = new FileWriter(new File("./da...
d942af56-c5bf-40a3-aa5b-98812748c06a
4
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } Position other = (Position) obj; return this.x == other.x && this.y == other.y; }
ca677458-ca3b-4664-9553-76b6a53a2281
1
@Test public void testSmooth() { EdgeFinder edges = new EdgeFinder(); double[][] smoothedGray = edges.graySmooth(testImage); try { for(int i = 0; i < smoothedGray.length; ++i) { assertArrayEquals(testImageSmoothedGray[i], smoothedGray[i], 0.5); } } finally { System.out.println("Smoothed Gray Expec...
7f86fc05-0fd9-4322-923c-208396797482
4
public void exitQueue(Vehicle v,int exitTime) throws SimulationException, VehicleException { if(!v.isQueued()) throw new SimulationException("Vehicle not in queue"); if((!v.isQueued()) || (exitTime > Constants.CLOSING_TIME) || (exitTime < 0) ) throw new VehicleException("vehicle is in an incorrect state or ti...
ea7f1dc7-dc60-4dd3-ba0c-896ff068f786
0
public void SetInputBuffer(int inputBuffer) { this.inputBuffer = inputBuffer; }
4d023603-8432-4efc-825f-401d12537fa8
2
public Item dequeue() { if (isEmpty()) throw new NoSuchElementException("Queue underflow"); Item item = first.item; first = first.next; N--; if (isEmpty()) last = null; // to avoid loitering return item; }
7e1f6025-25c5-4cad-bb1e-aaaccce5741b
7
public void printTag(String name, HashMap parameters, boolean insertTab, boolean insertNewLine, boolean closeTag) { if (insertTab) { this.printTabulation(); } this.print('<'); this.print(name); if (parameters != null) { int length = parameters.size(); Map.Entry[] entries = new Map.Entry[length]; p...
d0f04502-e249-4389-9e12-8e3111c5a338
2
public String count(String s) { StringBuffer sb = new StringBuffer(); char previous = s.charAt(0); int i = 1; int count = 1; while (i < s.length()) { char current = s.charAt(i); if (current == previous) { count++; } else { ...
f82a66fc-54f1-4d44-851f-9a3c77a09249
8
@Override public void mousePressed(MouseEvent arg0) { try { UMLButton selected_button = ButtonFinder.getSelectedButton(tool_buttons); if(selected_button != null && selected_button.class_or_assoc == null) { if(selected_button.getText().equals("Delete")) { deleteAt(arg0); } else return; ...
7e282cb2-c83f-4d72-af0e-9fce57b97d3c
9
private void intLoop(Raster source, Raster dest, Rectangle destRect, int incr1, int incr2, int s_x, int s_y) { MultiPixelPackedSampleModel sourceSM = (MultiPixelPackedSampleModel)source.getSampleModel(); DataBufferIn...
50ce2194-8e5d-4c28-96ca-0d35a8628176
5
public LinkedList<Road> getFriendlyRoadWithoutAlreadyCounted(int activePlayer, LinkedList<Road> alreadyCounted, Road commonNeighbours){ LinkedList<Road> friendlyRoads = new LinkedList<Road>(); for (Road r: roadNeighbours) { if (r.isBuilt() && r.getPlayer() == activePlayer && !alreadyCounte...
99ba11d7-99a2-4553-82bd-fc60ded32a83
9
@EventHandler public void inventoryclick(InventoryClickEvent e){ if (e.getInventory().getName().equalsIgnoreCase("Choose game: ")){ if (e.getRawSlot() < 54 && e.getRawSlot() > -1){ // the top inv rawslots are numbered 0 to 53 starting top left, -999 is returned if u click outside the inv view s...
628ca584-7fa1-4f70-be85-faf8ddc1f62b
1
private static boolean biggerThanT2A(int n, int[][] a){ return n>a[2][1] && n>a[3][1]; }
0239665d-4748-4d4a-822f-6fa160c3469b
9
@Override public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game) { if (Objects.equals(stype, "")) { if (sprite1.is_avatar) { MovingAvatar a = (MovingAvatar) sprite1; a.setScore(0); if (killSecond && sprite2 != null) ...
42023abb-9b3b-4971-b267-c2403c77abe8
1
@Override public String toString() { return String.format("%1$-15s %2$-7s %3$13d", name, isOnline() ? "online" : "offline", credits); }
00a0819f-b566-40ac-a60e-a31ee79cd576
6
public static void main(String[] args) { System.out.println("Veuillez entrer une chaine de caracteres : "); String s = scanner.nextLine(); // la chaine a coder String aCoder = ""; // la chaine codee String chaineCodee = ""; /************************************...
8a20ead2-0d43-4e49-9a41-6fac603dbd50
4
private void checkRefCount() { synchronized (this) { if (HydnaDebug.HYDNADEBUG) { DebugHelper.debugPrint("Connection", 0, "RefCount:" + m_channelRefCount); } if (m_channelRefCount...
07732535-0e4e-4d7a-a675-18d6091700bc
3
public void run(){ if(this.thread_type == "Persistent" ) runPersistentConnectionThread(); else if(this.thread_type == "Key") runKeyPressThread(); else if(this.thread_type == "Server") runServerThread(); }
0ab38c49-34bb-4539-a74b-232c337f1941
1
public void exportAsCSV() throws IOException{ out.write("address;date;text"); out.newLine(); for (SMS s : sms) { out.append(s.getAddress() + ";"+DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(s.getDate())+ ";"+s.getText()); out.newLine(); } out.close(); }
9cc779dd-45ff-4abc-b05f-9fbb9f12fcc9
7
private void processAddMasterResult(Sim_event ev) { if (ev == null) { return; } Object[] pack = (Object[]) ev.get_data(); if (pack == null) { return; } String filename = (String) pack[0]; // get name int uniqueID = ((I...
072f8794-3d83-461b-98de-d7f0bf8cb20a
2
public void setMaximum(int max) { int newMax = max >= 0 ? max : 0; if(newMax != this.max) { this.max = newMax; updateBarSize(); } }
96b69993-a075-4e49-8cf8-158ea8a72624
1
public Sounds(String file) { try{ // AudioFile audioFile = new File("src\\SoundsMusics\\Sounds\\"+file+".wav"); AudioInputStream audioStream = AudioSystem.getAudioInputStream(audioFile); AudioFormat format = audioStream.getFormat(); Da...
b685970f-d432-4898-85ad-891504a2e42a
1
public boolean equals(Object stack) { try { return ((CharacterStack) stack).buffer.toString().equals( buffer.toString()); } catch (ClassCastException e) { return false; } }
0817a60b-5a9d-4dd2-9b60-f782d57f85cc
9
public boolean read(String fileName) { InputStream is = null; try {is = new FileInputStream(fileName);} catch (IOException e) {IJ.write("" + e); return false;} int width = (int) readfloat(is); int height = (int) readfloat(is); // allocate the arrays. v = new Volu...
652ffade-9960-44a4-8fba-9697aa06af2a
1
public void infiniteDynamite(boolean b) { infiniteDynamite = b; if(b) { robot.addDynamite(); } else { robot.useDynamite(); } }
90906d62-5652-4e32-9e2d-aad6ab7427fb
7
@SuppressWarnings("resource") public static void main(final String[] args) throws ImageFormatException { SysOutPrinter printer = new SysOutPrinter(); Scanner in = new Scanner(System.in); printer.print("Please select the picture with a 'green screen' background."); Picture greenScreenedPic = new Picture(FileCho...
67c917d4-82db-47a9-ab3e-15d3517faeb7
8
public void keyPressed(KeyEvent e){ if (e.getKeyCode() == KeyEvent.VK_RIGHT){ ship.setDir(1, ship.getYDir()); } if (e.getKeyCode() == KeyEvent.VK_LEFT){ ship.setDir(-1,ship.getYDir()); } if (e.getKeyCode() == KeyEvent.VK_UP){ ship.setDir(ship.getXDir(), -1); } if (e.getKeyCode() == Key...
956778c9-bdc5-43f6-8210-ac089b079bca
0
@Required public void setMainWindowView(MainWindowView mainWindowView) { this.mainWindowView = mainWindowView; addView(this.mainWindowView); }
9fb74f81-7b0d-4147-bf5e-5800ffec49dc
6
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Movie)) return false; Movie movie = (Movie) o; if (rates != movie.rates) return false; if (!director.equals(movie.director)) return false; if (!name.equals(movie.name)) return...
1c7bb0f2-ae2d-4b6a-9377-4f5d29a5fbe3
8
@Override public boolean okMessage(Environmental myHost, CMMsg msg) { if(!super.okMessage(myHost, msg)) return false; if((msg.target()==affected) &&(msg.tool() instanceof Exit) &&(msg.targetMinor()==CMMsg.TYP_ENTER) &&(!CMLib.flags().isFlying(msg.source()))) { if(this.canEverEnterThePool(msg.source(...
1bd65f91-3bc9-4d46-9aad-7667f80bc892
0
public void setReplaceInterests(boolean replaceInterests) { this.replaceInterests = replaceInterests; }
4d43731e-0a16-428c-a743-98ebb5cc3569
7
protected boolean deconstructRecipeInto(final Item I, final Recipe R) { if((I==null)||(R==null)) return false; if(!(this instanceof ItemCraftor)) return false; final ItemCraftor C=(ItemCraftor)this; if(!C.supportsDeconstruction()) return false; if(!C.mayICraft(I)) return false; final List<Stri...
97e828fb-b8d1-4f69-90f6-2e37b05abbc8
7
private void gameUpdate() { if (!isPaused && !GC.getGameOver()) { GC.Update(); Display.Update(GC.getInfoForHUD()); } if (GC.getGameOver()){ Display.Update(GC.getInfoForHUD()); if ((xforreset<280+40)&&(xforreset>280)) if ((yforreset<335+40)&...
eb02ebb3-f4eb-4a25-9840-4cf590c16d02
5
public byte[] getAvatarAsBytes(int px) { switch(px) { case 16: return gravatar_16px; case 32: return gravatar_32px; case 64: return gravatar_64px; case 128: return gravatar_128px; case 256: return gravatar_256px; default: return gravatar_256px; } }
0c76725d-bec8-4135-b020-c2d1671b3b55
0
public void explodeAnimate() { }
53e8f979-2a79-4eac-96f3-e1031f7fc45b
6
private String getResult(String input,String result) { int len=input.length(); for(int i=0;i<len-1;i++) { int encodedDigit = Character.getNumericValue(input.charAt(i)); int decodedDigit = Character.getNumericValue(result.charAt(i)); if(i>0) { ...
757b5e4c-4052-437c-b07c-87bec15528ec
1
protected static int getCode(char cc) { byte[] bs = String.valueOf(cc).getBytes(); int code = (bs[0] << 8) | (bs[1] & 0x00FF); if(bs.length < 2) code = (int)cc; bs = null; return code; }
98541c9e-7081-4a1d-9de4-fee30e482fb9
4
public void open(String url, int mode, boolean timeouts) throws IOException { this.mode = mode; //url = url.substring(5); int cut = 5; // file:// while(cut < url.length() && url.charAt(cut)=='/') cut++; if(cut+1 >= url.length() || url.charAt(cut+1) != ':') cut--; String path = url.substrin...
70fd51cd-444f-4a58-b80c-952f0dae94ce
0
@Test public void testGroupWithEmptyDataCanBeCreated() throws Exception { GroupObject emptyDataGroup = new GroupObject("", "", ""); createGroup(emptyDataGroup); }
84ed5434-e43f-489b-b2df-479f902c3168
9
void prepareData(boolean averageY) { int numPoints = Math.min(MAX_DATA_POINTS, plotMaxData); if( x.length > numPoints ) subsample(numPoints, averageY); // Find min & max values minX = Integer.MAX_VALUE; maxX = Integer.MIN_VALUE; minY = Integer.MAX_VALUE; maxY = Integer.MIN_VALUE; for( int i = 0; (i < ...
dbf7a8a3-9237-4561-b13d-077338fd9540
4
private int jjMoveStringLiteralDfa9_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 8); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 8); } switch(curChar) { case 56: return jjMoveStringLiteralD...
c1b6782e-5e6a-4bc1-8a10-932722cf7555
4
private void setPixelVal(int x, int y, int v) { int i = x + y * width; int bpp = getBpp(); if (bpp == 8) data[i] = (byte) v; else if (bpp == 16) { data[i * 2] = (byte) (v & 0xFF); data[i * 2] = (byte) ((v >> 8) & 0xFF); } else if (...
31329f37-15c6-41b8-8f23-10aa27297a28
9
public void processGet(Request request, Response response) { // セッション ID とユーザー名を取得する。 String sessionId = request.getCookie("session_id"); try (ShopDB db = new ShopDB()) { if (sessionId == null || ! db.checkSessionId(sessionId)) { response.setError(Response.STATUS_BAD_REQUEST, "セッション ID を取得できません。"); ret...
7fb2657c-f7b5-453f-a021-934d74d05e52
9
private int calculateNumberOfFaults(){ int numberOfFaults = 0; for (int i = 0; i < board.length; i++) { if (!isColumnLegal(i)) numberOfFaults++; if (!isRowLegal(i)) numberOfFaults++; if (!isDiagonalLegalRightToLeft(0, i)) numberOfFaults++; if (i > 0 && !isDiagonalLegalRightToLeft(i, board[0]...
1c5c6926-0981-43a5-b9f6-23db4db8f159
7
private void buildTiles() { int number = 0, desertIndex = 0, intResource = 0; // Nombre aux des, numero de la tuile desert, numero de la ressource. int resourceCounter[] = new int[5]; // Un tableau comptant le nombre de ressource qui ont ete affectees a des tuiles (5 ressources differentes). int numberCounter[] ...
a4c37140-6743-49af-b4fe-f5f8353c496c
8
public void validate(Object data)//, int length) { if (data == null) return; BigDecimal bigD; if (data instanceof BigInteger) { bigD = new BigDecimal((BigInteger) data); } else { bigD = (BigDecimal) data; } boolean ne...
09f4b58c-4006-435a-9a60-87759b501011
8
public void testBuildInitialization() { boolean result; int i; int n; String[][][] processed; String msg; // process data twice processed = new String[2][m_Data.length][]; for (n = 0; n < 2; n++) { for (i = 0; i < m_Data.length; i++) { try { processed[n][i] = Tokeniz...
d7994261-ac6d-4e54-bad4-03faaeb0270f
0
public String getCode() { return code; }
1104e9ea-7bb4-4e97-97e7-53e161f289f1
6
@Override public void travelTo(double x, double y) { travelToNearestIntersection(); Delay.msDelay(2000); double destinationRow = calculateDestination(y); if (odo.getY() < destinationRow) { // Go Up turnTo(90); } else { // Go Down turnTo(270); } // Travel vertically loop (while not at destin...
1abe85c0-3782-436b-b88e-7f61be8fd4d1
6
public void expand(RPChromosomeRegion testRegion) { if (testRegion.startChromID < startChromID || (testRegion.startChromID == startChromID && testRegion.startBase < startBase)) { startChromID = testRegion.startChromID; startBase = testRegion.startB...
2ef43b77-02b3-4920-b032-632ff4cfcfc3
6
private static Set<String> writeMethod(TreeLogger logger, GeneratorContext context, JMethod method, SourceWriter writer) throws UnableToCompleteException { if (method.getParameters().length != 0) { logger.log(Type.ERROR, "Only supporting methods with no arguments"); ...
294853a0-a5b3-4b71-b914-b1f716641c5b
8
private Point2D[] getNewSlopes() { double mX = movementVector.getX(); double mY = movementVector.getY(); Point2D[] newSlopes = new Point2D.Double[2]; newSlopes[0] = movementVector; newSlopes[1] = movementVector; if (mX < 0 && mY != 0) { // Lookin...
bddd5abd-2164-4d48-974e-b2e8b0749ea9
0
public VueMedicaments() { initComponents(); }
3c8478f2-2f1b-4b91-b13f-00ba66c07d27
4
public static void main(String[] args) { String s1 = "Hello"; String s2 = "goodbye"; String s3 = "Happy Birthday"; String s4 = "happy birthday"; System.out.printf( "s1 = %s\ns2 = %s\ns3 = %s\ns4 = %s\n", s1, s2, s3, s4); if (s1.equals("hello")) { ...
7b7cd835-9753-4f17-a5a6-690f91f5635a
1
public final void codeB(long op) { while (op!=0) { write((byte)(op & 0xFFL)); op=op >>> 8; }; };
8f746c18-08b7-4118-a123-b8caf461b61f
7
void setVisibilityFlags(BitSet bs) { /* * set all fixed objects visible; others based on model being displayed * */ for (int i = meshCount; --i >= 0;) { Mesh mesh = meshes[i]; mesh.visibilityFlags = (mesh.visible && mesh.isValid && (mesh.modelIndex < 0 || bs.get(mesh.modelI...
1c846b38-c138-4ce5-91ea-edb69f3bd3df
0
@Override public Set<String> getEntities() { return getList(entityYamlConfiguration); }
a98a9f71-5efe-4bb2-9e04-9173e460e3f8
7
private synchronized void startServices() { //Check to see if we already started if(sessionStarted_flag) return; logger.log(Level.INFO, "STARTING Session"); sessionStarted_flag = true; //Start the services listed in start_services.xml try { URL url = nul...
3c3354ff-c76f-4961-beac-858a035cad6c
1
public void visitLocalExpr(final LocalExpr expr) { if (expr.isDef()) { sideEffects |= SideEffectChecker.STORE; } expr.visitChildren(this); }
b3f91e45-2117-4371-998e-9c07da289de1
6
public static void main(String [] args) { JFrame gameWindow = new JFrame("Monopoly"); JPanel gameBoard = setUpBoard(); gameWindow.add(gameBoard, BorderLayout.CENTER); gameWindow.setVisible(true); gameWindow.setSize(880,650); gameWindow.setResizable(false); gameWindow....
52d7f32c-fca2-4d91-af28-062dc44c547b
8
*/ public void cellsRemoved(Object[] cells) { if (cells != null && cells.length > 0) { double scale = view.getScale(); mxPoint tr = view.getTranslate(); model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { // Disconnects edges which are not in cells Collection<Obje...
65d3ce44-eebc-4008-95fc-f7daad118a13
6
private Node lowerNode(T k) { Node x = root; while (x != null) { if (k.compareTo(x.key) > 0) { if (x.right != null) { x = x.right; } else { return x; } } else { if (x.left != null) { x = x.left; } else { Node current = x; while (current.parent != null && cur...
37256ae8-bdc6-4713-bcff-1fdf6559c08b
3
@EventHandler public void onPlayerQuit(PlayerQuitEvent event) { try { PreparedStatement statement = HyperPVP.getStorage().queryParams("UPDATE users SET last_online = ? WHERE username = ?"); { statement.setLong(1, (System.currentTimeMillis() / 1000L)); statement.setString(2, event.getPlayer().getName()); ...
9cbb32f4-24a8-4d0f-9319-c48ec063cbb3
2
public ZombieLevel(House current) { this.house = current; int width = current.getHouseWidth(); int length = current.getHouseLength(); Tile[][] array = current.getHouseLayout(); // On instantiation, layout is set to a copy of the original array. layout = new Tile[width][le...
6545b190-ae31-4a76-8219-0d29b4680c09
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(); ...
22ea975b-e677-48c0-bc57-ad73234dcbdf
1
private void test(PumpingLemma p, String[] s, int n) { for (int i=0; i<s.length; i++){ System.out.println("Lemma "+n+" String "+s[i]+" ... "+p.isInLang(s[i])); } System.out.println(); }
d6da5463-e053-4b3e-89a1-b7ddc9ab3f9b
2
public static Target getTarget(String s) { switch (s) { case "user": return user; case "target": return target; } return null; }
419125a5-9f1c-4ad7-bc9f-b6aaa9a469b0
9
private void doListRecordsOrIdentifiersTest(String from, String until, String prefix, String set, boolean identifiers) throw...
d91c5574-64c2-4e8a-9ce1-61d4f0cf2386
7
public JSONObject getCountryList(String filter, Integer limit, Integer offset, String orderBy, String direction) { StringBuilder uriBuilder = new StringBuilder("/api/getCountryList?") ; log.debug("Setting API Token") ; uriBuilder.append("AUTH_TOKEN="+apiToken) ; if (filter!=null) { uriBuilder.append("&filt...
70ae32b4-d917-42d6-a986-922f43f95e06
8
private DockingWindow getDeepestWindowAt(Component component, int x, int y) { if (component == null || !component.isVisible() || !component.contains(x, y)) return null; if (component instanceof Container) { Component[] components = ((Container) component).getComponents(); for (int i = 0; i <...
ecdc4e02-a66d-4e4d-8f20-6c7ce3df54e3
1
private static Persister getPersister() { if (persister == null) { persister = new Persister(new Format(2, XML_DECLARATION)); } return persister; }
1320649a-5688-4d8f-9cb8-51c6441d885b
6
private void refresh() { Competition.getInstance().setNextCodeRedMatch(CURRENT_MATCH); Match match = schedule.get(CURRENT_MATCH); boolean red = match.getRedStation1() == 2771 || match.getRedStation2() == 2771 || match.getRedStation3() == 2771; nextMatchNumber.setText(String.valueOf(match...
9f2399d3-077c-46c0-bda9-bcd522277bcd
1
static int fibonacciRecursive(int yourInt){ if(yourInt < 3){ return 1; } return fibonacciRecursive(yourInt-1) + fibonacciRecursive(yourInt-2); }
b8137c80-0f4b-4cde-b3c2-683f7d0dad2f
4
public final static void main(String[] args) { hasFailed = false; if(!test1()) System.err.println("Test 1 failed."); hasFailed = false; if(!test2()) System.err.println("Test 2 failed."); hasFailed = false; if(!test3()) System.err.println("Test 3 failed."); hasFailed = false; if(!test4())...
a0bf0756-f0b9-420e-9798-1791957ca7cb
3
@Override public void execute(double t) { if (fis != null) { double[] v = new double[fis.length]; for (int i = 0; i < fis.length; i++) { fis[i].setVariable("t", t); v[i] = fis[i].evaluate(); } try { output.setOutput(new ColumnMatrix(v)); } catch (OrderException e) { // TODO Auto-genera...
c9a3f604-5777-4430-956c-13576385e8de
3
public static String getCategoryID(String CategoryName){ try { ResultSet rs=DB.myConnection().createStatement().executeQuery("select* from category where CategoryName='"+CategoryName+"'"); while(rs.next()){ category_id=rs.getString(1); } ...
74095195-87a1-41d2-b91d-61a57f70cd9e
9
@Override public String stateString(Rider R) { switch(rideBasis) { case Rideable.RIDEABLE_AIR: case Rideable.RIDEABLE_LAND: case Rideable.RIDEABLE_WAGON: case Rideable.RIDEABLE_WATER: return "riding in"; case Rideable.RIDEABLE_ENTERIN: case Rideable.RIDEABLE_SIT: case Rideable.RIDEABLE_TABLE: c...
0c47c225-1b57-4d1e-a949-dd14c1477bf8
1
@Override public Ticket[] toTicket(TicketPoolTicket[] poolTickets) throws Exception { IRailwayRepository repo = this.getSite().getRequiredService(IRailwayRepository.class); Ticket[] rs = new Ticket[poolTickets.length]; for(int i = 0; i < poolTickets.length; i ++) { final TicketPoolTicket pt = po...
29172f71-769c-4bd8-82f4-0cfd1da65017
9
@Override protected MoveResult determineMoveResult() { MoveResult result = MoveResult.OK; if (redButterfly != null && isSurrounded(redButterfly)) { result = MoveResult.BLUE_WINS; } else if (blueButterfly != null && isSurrounded(blueButterfly)) { result = MoveResult.RED_WINS; } else if (turn == maxTurns) ...
7855af8c-fdb8-43b9-b80e-9ad679f84e4b
1
public void notified(String str) { for(Watcher watcher : list) { watcher.update(str); } }
d27aa229-15b9-4cec-8e63-2aa50bae1512
4
public static void printConnectivity(Node node)throws IOException{ Node node2=node; String s=""; s=""; do{ Node node3=node2; s+="\t"+node3.symbol.value; do{ s+="\t"+node3.constraint.value; node3=node3.right; }while(!node2.equals(node3)); s+=NEWLINE; out.write(s); s=""; node2=n...
eade5761-d80a-4303-b847-44f2a511b15c
9
private List<Person> extractFriendsList(String jsonText) { List<Person> personList = new ArrayList<Person>(); boolean readFriends = true; int rowId = 0; try { JsonFactory jsonFactory = new JsonFactory(); /*** read from JSON String ***/ JsonParser jParser = jsonFactory.createJsonParser(jsonText); ...
beb60915-4ad0-424b-983f-e4caacfd609a
4
@Override @Deprecated public String insertProtection(String EntityI, Vector<String> properties) { Vector<Vector<String>> triples= new Vector<Vector<String>>(); String xml=""; boolean ack=false; //String Protection_Entity = "http://" + Double.toString(Math.random()); String Protection_Entity = "http://"...
8435f9ad-2f5a-478c-b5c0-9278398900ec
9
public boolean modificarJugador(){ String nom, nom_c, nac, pos; double altura, peso; int dia, mes, anio; Date fecha_nac = null; boolean modificacion_correcta = false; if(tf_nom_comp.getText().equals("")){ JOptionPane.showMessageDialog(this, "El campo n...
e39ba4d5-0203-44ae-b30f-33ebaf6416c3
5
@Override public void render(Graphics2D g, LevelEditorComponent ed) { int X = this.X * 16; int Y = this.Y * 16; Rectangle srcRect = new Rectangle(0, 0, 16, 16); Rectangle destRect = new Rectangle(X, Y, 16, 16); for (int xx = 0; xx < CachedObj.length; xx++) fo...
a0d767f9-b71a-4e93-ad3f-91c42c57f031
1
public static JPUtil getInstance() { if (instance == null) { instance = new JPUtil(); } return instance; }
e7241ed1-036c-4e7c-b0fa-b2102500d730
5
private void writeObject(boolean first, Writable o) throws IOException { if (!first) { this.outStream.write(csvSeparator.getBytes(utf8)); } boolean encloseQuotes = true; if (o.toString().contains(csvSeparator)) { encloseQuotes = true; } if (encloseQuotes) { this.outStream.write("\"".get...
85d2103a-27ee-4bc5-9a46-e3756799bad6
6
void calcDegeneracy() { degeneracy = new HashMap<String, Integer>(); for (char base1 : DnaCoder.TO_BASE) for (char base2 : DnaCoder.TO_BASE) for (char base3 : DnaCoder.TO_BASE) { char c[] = { base1, base2, base3 }; String codonStrOld = new String(c); String aaOld = aa(codonStrOld); for...
46c28db5-1ed6-4011-a76e-1d0d76e25951
5
static private int jjMoveStringLiteralDfa8_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(6, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(7, active0); return 8; } switch(curChar) { cas...
1f2cd07e-c637-4960-b48b-cf073eae3cd1
7
int getContentWidth (GC gc, boolean useDisplayText) { int contentWidth = 0; String text = useDisplayText ? displayText : super.getText (); if (text.length () > 0) { contentWidth += gc.textExtent (text, SWT.DRAW_MNEMONIC).x; } if (super.getImage () != null) { contentWidth += super.getImage ().getBounds ().width...
4e24310e-93e8-4bb4-af40-067fe1a3cbe8
0
protected Stage getStage() { return this.stage; }
95aecc0f-a46c-426d-a898-03608bd7352b
8
void freeTree(treeNode root) { while (!treeFinished(root)) { if (root.lc == null && root.rc == null) { root = root.parent; } else if (root.lc == null && root.rc != null) { //Schau ob rc ein Blatt ist if (isLeaf(root.rc)) { ...
50c08d8c-1040-4563-8718-940d3e36472a
0
public InetAddress getAddress() { return address; }
02545c76-1f44-439f-b9bf-6b43b127b9d1
0
public void setDirFilterExclude(String dirFilterExclude) { this.dirFilterExclude = dirFilterExclude; }