Jesse Silverman wrote:I had the discussion with Campbell in another thread some weeks back, and made almost exactly the same points you did.
I don't even know how one goes about doing the GPU-based stuff in Java, the material I worked with was focused on C/C++/Python and FORTRAN only.
There is some vector API work that has made its way into Java 17 for future progress in this direction.
I agree with Campbell's main point that short of dealing with HUGE numbers of data, there is very little to be bought using float type, at least on the CPU-based and FPU-based instructions that I think Java uses for all normal math.
And yes, this is all way, way beyond the scope of Beginning Java.
Antonio Moretti wrote:
I know how to parse a CSV. I just used the split() method and put each value in a array and took it from there. I just wondered if there was another way of reading the file in other than line by line, which to me, suggests a lot of disk operations if the file is long. That was my question all along.
Campbell Ritchie wrote:Unless you have an assignment reading a CSV file, you are probably better off downloading an app optimised for CSVs.
I wouldn't want to store values read in an array, not if I could put them directly into an object.
Tim Holloway wrote:I'm not sure what this "dependency management system" thing is supposed to be.
Maven is a build system where the dependencies are indicated as standard resources. Maven keeps a local cache (repository) of such resources so that it will automatically pull needed dependencies from central Maven repositories as needed, then keep them in the cache. It will also transitively pull indirect dependencies so that the build is self-contained.
Ant is a build system where you have to pull all of the dependencies manually and store them locally (and where people stored them locally was always one of my biggest headaches). You basically either had to store them in the Ant project directory and end up with myriad duplicate copies if you had lots of projects or put them in a location outside the project which made shipping projects difficult and installing them on remote systems sometimes impossible. Or you could use Ivy, which basically does what Maven does, and, in fact, I'm fairly certain pulls from Maven's repositories (as does Gradle).
As for managing dependencies, I can attest that while Maven can handle pulling, caching, and building with dependencies, if you modify a project where one dependency's upstream version requirements clash with another's, you're in for fun times. If there's a tool that can unsnarl that particular problem automatically a lot of people would love to hear about it.
if you modify a project where one dependency's upstream version requirements clash with another's, you're in for fun times
Antonio Moretti wrote:Hi
Can someone please show me how to use StringBuilder with String.Format features, so I can use the format specifiers? Is this a thing? Or should I just use normal concatenation?
Tim Holloway wrote:Back to the original topic:
That said, the upside to Ant is that you can build complex build systems in any way you like. In Ant you know exactly what the process steps are and what they do.
Campbell Ritchie wrote:On a 64‑bit machine, you might use all 64 bits for floating‑point arithmetic regardless.
Damon McNeill wrote:. . . a float takes half the space. . . .
You will probably have to have millions upon millions of floating‑point numbers in memory all at once before you notice the difference in memory use.
The default is to use double arithmetic; indeed you either need the terminal f or a cast to turn the arithmetic into a float.
It isn't worth the bother only to lose the already limited precision of double arithmetic.As soon as you start doing arithmetic, your byte will be turned into an int anyway, except when using the compound assignment operators. The short and byte datatypes probably also have no real‑life use. The byte datatype, on the other hand, is very useful for sending information across networks.
always use int where a byte would do, no?
Campbell Ritchie wrote:Welcome to the Ranch
Please avoid floats, unless some other API requires them; they simply lose you precision as against doubles.
Why would you expect that program to print 0?
Tim Holloway wrote:When you see a "no guarantees" warning, it's an indication that you should be treating the functionality in question as a "black box" and not try and design code based on its current implementation.
One example, complex tests using || that so obviously meant && and vice versa, another <= in places that obviously should have been >= and vice versa.