Kelvin Okornoe

Ranch Hand
+ Follow
since Mar 18, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kelvin Okornoe

Attached is a snippet of the Json data and how the data is formatted in the textview.

I need help on how to do it correctly
3 years ago




3 years ago
Thank you for the suggestion so far, I have noted them.
Am still working on the program and I will be posting it here for more reviews.
Thank you.
3 years ago
Am currently working on a project from JetBrains Academy which requires me to read a file containing a matrix and reduce it into reduced row echelon form.
The project requirement can be found here https://hyperskill.org/projects/40/stages/211/implement

This is my current implementation, it only reads the file into two dimensional integer array.

Any recommendations to make the current implementation robust will be appreciated.



This how the content of the file looks like
The first line determines the row length of the matrix
3
1 1 2 9
2 4 -3 1
3 6 -5 0

Thank you.
3 years ago
I am adding a method to count the number of syllables in a word.
This is my implementation so far.



I need a review to make it better and more rigorous.
Thank you
3 years ago

Liutauras Vilda wrote:For the moment let's assume your calculations are correct.

Do you think would be better if you'd create a class similar reading to TextStatistics, to which you could pass potentially a text or file and be able to:

TextStatistics myFavouriteBook = new TextStatistics(text);
or



Yes! I will do that.
Thank you
3 years ago
Current state of the code.

3 years ago

Liutauras Vilda wrote:

Kelvin Okornoe wrote:Am I allowed to reference the code from github? So I don't keep re-posting the code here.


You are, just not all people will be interested to click on the link and go "somewhere". And to keep discussion and the tangible asset on the forum might be useful for future readers, while your Git repository technically can get demolished at any given point in time.



I understand. Thank you,
3 years ago

Liutauras Vilda wrote:1. coderanch is a forum! Cozy one.
2. coderanchisaforum!Cozyone.

When you split by ! you get array with elements:
1. [coderanch is a forum] [Cozy one.]
2. [coderanchisaforum] [Cozyone.]

So what do you achieve by removing all the spaces?

Only the first and last spaces might affect the result, so really trim() (removes leading and trailing spaces) might be the wise thing to do right after reading the file.



Okay, I think I get the idea.

Thank you
3 years ago
Am I allowed to reference the code from github? So I don't keep re-posting the code here.
3 years ago

Liutauras Vilda wrote:

Kelvin Okornoe wrote:Current Implementation


As Campbell asked, what do you achieve by removing all the spaces before counting sentences? Perhaps trim() would be enough?



I am not getting the understanding. Please throw more light
3 years ago

Liutauras Vilda wrote:


This bit. String has length() method. So perhaps you don't need to convert to char array too.



Yes!, That will be more efficient.
Thank you
3 years ago
Current Implementation. Bug fixed!

3 years ago

Liutauras Vilda wrote:@OP

Run through your sentences counting this nonsensical: "Done! A boy with toy. Really? Yes... Oh boy!"

I counted 5 sentences. How many you got?



haha!, I got 7 from my code...It should be five.

The bug is probably coming from the regexp.

Thank you soo much, I will fix it.
3 years ago

Campbell Ritchie wrote:Afraid I don't like the technique of getting rid of all the spaces. There must be a simpler way to count sentences than that. Much simpler.
Similarly I don't like that way of counting printing characters. The definition of line end characters given in your first post is incorrect, and won't work on a Windows® machine.



Any ideas on how to count the sentences? Please.
3 years ago