- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 14
- Posts with Upvotes
- 11
- Upvoting Members
- 7
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Main occupation : e-Learning researcher.
Meanwhile : Computer science teacher basically : algorithmics, information systems, software design and theory of organizations.
- Interests
- Software development, Java, JVM languages
- PC Specs
- Dell Inspiron N5050
Re: Hi, I'm not really sur but isn't there a "public" directory or this is something usual in JNode. Also, you may add Javascript tag instead of Java tag. | |
Re: Hi, 1. This algorithme will have a O(n) complexity : you will check all the tree, so the "binary" particularity doesn't change things. 2. cout excutes : 1+3+6+10+15+21+... Sum of (1+m)(m/2) and m changes from 1 to n To simplify, it will b a O(n³) (I think) | |
Re: Both answers (one table, many tables) are correct but you must choose the right one. So, you must answer this question : "Does Category have any useful additional information ?" If Yes then you must create it as a table. If No then you must keep it simple and use … | |
Re: Hi, The first code seems correct, not really pretty, but correct. I would write : public boolean addIfAbsent(UserBean userBean) { if (users.stream().anyMatch(x -> x.getUsername().equals(userBean.getUsername()))) { return false; } else { users.add(userBean); return true; } } } And I would call it in the if statement. The second code seems to … | |
Re: Hi, It's a parsing code, and as Venkat Subramaniam said : "don't show your parsing code to any one, it is always ugly" :) So, start by looking in "seminar.txt". | |
Re: Hi, You have two characters here : The 0A (10) is the "new line" character, The 0D (13) is the "return to start" character. You're not in a binary file, you're in a text file so you must check the ASCII code to know which charcter has the displayed value … | |
Re: Hi, You must check your CSS selector here : img.resize means the tag img with the class name .resize somthing like : `<img src="/path/to/image" class="resize" />` Otherwise it won't work. Check [this course](https://www.w3schools.com/cssref/css_selectors.asp) | |
Re: Hi, I highly doubt it's possible. If we don't know the class structure than we can't use it after parsing. I have seen (in Groovy) examples where the JSON object is converted into a map and you can, after that, get all keys and values easily. I have found some … | |
Re: I will assume that this is your first try and you are new to this so let's start together : *StrongTEETH4U is a private dental clinic that is well known and has an excellent reputation in the area. All patients in the clinic have their details stored in a ClinicBook … | |
Re: In addition to what stultuske has said, you can use t and c directly because they are the content of the JTable row. | |
Re: Two methods in the same class : JOptionPane.showInputDialog() JOptionPane.showMessageDialog() Documentation here : https://docs.oracle.com/javase/7/docs/api/javax/swing/JOptionPane.html But, as others have said, you must be able to : convert from String to int, manipulate arrays (small ones at least) and may be loops to write a proper solution. | |
Re: And I will add the following : in the begining, the first version of your code, it is recommanded to not mix actions; separate reading from checking. Read what you need to read then check the result in the while condition even if that means you need to put the … | |
Re: In the first loop, you have a block so, I think it must be : do { // }while( //condition); In the second loop, I don't get the first line : mark += ranges.length; I think you must rethink a good part of the program. | |
Re: First, choice2 is supposed to be an integer (int) but in the while condition, we can read (choice2=true) Second, choice2=true is not a comparaison, it is always true. I think you should use choice2==true and here again choice2 is supposed to be compared to an int value not a boolean … | |
Re: Well, start by creating a new project, kept the "Main class" option checked, open your main class and we will continue from there. | |
Re: Hi, The statement : printStream = new PrintStream(new FileOutputStream(fileName, append), autoflush); Creates the file but does not write into it. You must write in the file using : printStream.print() [More details](https://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html) | |
Re: Hi, I think you're juste starting so let's be simple : 1. You already have the statement that generates the random number, 2. All you need to do is an if...else to check if the random number is > 90 && < 100 to display A 3. Start by one … | |
Re: Hi, If it must run in a web browser then you must learn (or search codes in) J2EE (Servlets/JSP) not simply Java (J2SE). Good Luck. | |
Re: Hi, If I get it right, your problem is on the front end : how to format the display ? First, the most used format are XML and JSON because they allow us to use in-built parsers , so you won't be stuck in string processing. To create a JSON … | |
Re: Hi, In this particular case, personally, I don't use any APIs, I simply generate a csv file which [can be opened directy in Excel](https://support.office.com/en-gb/article/Import-or-export-text-txt-or-csv-files-5250ac4c-663c-47ce-937b-339e391393ba) like any other Excel file. [CSV format](https://en.wikipedia.org/wiki/Comma-separated_values) is a text format wich means a simple FileWriter can be used without any external APIs. The generation takes … | |
Re: I agree with JamesCherill, it can be a design problem, and the solution you propose is probably false : restarting a server aims to clear the cache or to erase temporary data; disconnecting and reconnecting the client can't guarantee that. | |
Re: Hi, I don't think isValidateRoot() means what you think it means; I don't think you need it here. You have two JTextField, one for the inputs, the other for the result, so what's the problem? All buttons will use the same JTextField. | |
Re: Hi, I don't know if I came too late, but there's a simple solution, especially if the exercise concerns loops, you can make successive subtraction of 2 util the value is less than 2, if the final result is 0 then the number is even, otherwise the number is odd. | |
Re: Hi, We can't do your homework, you will learn nothing. But, some hints may help you ; 1. It's evident that you need to use a loop inside another one : The first loop is to create many lines, The second one is to print many stars or dots. 2. … | |
Re: The java code seems correct, check the SQL query in your jrxml file. | |
Re: Interesting, I see the java famous "import" and "string" is a data type, the main method is almost the java one, but without creating a class to test few lines of code. | |
Re: Hi, JamesCherill is right, you must use the size variable not the DEFAULT_SIZE, but you need to initialize it : public Queue(int capacity) { elements = new int[capacity]; size = capacity; } Annother probleme : before adding an element you must check if the queue is full or not, and … | |
Re: To resolve this, you must use the try-catch differently : your methods must throw exceptions not catch them, and the try-catch bloc will be in the enterJButtonActionPerformed method. [A simple tutorial here](https://weblogs.java.net/blog/manningpubs/archive/2013/06/13/using-throws-and-throw-statements-java) | |
Re: Hi, `private class KellyCoffee<Order> extends Queue implements OrderLineInterface` Otherwise, the declaration seems wrong : a class can't extend herself. | |
Re: I'm not sure I understand what you want to do here (first of all, the code is not readable"), but what I know, your "perm" array is not a matrix. |