• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Programming in.NET Environment

    No need to shout! Let me explain: at DaniWeb we help people who are learning or having a problem. We try to help by teaching them what they need to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in cant seem to understand the code

    What is it about that code that you don't understand? ps: although it's legal Java, it's not very good code - obviously written by a beginner. Don't use it as …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited Python Slope of a line

    I am stuck trying to figure this out. I need to find the slope of a line after the user is prompted to click two points and display the line. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Optionals in java not behaving correctly

    First a quick point... You never need toString() in a print because print does that anyway. And if you just want to print the value you can use a simple …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in SQL Error: ORA-00907: missing right parenthesis?

    Just go through the code and check each pair of open/close parenthese. Either you are missing , or you have an extra, unmatched one. If that's OK then you are …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Optionals in java not behaving correctly

    That's not how Optional should be used. The Optional variable itself should never be set to null. Use `Optional.empty()` to create an Optional that has no value. Ie line 8 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for coding

    > @james - that's "Mad" world. Oh yes. Now don't I look foolish. But Lambert really was amazing anyway.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to Tejindra in help for coding

    You are going to build a simulator for a Bakery Business. The bakery sells up to 10 different items, and has a different number of each item at the start …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for coding

    Tears for fears originally, then Adam Lambert in the best performance of any talent show anywhere anytime. But yes, how appropriate for this thread
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Regular expressions - HTML - to TXT

    Line 13 you create a File but you never use it Line 14 - what value are you entering for the (first) run time argument? Your regex searches for a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Deadlock Algorithm Conversion

    You need to be be specific about what you have done already and exactly what help you need.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java questions...

    It would take you about one minute to try each of those modifiers in the java compiler to get an absolutely definitive answer.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in simple fare calculator using conditional statements in java

    Then fire up your text editor and start writing! When you get stuck then come back here, show what you have done, and explain what’s stopping you.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Tortoise and hare problem?

    Your mistake is that class RaceTest is inside another class. Move it out so it’s a top-level class, then you can make your main method static. You will then need …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Tortoise and hare problem?

    Ok, just think of it like this. You have a method that gives you a random int in a range starting at 0 You want to start at 1 That’s …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Tortoise and hare problem?

    That code will give you a random int in the range 0-10 (inclusive). Is that what you want?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in getParent() returns null string

    That depends on what you are trying to achieve! If you want the current user directory then Sytem.getProperty is the right answer.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Permanent update in JTextArea with database

    Break this down into easy steps. Your destination is to have the database query running in a different thread from the Swing thread, because the whole gui will freeze during …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in getParent() returns null string

    Your File object does not refer to any actual file (the file name is a zero length string) so it has not got a parent.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Animated Sprite Collision

    I can’t see any code that could explain a sprite colliding with itself. Is there maybe a double loop somewhere that calls OnTriggerEnter2D for each pair of sprites?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in i did everything right but it doesn't work

    Variable c is null, so it’s not an array and line 10 will give a null pointer exception. You need to initialise c to an array of the right size …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Equality and Relational Operators in GUI jTables on netbeans

    Please give more details of what you are trying to do, and exactly is the problem that is preventing you from making progress.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in [JAVA] Resize a JPanel based on GridBagLayout's cell width and height

    This is marked ‘solved’, so can you take a moment to share your solution for the benefit of others? Thanks JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Shared calculate the grades for a student using if..else statements.

    hi everyone, i am very new in java. can anyone help me to solve the following problem: A school conducts a 100 mark exam for its student and grades them …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Layout Manager

    He referred to setting a null layout manager, which, as you say, is generally a bad idea in almost all circumstances. (Eg any time there is any text being displayed!) …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in dfs

    Yes, we will help. But we won't do it for you. You need to explain what you have done so far with your dfs, and why/where you have got stuck.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in dfs

    Very interesting. Did you just want to share that, or is there a question?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Will a true AI have a net positive or negative impact on society?

    Leaving aside al the Sci-Fi stuff, we are already facing a total collapse of society as we know it. Waves of automation, starting in agriculture, then factories, then offices, then …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Began Watching How big are Windows 10 updates?

    I'm asking this question in the context of a satellite internet service with expensive download limits... If you just accept all the recommended updates for Windows 10 (creator's update, security …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Stopped Watching How big are Windows 10 updates?

    I'm asking this question in the context of a satellite internet service with expensive download limits... If you just accept all the recommended updates for Windows 10 (creator's update, security …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Began Watching How big are Windows 10 updates?

    I'm asking this question in the context of a satellite internet service with expensive download limits... If you just accept all the recommended updates for Windows 10 (creator's update, security …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Created How big are Windows 10 updates?

    I'm asking this question in the context of a satellite internet service with expensive download limits... If you just accept all the recommended updates for Windows 10 (creator's update, security …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to mastermyne in Crystal report error on client system

    Choose another version
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Volatile keyword atomicity

    One thread can both read and write a volatile variable, all the other threads can only read it. You say you are aware of the concept, so what exactly is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Volunteer/Amature Web Developers needed.

    > EIQ Studio's In English there is no apostophe in the plural "Studios". Not a good start. Is this a) a scam b) wishful thinking by some teenager in his/her …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Creating a python game? redlight greenlight

    Yes, very interesting. Did you have a question?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in SynchronizedMap ConcurrentModificationException

    I know this is marked "solved", bt for the benefit af anyone who has the same problem... To quote from the API doc... > It is imperative that the user …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    > Im not sure where this is accually leading Doen't matter. Sometimes it's just fun and educational to set off in some direction and see where it leads you and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    Hi Jonathan - it sounds like things are going really well. How are you doing for structuring all this code? ps Why the new user ID?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Synchronised block in the main method

    After a `notify` any ready thread(s) may be scheduled for execution. You have no control over which one.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Synchronised block in the main method

    The wait method releases the thread's lock.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Finally not executed after try block

    Be careful when reading a single output that combines System.out and System.err. They are separtely buffered, and may not appear in the same order that they were generated.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Finally not executed after try block

    > According to the output it seems finally was not executed despite the try block getting completed. ? line 3 of the output appears to be the message from line …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    Hold fire... I have a better idea.. Imagine the rect. Now draw an extended shape around it that's distance r from the rect (where r is the radius of the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    I'm worried that none of these algorithms seems to consider the velocity of the circle. Eg At time t the circle overlaps the top left corner of the rectangle, which …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    The great thing about Shape is the Ellipses, Rectangles etc are all Shapes, so the only draw method you need is draw(Shape). So leverage the classes that Java gives you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    > What would this method be used for? It tests for two Shapes overlapping. They can be rectanges, circles, polygons or completely arbitrary Shapes. If you have a Circle then …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Layout Manager

    > Is it all good? in terms of coding practice? not sure One thing to watch out for is the date when the video was made. I still see a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    Have a look at java.awt.geom.Area - it implements Shape but represents a closed shape at a particular position. It has all kinds of useful methods that Shape doesn't have, including …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Circle Rectangle Side collision.

    Yes, don’t reinvent the wheel. Re bouncing off sides: In practice you do need to consider the direction of motion (a) because that's simpler and (b) otherwize you get artifacts …

The End.