Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!

Liutauras Vilda

+ Follow
since Nov 12, 2014
Liutauras likes ...
Mac OS X VI Editor BSD Linux
Forum Moderator
London, United Kingdom
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 Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt

Recent posts by Liutauras Vilda

Could you please post actual code as a text rather than picture.
1 week ago
Welcome to the Ranch.

Please show us how far have you got. Please post the code if you wrote already some, or write down the algorithm steps you designed on a piece of paper.
1 week ago

John Knox wrote:Do we need to save the file name as best practice or it is not needed???

It does depend to most extent on the use case(s), one of which could be if client says: "No, we uploaded file only once", but you have an evidence in database, that filename logo.png was uploaded twice by the same client id, hence got overridden...
14logo.png2020-06-24 14:44:09
27company.jpeg2020-01-10 10:23:02
34logo.png2020-06-24 14:45:09

Thousands of reasons you'd want to store filename, and the same amount of reasons you wouldn't ever need it.
1 week ago
Welcome to the Ranch again

Sounds like a homework. As CR said, spend some time providing an evidence you already putted an effort in it, as this exercise seems to be for the purpose so you'd learn something.
1 week ago

And don't try to fight yourself which language to learn, which one is worth spending time on and which one isn't. Both languages worth knowing to some extent as they both have their use. However, principles behind the programming is what mostly matter, and they overlap a lot in both languages. Meaning if you can sufficiently write code in one, you would find yourself capable with some research to work with other language too.
1 week ago
Welcome to the Ranch! Enjoy the stay.
1 week ago
Nice to see you around, Steven!

Steven Moore wrote:... or Switch

See.. everyone has something in common
1 week ago
Consider also technique for such type of questions by eliminating some answers as obviuosly not considerable.
4 weeks ago

Well done on running and debugging your code, you seem to actually started solving a problem.

Just one note. Piet’s code is based on somewhat Java’s 9+ code, which Java version you are running on?
1 month ago

fred rosenberger wrote:think like a programmer

@OP, it just reminded me.

The book I read during my early studies days. It influenced me in a good way the way I think about programming. You may want to pick up a copy and you might would find it useful too. It is really just trying to deploy in your mind a simple technique how to solve any programming problems you may face, whether it big complex and complicated, or fairly small and simple problem. All of them get solved in a similar manner. Pretty much in the same way as guys were suggesting you in your threads.

(please find attached book pic)
1 month ago
John, you give such suggestions to people, who were ready to help you. Apparently they offer to spend their time and knowledge for free so could help some stranger.

Now, I hardly can imagine who'd wish to try to help you and not risk to get the same suggestion.

Tim is a senior member on these boards and one of most reputables actually, who demonstrate wide range of knowledge and helpfulness.
1 month ago

Ok, re-read once again. Yesterday I think I slightly misunderstood the text.

So really what you need to do is, let's assume a starting list contains a singular element of 480 chars, so you need to divide it in chunks of 40 chars (12 in total) and create two sublists with 6 chunks in each, right?

So my question is, what you can and what you can't do when a starting list contains 2 or more elements. Do those elements can be combined? Asking this, because that depends whether you efficiently would use those element spaces in each sublist.
1 month ago
Mark, were you told to use arrays (an array of arrays actually)?

I'd suggest a different approach.

1. Have class which represents that pair, like VideoGame. Find the name what that actually is
2. Have List<VideoGame> videoGames

So having similar to this setup, you wouldn't need to worry about the number of lines in a file, as List is an expanding data structure.

So during the read of line, you could parse line's content and extracting number of games and their price, and using that would initialize VideoGame or similar. Then all you'd need to be left to do, is to add it to videoGames collection: videoGames.add(game)

Would that be easier to work with?
1 month ago