• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Generating Bills

    Maybe that is overkill, maybe not, but in any case, starting with OP's tables, they need at least some kind of foreign key to relate Bills to Consumers. Without that …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    There are no silly questions. Conversion to meters (which happens tp be the base unit) is the same as any other conversion - just add Meters to your definitions UnitDefinition …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to AssertNull in Code Efficiency

    pritaeas's code seems efficient AND readable to me. You potentially have two calls to the Contains function in your original if statement. Your question seems to be asking if you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to Reverend Jim in Code Efficiency

    Unless the code in question is inside a loop that will be executed millions of times, a slight (but otherwise unmeasurable) increase in efficiency is not worth sacrificing clarity.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    Part 2: This is a little sketch of how the unit definitions are used for a conversion. Rather than having n^2 methods that convert directly between any two units, we …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    It's a little class I wrote. I didn't post the code because I wanted you to see WHY it's defined the way it is. Anyway, here it is now... class …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    > I still need a mechanism to determine which one I need to do one or the other No. When you supply the conversion constant simply use the value that's …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    All you need to remember is that diving by x is the same as multiplying by 1/x So every conversion can be done as a multiplication, you just define the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in upgrading from Java 7 to 8

    Yaaayeee! Safe at last!
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in upgrading from Java 7 to 8

    > (JamesCherrill will be pleased,lol!) :) It's nothing to do with whether I (or anyone else) will be pleased. It's more a question of self-preservation > Auto-update Notice and End …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to Himanshu_8 in nextLine() after nextInt() or nextDouble gives trouble

    Hi All, for this problem, you have to call a function and give the input in the method. see my program: import java.util.*; public class ScannerDemo `{` public static void …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    Yes. For any given measure (weight, length etc) all the units can be defined in terms of a "base" unit (meter, kilogram etc). So all you need to know is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    Yes. You can leave the build settings in Eclipse to be Java 7 for compatibility in the unlikely event of a problem, even if you are using a Java 8 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in upgrading from Java 7 to 8

    Well done! In general, yes, install the latest SDK and wait for everything to re-build, then change the settings for each project where you want to use JDK 8 features. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Where to go after 1 year Computer Science having learnt basic Java and OOD?

    If you know Java then JavaScript is just like a children's version of Java and you can pick it up in no time at all. Do that anyway, becuase Java …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    I can't believe I;m doing this... converting code back to Java 7 so somebody can run it on a machine exposed to unpatched security problems in an obsolete unsupported Java. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    OK. If you MUST use Java 7 then so be it, but really it's dangerous to stay on old versions. If there is any possible way to get that up-to-date …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    OK, here's the first example - separation of logic and UI. First we code the logic as a class (or package) with no UI. This temperature converter holds a temperature …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    The thing that stands out about your converter is that apart from the initial disp;ay the whole thing is one big class with GUI, validation, logic all piled up in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Hello,

    Seriously? You're doing a dissertation for a Master's degree and you don't know how to use Google search? Go away and do some work yourself. If/when you get stuck you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java console application for truck dispatching

    Its unlikely that your teacher has set you an assignment that you cannot even start, so let's take a deep breath and go one step at a time. > Truck.java …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java console application for truck dispatching

    You just copy/pasted your assignment without even a moment taken to explain what help you need. There are lots of people here who will freely give their time to help …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in I need some help wrapping up my assignment please!

    > I can easily do the problem on paper ... then you are 90% of the way there. Just do it on paper slowly, one small step at a time, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in I need some help wrapping up my assignment please!

    dividing by 100 is not the same as multiplying by 0.1
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Read this before posting sticky

    > only 8% of our overall traffic is on mobile. Chicken or egg? Surely nobody would develeop a new networking environment in 2016 without supporting Androis and IOS devices!
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Is Smalltalk ready to make a comeback?

    I was Principal Consultant with Easel/VMark after they acquired the Enfin Smalltalk implementation (now part of Object Studio) in the 1990's. The claims made for Smalltalk are largely true. It …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in unable to send email using java api

    ... well, what did you expect when you haven't shown us any of the code that you are trying to use? People here will try to help you, but we're …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in unable to send email using java api

    There is a missing semi-colon on line 132 of your code.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    The important thing here is to separate your code into classes with high cohesion and low coupling. If you have more than a few classes, consider grouping them in multiple …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Filling a Match Profile

    I too had these problems when trying to access DW from my iPhone this afternoon. It insisted on all kinds of obtrusive offensive and and irrelevant questions before it would …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to handle Error Handling

    In a really trivial case like this there's no harm in putting it all in the try/catch, but moving forwards that's a bad practice because it doesn't scale at all. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    Personally I prefer not to have a button when there's no need for one. If you have difficult validation then OK, but otherwise you just make things more cluttered and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Building a java converter

    I'm with stultuske on this one. Looking at your posts here you are trying to do way too many things at the same time. Stop messing about with frameworks and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to handle Error Handling

    > I could get my validateInputs() to return a boolean value of false if an exception has occurred and true if it hasn't, pass that back to the caller and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Transfer files over socket from server to client

    You can just write/read them as objects (casting to String at the receiving end). Alternatively you can use writeUTF/readUTF which give the same results but may be slightly more efficient
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Transfer files over socket from server to client

    Mixing stream types on a single socket is guaranteed to cause chaos, so pick one type and stick to it. Object streams are the obvious way to go because they …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in NumberFormatException error: how to deal with it

    Yup, that's right! JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Programming Classes and Objects

    By calling a method that either accepts the variable as a parameter, or returns it. Doesn't matter if its a simple value, or an array, or whatever.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in NumberFormatException error: how to deal with it

    Yes, you need to catch the NumberFormatException that's thrown when the user input is not numeric. > I would have thought that the InputMismatchException would take care of it No. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Read a text file continually being updated by another process

    > The text file can become very large and opening then closing it, then opening it again to start reading the updates is highly inefficient and I am searching for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in brexit

    > Nigel Farage and Boris Johnson were pro-Leave and they won, right? Why would the winners step down? Farage knows he is not a credible leader, or even a credible …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Newspaper java problem

    Exactly which line of code is that? NPE usually means you have an uninitialised reference variable or value returned from a method call. Look at that line of code, see …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to Agilemind in brexit

    > If the system isn't going to work for them then it isn't going to work for anyone. So they are the electoral equivalent of internet trolls? They are throwing …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in brexit

    The above (which I agree with) was written before today's shock news that Boris has announced that he is not the man to lead the Conservative party and the country. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Connecting jTable with a table from SQL

    Hi Zaraki (and Kriti) Please note that it is DaniWeb's policy that posters should show some effort before we give them help. "Please do my homework for me" posts are …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Basic Programming Need Help

    When you call `parseDouble` passing a string that cannot be parsed as a number Java will throw a `NumberFormatException` You can put your `parseDouble` inside a `try` block and `catch` …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in convert jobject to jboolean in JNI

    I thought this question was how to handle a Java Object (that happens to be a Boolean) in cpp code? If it's a Java question then you need to cast …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in brexit

    Although the Independent paper folded, it's web version is still very much alive and an excellent source of balanced info. And of course there's always the BBC. The UK edition …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in brexit

    Surely no one else will jump before they see exactly how this plays out for the UK. Which could be a long wait. The concensus from both sides is that …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in brexit

    > If we now want to trade in the EU (single market) we will have to do what we.re doing now AND have absolutely no say on policy He surely …

The End.