Win a copy of Functional Design and Architecture this week in the Functional programming forum!

tangara goh

Ranch Hand
+ Follow
since Dec 27, 2009
I am a beginner in Java and hope to pick up the trade secrets so that I can move on to Android development
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 tangara goh

Hi guys,

I have been spending 2 weeks doing a 2D 90 clockwise rotation and only able to do it after seeing the answer in Stackoverflow.

But, still I am not really able to grasp the concept on a specific part :

The specific part that I don't get it is :

This line of code could appear in the outer or inner loops.

Could someone kindly explain things to me ?

Tks a millioin.
6 days ago
Sorry guys, I managed to enable the IDE to run 2 versions inside.  Please help me to delete this post.
1 week ago
Hi guys,

I am now trying out a hyperskill developer solution which uses var which means I have to use a higher version of JDK.

Thus, I installed openJDK 10 in Eclipse.  The Oracle one just could not be downloaded.

OS : Window 10

Now, the problem is that in the workspace, the rest of the codes are all written using Java 8 JDK from oracle.

How can I make Eclipse toggle between Java 8 JDK if I want the codes to run in Java 8 and this particular code which needs to run in OpenJDK 10 in Eclipse.

So, there was some errors occurred and I as usual hastily deleted the Java 8 compiler from build path.

And now I am ended up with this screen which I had no idea how to make things work.

Hope to get some tips here.

1 week ago
Sorry guys, it is my mistake : I left out a thread.start() at the public void main there and this is right after myThread.start()

3 weeks ago

Tim Holloway wrote:Stored procedures are something that I recommend avoiding where possible regardless of the framework you are using. Stored procedures tend to lock you into a particular database vendor plus they make it harder to determine where business data logic resides - on the DBMS server or in application code, thus raising time and cost of system maintenance. Plus it's generally harder to keep version control over stored logic than it is for application code.

The main reasons for using stored procedures would be in cases where performance was prohibitively worse when doing database logic in application code or the same logic needed to be shared between multiple applications. Both conditions are typically pretty rare.

Spring Boot really doesn't impact this. If Hibernate is being inefficient, then it's Hibernate you need to tune and that process is the same for Spring Boot as for regular Spring or even non-Spring apps.

Thank you so much for answering my question because this is the exact thought in my mind, even though I was still very green in this field 4 years back.  Unfortunately, I was deem a failure by the school and refused to give me my cert after clearing all my exams.

Now, I am subjected to all kinds of coding tests which I doubt I can pass.

Sorry for the rant again.
4 weeks ago
Hi experts,

I was questioning someone of using Stored procedure vs SpringBoot JPA which uses Hibernate under the hood?

So, now since SpringBoot naturally advocates its own goodness but I heard in reality that Hibernate would fetch unneeded data and thus not achieving optimisation.

How is this kind of problem handled ?
4 weeks ago

Norm Radder wrote:

1. Prints: MyThread: run() followed by MyRunnable: start()

Do you mean this is what the output should look like:
1. Prints:
MyThread: run()
MyRunnable: start()

Add @Override before the start methods to see which ones actually are overriding a  class method.

At which start method should I add the @Override ?

4 weeks ago

Liutauras Vilda wrote:I'm not sure whether the code is copied exactly as it should, but none of the answers are inline with an existing code.

I have double check and it is indeed the same.  In fact, before I posted, I was worried that I have copied wrongly.

And I did make sure it is really the same cos I could not get any answer and was abit doubtful.
4 weeks ago

Liutauras Vilda wrote:1. You can't have two public classes in the same source file. You have MyThread and myTest.
2. Source filename should match the public class's name.

Try to fix those and see how it goes then.

I did put myTest in another class under the same package in the IDE but when it doesn't give me any answer listed in the 4 choices I wanted to find out more, hence this post.

4 weeks ago
I need help to get the answer for this MCQ :

The question asked what is the output of the following codes?

So, I am suppose to choose 1 correct answer but I can't even make it run.  I would like to verify if there is something wrong with the code the question is set?

Here are the 4 choices:

1. Prints: MyThread: run() followed by MyRunnable: start()
2. Prints: MyThread: start() followed by MyRunnable:start()
3. Prints: MyThread: run() followed by MyRunnable:run()
4. Prints: MyThread: start() followed by MyRunnable:run()

Please let me know which is the correct answer and if there is something wrong with the code.

4 weeks ago

I will be taking another coding test soon but this time round in another platform - CodeSignal.

So, now I am only practising the 3rd question - very slow progress.

And in this question : I notice there is a line that states :

Please see attached the full question

guranteed constraint :

2 ≤ m ≤ 100.

What is this constraint all about?

What if it is not <= 100 and not 2 but some other numbers, will it make a difference to the algorithms when calculating the distribution of the candies?

4 weeks ago
Hi Campbell,

How do you write a method that don't use Java 8 to do it and without Scanner ? The using Scanner method I am able to view others answers.  Sorry that I was not clear but I was trying to convert one of the brilliant answers using Scanner to one that that no need to use Scanner because that is what real life programming is about.
1 month ago
Hi guys,

I am stuck with this popular question on shifting the element(s) in an array like forever....and till now I am still not confident to go for a coding test.

So, there were lots of amazing solutions offered by the most creative people I have seen in Hyperskills.

The original one - I thought the person was damn clever to do it this way:

Now, when I tried to use the function written using Scanner by others to one in the IDE, it won't work if the function is asked to have 2nd last element as the first element.

How do I transform that clever code to a method using the IDE with the same kind of idea behind that clever developer ?

I also tried to study the way this guy did in the stackoverflow :

and he uses

But, it doesn't help in terms of transforming the code that can use if that's say the shifting is changed to the last 2nd element or 3rd element etc.

1 month ago

Houssam El wrote:I hope the following explanation will help you to perceive HashTable properties.

1-TableEntry<T> is an API that defines operations of the HashTable class, in other words, API is a tool used by the HashTable class, furthermore, we should implement TableEntry<T> interface in the HashTable class in order to override its methods, as the following example shown

The error that you've faced while using the get() method, is thrown because the get() method is neither defined on TableEntry<T> interface nor HashTable class, that's why the error is raised at compile-time, you would define it in the TableEntry interface, thus, the IDE will ask you automatically to override it in the HashTable class.

NB: your implementation or usage of HashTable may thrown a key collision key (quadratic probing), and you should re-hash it again as you did the first time

Hi Houssam,

the example from Hyperskill actually uses TableEntry as a class, and not interface.

Can it not be done using TableEntry as a class ?

I think they are trying to use TableEntry to illustrate about HashTable..

1 month ago

Paul Clapham wrote:If you're trying to write your own implementation of Java's Hashtable class, then you should realize that as a map, a table entry has a key and a value. So for a start you should be implementing

As for your existing code, you can't call a get(int) method on your Hashtable<T> class simply because you didn't write one.

Hi Paul,

But, the tutorial given did not have K, E inside as seen from the above.
It just have a genericl T inside the EntryTable and then it uses a

Does it mean that there is no way to use a get using the existing code that is written like that?
1 month ago