Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!

Liutauras Vilda

Marshal
+ Follow
since Nov 12, 2014
Liutauras likes ...
Mac OS X VI Editor BSD Linux
London, United Kingdom
Cows and Likes
Cows
Total received
536
In last 30 days
2
Total given
1822
Likes
Total received
1650
Received in last 30 days
19
Total given
1896
Given in last 30 days
20
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt

Recent posts by Liutauras Vilda

Welcome to the Ranch!

Please clarify, what do you want to alter and why?
3 hours ago

Nex Wat wrote:I made a mistake in the comment, it should be


Don't feel bad about it. It is less a mistake, but more an ambiguity.

When you write such type of comments or speak with your friend, it is always a good idea to state it explicitly. For example: 0 (inclusive) to 44 (exclusive), now that is not questionable.

I'm sure in the sense of correct english, 0 to 100 or similar might actually mean 100 (exclusive), but why to leave that for the reader to parse if could be stated explicitly.
2 days ago
Nex Wat, please don’t alter the posts (by fixing pointed out issues) which were commented already. Note: I have reverted your latest edit.

The reason being, Those who read the thread could think that people (in this case I) comment about the things which don’t exist. And who likes to look silly
2 days ago

Nex Wat wrote:


Not sure how important that is in your case, but that comment might be a bit ambiguous.

This is how the JavaDocs (portion of it) for this method (Random.nextInt(...)) reads:

Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)...


Verify whether your implementation is what you actually want.
3 days ago
@OP

Also I'd say, try not to mess around when writing a code. Meaning, make sure formatting is consistent, code is well indented. No excessive amount of empty lines between the code blocks, at the same time, code is not squeezed onto fewer lines as possible. Variables names are chosen carefully, so they tell exactly what they represent.

These things aren't difficult to get them right right from the beginning (except maybe it will take some time to name variables in an optimum way..), and they do help a lot.
5 days ago
@OP

These days like never before I value the code readability, meaning, how much effort it takes to understand its purpose (also what it does) when I reading it. Look at the requirements you posted (bolded), and then the actual implementation you provided, i.e. method name twoSum(...). I personally couldn't find any relation (except maybe word "two") between the requirements and the method name.

Not sure what the question is, but pay an attention to variable names, method names, class names you choose. They communicate to you the ideas/intention, what is meant to happen, and what is likely going to happen. Now, if they don't match - that is a bit of a problem occurs to the code reader, including yourself. That is often also the reason of bugs or inability to solve problem at all.

Dreke Droga wrote:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target


Dreke Droga wrote:

1 week ago
Congratulations, Campbell! 15 years, that's a long lasting project of yours
1 week ago
It seems we missed your thread. Apologies. Somebody potentially will have a look now that we bumped it
1 week ago

Dreke Droga wrote:It's more than 5 attempts to get the success for easy program. What are the best methods to study and write successfully?


I won't be original here, but that's normal. Over the time you'll develop your senses what likely can go wrong in your so called "easy" programs and you'll be able to recognise those beforehand execution.

Other than that, you'll face problem solving failures in your career more often than you think. When you get more experience, you'll find yourself spending more time in planning and thinking about the problem, than you actually bang the keyboard. That will reduce surprises along the way, but won't eliminate unforeseen issues completely. The key would be, that you'd allocate some buffer for those.
1 week ago
Since you posted not in the beginners forum, why you don't write unit tests so you could verify each and every method?

I didn't look at whole code flow.. but your goal is to narrow down the problem and replicate scenario which would be easy to understand.
2 weeks ago
Lines 119; 120
Potentially last here is null.
2 weeks ago

Paul Clapham wrote:Peri-peri was our favourite flavour when we were there.


These days these are called chicken shops here in London (UK). When I came to UK it used to be 2£ for 6 chicken wings (of length of your small finger) and fries (not chips) and a drink of your choice (pepsi/7up/mirinda). Now prices gone up, in most places 5£ or more.

3 weeks ago
[rant]
Today was 47522347th case when I tried to copy text from IntelliJ's Markup preview and again failed. Can't think of a good reason why it is not a feature.
[/rant]
3 weeks ago
I'd suggest your kid registers here and asks a lot of questions along the way. I got a lot of knowledge from here simply by seeing things floating around and using them as an indication what I need to study/research/learn.

When starting out, you normally don't know where to start and what you need to learn, so forums (like coderanch) do help, in addition to that moderators watch the content, so one can get a better sense which posts along with content are of a better quality. Books are great, but not always can draw you a clear picture, a lot books what I came across at the beginning gave an understanding about individual pieces of a puzzle (which is also very important), but forums like this (and especially this), helped to get a practical understanding of how to paint canvas, think of this learning as "how to use skyscraper tools applied to a kennel size problems".

Another important aspect might be, that forums like this have a mixture of academia strength as well as industry - so really students can get a better grasp what's expected on both sides and how to enable both parts of the knowledge to work together.
3 weeks ago
I am sorry, but I'm confused with the code you posting. Every time seem to be significantly different.

Can we narrow down the problem so it is easier to discuss and follow? Or maybe ask concrete questions about the problem/code before it gets messy.
3 weeks ago