• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Hi every one i need help for my quation

    I tagged this "java" so the right people wil see it. Show what effort you have made so far. What the heck does "one toss of a die is equivalent …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in array length is one!

    You define the function with 3 parameters, but call it with 2
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Running an Application with Elevated Privileges

    Linux or Windows? Doesn't Windows throw up the authorisation wondow as required? Linux: Have you tried a simple `sudo` - doesn't that pop up the passsword request automatically?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Running an Application with Elevated Privileges

    Are you trying to create code that will run something with elevated privileges without the user needing to input an admin password?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Pointers C++

    Did you run that code? What output did you get?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in object oriented programming

    OK guys, this is starting to go off-topic. Everyone has had a say, so let's get back to the original question re tutorials for OO etc please.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in object oriented programming

    I tend to agree with that. My typical code also has many classes, but not necessarily many subclasses. In practice I think it's obvious when you should use subclasses - …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in object oriented programming

    We don't have tutorials as such here - mostly because there are so many tutorials on the web already. As always I recommend the original Sun/Oracle tutorials. They are the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Casting a a variable type to an ordinar type

    ps: If you are using JFuzzyLogic, then the approriate method is called `getValue()`
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in server implementation using multithreading

    Before doing a lot of work, and possibly constructing harder-to-maintain code, maybe you should check your assumptions? How about a trivial program to create and detach 1,0000 threads and see …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Casting a a variable type to an ordinar type

    You are using classes that are not part of standard Java, and so we have no documentation for them. In general you can't cast to a primitive type (int etc) …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in syntax for adding to a Iterable integer linked list

    You could do an (unsafe) cast, but that's not a good solution. Can I assume the method has to return an Iterable? Inside your method you need to construct and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in syntax for adding to a Iterable integer linked list

    Line 2: you define adj (or whatever) as an Iterable<etc>. Later you assign a LinkedList to that. That's OK because LinkedList implements Iterable. However later on you try to call …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in syntax for adding to a Iterable integer linked list

    Having a method and a data member with the same name `adj` is bound to lead to confusion.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Instant messaging java

    If you want people to spend time then you must a) explain exactly what help you need b) show what you have done so far ps I tagged this "Java" …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Explanation of one threading concept

    What you pass is the object that you are using as a lock. Only one thread can have the lock at any given time. (Every object has an associated monitor …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Regular expression to extract content between tags from an html output

    On the other hand you clould just hack it... If there's just one `<tr><td>GLOBALID=` prefix in the text, and the `</td>`suffix is on the same line then you can simply …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Regular expression to extract content between tags from an html output

    JSoup looks like an excellent solution, except for OP's "i would not like to use any external libraries". Personally I find nothing wrong with external libraries, provided they are open …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Regular expression to extract content between tags from an html output

    I'm no REGEX expert, but standard Java does include classes for parsing XML (and therefore HTML) without any "external libraries". That's probabaly the safest way to ensure your parsing isn't …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in boolean 2d array how to check if true

    `matrix` is a 2D array (strictly: an array of arrays) so you need two indexes to get to a single element in `matrix`. I don't know excatly what you tried, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How can i to return the difference between two collections in java?

    use `removeAll` to remove all the elements in b from(a copy of) a... what ever is left is the answer
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in need some help with netbean java programming

    You had a good answer 22 hours ago.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Memory Leaks

    The Java equivalent of a memory leak is when you accidentally keep a reference to an object that prevents it being garbage collected. You would need to apply some incredibly …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How can I compare 2 strings contain few same words ?

    Yes, split will do that nicely. Once you have an array of words from string1 you can loop through that array seeing if each word is in the seocnd string. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How can I compare 2 strings contain few same words ?

    You will have to use a loop that takes every word from the first string, and checks to see if that word is in the second string. The check is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in c# program

    yes... and...?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JTable and HashMap

    As far as I can see you need a variable (pointer) when retrieving the values (line 6), but not another HashMap.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JTable and HashMap

    After a quick look at that code I see three HashMaps. Only one seems to get anything put in it, and only one (not the same) gets printed. Makes no …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why testers are dumb?

    That just confirms that you need a multi-pronged test strategy involving users, UI testers, DBAs etc. If your architecture is layered well then backend bugs should have been found during …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java clock app, can't increment hours/minutes

    What exactly is theproblem... what is happening that shouldn't or what is not happening that should?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Please help me.

    OK, I've done that. Please let me have your teacher's contact details so I can email it directly to him, thus saving you the bother of copy/pasting the solution. You …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in please tell me the code about this question I can't understand this.Help me

    Just giving you the code isn't going to help your ability. Memorising answers to possible questions is no way to improve, it's just a dead-end. If you want to do …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in please tell me the code about this question I can't understand this.Help me

    OK, I've written it. If you let me have your teacher's email address I can submit it for you to save you the bother of copy/pasting it yourself. DaniWeb Member …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to RudyM in Help! I'm stuck in a loop!

    I ALWAYS follow conditional statements with a brackets { ... }, even if it's just one-line of code. Not a bad practice for me at least.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in why char array prints without for loop while int array doesn't.

    My pleasure. Until next time..... J
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in why char array prints without for loop while int array doesn't.

    No, it's not any kind of Java language assumption. `println` is a method in the `PrintStream` class. (System.out is an instance of PrintStream). It's overloaded for all kinds of parameters, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to analyze the running time of a recursive function!?

    Well, no, it's not about actual runtime, so what is the relevance? There's no "timeit module" in standard Java AFAIK, and you give no link or reference for it, so …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Key of node based on rank in bst (binary search tree) at O(N) worst case

    ... after seeing another post by Teme64 I would have to qualify my previous post by saying I was assuming a ***balanced*** tree. In the worst case of an unbalanced …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to analyze the running time of a recursive function!?

    Binary search is the subject of another post by OP, but this one is about simply counting all the nodes, so let's not get distracted. Gribouillis is right, although I …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in IS IT BETTER TO MOVE TO SWIFT OR STAY WITH OBJECTIVE-C?

    When Apple adopt new technologies they usually do it hard and fast. Don't be surprised to see new hardware or software features getting support in Swift first, then before too …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to analyze the running time of a recursive function!?

    You need to access each node once, so O(n). The size of the stack is O(log n) so you can ignore that when there's a O(n) component
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Key of node based on rank in bst (binary search tree) at O(N) worst case

    > I also thought of using an array/stack/queue but filling it is O(N) and then running through that again is another O(N) creating an O(N^2) scenario again ? If there …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in open console and interact with user while running shell scrip

    ProcessBuilder was intended as a replacement for Runtime exec, so maybe that will work, but it is a step backwards.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in High Level vs Low Level Design

    I'll second the vote for UML. Especially use cases -> component diagrams -> class diagrams -> sequence diagrams (the last 3 in iterative loops of course). For low level design …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to change the countdown timer into minutes : seconds

    rproffitt did help you. (S)he gave you excellent advice. `"Think about how you do this in your head now. Now ... translate that directly to code. If the step can't …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Pc software

    That would certainly be a useful application. Google Translate does have voice input and output, although I don't know if Polish is a supported language for that. Ditto Microsoft Skype. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Pc software

    You can talk here as long as you recognise that whatever you say will be visible to everybody. There are many people here who can give you good advice.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Array : Learning

    Yes.. it iterates through the array for you. it's called an "enhanced for loop". Google for details & examples.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Array : Learning

    To understand this you need to remember: `int[] arrayA = ...` creates a reference variable `arrayA`that holds a pointer to an array `new int[3]` creates an actuial array of 3 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Get SummaryStatistics for multiple class fields

    I think you will need separate code for each subject UNLESS you replace the sub1, sub2 etc with a List or array of subjects - which would be code better …

The End.