method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
4d7bcaab-dfb4-4339-b5fc-40e1c4b724b7
8
public double[] distributionForInstance(Instance instance) throws Exception { double[] result = new double[instance.numClasses()]; switch (m_CombinationRule) { case AVERAGE_RULE: result = distributionForInstanceAverage(instance); break; case PRODUCT_RULE: result = distributionForInstanceProd...
1fadef68-ca91-46bf-98c5-7663791f3a34
3
@Test public void testSoundInterrupt() throws Exception { System.out.println("playSoundInterrupt"); MusicController mc = new MusicController(); Thread instance=new Thread (mc); instance.start(); for(int i=0;i<150;i++){ System.out.println(i+" Seconds passed "); ...
bc93f783-866c-492a-bdf4-b3eabee0e759
9
public static float[] RGBtoHSB(int r, int g, int b) { float hue, saturation, brightness; float hsbvals[] = new float[3]; int cmax = (r > g) ? r : g; if (b > cmax) cmax = b; int cmin = (r < g) ? r : g; if (b < cmin) cmin = b; brightness = ((float) cmax) / 255.0f; ...
1fea8ed8-47aa-400b-9d36-1004a62f7f54
4
public void updateGameState() { if ((! isDebug) && PlayLoop.gameSpeed() < 1) { Power.applyTimeDilation(PlayLoop.gameSpeed(), this) ; } if ((! isDebug) && PlayLoop.gameSpeed() > 1) { Power.applyResting(PlayLoop.gameSpeed(), this) ; } world.updateWorld() ; }
3ee21998-afcb-4a12-a517-7edebd6f3d55
1
private boolean usernameFilter(String channel, String sender) { if (userFilterList.contains(sender.toLowerCase())) { logFilter(channel, sender, "null", "User filter"); acebotCore.addToQueue(channel, "/ban " + sender + " Blacklisted User. -AB", 1 /*1*/); acebotCore...
d63f954e-415b-4348-9f33-9157b1338cf3
4
public void keyPressed(KeyEvent e){ int key = e.getKeyCode(); if (key == KeyEvent.VK_RIGHT){ dx = 6; } if (key == KeyEvent.VK_LEFT){ dx = -6; } if (key == KeyEvent.VK_UP){ dy = 6; } if (key == KeyEvent.VK_DOWN){ ...
2501e6dd-4f4a-47d9-b51b-a6e9f27d94cd
0
public void incrementValidRxCount() { validRxPackets++; setChanged(); notifyObservers(); }
59a4a240-6c12-4889-9898-8c06f93a611c
0
protected void useCameraValue(double value) { _angleToTarget = -value; }
265e9d43-7e71-4f0a-821c-6d3c003dcd3d
3
public void renderContent(Graphics2D g) { if(this.Enable) { BufferedImage Content = new BufferedImage(Size.getWidth(), Size.getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D) Content.getGraphics(); // Draw Background if(this.Back...
17311305-e64b-4a64-b5ae-22214032beb7
4
public static Point2D.Double strongestRSS(Cell cell) { int currentStrongestRSS = -114; List<Measurement> strongestRSSMeasurements = new ArrayList<Measurement>(); for(Measurement measurement : cell.getMeasurements()) { if(measurement.getSignalStrength() > currentStrongestRSS) { strongestRSSMeasurements.clea...
e86c8eef-eb89-4afd-9238-4e87d7c3908f
7
public Object get(Object target) { try { if (readMethod != null) { try { return readMethod.invoke(target); } catch (InvocationTargetException e) { if (e.getCause() instanceof Error) { throw (Error)e.getCause(); } else if (e.getCause() instanceof RuntimeException) { throw (Runtime...
be3bcb53-a636-4d2f-8222-0fd34c35c007
0
public int getY() { return y; }
9b95e06d-c6fc-47db-bc73-557b973b2725
5
public void CreateChatSQLTables() throws SQLException { sql.initialise(); if(!sql.doesTableExist("BungeeChannels")){ System.out.println("Table 'BungeeChannels' does not exist! Creating table..."); sql.standardQuery("CREATE TABLE BungeeChannels (C_ID int NOT NULL AUTO_INCREMENT, ChannelName VARCHAR(50) N...
4d34532e-b841-4d81-8cc3-e8df6dbdb03e
1
private void updateSubStats(boolean reset) { speed = 10 - (DEX / 2); armor = STR + CON; max_hp = CON * 10; if (reset) { hp = max_hp; } }
af081df6-d4ec-44c6-a375-5102f6c8d703
3
private static void depthInputValidator() { while (!validInput) { try { System.out.print("You selected to search by depth. Please enter a depth: "); depthInput = actionInput.nextDouble(); System.out.println("You entered: " + depthInput); validInput = true; if(data1.isEmpty()) { ...
01874106-c3cf-4f19-a5c8-3ca29e0c5c19
3
public static StringBuilder Htmlproduct (Integer ID) { // Display the selected item String [] Array = Product.searchProduct(ID); for (int i = 0; i < Array.length ; i++) { if (Array[i] == null || "null".equals(Array [i])) { Array[i] = ""...
a5e7a025-9345-4b3b-a37d-2e6487c00642
8
public void display() { RefFinder rf = new RefFinder(); List<String> readBooks = rf.readBooks(); List<ArrayList<String>> readTopics = rf.readTopics(); System.out.println("Scripture References:"); for (String readBook : readBooks) { Boolean flag = true; for...
45491fc7-a066-4e8b-91b3-fd8d9e48f52d
0
public boolean isInterested() { return this.interested; }
ebf20719-883a-4c3d-9acc-b8c1dbb9abeb
4
public void formCountryList(SessionRequestContent request)throws ServletLogicException { Criteria criteria = new Criteria(); User user = (User) request.getSessionAttribute(JSP_USER); if (user != null) { criteria.addParam(DAO_USER_LOGIN, user.getLogin()); ClientType type =...
3783c157-f059-46aa-92f4-cf78f57d63b1
7
public void print() { if(this instanceof AddOp) { System.out.print("+ "); } else if(this instanceof SubOp) { System.out.print("- "); } else if(this instanceof MulOp) { System.out.print("* "); } else if(this instanceof DivOp) { System.out.pr...
1532a147-64ed-4859-9689-2639bce7c8be
6
public boolean getBoolean(String key) throws JSONException { Object object = this.get(key); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equals...
6f19e3f6-4f3f-4d6d-a089-b296d10ea280
4
public void setDownloadProgress(String status, int progressValue, int totalProgressValue, final File file) { this.pbDownload.setString(status); this.pbDownload.setMaximum(totalProgressValue); this.pbDownload.setValue(progressValue); // Done downloading if (statu...
789ed547-09b3-412d-8bbd-7f69d2d04416
2
public void join(Client client) { client.send(PacketCreator.userList(this)); addClient(client); for (Client c : getClients()) { c.send(PacketCreator.addUser(this, client, c == client)); } if (topic != null) { client.sendButlerMessage(name, String.format( "°BB°_Dieser Channel hat folgendes Thema:°...
22897f4f-0502-4768-9128-87b173216278
6
@SuppressWarnings("empty-statement") public static Mat[] colorChannels(Mat frame) { Mat frames[] = new Mat[frame.channels()]; for (int i = 0; i < frames.length; i++) { frames[i] = frame.clone(); } int nl = frame.rows(); int nc = frame.cols(); double[] pi...
2befaa48-1b26-4056-8199-c9ba718d5747
6
@Override public <S extends Subscriber<T>, T> boolean unsubscribeByTypes( ConcurrentMap<Class<?>, List<SubscriberParent>> mapping, S subscriberType, Class<T> messageType) { boolean ret = false; List<SubscriberParent> list = mapping.get(messageType); if (list != null) { for (SubscriberParent p : list) { ...
efd73149-0c29-42e6-a09d-1bfbd9dc2e36
8
public void reduce(IntWritable key, Iterable<Text> values, Context context ) throws IOException, InterruptedException { ArrayList<String> list = new ArrayList<String>(); for (Text val : values) { list.add(val.toString()); context.write(val, null); }...
f11e2621-3bb5-40c5-82cb-ecf91b8d1016
8
public static void addFriend(Player adder, long added) { int worldId = -1; for(World world : Worlds.getWorlds()) { for(Player cyclePlayer : world.getPlayers()) { if (Utilities.playerNameToLong(cyclePlayer.getUsername()) == added) { worldId = world.getId(); break; } } } Player addedPlayer...
cb54eec7-a94f-4622-9610-6d57e87dbcbd
5
public Object getFieldValue(_Fields field) { switch (field) { case RHINO_ID: return Long.valueOf(getRhinoId()); case TITAN_ID: return Long.valueOf(getTitanId()); case PROPERTIES: return getProperties(); case OUT_EDGES: return getOutEdges(); case IN_EDGES: return...
4c71afdc-60d8-48a4-8758-597512de2bcd
0
public void setjCheckBoxPracticiens(JCheckBox jCheckBoxPracticiens) { this.jCheckBoxPracticiens = jCheckBoxPracticiens; }
e2f133fb-ce77-4d7f-8276-920be290b96b
1
private void loop() throws Exception { buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL); while (frame.isShowing()) { box.rotateY(0.01f); buffer.clear(java.awt.Color.BLUE); world.renderScene(buffer); world.draw(buffer); buffer.update(); buffer.display(frame.getGraphics()); Th...
96513470-e034-459f-beae-1fad08a2ba63
8
@Override public void createPartControl(Composite composite) { composite.setLayout(new GridLayout(11, false)); Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); label.setText("文件"); fileText = new Text(composite, SWT.BORDER | SWT.REA...
de1be637-e98f-4441-8aee-6f048757ecb6
5
private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBtnActionPerformed // TODO add your handling code here: try { connectDb(); int selectedRow = questionTable.getSelectedRow(); rowID = (questionTable.getModel(...
6fd8e566-be86-4332-bc7c-2c2807ac3761
0
public static void main(String[] args) { changeIt(str); System.out.println(str); }
b1333226-efc3-4f64-8c45-38cd2774068e
5
private void setNode(DefaultMutableTreeNode root, String[] path, int cPath) { @SuppressWarnings ("rawtypes") Enumeration e = root.preorderEnumeration(); DefaultMutableTreeNode n = null; while (e.hasMoreElements()) { DefaultMutableTreeNode cn = (DefaultMutableTreeNode) e .nextElement(); if (cn.getU...
1a660d20-3b6b-428c-82bd-425f8720708a
8
protected void nodeID(StreamTokenizer tk) throws Exception{ if(tk.ttype=='"' || tk.ttype==tk.TT_WORD || (tk.ttype>='a' && tk.ttype<='z') || (tk.ttype>='A' && tk.ttype<='Z')) { if(m_nodes!=null && !(m_nodes.contains( new GraphNode(tk.sval, null))) ) { m_nodes.addElement( new GraphNode(tk.sval,...
f8622fd0-4a8a-478d-bfad-1593afce6516
9
private void writePackets(Thread thisThread) { try { // Open the stream. openStream(); // Write out packets from the queue. while (!done && (writerThread == thisThread)) { Packet packet = nextPacket(); if (packet != null) { ...
448aa749-aceb-4913-abe6-d8d0aac6ed02
2
private List<Method> matchPojoMethods(T entity,String methodName) { //获得当前Pojo所有方法对象 Method[] methods = entity.getClass().getDeclaredMethods(); //List容器存放所有带get字符串的Method对象 List<Method> list = new ArrayList<Method>(); //过滤当前Pojo类所有带get字符串的Method对象,存入List容器 for(int index...
3d4f9e0f-b459-4d22-a145-42ebf823f50e
9
* @param env The environment current at the expression. * @param member The member that must be contained in the result. */ Symbol resolveSelfContaining(DiagnosticPosition pos, Env<AttrContext> env, Symbol member, ...
f858082f-782f-4b5b-9a0d-da6c390f0efd
7
final void call_(Connection conn) throws SQLException { CallableStatement stmt = null; try { StringBuilder sb = new StringBuilder(); sb.append("{call ").append(sql).append("("); if (params != null) { int i = 0; int length = params.length; while (length-- > 0) { sb.append("?"); if (i <...
257e8f8f-347c-4c84-9a87-fe1c11697ef3
0
@Override public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) { calculateTextState(e.getDocument()); }
3a8f1e99-239a-49b0-8308-f8c1a1aa5e76
8
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
710b3343-fcc5-4a80-a11b-5b96557ab631
5
public ServerDialog(OptionsDialog options_, Options opts_, CConn cc_) { super(true); cc = cc_; opts = opts_; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setResizable(false); setSize(new Dimension(350, 135)); setTitle("New TurboVNC Connection"); addWindowListener...
8a8a7e5e-73b5-4249-9684-f55b68950f85
1
public void setUrl(String url) throws com.easy.imageloader.NullURLException { if (url == null) { throw new NullURLException("Link of image is null"); } this.url = url; }
fe9685aa-d9e3-420f-adb7-c0dd16531633
2
@Override public String getId() { if (displayedBugId == null || isEmpty(displayedIssueLabel.getText())) { return null; } return displayedBugId; }
ba68c6bd-47c7-4167-a228-1846396e8211
2
public String toString(){ String resultado = "{ "; if(getInicio() == null){ return "Lista de correo vacia"; }else{ NodoCorreos q = this.inicio; while( q != null){ resultado += q.getInfo().toString() + " , "; q = q.getLiga(); } } return resultado.substring(0, resultado.length() -1) + " ...
c561a48e-ba33-4e88-ace3-41d624345d66
5
public void draw(GOut g) { if (state == 0) g.chcolor(255, 192, 192, 255); else if (state == 1) g.chcolor(192, 192, 255, 255); else if (state == 2) g.chcolor(192, 255, 192, 255); g.image(bg, Coord.z, sz); g.chcolor(); if ((state & 1) != ...
8a0ba2c8-95d6-4db1-80b3-335697b3af89
6
private static void addotuToFamily(HashMap<String, String> map, File f) throws Exception { BufferedReader reader = new BufferedReader(new FileReader(f)); reader.readLine(); for(String s= reader.readLine(); s != null; s = reader.readLine()) { String[] splits = s.split("\t"); String lastToken = ...
f6d0f265-9605-4561-8a54-ef21de73ec7e
8
public String build() throws HTMLFormatException { if (this.title.isEmpty()) { throw new HTMLFormatException("HTML title cannot be empty."); } StringBuilder out = new StringBuilder(); out.ln("<!DOCTYPE html>"); out.ln("<html>"); out.startBlock(); { out.ln("<head>"); out.startBlock(); { out...
c2aa18be-5413-444b-b313-8c21b9cee82f
6
public void quickSort(int lowerIndex, int higherIndex) { int i = lowerIndex; int j = higherIndex; int pivot = array[lowerIndex+(higherIndex-lowerIndex)/2]; // Divide into two arrays and partition step while (i <= j) { while (array[i] < pivot) { ...
e44ede70-88b9-495f-9bad-cf1dcf14ac29
9
public String getAlignment(){ switch(this){ case LAWFUL_GOOD: return "Lawful Good"; case NEUTRAL_GOOD: return "Neutral Good"; case CHAOTIC_GOOD: return "Chaotic Good"; case LAWFUL_NEUTRAL: return "Lawful Neutral"; case TRUE_NEUTRAL: return "True Neutral"; case CHAOTIC_NEUTRAL: return "Chaotic Neutral"; ...
5ef23c76-47f8-409f-aa47-d0203c09d0df
4
private boolean validateCoordinates(MouseEvent e) { Point location = getLocation(); Dimension size = getSize(); if (e.getX() < location.getX() || e.getX() > location.getX() + size.getWidth()) { return false; } if (e.getY() < location.getY() || e.getY() > location.getY...
f3cc77b9-8522-4b08-b9f6-7d0160bec6a7
6
public void KeyDown(int key, char c) { if(key == 1) { //ESC enabled = !enabled; if(enabled) { game.addComponent(inventoryComponent); } else { game.removeComponent(inventoryComponent); } } if(enabled) { if(key == 208) { //up inventoryComponent.up(); } else if(key == 200) { //down ...
0444aee7-e6cd-4206-a9a7-72724ed6bdc2
1
private void renderCurrentPlayer(Graphics2D graphics) { if (objectTron.getPlayerNumber(objectTron.getActivePlayer()) == 0) graphics.drawImage(playerRed, 40 + startPointXCoordinate, 320 + startPointYCoordinate, 40, 40, null); else graphics.drawImage(playerBlue, 40 + startPointXCoordinate, 320 + startPointYCoor...
de1c8e1a-8d71-4593-b611-7370ceb7a210
9
public void generateDemoData(int nCompanies, int nProjects, int nAddresses, int nDepartments, int maxProjectsPerEmployee, int maxEmployeesPerDepartment, int maxEmployeeVacations, int maxEmployeeNickNames, int maxEmployeePhones) { try { begin(); PhoneService phoneService = lookupService(PHONE_SERVICE, PhoneSe...
2c7f86b5-c6e2-4517-8f29-29838b17a914
1
public void atualizar(AreaFormacao areaformacao) throws Exception { String sql = "UPDATE areaformacao SET nome = ? WHERE id = ?"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); stmt.setString(1, areaformacao.getNome()); stmt.setLong(2, areaformacao.getId()); ...
7b92f487-97f9-40bc-a40e-28480a7a6226
5
public static void main(String[] args) throws Exception { /* * This credentials provider implementation loads your AWS credentials * from a properties file at the root of your classpath. * * Important: Be sure to fill in your AWS access credentials in the * ...
797ee5be-e7f9-4ea7-85a3-94e61d2c9852
4
private void create(int[] initialValue, Color bg, String fieldTitle, boolean showResetBtn) { setPreferredSize(new Dimension(GUIConstants.DEFAULT_FIELD_WIDTH, FIELDHEIGHT)); setBackground(bg); setBorder(BorderFactory.createTitledBorder(fieldTitle)); setLayout(new VerticalLayout(5, Vertica...
ef4a33a8-4b08-4e7d-8e01-493b871966a6
1
public ClassHierarchy(final EditorContext context, final Collection initial, final boolean closure) { this.context = context; this.closure = closure; classes = new HashSet(); extendsGraph = new Graph(); implementsGraph = new Graph(); worklist = new LinkedList(); inWorklist = new HashSet(); this.re...
92afef34-8d13-41a7-b1d5-ea7aae770652
7
public static void main(String args[]) { //10. Un número perfecto es un número entero positivo que es igual a la suma de sus divisores apropiados. Por ejemplo, 6 es un número perfecto porque 6 = 1 +2 +3. //Crear una función que recibe dos valores X y Y, debe devolver el menor número perfecto encontrado, que es mayor o...
410c17b0-263e-42a1-8a88-02549d85ebd2
9
private static void render(String s) { if (s.equals("{")) { buf_.append("\n"); indent(); buf_.append(s); _n_ = _n_ + 2; buf_.append("\n"); indent(); } else if (s.equals("(") || s.equals("[")) buf_.append(s); else if (s.equals(")") || s.equals("]")) ...
89615daa-3f37-4022-8ea5-1a7280c718c7
0
public JButton getjButtonOK() { return jButtonOK; }
b3388f6d-abf7-4887-b3d6-a53918b433de
5
public static void main(String[] args) throws IOException { String[] copyrights = { "*****************************************************************", " 日本語形態素解析器 MoCA(もか)", " https://github.com/Tonixy/MoCA", " tony.tonixy@gmail.com", "", " MoCA は、日本語形態素解析器 Kuromoji のソースコードを", " ...
5dca5114-bc2e-4ccd-8eb7-8be0cbe3f3ef
8
private void handleInitRequest(InitRequest msg) throws IOException { BootstrapList bootstrapList = null; CAMessage response = null; String userId = msg.getUserId(); //stub method, it should implement the various id verification policies verifyIdentity(userId); //build the bootstrap list Li...
84b75487-484c-4632-90dc-83c1acd199a9
4
public void respawn(PlayerSprite s) { // find lastest checkpoint spawn ani increment Checkpoint c = checkpoints.get(s.getLatestCheck()); int spawn = c.getMostRecentSpawn(); c.incMostRecentSpawn(1); // zero all velocity s.setVel(0); s.setVelX(0); s.setVelY(0); // reset faceAngle bas...
cb3d7220-fe83-41b8-8c10-ec37997ca22f
4
@Override public void execute(CommandSender sender, String... args) { if (!(meta.perm().isEmpty() || sender.hasPermission(meta.perm()) || bypass.remove(sender))) { errorPermission(sender); return; } sender.sendMessage("leere M"); lang.sendMsg(sender, "leereM"); sender.sendMessage("normale M"); lang...
b9e5af39-f111-43ba-8467-36f65c397866
0
@Override public String getName() { return this.name; }
7a49cd9f-73dd-4212-a293-103e21b9d3b8
6
@Override public FunctionResult<Article> update() { return Database.driver().executeUpdate(getTableName(), getPrimaryKey(), getPrimaryKeyValue(), "name = "+(name.length()>0 ? "\""+ name +"\"":"NULL")+", " + "code = "+(code.length()>0 ?"\""+code +"\"":"NULL")+", " + "pricea = "+(priceA>0? "\""+priceA +"\"":...
fbfad8d4-975a-4cbc-ac8d-5c61a3052fb0
2
public Result Recognize(Vector points) { points = Utils.Resample(points, NumPoints); points = Utils.RotateToZero(points, centroid, boundingBox); points = Utils.ScaleToSquare(points, SquareSize); points = Utils.TranslateToOrigin(points); bounds[0] = (int)boundingBox.X; bounds[1] = (int)boundingBox.Y; ...
71cdec1b-d35b-424c-bedd-c921e5a8f482
2
public long inserir(Pesquisa pesquisa) throws Exception { String sql = "INSERT INTO pesquisa (titulo, orientador, pesquisador_responsavel, ano_submissao, tempo_duracao, tipo, qualificacao, impacto_pesquisa, gerou_patente, status, resultado, instituicao_submissao, fonte_financiamento, area_conhecimento_CNPq, resumo) ...
5e6bde75-c79e-4c81-8b3e-da9ff3972569
7
static final Class242 method3249(int i, int i_0_, OpenGlToolkit var_ha_Sub2, String string) { try { anInt9656++; int i_1_ = -89 / ((29 - i_0_) / 47); long l = OpenGL.glCreateShaderObjectARB(i); OpenGL.glShaderSourceARB(l, string); OpenGL.glCompileShaderARB(l); OpenGL.glGetObjectP...
0a2d5c6b-264d-486e-804f-e8edf0d0f300
4
public int[] bigPower(int pN, int pn){ //int[] number = new int[(int) Math.ceil(Math.log10(pN)*pn) + 1]; int[] number = new int[200]; java.util.Arrays.fill(number,0); number[0]=pN; for(int n = 1; n < pn; n++){ for(int i = 0; i < number.length; i++){ number[i] = number[i]*pN; } for(int j=0;j<num...
091169d5-76bf-4b4e-a8fb-fef7671dbd18
6
public @Override void execute() throws CommandException { final Namespace<? extends Kind> namespace = getModule().getKindNamespace(); assert (namespace != null): "Module provided null namespace"; final TokenFeed feed = getFeed(); try { feed.beginExp(); feed.confirmBeginExp(); final Kind oldKind = names...
78a3d944-07ba-4996-918b-53203ef8c021
5
private void parseUsages(List<Monitor.Use> useList) throws CannotProduceStatCollector { for (Monitor.Use use: useList) { Class c = null; try { if (use.getCollector() != null) { c = ClassEx.getClass(StatCollector.class, use.getCollector()); ...
38a88f15-6643-452d-9bfc-3d956f56ede2
3
public Item removeItem(String itemName){ boolean done = false; int i = 0; while(!done){ Item current = items.get(i); if(current.getName().equalsIgnoreCase(itemName)){ items.remove(i); currentWeight -= current.getWeight(); re...
753b22b2-314f-4116-a31a-94ab3ee2982d
1
public static void writeProperties(){ //get parameters from GUI getParametersFromGUI(); //write the file if(PropertiesHandler.writePropertiesFile(ipAddress, user, password, filepath, filename, includeDate)){ OptionPanes.notifyPresetSaved(gui); } }
73db88e3-e74c-422c-92be-a2402b9b878b
4
@Override public void move(Excel start, Excel finish) { // TODO Auto-generated method stub if (start.getX() == begin.getX() && start.getY() == begin.getY()) { begin = finish; setColoredExes(); } if (start.getX() == end.getX() && start.getY() == end.getY()) { end = finish; setColor...
a2cc1276-dc41-426f-9428-bb11980858f8
7
private void findSelectionIntegerPair(JComboBox box, int[][] preferred) { ComboBoxModel model = box.getModel(); int arrayOff = Integer.MAX_VALUE; int modelOff = -1; for(int i=0; i<model.getSize(); i++) { IntegerPair pair = (IntegerPair) model.getElementAt(i); int foundOff = -1; for(int j=0; j<pre...
09586ce9-4b43-4f68-898d-12fcb4133a3c
6
public static void main(String[] args) throws IOException, InterruptedException { // TODO Auto-generated method stub String line; Properties properties = new Properties(); properties.load(Publicwatch.class .getResourceAsStream("/AwsCredentials.properties")); BasicAWSCredentials bawsc = new BasicAWSCre...
bded849e-f803-4d72-9910-e29eb2f8ac0b
7
public Object getServiceObject(IMyxName arg0) { if (arg0.equals(msg_IChatListener)){ return this; } if (arg0.equals(msg_IFileSentListener)){ return this; } if (arg0.equals(msg_IImageSent)){ return this; } if (arg0.equals(msg_ITTTListener)){ return this; } if...
ccf66218-7967-4203-a4bf-c8e8c169d837
0
public void logout() { isLogin = false; }
73da2059-9ff4-4c5f-b949-13b9ff55a5ec
5
@Override public HandshakeState acceptHandshakeAsServer( ClientHandshake handshakedata ) { if( handshakedata.getFieldValue( "Upgrade" ).equals( "WebSocket" ) && handshakedata.getFieldValue( "Connection" ).contains( "Upgrade" ) && handshakedata.getFieldValue( "Sec-WebSocket-Key1" ).length() > 0 && !handshakedata.getF...
f85c3a52-7241-4155-aca1-241c50c732d4
2
public DefaultResponse deletePersonalEvent(String asUserId, String asPersonalEventId, boolean abDeleteAll) { String lsParam = ""; if (UtilityMethods.isValidString(asUserId)) { if (UtilityMethods.isValidString(asPersonalEventId)) { ...
fa794365-fe79-4bba-a9c4-01d8b28145dd
6
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (equalsMethod(method)) { return false; } if (toString(method)) { return "[vraptor-client] proxy for " + interfaceName(proxy); } RestMethod restMethod = cache.get(method); try { long time = System.currentTimeMilli...
d8c931f3-edb7-4557-9a03-b6c1841c97aa
1
public void setPersons(Person persons) { if (verify(persons)) { Persons.add(persons); CantPerson+=1; //setCantPerson(CantPerson +=1); Order(Persons); } }
2312a4f9-be14-430e-8519-0019452dd1b9
2
public void testFixedMillisSecurity() { if (OLD_JDK) { return; } try { try { Policy.setPolicy(RESTRICT); System.setSecurityManager(new SecurityManager()); DateTimeUtils.setCurrentMillisFixed(0L); fail(); ...
8466645b-08b1-4b59-9710-3d1b307c2205
2
public Info dequeue() { // Entfernt das erste Element aus der Warteschlange, // falls die Warteschlange nicht leer ist; Info element = null; if (!isEmpty()) { element = test.get(tail); size --; if (tail == test.size()-1) { ...
12622279-a4cd-492d-9759-5c8da095d544
1
public void contextInitialized(ServletContextEvent sce) { System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000"); try { FileOperater.loadFromFile(); } catch (IOException e) { e.printSta...
0662e4ff-f374-4b61-8fd7-9c1862659986
8
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed String name = txtFieldName.getText(); String city = txtFieldCity.getText(); String code = txtFieldCode.getText(); String errorMessage = ""; name = name.trim(); ...
cb150178-b68a-42b3-9355-3937f38e0bfa
7
public boolean isValidSudoku(char[][] board, int row, int col, int val) { for(int i=0; i<9; i++) { if(Character.getNumericValue(board[row][i])==val) return false; } for(int i=0; i<9; i++) { if(Character.getNumericValue(boa...
10edfe8a-38ff-4184-a758-09cf344a97a6
6
public Quantity mul (Quantity target) { if( target == null ) { throw new IllegalArgumentException(); } Quantity result = new Quantity(); result.value = this.value * target.value; // if "this" has empty units, just put everything from target to "this". if(this.unit.isEmpty()) { ...
d4eb86ee-bd7b-4a57-a31c-0e02b7d334ea
8
private Image makeImage() { // byte[] r,g,b; // r = new byte[256]; // g = new byte[256]; // b = new byte[256]; // for(int i=0; i<256; i++) { // r[i] = (byte)i; // g[i] = (byte)i; // ...
87773024-5796-430c-9af9-e32ff816d2df
0
public int getInvocationsTimedTaskA() { return this.invocationsA; }
15014550-b880-48dd-b87d-a007582194dd
7
public static int parseDayOfWeek(String strDay) { strDay = strDay.replaceAll(" ", ""); if (strDay.equalsIgnoreCase("monday")) return Calendar.MONDAY; else if (strDay.equalsIgnoreCase("tuesday")) return Calendar.TUESDAY; else if (strDay.equalsIgnoreCase("wednesday")) return Calendar.WEDNESDAY; else if...
eb11859c-2a61-4ecb-bc1c-6c63bd180fd6
5
public Sound(String fileName) { // specify the sound to play // (assuming the sound can be played by the audio system) // from a wave File try { File file = new File(fileName); if (file.exists()) { AudioInputStream sound = AudioSystem.getAudioInputStream(file); // load the sound into memory (a Cli...
6ecb854b-372f-4724-b1bf-63a46d1afc25
6
@Override public void put(K key, V value){ int h = Math.abs(key.hashCode()) % table.length; // Calcule de l'index de la clé Entry<K, V> n = table[h]; while(n != null && !n.key.equals(key)){ n = n.next; } if(n == null){ // S'il n'existe pas, on l'ajoute table[h] = new Entry<K, V>(table[h], key, va...
a8f5481a-242e-4516-bb11-8c0a746a0d64
2
public void testFactory_Zone_RI_int() { GJChronology chrono = GJChronology.getInstance(TOKYO, new Instant(0L), 2); assertEquals(TOKYO, chrono.getZone()); assertEquals(new Instant(0L), chrono.getGregorianCutover()); assertEquals(2, chrono.getMinimumDaysInFirstWeek()); assertSame(G...
ca8a0762-7cbe-4254-944e-30053bbfdf2c
5
@Override public boolean equals(Object o){ if(! (o instanceof Mass)) return false; Mass m= (Mass)o; boolean equalVelocity= myBody.getLinearVelocity().x==m.myBody.getLinearVelocity().x &&myBody.getLinearVelocity().y==m.myBody.getLinearVelocity().y; ...
975341d1-0ce3-4929-8904-7a45e5e44b4d
2
DynamicJMenuItemPropertyChangeListener(JMenuItem menuItem, Action action, PropertyChangeListener chainedListener) { OwnedWeakReference ref; while ((ref = (OwnedWeakReference) QUEUE.poll()) != null) { DynamicJMenuItemPropertyChangeListener old = (DynamicJMenuItemPropertyChangeListener) ref.getOwner(); Action o...
24ab0ec6-9950-45f1-abe0-11afedfc551e
0
public Cluster get(int i) { return this.list.get(i); }
9b367ef8-aada-401b-8f24-e59f17b3f068
6
public void run() { while (!gameover) { while (!this.myturn) { } this.out.println("play"); try { while ((letter=in.readLine())==null) { } if (!myturn) letter="wastedturn"; if (!letter.equals("wastedturn")) { x=Integer.parseInt(letter); y=Integer.p...