Campbell Ritchie

Marshal
+ Follow
since Oct 13, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
377
In last 30 days
0
Total given
1140
Likes
Total received
8662
Received in last 30 days
10
Total given
707
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
Rancher Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by Campbell Ritchie

Consider putting the breeds into an enum and you can use an EnumSet, and you might get even faster execution.
3 days ago
Surely you would put those Strings into a Set<String> rather than a List? A HashSet will permit nice fast searches. Even faster if the Strings are interned and can therefore cache their hash codes.
3 days ago

Mike Simmons wrote:. . . they work fine for this problem.

I would say both those Comparator λs are incorrect. The range of arguments they are being tested on is too small to detect the error. You can read about object ordering in the Java™ Tutorials, which will tell you the correct thing to write. You can simply write Comparator<Integer> comp = Comparator.naturalOrder(); beausee Integer has a natural ordering.
There is another method in Comparator for ordering in reverse.
All these suggestions won't accept nulls without throwing exceptions.
3 days ago

sai rama krishna wrote:. . .

The method write(int) in the type BufferedWriter is not applicable for the arguments (Object)

. . .

There isn't an overloading of that name taking Object as an argument. It will take a String, however, so change to writer.write(s.toString()); to or similar.
You are opening and closing your resources incorrectly. Don't call close() if you can use try-with-resources instead. You should be able to close writers, result sets, connections and statements like that. If an exception is thrown anywhere, those resources might fail to close the way you wrote them.
Don't use the buffered writer constructor; use this or another newer program as you will find in the Java™ Tutorials instead.
3 days ago

tangara goh wrote:. . . i just have to grab the method reference from the Object in this case is it s method that is coming from FizzBuzz the class object.

That sounds very confused; you don't grab a method but use the method reference to instrut the λ what to do. Saying, “class object” suggests you don't understand where the method it. I suspect it is static and therefor doesn't involve an object at all.
I haven't looked in my copy of Urma Fusco and Mycroft; please remind us briefly what is on page 125.

Thanks.

That's a pleasure
4 days ago

tangara goh wrote:

Ira Go wrote:. . . function call . . .

. . . function call . . . .

It means, “method reference.”
The user of an object needs to know what its methods are. I suspect FizzBuzz is written incorrectly and has static methods, so it is used in a non‑object‑oriented fashion. If U you look up FizzBuzz it will probably have a method likeIt takes an int in and returns a String, so, as IG said, it turns an IntStream into a Stream<String> if used by the getStringForNum(int) method.
Are you looking at Urma Fusco and Mycroft as I suggested a few weeks ago? What does it say about the Map() method? The mapToObj() method is similar. Have you read about IntFunction?
4 days ago

tangara goh wrote:Please note "U" is not allowed so i have no choice but to changed it to YOU

Change it to &#x55; If you look up Unicode, you will find that 55 is U. Hexadecimal numbers, of course.
4 days ago

Ab Burda wrote:. . . thank you for your time. . . .

That's a pleasure
6 days ago
Please avoid initialising individual elements of an array, even more so of arrays of arrays. Note the array of arrays in Java® is different from the 2D array in some other languages.
Use an array initialiser. Much more reliable and much less error‑prone because it is difficult to miss out an index.Note how awkward it is to get the elements to align vertically; a text editor with monospaced type will probably make that easier to achieve. Note also a design problem that you have so many blank Strings there. I can see another design problem, which you can find out more about here. 13lb is not a String, but a weight. It should be implemented by a number, and you will need to make your array into an Object[]. It would be better, I think, to create an Armour class and use an Armour[] to populate the table.
6 days ago

Ira Go wrote:. . . Bit handling in Java is not straight-forward. . . .

Bit‑twiddling is never straightforward. But let me repeat what I have said several time already: do arithmetic, which I am taking to include bit‑twiddling, with ints and longs only.
The implicit cast to (byte) in the above code won't work at all well if you start with a negative value. Try it.
Conclusion confine arithmetic to ints and longs.

Ira Go wrote:. . . is there any way to do unsigned right shift on a byte, for example, just with >>> in one go? . . .

Ira Go wrote:. . .  (or any other binary numeric operator, in this case). They follow numeric promotion

All arithmetic operators use promotion.

. . . is there any way to do unsigned right shift on a byte, for example, just with >>> in one go?

Why would you want to do arithmetic, including shifts, on a byte? Confine your use of byte and shorts to certification exams and only use ints and longs for arithmetic. On the other hand, a byte[] is something useful because you can send it across a network.
Please avoid the quote button; it simply duplicates what has been written before and adds nothing new. Duplicated material is liable to removal.
Please don't edit posts after they have been replied to because that makes it difficult to follow the thread. Please post new material in a new post.
Please check your GitHub link in case it exposes internal policies you would want to keep hidden.
1 week ago


vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |