L Foster

Ranch Hand
+ Follow
since Oct 28, 2003
L likes ...
Android Angular Framework Spring AngularJS Java
Software developer with many years of experience writing Java.  Have worked in Finance, Gov Contracting, BioScience, and Publishing.  Lately heavily involved in AWS.  MOOC junkie.  Family guy.
Maryland, USA
Cows and Likes
Cows
Total received
15
In last 30 days
0
Total given
0
Likes
Total received
50
Received in last 30 days
0
Total given
38
Given in last 30 days
2
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by L Foster

Just replying to Mr. Van Hulst,

The one I was looking at was called "java.activation".   My module file has to "require jakarta.activation"--and that's been there since I moved up to Java 11.  However, I oddly saw this message about "java.activation".

As I said, I wanted to learn about tools here.  Thank you
3 weeks ago
I found a way to answer my own question.  Not sure if there may be a better way out there, but here goes.


Even though there are still issues in the project, these dependencies are still spelled out.  Still have to read it, though ;-)
3 weeks ago
Just googling "java module graph" did not help.  Good thought, though.  I need to know in this case, because the module was deprecated and now removed in the latest java.  I have other dependencies and one of them is trying to depend on this.  I wish I could just snap in things as needed to a modules file, but even my brief experience has taught me it is never that simple.
3 weeks ago
I need to know how to figure out which module or class (of my own) requires a specific module.  I want to be "taught to fish" rather than trying to recreate this issue here and receive (the usual excellent) help from others to solve it.  I want this for a couple of reasons:   first, I suspect this will happen again after I solve this one, and second, this only happened after a lot of big changes -- move from maven to gradle + Java 11 to Java 17--which I think will make it difficult to recreate this bug without the whole codebase.  So, I want to be able to solve this myself if possible.

So, when I see gradle claiming



Or any other module, is there some tool I can use that will tell me what code has that dependency?   Yes, I have seen that jakarta.activation is supposed to have replaced this as of long ago.  I have that dependency in place.

Thanks
3 weeks ago
I see some great posts pointing out interesting things about the example code.

Interesting question in some ways.  If I were asked "how I would optimize it", and I don't guarantee this would win points, I think I would reply that I would paste the code into an IDE, run it a million times, and see how long it actually takes.  Then I would possibly profile it (although this is pretty small) to see where the time is going, and one fix I would consider changing would be the concatenation argument (+) to using of StringBuilder.append().  I say "consider" because there may be some JVM optimizations by this point that handle underlying use of String Builder.  After any such change, run it a million times again and time it.  Multiplying runs like that is a good way to force differences to emerge even if they were fairly small to begin with.  As has been pointed out, this code will not do anything.  As such it will run pretty fast.

1 month ago
UML
What is it you need help with?  Please elaborate.

It is always best to work through problems yourself.  Perhaps what you asked for help with was the "implement your code here" blocks?  If so, think about what the methods are named, and of course the (apparently) requirements list.  Consider how you would make those things happen using Java.  This really is where the fun begins.  You could create something at this point.  Along the way, remember you can always print out the states of things using code like this.   This is an example of how to dump room contents, assuming a room has been declared and has data in it.



One hint I would give: those "toString()" methods have been commented out.    takes code "out of commission".  Removing those from around the code will allow it to be executed again.

Have fun!
1 month ago
Having seen this and scanned some of the discussion, I want to raise a few points.  Firstly, it has been gospel in OO going back to early days that "static methods are bad".  However, when the designers of Java got their opportunity, they did leave them in.  I have long held that belief because static methods tend to not only bypass the whole encapsulated data notion, but they also stick you with only a single copy of something.  Having multiple instances of a class with different state is one of the things that drew me to OO that long ago.   Static methods also require class members rather than object fields.  Further, if you want to setup the state of a class that has all static methods, it either all has to be in constants or the static members have to be mutable.  Hence, it would discourage immutability.  And on a basic level, without an object, it is as if you are still doing Procedural code.  Why waste time compiling Java at all?

That being said, there are exceptions that are encouraged by industry experts.  In particular, Joshua Bloch's "Effective Java" encourages the use of static methods as a means of improving how objects are created.  Instead of directly hitting the constructor, you use a static method to get an instance.  This comes with it a host of advantages, such as the ability to constrain the number of instances to just a few (sort of like making a "multiple-ton").  It allows one to enforce a builder pattern by making the constructor itself private--which in turn allows one to make an immutable object even when all parameters may not be available at one time.  Further, with a constructor you get only one name -- same as the class.  Using a static method to construct (factory method, actually) you can give a more meaningful name to a constructor to be used for a specific type of configuring of the object.

I have also seen some rather convincing arguments that a static method is acceptable if it does something general to something that is related to a class, but is not using any of the class's state to do so.  Suppose you had a "Person" class, but you wanted to have a method that properly capitalizes person names?  One could argue that the Person class would be a good place to put it, but that it might be leveraged by others.  But it could as easily be argued that "capitalize()" belongs in some utility class.

In summary, I think an ideal question here might have been about when it is advisable to use a static method.  Simply having asked, I suspect it is apparent to the OP that there is more to the discussion than "one is better than the other".
1 month ago
Awesome to have Ken Kousen on the forum.  I have seen him and heard about "Kousen IT" a few times.  That's witty.

I am curious: is it possible for a boss to provide too much feedback?

Thank you
1 month ago
Greetings, All.
I found a nice course on HDPCD certification.  When I say 'nice', I mean informative.  This teacher seems to have all the right information, but is not as slick as some instructors online.

Anyway, although I had never thought of taking HDPCD, I took the course to learn more.  However, the FAQ states that HDPCD is discontinued.


https://www.cloudera.com/about/training/certification/faq.html  this FAQ states:

Will HDP exams continue to be delivered?

The HDPCSD and HDPCD exams were retired on December 6, 2019.



I think the course is still good info (like I said, I did not want to take the test anyway).

The course is "HDPCD:Spark using Scala" on Udemy.

Thanks
1 year ago
Hello, Irvin:

You should take a look at the logic for the third function.  You seem to be expecting it to do a lot, but not giving it any relevant code to do so.  To get you going, you should:
1. Review == and the "equals(Object o)" method in Java.
2. Consider: how could the method ever return anything other than "true"?  You have the default at true, and then you never change the value to anything else.
3. Review some of the methods in java.lang.String.

I hope that helps.
2 years ago
Hello, All.

While I am actually still struggling with a related issue (that is, I am no expert), I can tell you something pivotal to your understanding of this problem.

Java7 and Java8 included JavaFX in their JVM.  As of Java9, that was no longer the case.  Java9 through Java12 (+ assume) requires you to get JavaFX as a module and use that module.  If you are using Maven, you can get past this by including dependencies.  I think these should work.


However, the swing dependency may not be needed, and there are other dependencies to do with JavaFX that you may need, such as javafx-fxml and javafx-media.

Please refer also to https://openjfx.io/openjfx-docs/ for further info.

I hope this helps someone.
2 years ago
This is my question for the author of the new book: "Architecting Modern Java EE Applications".

Looks like hope for the future.  My question to you: what motivated you to take the time to write on this particular topic?  I have seen fewer organizations embrace this technology than in the past.   It is far from moribund in my view.  Are there certain developments in JavaEE 8 that really excite you and convince you this is an excellent approach to modern problem-solving?

Thanks
Hi, nice work going toward graph theory!

So, you've created a 2D space and given it sparse vertexes and edges running through it.  But I cannot tell what you might do with this "model".  Delete-vertex seems to do nothing but report whether the vertex previously existed.  Is that the idea?
3 years ago