This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

Raymond Tong

Ranch Hand
+ Follow
since Aug 15, 2010
Raymond likes ...
IntelliJ IDE Java Spring
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
26
Received in last 30 days
0
Total given
0
Given in last 30 days
0
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.
4 months 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?

Thanks
4 months 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
3 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 ?

Thanks,
Raymond
3 years ago
May be the link below would be useful to know more about the parallel operation added in Java 8
https://www.youtube.com/watch?v=lFNnpfMBiCE&list=PLMod1hYiIvSZL1xclvHcsV2dMiminf19x&index=19
3 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.
3 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
3 years ago
comparison of Strings is case sensitive in Java.
If you are familiar with regex, you may want to give it a try.
3 years ago
https://grails.org/wiki/Build%20System
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
3 years ago
Depends on your actual scenario.
If you know exactly which instance you want. You can try @Qualifier
http://www.mkyong.com/spring/spring-autowiring-qualifier-example/

If you want to register beans with conditon. You can try @Profile
http://www.mkyong.com/spring/spring-profiles-example/
3 years ago
http://martinfowler.com/bliki/LazyInitialization.html

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.
3 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
3 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
3 years ago