Raymond Tong

Ranch Hand
+ Follow
since Aug 15, 2010
Raymond likes ...
IntelliJ IDE Spring Java
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raymond Tong

Thanks for your comment. Did not know there is Ruby 3 and hope it would not like Python 3 with a not backward compatible syntax.
3 years ago
Ruby 2.6 and 2.7 have improvements for JIT compiler and GC.
How is Ruby performance in recent versions compared with other popular languages like Python, Java, etc.?
What about JRuby?

3 years ago
I took this one https://www.coursera.org/course/progfun and enjoy it very much which taught by Martin Odersky himself.
I have read http://www.amazon.com/Scala-Impatient-Cay-S-Horstmann/dp/0321774094 to have a quick start
and also read https://www.artima.com/pins1ed/ afterwards
6 years ago
I think a free account only limited to 12 months.

1) Can I remove the credit account information after registration to avoid charging me any money ? service suspended automatically if over the usage limit?
2) Can I create another account after the 12 months with transferring my data and config from the old account to remain free ?

6 years ago
May be the link below would be useful to know more about the parallel operation added in Java 8
6 years ago
You have declared an array with size MAX of Trees. All elements default with null.
You have read the content from a file with a count.
What would happen if your file is empty and you try to change all the elements in an array which have not been initalized.
6 years ago
In single sentence, Groovy as "Better Java", but you may have to understand it more to see whether it fulfill your need
It helps you to get rid of some boilerplate code in Java. e.g.
String interpolation http://groovy-lang.org/syntax.html#_string_interpolation
Safe navigator http://docs.groovy-lang.org/latest/html/documentation/index.html#_safe_navigation_operator

It is just another language running on JVM so it could be used to build web applications (e.g. Grails)
Many modern IDEs work well with Groovy
6 years ago
comparison of Strings is case sensitive in Java.
If you are familiar with regex, you may want to give it a try.
6 years ago
Just googled and I am surprised Grails actually using Gant instead of Gradle.
But there is a plugin to use Gradle instead if wanted https://github.com/grails/grails-gradle-plugin
6 years ago
Depends on your actual scenario.
If you know exactly which instance you want. You can try @Qualifier

If you want to register beans with conditon. You can try @Profile
6 years ago

Remember that this is an optimization technique to help responsiveness in situations where a client doesn't need the lazy initialized value. As with any optimization you shouldn't use this technique unless you have a real performance problem to solve.

Lazy initialization may not always be the right choice but it may be used if it is needed.

For your code above, how the caller to get an instance if getInstance is not a static method ? and it should have a private constructor?
I am not saying one approach is better than the others, use the right tool to do the right job.
6 years ago
Lazy initialisation would be good if the initialisation process may be expensive and not necessary.
There is also another way of creating Singleton -> Enum
6 years ago

Simone Taylor wrote:
Write a program that generates a Day object
representing February 28 of this year

You need a Day object, and think what fields it should contains.

Simone Taylor wrote:Advance each object by one day

Day should have a method for you to advance by one day

Simone Taylor wrote:, and print each
object. Also print the expected values.

Day should have a method to print its current content
6 years ago