Jorge Ruiz-Aquino

Ranch Hand
+ Follow
since Sep 25, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
26
Received in last 30 days
0
Total given
15
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jorge Ruiz-Aquino

Thank you.
I think the limitation is on my side as I'm still thinking in terms of what Java ME was.  
But I need to shape my mind around that Raspberry is capable of running full Java SE.
5 months ago
Thank you Igor.
I would take another look. Most of the posts I find is about JavaFx and few of them on other technologies like SWT, HTML, even old discussions about swing.
5 months ago
Hi Frank,

I see you make use of JavaFx in your book.
Are there other alternatives for the UI in Java on Raspberry Pi?
Can I use any of the other de-facto UI for Java like GWT, JSF, even Web centered like JSP, Javascript libraries?
Or are there limitations for using any of these on Raspberry Pi?
5 months ago
Thank you Frank.

It is amazing having the shopping list you share. Sometimes book writers take for granted this sort of things.
6 months ago
Hi Frank DelPorte,

I already know Java but I'm novice on electronics. It this book right for me or should I have previous knowledge on electronics/Raspberry Pi to be able to get everything from the book?
How do you recommend to start for a newbie in electronics?

Thanks.
6 months ago

Khalid A. Mughal wrote:Hi,

See if the explanation below makes sense for the results you are seeing.

Consider this method:
T reduce(T identity, BinaryOperator<T> accumulator)
This method on a parallel stream uses the accumulator as a combiner (i.e. for combining partial results).

The accumulator and the combiner must satisfy the following relationship for any t1 and t2...



Khalid, I tested the code you provided.
Your explanation makes complete sense.

I really appreciate all your responses. Thank you!
Hi Vasily,

In this case the code came from a certification preparation book. But when I tested I found the consistent result even when tested with different values in different places. But your explanation of other variables to take in account makes sense.
Thank you for the advices. For sure I will take them in consideration for my own code.
Hi Khalid/Vasily

About parallel strams and reduce().
I know that the number of threads the parallel stream allocate is proportional to the number of CPU.
Even when working on parallel streams some operations are processed sequentially.
For the reduction to achieve the same results in either sequential or parallel stream, the accumulator and combiner have both to work regardless of the order they are called. Example: in an addition the order of operands is not important, but in the case of subtraction the order matters.

So, for the code snippet below that calls reduce() on a parallel stream, would be right to say that the result is undefined? What if we are given the number of CPU?

I ask because if I run this code snippet with a parallel stream the result is always the same: 5


I've used the code below to test the assumption:


I always get the exact same results for the parallel stream running the same code in multiple Online services.


Is the assumption incorrect? Because there seems to be an algorithm to calculate the result when performing on parallel stream.
Would you give some insights on this?

I remember to hear about some people just memorizing exam samples and got certified for Java 5 or Java 6. But I think starting from Java 8 having a set of questions to memorize should be much more difficult as there are more variations on syntax for writing the same thing. Such is the case of Java 8 that Oracle started with two level of certifications, OCA and OCP.

With Java 11 as more topics are added to the language it becomes more interesting and difficult for most people to achieve the certification just through memorization (cheating or breaking the system?), which is good.  

Khalid A. Mughal wrote:
Our book is comprised of two volumes, standing at about 1800 pages.
The reason for its hefty size is that topics are covered thoroughly, without glossing over details.


Wow, that is almost an encyclopedia! Then, it could be taken as a Java text book for a new Java programer?

Khalid A. Mughal wrote:
...I let that be a surprise for the reader.


I like that one!

I just saw the book details:
Paperback ‏ : ‎ 1851 pages
Item Weight ‏ : ‎ 5.55 pounds  
Hi Carl,

The credentials don't have an expiration date.
However, Java is going fast on new versions and features and the industry tries to catch up. So, a Java 5 certification credential, although still valid, is way long outdated. Althoug, there are still some companies running legacy applications where they would absolutely require knowledge on those old versions of Java.
Hi Bhaskar,

Bhaskar Bantupalli wrote:How important(with weightage/marks) is modules and Reflection in OCP-Java17 exam?


Maybe the authors can correct me on this, but...
Usually, all questions in Java certifications are given the same weight. So you are getting the same points by correctly answering a LOOP question than if you correctly answer a Modules or Reflection question. The rule of thumb is to answer all questions, even if you don't know the exact answer, try to respond correctly as many as you can.  

Bhaskar Bantupalli wrote:Also, can the book(by Khalid) be used as sort of textbook for migration to modules from Java-8?
and how/what examples to practice to get good understanding of modules?



Apart from what the authors would say...
I've read Jeanne Boyarsky's Java certification books. What I found is that they explain what is going to be asked in the exam. The certification books do not go deep on strategies for migrating to Java modules.
I would recommend to get a book specifically for modules. Examples:
  • Java 9 Modularity, O'Reilly
  • The Java Module System, Manning.
  • Java 9 Revealed: For Early Adoption and Migration, Apress
  • I'm pretty sure there should be many more about migrating to modules.
    Hi Khalid/Vasily,

    I know the list of changes from Java 11 to Java are the ones below:
    [1]: Text Blocks
    [2]: Pattern Matching for the instanceof Operator
    [3]: Java Records
    [4]: Sealed Classes and Interfaces
    [5]: Switch Expressions

    I've seen the new syntax for those topics and are completely different of what pre-Java 17 developer know.
    Do you present edge cases in your book? Those that are rare in the professional life but could be asked in the exam? Like which ones?
    Hi Miro,

    Talking about GoF patterns. Did you left any of those patterns out of your book because they are outdated or not relevant in the modern days? Which ones would not be possible to implement with Java?