Dawid Smith

+ Follow
since Dec 17, 2018
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 Dawid Smith

Tim Holloway wrote:

Dawid Smith wrote:
When it comes to actually practising, mirroring(reapeating after chosen person) worked for me much better than studying books about pronunciation.

You really shouldn't believe what books say, anyway. They frequently assert that certain sounds "don't exist" in Language X, but you can plainly hear them (although usually weakened) if you actually listen to native speakers.

And forget about pronouncing things as you read them. Virtually no languages pronounce exactly as written. Possibly excepting Standard Arabic, but that's a formal language, not a "natural" one. French is notorious for all the letters you don't pronounce, Polish managed to make "Lodz" pronounce as "wooz". Gaelic is a nightmare. And English is probably the grossest offender of them all, thanks to its habit of plundering words wholesale and more or less keeping their original spelling despite differences in how alphabets are used. And, of course due to the sound mutations over the centuries, even the native and Anglo-Saxon mother language contributions have only light correspondence to their present-day spelling.

Disclaimer : not a language expert here. Just trying to figure out the best ways to learn

"Łódź" is actually not the best example. It's pronounced the way it should be ; as "wodź". The last consonant can be confusing because there is no English equivalent of that kind of sound. Source : I am Polish . I am just nitpicking though. I am not sure if I get your point because the fact that something isn't pronounced the way it's written isn't a big problem if textbooks provide information about it. Let's take a common word like "comfortable" for example.  Here, in the British pronouncation, the "or" part in the middle is mute and I was instructed not to pronounce it. Perhaps, the better example would be Japanese language where discrepancy between reading and writing of certain words is common knowledge and it's being tought in every book/course.

I acknowledge the fact the languages are constantly evolving though and that,in my eyes, is one of the most important reasons why learning from native sources is so beneficial. I assume that the endgame of learning a language is to get as close as possible to a level of a native speaker. That means we have to embrace the modern version of a given language. Sometimes the textbooks just can't keep up with the pace.
1 week ago
I have 0 previous coding experience and I am in the middle of "Java: A Beginner’s Guide by Herbert Schildt".

pros :

-Challenging. Very quick jump from "hello world" to nested loops and things of this nature;
-writing style is relatively easy to understand for the most part;
-you can download code sheets used in the book;
-self-test at the end of each chapter;

cons :

-it actually doesn't seem to be aimed at begginers at coding because often times, the author makes  references to other programming languages. I assume the book is meant for begginers in Java in particular, not for beginners in CS/coding;
- it moves fast so, at least for me, it was necessary to practice a lot with every new concept learned. I have been constantly inventing exercises for myself. Also, recently I've been struggling with some concepts and had to ask for help on this very forum. I am not sure if this book is that good for self-learners
- apparently it doesn't cover some important topics like LinkedLists but I can't really make a judgement on it with my current skills.

1 week ago
English is my second language and it seems to me that,when it comes to speaking and pronunciation, listening to native media like podcasts, plays a big role. While listening, you are getting familiar with the language sound's system and after many hours, you start to develop good intuition of how the language is supposed to sound. Then, with that intuition, the practice of speaking becomes easier because you know how the phrase you want to say should sound and you can self-correct.

When it comes to actually practising, mirroring(reapeating after chosen person) worked for me much better than studying books about pronunciation.

Intrestingly enough, this is the way that all of us actually learned how to speak. We were listening and repeating. Of course, according to science, age plays a role in learning a language and specifically in acquiring an accent. With that being said, it's possible that we can still benefit from that observation and maybe try something else other than the textbooks.

I noticed big improvement in speaking ability after doing what I've described above for few months. So did a few of my English teaching friends. Maybe this approach would be good for you too. Good luck.
1 week ago

salvin francis wrote:Have a cow for sharing your implementation with us.
Typically, I would have suggested comparing the index for equality first since if both indexes are same, then the comparison is not needed. However, I see that doing this wont achieve much difference.
I think that your implementation is good given the constraints of the problem specified. Ideally, I would suggest not calculating "ar.length/2" for every iteration since it does not change. A more simpler implementation would be to send a cropped copy of the array to the next recursive call instead of the pairLocation.

Thank you for the feedback and the Cow. I didn't know it was a thing. I am going to try to modify the code according to your advice.

In the meantime, how would you guys go about testing such a method? I have 0 experience in this and previously linked "Evil Unit Testing" by Paul Wheaton seems too advanced for me now. Therefore, I attempted to write a program that would test isPalindrom() method before posting it. What it does is :
1)Generates random char array. The method allows us to decide how many char primitives will the array have as well as what range of ASCII characters will be used to create those arrays. I thought it would be useful for testing since repetition of char primitives is relevant to determine whether something is palindrom or not and that feature allows us to choose narrow range of ASCII characters to make repetition more frequent if desired.
2)Generates 2d array consisting of desired number of previosly generated random char arrays.

Here is the full code that includes isPalindrom method and the testing methods :

Do you think it's acceptable way of testing this method?
1 week ago

Paul Clapham wrote:

salvin francis wrote:The original question asks you to write: ...

Yes, the original post said

The method returns 1 if a[] is a palindrome, 0 otherwise.

But that's an icky design for Java, it looks like somebody was used to writing C and didn't know much Java. So I'd fully support returning a boolean value.

I forgot to mention that I intentionally made a change to boolean type following Campbell Ritchie's suggestion. He suspected that the exercise isn't intended to be solved in Java because of the required parameters. It turned out that he was correct. My bad for choosing wrong source for the exercises.
1 week ago
Thank you guys for all the suggestions. Also, I am very sorry to reply so late. I hope it won't look like I don't appreciate your help but sometimes real life gets in a way big time. Anyways, getting back to the problem. I attempted to correct the recursive method. Here it is :

I would love to hear your opinions
1 week ago
Hello. I am trying to solve a following problem : Write a recursive function that determines whether an array is a palindrome, where the array and its size are given as parameters. The method returns 1 if a[] is a palindrome, 0 otherwise. The exercise comes from : http://www.bowdoin.edu/~ltoma/teaching/cs107/spring05/recursion.html

I've got a solution that seems to work,but since recursion is difficult to me and I am self-studying, it would be great to get some feedback on it. Here it is :

1 month ago
Thank you very much, Carey. I now get it. I was confused about what classes and methods are destined to do.
2 months ago

Carey Brown wrote:Lines 24-28 are not enclosed inside a method where as main() encloses your other usage.

Thank you for the response. Could you clarify it a little bit? Embarrassed to admit it, but I don't get it.
3 months ago
Hello. I've encountered the following problem : I've created "getAverage" method and it works within MyClass but it doesn't within the firstsemester class. Here is the code :

the error is " <identifier> expected
   bestscores.getAverage(h,j); "

I could rewrite the code to make it work but I would like to understand why it doesn't work the way I wrote it since I've never used multiple classes in the program before. Any help will be greatly appreciated.
3 months ago
Thank you very much. Your explanations are what I was looking for. It seems pretty straightforward now. The code comes from Java: A Beginner's Guide, Sixth Edition by Herbert Schildt
5 months ago
I have a code from a book which aims to demonstrate the workings of two-dimensional array. There is,however, little to no explanation of the details. Here is a code :

I have a basic idea of what two-dimensional array is but I don't understand this part of a code : "ar[t][i] = (t*4)+i+1;" . How does it load the array with numbers?  
5 months ago