• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in calculating zakat

    Please note our member rules, including > Do provide evidence of having done some work yourself if posting questions from school or work assignments
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to ChrisHunter in Preventing Double Html Encoding Strings

    Sorry I realise I've posted this in the wrong section, it's been a while since I've visited DaniWeb.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to ChrisHunter in Preventing Double Html Encoding Strings

    Sorry I realise I've posted this in the wrong section, it's been a while since I've visited DaniWeb.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited Preventing Double Html Encoding Strings

    I'm currently doing some encoding work to protect a site from XSS attacks. We've stuck a bunch of `<script>debugger;</script>` tags in the db. Dispite my best efforts, the strings I've …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in i need your help pls? how to convert to integer jdatechooser?netbeans

    That question is so vague that nobody could answer it sensibly. Please explain EXACTLY what you are trying to do, what you have done so far, and exactly what is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Student Database Program in Java for class 10 Students

    Dipayan_1 Is this homework? In which case we can help you to do it, but nobody here will do it for you. Show us what you have done so far.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Student Database Program in Java for class 10 Students

    > databases don't have 'Arrays'. They have columns and records. Not correct, or at least incomplete. Relational databases have columns and records, but other databases use different formats. I used …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited Student Database Program in Java for class 10 Students

    Can you please Create a student database in java using string and arrays wherein we can store details of students Like their ROLL no, Name, Father's Name,DOB, Section and then …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Hangman: Do-while loop 'yes or no' user input response

    I don't mean to be picky, but a loop that needs to be executed at least once should be a `do/while` not a `while`, which would obviate the need for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Android Java: What makes my game crash?

    Maybe you could use a try/catch for any Exception at the highest level in your code and see if you can output the message from there?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Android Java: What makes my game crash?

    Sorry, I’m all OSX, IOS, Win10, don’t know android at all.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in calculation is off

    Just bad luck with the first test data. Triangle with sides 1, 2, 3 is valid, but it’s an extreme case... just visualise that... the 1 and 2 sides have …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Android Java: What makes my game crash?

    Just a random thought... Are the array sizes ok? Visually it looks like pcX is bigger than pcY, so there’s a possible array index out of range???
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in runtime error on voting system

    I’m not offended, no worries. No need to apologise. Now, have you fixed the empty catch, and what is the message and stack trace from your error? Jc
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Student Scores

    Look at line 127
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Android Java: What makes my game crash?

    “Crashes” doesn’t tell us much. How about an error message and a stack dump?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to tinstaafl in Student Test Score

    Sorry I probably been should have been more verbose. It's my understanding that when there are no constructors defined a default constructor is automatically defined by the compiler. But if …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to cereal in Cross-Posting

    diafol! Why delete? Keep the account and allow us to keep a contact with you, I cannot imagine this forum without your posts :(
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Student Test Score

    Just for the record, a default constructor is not normally required... typically when you create a constructor with args then you deliberately do not have a default constructor because you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my do while loop in the main method not working correctly?

    I agree that’s how it works in the real world. But this is a training exercise, and the menu is a console print with greying not an option. Personally I …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my do while loop in the main method not working correctly?

    That makes sense... only options 1 and 6 can be used at first because you can’t fetch, delete etc until there is something to fetch, delete etc. Or maybe you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cross-Posting

    Re noobs... I have been worried about the aggressive responses to some recent cross posts. Nowhere in advance do we tell them not to do it. Maybe the majority of …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my do while loop in the main method not working correctly?

    > what I am confused about is the specific types of arguments that should be added those methods Look at the definitions of those methods. The first line tells you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my do while loop in the main method not working correctly?

    When you try to call those methods you are missing parameters or using parameters of the wrong type.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cross-Posting

    > Anyway where are the rules? Yes indeed. I think it's poor practice for us to penalise people for breaking rules they don't know about. A link buried in the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Increment / decrement (x++, ++x...) not producing expected output

    That's more or less my understanding too - order of execution was left undefined/unspecified in places where the experts thought it would allow compiler writers more scope for optimisation. Nowdays …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Increment / decrement (x++, ++x...) not producing expected output

    > Smart people ... decided that it was best to make stuff like this undefined Yes, I did understand that. My opinion was formed including that knowledge. I'm more worried …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Increment / decrement (x++, ++x...) not producing expected output

    Here's a definitive reference on order of evaluation http://en.cppreference.com/w/cpp/language/eval_order Note about half way down ("Undefined behavior") it discusses ++x specifically. Apparently it used to be "undefined", now it's just "unspecified". …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Increment / decrement (x++, ++x...) not producing expected output

    No reply from a C++ buff yet? At the risk of making a fool of myself I'll try. I'm no C++ expert, but this looks to me like another example …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in runtime error on voting system

    To be fair, 266 of those lines are GUI code generated by NetBeans, never intended to be read. It was pointless posting that part. In the actual code the choice …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    Thank you for your thank you. The world is such a scary place that there's no such thing as being too kind or too nice. And yes, after putting effort …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How can implement a perfect hashed data structure and their operations?

    You shoud look at the JavaDoc for Java's HashTable for essential information. The source code for that is also on the web, so you can see how it's implemented (if …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    Hey, no need to apologise - I know how frustrating it can be when you look at code and you just can't see what you're looking for. I too started …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to Sinisa_1 in Please help: Nested timers, or timer inside loop, or what? How?

    I knew my old single-task way of thinking was messing with my Java, but I didn't realize how much. (Pascal and fortran for DOS, 30 years ago.) I must apologize …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    .. still don't believe me? Ok then, here it is structured as above and working... import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import static java.lang.Math.random; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JButton; …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    ... and just to be absolutely certain I have edited your code into the structure described above and tested it. It executes exactly as you described. It took a few …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    No, that's not right. It does exactly what you asked. Maybe you're not reading the pseudo code correctly? On the first move (timer event) the label will not be at …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    That has absolutely no resemblance to the pseudo-code I posted earlier (did you read it?), and definitely will not work. Maybe I confused things by talking about "ticks". In animation …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    The timer is a repeating timer that fires every 200ms Every time it fires you move the label 36 pixels right So it moves at a speed of 180 pixels …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    You are right about EDT choking. That's why all your "looping" has to be done by a repeating Timer, not a for/while/do loop. I'll say it again. You cannot use …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Hii i want to convert the following source code in c++.

    What help do you need, exactly?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help: Nested timers, or timer inside loop, or what? How?

    The reason this is confusing is that the code lines 52-57 are coded inside the loop 40-61 but they are not executed in that loop. They are executed only after …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in I want to convert the following java program into c++

    As far as I can see that program has nothing specially "Java" about. It's a long time since I've seen a whole Java program entirely in static methods; it's even …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Open partial view in a new popup window

    > It opens a new tab instead of a new window That's a setting that is in the user preferences for Safari, and probably for other browsers as well.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Convert UTC to local time MVC

    > having written a LOT of time conversion software over the years Why? There's proven tested supported code out there that does it. Do you have some kind of magic …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in runtime error on voting system

    I can't believe that after all this time you would still post this without a complete exact copy of the error message and stack trace! ps: please don't address these …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in javaFX How to setText() to a button from another class wtihout FXML

    In OO each object has a public interface and a private implementation. No object has access to any other object's private implementation. This massively simplifies the overall architecture by restricting …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Could you please help me fix my game of life code?

    Great! In that case please mark this "solved". If you have any new questions you can start another topic. JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in if statement

    What is your question?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Could you please help me fix my game of life code?

    You can't do it with one array. You will need two arrays, one for the current state and one for the new state - so you check the number of …

The End.