Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

salvin francis

Bartender
+ Follow
since Jan 12, 2009
salvin likes ...
Google Web Toolkit Eclipse IDE Java
Forum Moderator
salvin francis currently moderates these forums:
Mumbai
Cows and Likes
Cows
Total received
150
In last 30 days
0
Total given
178
Likes
Total received
446
Received in last 30 days
0
Total given
245
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by salvin francis

Campbell Ritchie wrote:Which approach will make you more likely to get the job, Salvin?

depends on how interesting the conversation goes post that question  

1 month ago

Monica Shiralkar wrote:... If we do Git activities from the IDE itself , would I be able to do everything the way I have been doing or will I have to do only from command line ?


Not sure what this question means.

An IDE is just a GUI shell over git commands. IntelliJ also has a console window where it shows the actual commands that are executed for git. While using an IDE or not is purely up to one's personal choice, there are a few advantages such as warnings and wizards to do common tasks for git. Intellij also does some code clean up and formatting if configured.

Hope this helps
Back to the question at hand. If the loop was indeed valid from 0 to 100000, my answer would vary depending on my mood. If I was in a good mood, I would divulge into StringBuilder.
If not, I would question the interview about why the said requirement was valid from a business stand point.
I don't see any usecase where a program would require a string of numbers like "...50005001500250035004..." without any delimiter.
1 month ago

Junilu Lacar wrote:...Oh, really. So what am I, cabbage soup? ;)

That is a very tricky question !!
My answer is Yes, only if you're a person who really cherishes drinking that.

1 month ago
I'll take an opinionated approach here....
Here's my answer:


Is it just me or ... No one read the loop statement !!??!
Edit: Campbell spotted it first !
1 month ago
Came across this gem while browsing, thought about sharing it here.
2 months ago

Jesse Silverman wrote:... Also, when playing in JShell, even the return values you discard are kept, tho that is a sandbox...


If you open up a different terminal or even terminate jshell and start it again in the same terminal, the values are no longer present.
2 months ago
First of all PostTextNotScreenshots <--  It's a link
If you are having trouble knowing where to put the code, I strongly suggest against using a UI program as a learning exercise for learning java.
The JTextArea has a simple method called setText that will set the text displayed on screen. It also has a setEditable method to disallow users from editing the text.
Next, if you have trouble on how to load text from a file, I suggest looking at oracle tutorials <-- It's a link
3 months ago
Interesting assignment, of the three games, tic-tac-toe and connect 4 have a similar premise, but mastermind is way different.
What are you struggling on ? What is your plan of action ?
4 months ago

Estel Lopez wrote:... every 4 people needs 500gr of rice, 200gr of shrimps and 400gr of squids...


Let's leave code aside, the above statement can be simplified to : Every person needs 125gr of rice, 50gr of shrimp and 100gr of squids.
Does it now help with the calculations ?

Side note, as per wiki (Gram) a gram is denoted with "g". I have seen variants of "gm" but this is the first time I see "gr".

And welcome to Coderanch !!
4 months ago
I am a bit late to the party But I found this thread interesting.
My thought process usually works around enums for such types of problems. Even if you get inputs as Strings. You can have helper methods to convert those strings to objects. Here's how I would create the data structures ...

Enum for Suits:
Enum for Ranks:
Class for Card:Example usage based on strings: Once well defined data structures are in place, you can do any logic you want that fits your requirements. I'll leave that to you

4 months ago
Working on a proof of concept hobby game for mobile.

Here's a test sandbox stage for anyone interested in gaming :
http://salvin18.itch.io/car-platformer

I am still thinking of a name for my game. You can play it on any modern browser that supports wasm.
5 months ago