method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
9cd3a64c-6bc1-40d5-8893-51965c57a801
5
public String launch(GameState state) { Scanner inputScanner = new Scanner(System.in); System.out.println("d: Debug Menu"); String debug = inputScanner.next(); if(!debug.equals("d")) { return debug; } while(true) { System.out.println("\nDebug Menu: \n"); System.out.println("b: Vie...
fc7d9658-1738-49e4-9fa2-41c375c59f2d
0
public CheckResultMessage checkL7(int day) { return checkReport.checkL7(day); }
14fd1a5f-6553-466e-87fb-4962ba8ad8ef
2
public static ProcessManagerCommand getInstance(String value){ ProcessManagerCommand[] instances = ProcessManagerCommand.values(); for(ProcessManagerCommand instance: instances){ if(instance.getValue().equals(value)){ return instance; } } return UN...
f90fa75e-9788-4b06-b348-986c5965b05a
5
public V remove(K key) { if (root == null) { return null; } if (root.key.compareTo(key) == 0) { V temp = root.value; if (root.right == null) { root = root.left; } else if (root.left == null) { root = root.right; ...
438847e4-3dad-4333-b07b-cfa200952a25
6
private Operator parseOperator(String operator) { if (operator.equals("==")) return Operator.EQ; if (operator.equals(">")) return Operator.GT; if (operator.equals(">=")) return Operator.GTE; if (operator.equals("<")) return Operator.LT; if (operator.equals("<=")) return Operator.LTE; if (operator.equals("!=...
43b8992d-7aff-48b3-81e5-80d999ed18b8
7
public static void cppOutputDeclarations(Keyword accesscontrolmode, Cons declarations) { Stella.cppIndent(); if (accesscontrolmode == Stella.KWD_PUBLIC) { ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println("public:"); } else if (accesscontrolmode == Stella.KWD_PRIVATE) { ((...
a0981ce9-a95d-4aeb-9c8f-0d37fcec66ff
1
public static void toggle(){ if(instance == null){ instance = new TimerPanel(UI.instance.root); } else { UI.instance.destroy(instance); } }
99f92077-7e28-46e3-bbe2-a075c88989aa
1
public static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); }
eedfb756-5b83-4124-8d3b-0e72728ee38f
1
public void testWithFieldAdded6() { Partial test = createHourMinPartial(); try { test.withFieldAdded(DurationFieldType.hours(), 16); fail(); } catch (IllegalArgumentException ex) { // expected } check(test, 10, 20); }
bd35620f-bcde-40a3-bf34-c504bb0321c8
0
public void shuffle() { myCards.clear(); init(); }
5ab5dff7-54c2-4beb-bccc-ebd2ba1daa28
0
public BrainConfirmationDialog() { setResizable(false); setModal(true); contentPane.setBorder(DefaultUIProvider.getDefaultEmptyEtchedEmptyBorder()); setContentPane(contentPane); getRootPane().setDefaultButton(correctButton); correctButton.addActionListener(new Acti...
d0211656-4a6e-4593-a4cb-da9c6a9d11fb
9
public static void floodfill(int i, int j , char source){ Queue<Integer> x = new LinkedList<Integer>(); Queue<Integer> y = new LinkedList<Integer>(); x.add(i); y.add(j); v[i][j]=true; while(!x.isEmpty()){ int xa = x.poll(); int ya = y.poll(); m[xa][ya]='&'; for (int k = 0; k < dx.length; k++) { ...
835097e7-002c-485a-bb0e-a433121979d1
6
private boolean validarDatos() { //unicamente valido el numero de cuenta boolean valido = false; Fechas fecha = new Fechas(); Validaciones val = new Validaciones(); if (jTextField1.getText().equals("") || jTextField2.getText().equals("")){ mensajeError("Ingre...
6a76d652-3791-4703-83e8-6dd9cbf85e9b
0
public ResultView getResultView(){ return resultView; }
dac6878b-e5cc-4635-a339-3902a0d7940d
6
public int diff_xIndex(LinkedList<Diff> diffs, int loc) { int chars1 = 0; int chars2 = 0; int last_chars1 = 0; int last_chars2 = 0; Diff lastDiff = null; for(Diff aDiff : diffs) { if(aDiff.operation != Operation.INSERT) { // Equality or deletion. chars1 += aDiff.text.length(); } if(aD...
22884033-a6bc-4eec-a8ac-61589f870c51
5
public void rightClickMenu(MouseEvent e){ int r = this.rowAtPoint(e.getPoint()); if (r >= 0 && r < this.getRowCount()) { this.setRowSelectionInterval(r, r); } else { this.clearSelection(); } int rowindex = this.getSelectedRow(); if (rowindex < 0) ...
bfe858a2-8085-44c9-a221-6f66b4741469
9
public void setFlag(int bit, boolean on) { switch (bit) { case LegacyState.SREG_I: if (on) enableInterrupts(); else disableInterrupts(); break; case LegacyState.SREG_T: T = on; break; case LegacyState.SREG_H: H = on; break; ...
56c66979-1d99-4fb3-af05-59c12f313dde
5
protected void updateStocks(int numUpdates) { if (Float.isNaN(credits)) credits = 0 ; if (Float.isNaN(taxed)) taxed = 0 ; if (numUpdates % UPDATE_PERIOD == 0) diffuseExistingDemand() ; // // Here, we clear out any expired orders or useless items. (Consider // recycling materials or sending el...
1f13a531-63ba-4cb1-bfd6-60e56957606f
5
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connexion.setUrl("jdbc:mysql://localhost/rdm?user=root"); try { //Chargement du pilote : Class.forName("com.mysql.jdbc.Driver"); } ca...
b9b8a6bb-585e-4fc0-ab0b-b8112f5b73d0
0
public void setH(float h) { this.h = h; }
37229715-d70f-4dfc-b578-637959d37f81
7
public static void main(String[] args) { final MicroBenchmark bench = new MicroBenchmark(); final int len = 1024; bench.logTime("start"); testAddSubtract(); testLinearCombination(); testMatrixMultiply(); testMatrixMultiplyFast(); testMatrixMultiplyStrassen(); //final int len = 1024; final DoubleMat...
31b0df9d-ddd1-428d-b523-044ebd5a01e2
4
@Override public void atacar(){ try{ for(int i = 0; i < ejercito.size(); i++){ int refPosX; int refPosY; refPosX = ejercito.get(i).refLabel.getLocation().x; refPosY = ejercito.get(i).refLabel.getLocation().y; ...
96d04833-0997-444a-bbdf-b89e22e5c6a6
3
public void loadConfig() throws IOException { File f = new File(BrickGame.path + "/custom/" + name + ".png"); if (f.exists()) { my_image = ImageIO.read(f); } try { System.out.println(name + ": load custom AI configuration"); ArrayList<Double> ai = Tools.getDoubleConfig(BrickGame.path+"/custom/...
a0748c49-ff3a-4248-a97c-cdf8589bd7eb
5
@SuppressWarnings("unchecked") public static String convertDealsToJson(List<Deals> deals, List<Merchants> merchantsList, List<String> dealPicURLList) { if (deals.size() != merchantsList.size() || deals.size() != dealPicURLList.size()) { return null; } JSONArray j_array = new JSONArray(); for (int i...
924ea355-a56a-4e1a-877a-3e07373eb488
9
@Override //work! public void execute(String[] command) throws ExeptionNotEnoughArguments { super.execute(command); String item=command[2]; Player p = GameController.getGame().getPlayer(); switch(command[1]) { case "world": case "w": { if(p.getLocation().getExit(item) != null && p.getLocatio...
611ad5c8-c17a-4931-8a47-22d04fb87f7b
1
public boolean executionAllowed() { return (receiver == null || receiver.hasPermission(getCommandType().getPermission())); }
b4af2c10-0648-4897-8beb-0019872571e0
7
public int addExpectedEdges(final Node node) { final OrdinaryCluster cl = node.getGtCluster(); /* * Intra-cluster edges */ final List<Long> intraClPartners = Sequences.binomialSequence(cl.getPIn(), cl.getNodeCount() - 1); for (final long index : intraClPartners) { // mind not to create self loop...
84cb30c8-a441-4f3f-bb4d-c9e0ac1bf827
5
public static String encode(final byte[] data) { final char[] tbl = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',...
2e1cf2e5-e329-43b2-ae87-81f921634357
9
public static ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode p1 = l1; ListNode p2 = l2; int incr = 0; ListNode ln = null; ListNode p = null;; while (p1 != null || p2 != null || incr != 0) { int sum = 0; if (null != p1) sum = sum + p1.val; if (null != p2) sum = sum + p2.val; sum = su...
a620e7d3-edb3-4029-9b16-27ed3a8a76eb
1
@EventHandler() public void onProjectileHit(ProjectileHitEvent e) { Iterator<Dodgeball> it = mm.getMinigames(); while(it.hasNext()) { it.next().handleProjectileHitEvent(e); } }
ba02767e-61aa-4c44-893b-e12745e0150f
8
public AbstractPiece[][] board(){ AbstractPiece [][] chessboard = new AbstractPiece[CHESSBOARD_WIDTH][CHESSBOARD_HEIGHT]; for(int rows = 0; rows < chessboard.length; rows++){ for(int column = 0; column < chessboard[0].length; column++){ ...
64f685a5-effa-474f-8eac-9ce4de020cbc
5
public TreeNode insert(int value) { TreeNode current = root, parent = null; boolean isLeft = false; while (current != null) { parent = current; if (current.val == value) { // I ignore this case } else if (current.val > value) { // goes left current = current.left; isLeft = true; } else...
08061ec2-96b8-43c5-a966-74a3d2f6ef3f
5
public void update() { getFps(); screen.draw(stage); if(menu.isOpen()) { menu.draw(); menu.update(stage); } screen.update(); if(!paused) stage.act(); Input.checkInput(stage); if(screen.toBeClosed() || Keybinds.EXIT.clicked() || toBeClosed) { close(); } }
178c983e-74b1-4f97-806f-af1430dd60df
4
public static String parse(String in){ String B = in; for(int y = 0; y < Main.parseList.length; y++){ try{ B = B.replaceAll((Main.parseList[y] != "[" && Main.parseList[y] != "]")? Main.parseList[y] : "\\" + Main.parseList[y] ,Main.unParseList[y]); } catch (NullPointerException e){System.out.print("F...
a190b79e-22ee-4efe-9b32-f0acfc470b72
7
private Graph<Vec2r> build() { final Graph<Vec2r> visibilityGraph = new Graph<Vec2r>(false); final Collection<Vec2r> vertices = new ArrayList<Vec2r>(m_Segments.size()); /* Adding segments vertices as graph vertics */ for (final Segment segment : m_Segments) { if (visibility...
72b47bb9-9b70-417c-b069-63774343ec65
0
public int getId(){ return id; }
83616507-96ee-43a6-b1cb-37920a01e1e7
1
private int updatePos(int pos, int increment) { if (offset > -1) offset += increment; return pos + increment; }
95117c4e-9fe9-4c88-b536-b4467c01af96
6
private void processRequest(ServerSocketRemoteChannel channel, Object bareRequest) throws InterruptedException { if (bareRequest != null && bareRequest instanceof Transport) { Transport transport = (Transport) bareRequest; String requestId = transport.getId(); Object requestObject = transport.getObject()...
aac0ef00-0b6d-4c07-9012-efd25fded00f
9
private boolean convertYUV422toRGB(int[] y, int[] u, int[] v, int[] rgb) { if (this.upSampler != null) { // Requires u & v of same size as y this.upSampler.superSampleHorizontal(u, u); this.upSampler.superSampleHorizontal(v, v); return this.convertYUV444to...
5b444fa4-0bc2-4bc7-8c36-a8c24abc8b76
3
public void nextQueens(String[] board,int row,int n){ if(row >= n){ list.add(copy(board)); return ; } char[] crow = board[row].toCharArray(); for(int col=0; col< n;col++){ if(ok(board,row,col,n)){ crow[col] ='Q'; board[r...
c7ca61a0-7648-4d34-86f8-00f182dbcb59
6
@Override public SampleModel createCompatibleSampleModel(int width, int height) { if (bitsPerComponent >= 8) { assert bitsPerComponent == 8 || bitsPerComponent == 16; final int numComponents = getNumComponents(); int[] bandOffsets = new int[numCompone...
e5775188-c700-434c-bfcd-211485e3781c
5
@Test public void invalidCardCreateProfile() { Address billing = getTestBillingAddress(); Card card = getTestCard(); ProfileResponse createdProfile = null; try { Card nillCard = null; createdProfile = beanstream.profiles().createProfile(nillCard, billing); Assert.fail("Fail test because the card was ...
6b3d0b06-aadf-4303-8d4e-da86a81c26e2
3
public int do600baudFFT (CircularDataBuffer circBuf,WaveData waveData,int start) { // Get the data from the circular buffer double samData[]=circBuf.extractDataDouble(start,13); double datar[]=new double[FFT_64_SIZE]; // Run the data through a Blackman window int a; for (a=0;a<datar.length;a++) { if ((a>...
1915a5f6-a2ad-46f8-af5b-c07694e7e087
7
private List<?> findByDate(Session session, String propertyName, Date date, String sortByPropertyName) throws InvalidHibernateSessionException, InvalidCriterionException, InvalidCriterionValueException, InvalidSortByPropertyException, DAOException { if(ses...
c587ea38-b8fd-43bd-9979-11fc6f9a92b1
2
@Test public void testWritePassword() throws NoSuchAlgorithmException { // Write double hashed password to mock persistence handler String id = "DouglasAdams"; byte[] passwordHash = new BigInteger( "769b1075dbb0ef9643e7bcc606acb023af49e00bce9518d6afcb14e6ba52d168", 16).toByteArray(); ph.writePassword(i...
3a6b35e7-36b4-40fd-ad4c-a0f7d5957149
3
final void startBackup(final Component parentWindow, final String destinationPath) { // If the destination path is invalid, return. if (destinationPath == null || "".equals(destinationPath.trim()) || !(new File(destinationPath.trim()).exists())) { AlertMessages.backupPathNull(); return; } ...
09b654cb-ccbd-493d-98ce-b145caec7918
5
public void deleteMin() { if (juurilistanEka != null) { BinomiSolmu kasiteltava = juurilistanEka; BinomiSolmu edellinen = null; BinomiSolmu pienin = min(); while (kasiteltava.getArvo() != pienin.getArvo()) { edellinen = kasiteltava; ...
c5543eb0-f476-43e6-ad6f-9e764b4ca27f
3
public static Subject[] findNatScSubjects(Data myData) { List<Subject> results = new ArrayList<>(); for(Subject thisWahlfach:myData.getWahlfaecher()) { if(thisWahlfach.getSubjectType()==NATURAL_SCIENCE) results.add(thisWahlfach); } if(results.isEmpty()) throw new NoSuchE...
7fdea5e1-8768-4787-8e14-22508230f663
1
public ServerThread(Server server, Socket socket) { this.socket = socket; this.server = server; // Store it so we can use it in parent class // I/O try { this.inFromClient = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); this.outToClient = new PrintWriter(this.socket.ge...
05611339-9113-483b-844a-2f14f8c684d9
3
public int checkstaff() { try { BufferedReader in = new BufferedReader(new FileReader("./data/staff.txt")); String data = null; while ((data = in.readLine()) != null) { if (playerName.equalsIgnoreCase(data)) { return 5; } } } catch (IOException e) { System.out.println("Crit...
a33b23ed-0acd-4263-811e-a1ab273c02b2
4
@Override public void run() { while (channel != null) { long start = System.currentTimeMillis(); try { buffer.flip(); channel.write(buffer); } catch (IOException e) { e.printStackTrace(); } long elapsed = UnblockingNetwork.getCycleRate() - (System.currentTimeMillis() - start); if (...
ee2c5822-ec46-44a2-ae6f-bd63bc394359
0
public void create(String name, int maxGuest, double price) { this.name=name; this.maxGuest=maxGuest; this.price=price; }
154cdc90-ea55-4a34-9f3c-ef79384fd11e
1
public void add(int n) { if (arrIndx == len) { arrIndx = 0; listIndx++; list.add(new int[len]); } list.get(listIndx)[arrIndx] = n; arrIndx++; }
88e448c3-8b12-47ed-943d-64e469ed0e90
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Identifier<?> other = (Identifier<?>) obj; if (_value == null) { if (other._value != null) return false; } else if (!_value.equals(other...
f9d09a02-afab-489e-afbe-b74b57df0d05
7
public static void makeCompactGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) { SpringLayout layout; try { layout = (SpringLayout)pa...
ea85e38e-b543-47d9-8d8a-e2e1f2d862a4
0
static long rotate(int u, int c) { return (u << c) | (u >>> (32 - c)); }
f4e9d9ac-ffad-4984-b7a4-c423cc18d300
2
public String toString(){ String result = ""; int i = 0; for(String[] s1 : this.population){ for(String s2 : s1){ result += s2 + ", "; } result += "Fitness = " + String.valueOf(this.fitness[i]); result += "\n"; i++; } return result; }
a443ba9e-42f3-4a07-9c3f-c880d7d86089
1
public boolean Apagar(int id){ try{ EmailDAO emailDAO = new EmailDAO(); TelefoneDAO telefoneDAO= new TelefoneDAO(); EnderecoDAO enderecoDAO = new EnderecoDAO(); PessoaDAO pessoaDAO = new PessoaDAO(); emailDAO.ApagarTodosQuandoExcluiPessoa(id); ...
69536917-86f4-4843-854d-8ff57bbcb27b
8
final public void Type_declaration() throws ParseException { /*@bgen(jjtree) Type_declaration */ SimpleNode jjtn000 = new SimpleNode(JJTTYPE_DECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(ARRAY...
d3f2400f-0405-420f-a329-316a6ed11ca4
0
public LoginServlet() { super(); // TODO Auto-generated constructor stub }
cf00849e-2ce2-464b-a98c-52edc7bdd6f3
9
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String deleteMembruEmail = request.getParameter("del...
d7ca507c-3e23-436a-bae1-898a1bb17d9f
8
public int searchInsert2(int[] A, int target) { if(A == null){ return 0; } int res = 0; if(target < A[0]){ return 0; } if(target > A[A.length - 1]){ res = A.length; } for (int i = 0; i < A.length; i++) { if(target == A[i]){ res = i; } if(i != A.length -1){ if((target > A[i])&&(...
1bf03fe0-192d-4ed4-9e47-daeefc2986c4
1
public int[] nextInts(int n) throws IOException { int[] res = new int[n]; for (int i = 0; i < n; ++i) { res[i] = nextInt(); } return res; }
02cc63b0-4abd-45b8-8f98-ce88b884afa5
2
private void stopFileReceiver() { while (this.fileReceiverThread.isAlive()) { this.log.fine("FileReceiver thread is alive"); this.fileReceiverThread.interrupt(); this.log.fine("FileReceiver thread is interupt"); try { this.log.fine("Join FileReceiver thread"); this.fileReceiverThread.join(); t...
8a389c18-6beb-4ed5-8dc5-fdcf605da99c
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...
62348e0e-2381-475a-8130-b06529e9ced3
2
public static ObjectInputStream getIn() { if(in==null){ try { in = new ObjectInputStream(socket.getInputStream()); } catch (IOException e) { throw new ConexionException("Error al crear el object in: " + e.getMessage(), e); } } return in; }
0744780d-4796-4420-91a5-82f8b1060d21
1
@Override public boolean isValid(File file) { if (firstTime) { firstTime = false; return true; } else { return false; } }
7b8294b1-1ffd-480c-815a-770910acef3c
2
public DataModel<MedicoBean> listaMedicos() { MedicoDAO medico = new MedicoDAO(); if (medico.getMedicos() != null) { medicosBean.removeAll(medicosBean); for (MedicoDAO e : medico.getMedicos()) { medicosBean.add(new MedicoBean(e.getIdMedico(), e.getNome(), e.getCrm...
9902c243-910c-4349-9be9-6ed72bf9ce4a
1
@Test public void arithmeticInstr_testInvalidDestinationRegisterRef() { //Checks instr. not created with invalid register ref. try { instr = new ArithmeticInstr(Opcode.ADD, 5, 25); } catch (IllegalStateException e) { System.out.println(e.getMessage()); } assertNull(instr); }
a2f6a57b-0beb-4f66-9d8c-ce237abe1e9c
2
private static String getQualifiedNameForArray(Class<?> clazz) { StringBuilder result = new StringBuilder(); while (clazz.isArray()) { clazz = clazz.getComponentType(); result.append(SpringClassUtils.ARRAY_SUFFIX); } result.insert(0, clazz.getName()); return result.toString(); }
2a217659-fe05-42b9-b70f-8532e263acd7
9
public void compileIndex(List<PendingBlock> blocks, RAMOutputStream scratchBytes, IntsRefBuilder scratchIntsRef) throws IOException { assert (isFloor && blocks.size() > 1) || (isFloor == false && blocks.size() == 1): "isFloor=" + isFloor + " blocks=" + blocks; assert this == blocks.get(0); assert sc...
7a40f700-c4c3-4262-aff4-4e707d2c3567
2
@Override public void Play(PlayerResponse response) { try { Suit move = response.getTrump(); System.out.println("trump is " + move); mP.setLastMove(response); mP.setCurrentTrump(move); // Send trump to players PinochleMessage message = new PinochleMessage(); message.setCurrentTrump(move.toSt...
2f964cea-51af-4a3c-a88e-df4418ed2b8e
7
public void draw(Graphics2D g) { if(!visible) return; int w = getWidth(); int h = getHeight(); //Color background = new Color(8, 145, 145); //Color background = new Color(35, 69, 102); Color background = new Color(22, 49, 79); Color foreground = Color.WHITE; RoundRe...
edda2605-c330-4ae7-9841-56b5237fda0c
1
public void setLatitudeLongitude(double latitude, double longitude) { this.setLatitude(latitude); if (Math.abs(this.latitudeInternal) == 90000000L) { // At the poles all longitudes intersect. Simplify for later comparison. this.setLongitude(0); } else { this.setLongitude(longitude); } }
a66cfa0a-2754-4c42-81d5-8d9117ed8d51
0
public final int length() { return filter.length; }
08ff51fa-434f-47ad-a511-3953a11879e3
5
public void login() { NavalBattleIO.saveAttribute(new SettingsAttribute("lastGoodUserName",usernameField.getText())); AuthStatus status = NavalBattle.getRoketGamer().init(new APIKey(Constants.API_KEY), new Player(usernameField.getText(), new Password(createString(passwordField.getPassword()))), Constants....
4f7bcefd-3d62-49d3-8581-cc0f0c1514fe
1
@SuppressWarnings("unchecked") public <T> T getProperty(String key) { if (properties == null) { return null; } return (T)properties.get(key); }
b1e4ec26-dbd9-4989-86fa-1943e35c8be7
7
@Override protected void fillModel(Map<String, Object> model, HttpServletRequest httpServletRequest, SProject sProject, SUser sUser) { SlackProjectSettings slackProjectSettings = (SlackProjectSettings) projectSettingsManager.getSettings(sProject.getProjectId(), SlackProjectSettingsFactory.SETTINGS_KEY); ...
0bc0cbe4-d710-4f41-b5b8-2b2917f6e9bb
5
public void nesteOppgave(){ /*Metode nesteOppgave() Denne metoden holder styring på om dette finnes flere oppgaver å vise Viser neste oppgave om mulig Når alle er vist sjekkes det hvor mange rett eleven har Samler hvilke feil eleven har gjort Lagrer informasjonen ved å kalle opp lagreFil metoden Bygger op...
336ea50f-54d8-43ba-ac1b-cb157dade569
4
private List<String> loadUpdateFiles(String tblId) { List<String> updateFiles = new ArrayList<String>(); String updatePath = "sql/" + tblId + "/updates/" + dbCon.getDBMS().toLowerCase(); try { JarFile jar = new JarFile(plugin.getJar()); Enumeration<JarEntry> entries = jar.entries(); //Loop through con...
36d99f70-78e4-4583-bc2d-c1052b442d93
8
private void extractParentheses() { int open = 0; // level of outer parentheses int openIgnored = 0; // level of inner parentheses, to be skipped Stack<Integer> lefts = new Stack<Integer>(); Stack<Integer> rights = new Stack<Integer>(); for (int i = 0; i < size(); i++) { if (get(i) instanceof TokenPare...
c5140025-c59e-4f96-ae15-015a2fbaafbb
5
public void update(){ if((vx+ax>0 && vx<0) || (vx+ax<0 && vx>0)){ ax = 0; vx = 0; } vr+=ar; vx+=ax; vy+=ay; x+=vx; y+=vy; if(vx>=0) rotate(vr); else rotate(-vr); boundingBox....
9b3c6313-6bba-4761-bdd0-cb13c29d3b41
9
public void buildTable(Renamer renameRule) { if (!isReachable() && (Main.stripping & Main.STRIP_UNREACH) != 0) return; if (isPreserved()) { if (GlobalOptions.verboseLevel > 4) GlobalOptions.err.println(toString() + " is preserved"); } else { Identifier rep = getRepresentative(); if (!rep.wasAlias...
6cde2c0e-a243-4a99-a118-f156f288b207
3
public void scoreSound() { try { Clip score = AudioSystem.getClip(); score.open(AudioSystem.getAudioInputStream (Ball.class.getResource("Bonus.wav"))); score.start(); } catch (LineUnavailableException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (Unsupported...
e228b3dd-cfab-4ae1-bc32-081bc740679e
9
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed if (lab_modo.getText().equals("Alta")){ if (camposCompletos()){ ocultar_Msj(); insertar(); menuDisponible(true); ...
b489fe0c-9db3-4c9a-968a-6981b656f72a
2
private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed //Remember: colocar no ultimo parametros o ID recuperado do banco de dados long id = 0; try { aum.EditarUsuario(txt_Senha.getText(),cmb_Perfil.getSelectedIndex(...
d6ca5a29-8614-40c4-82ce-ff3e60de77ff
9
static void initSections() { if (sectionLevelMax == null) { if (!includeTexOutputInOtherTexFile) { if (docclass.equals("scrreprt") || docclass.equals("report")) { sectionLevelMax = CHAPTER_LEVEL; } else if (docclass.equals("scrartcl") || docclass.equals("article")) { sectionLevelMax = SECTI...
d65d1b91-97c0-458b-aebc-acdad80c823d
9
public void bonusReward() { if (jqPoints < 1) { dropMessage("you do not even have one JQ point. idiot"); return; } jqPoints--; int type = (int) (Math.random() * 100); if (type < 5) { if (checkSpace(1812006)) { gainExpiringItem(1...
316693b1-af8b-439c-889f-ac3538cfb2c2
0
@Basic @Column(name = "FUN_GRADO") public String getFunGrado() { return funGrado; }
a3e4e0cd-0ad3-4064-8dfe-4147a70d257b
5
public BuddyWnd(Coord c, Widget parent) { super(c, new Coord(400, 370), parent, "Kin"); instance = this; bl = new BuddyList(new Coord(10, 5), new Coord(180, 280), this) { public void changed(Buddy b) { if (b != null) BuddyWnd.this.wdgmsg("ch", b.id); } }; bi = new BuddyInfo(new Coord(210, 5), n...
1a91ff09-23a5-4817-9c86-4fbf87bc6e5e
0
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (lastModified ^ (lastModified >>> 32)); result = prime * result + this.service.hashCode(); return result; }
21bd7434-b831-4c62-8b51-a2191c2db3b3
3
public static void run() { System.out.println("\n\n--|Bernoulli Process|----------------------------------------------------------"); System.out.println("Simulate five trucks, each with 40% chance of being late"); // create a truck which can only be on time (60%) or late (40%) Hat<Boolean> late_truck ...
0c28070e-a6d5-4946-b0b2-2a067df9afca
1
@Override public void load() throws DataLoadFailedException { super.load(); groups.clear(); List<String> groupList = getSection().getStringList("groups"); if (groupList != null) { groups.addAll(groupList); } }
df60d38a-3914-4c8f-8bf6-5ccaed5ad238
0
public ListenerManager(TotalPermissions p) { plugin = p; playerListener = new PlayerListener(plugin); worldListener = new WorldListener(plugin); entityListener = new EntityListener(plugin); consoleListener = new ConsoleListener(plugin); }
5a9773dc-a8ee-4eb4-b23e-b0561f11a997
2
private boolean createFileList() { Enumeration<String> list = listOfFileNames.elements(); while (list.hasMoreElements()) { // the list is in Object type, typecasting is needed String filename = (String) list.nextElement(); InputStream inputStream = null; try { inputStream = new FileInputStream(filen...
71887158-84ab-4864-8b25-85d8947d3989
7
@CLNames(names ={ "-ema" }) @CLUsage("time npop m11 m12 ...") @CLDescription("set the migration matrix at a given time. Effects propergate pastward. Note that the correct number of demes for the time must be specified") public void addTimeMigrationMatrix(double time, int npop, String[] mat) { if (!flagI) { thro...
58db47a5-92f0-43b8-a623-7e5c7d0a4714
0
public String getCity() { return addressCompany.getCity(); }
17106503-0da8-439f-90e1-0aa671c9897a
4
public void checkFadeVolumes() { if (midiChannel != null) midiChannel.resetGain(); Channel c; Source s; for (int x = 0; x < streamingChannels.size(); x++) { c = streamingChannels.get(x); if (c != null) { s = c.attachedSource; if (s != null) s.checkFadeOut(); } } c = null; s = null...
07b12ec2-34dc-44f4-b39d-0c2e1c430d9d
6
public static void main(String[] args) { try { System.out .println("RFIDClient: attempting to start XML-RPC Server..."); WebServer client = new WebServer(CLIENT_XML_RPC_PORT); client.addHandler("StableXMLRPCClient", new RFIDClient()); client.start(); System.out.println("RFIDClient: started succes...
dac6ad97-3433-42b9-abbe-e92116d49be3
5
public Object nextEntity(char ampersand) throws JSONException { StringBuffer sb = new StringBuffer(); for (;;) { char c = next(); if (Character.isLetterOrDigit(c) || c == '#') { sb.append(Character.toLowerCase(c)); } else if (c == ';') { ...