Mike Simmons

Master Rancher
+ Follow
since Mar 05, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
74
In last 30 days
0
Total given
1
Likes
Total received
1071
Received in last 30 days
5
Total given
202
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
Rancher Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by Mike Simmons

(Though both of those have bugs in general, they work fine for this problem.)
Aside from trying a more modern JDK, don't overlook Ron's previous comment about how the documentation for File.length() may explain this, and recommends using Files.readAttributes() to see if there's an error message.  You can go further and print out additional diagnostic info that may help:
1 day ago
Kevin, what is this "j8" command that you're running?

I'm guessing it may be an alias for a Java 8 runtime.  If so, can you try any other JDKs?  Something more modern?  This may be something that's been fixed in other versions.
2 days ago
If they ever use 0 for 1900s, or 2 for 2100s, then one approach would be to take that original format as a decimal number, and add 19000000.

So 1240528 + 19000000 = 20240528.  Convert that back to a String and parse it using yyyyMMdd.  That way you can easily handle any date from 1900 on to... whenever, really.
3 days ago
1240528 is not a random example - it's today's date, 2024-05-28, formatted according to the format given in the original post, 1yyMMdd.  It contains no time info, only date.  This can be reversed to parse a given string as a LocalDate, e.g.
3 days ago

Ira Go wrote:XOR is so basic that it is possible it was not talked about much in the book.


I wouldn't say it's basic, exactly.  It's not just XOR, but bitwise XOR, and also the whole issue of how binary numbers work, and how to convert from binary to decimal and vice versa - at least for very small numbers, in this case.  That may be basic computer science, from an old-school perspective, but I think nowadays many programmers don't find much need to know those things, day to day.  How many extra pages would that take to cover, for those unfamiliar with those concepts?

The book does say:

For the exam, though, you don't need to know anything about numeric bitwise comparisons, so we'll leave that educational aspect to other books.


This seems like a totally reasonable decision, based on an unfortunately false premise, that such details will not be asked on the exam.  Probably, they were not asked much on previous versions of the exam, and it was thought that this would continue to be true.  But it seems the latest OCP 17 may indeed ask questions that depend on understanding bitwise operators.
Yeah, I don't have a copy of the book, but it's hard to imagine that they would simply skip how to create a Statement.  Unless they went directly to PreparedStatement instead?  The OCP 17 objectives do include (emphasis mine):

Accessing databases using JDBC

Create connections, create and execute basic, prepared and callable statements, process query results and control transactions using JDBC API


This is really the way to create a basic Statement.  Do they not show anything like that in the book?

From the table of contents:

Chapter 15: JDBC

  • Introducing Relational Databases and SQL
  • Introducing the Interfaces of JDBC
  • Connecting to a Database
  • Working with a PreparedStatement
  • Getting Data from a ResultSet
  • Calling a CallableStatement
  • Controlling Data with Transactions
  • Closing Database Resources
  • Summary
  • Exam Essentials
  • Review Questions

  • Hm, I guess it's possible they largely skipped Statement, and only spent time on PreparedStatement and CallableStatement.  Still, the original objective is pretty clear that creating and using a "basic" Statement should be understood as well.

    I wonder if the exam objectives have changed at all?
    It would have been nice if they pointed that out in the JavaDoc when they deprecated the class, but they did not.  However, the Changelog for Tomcat 9.0 does contain the helpful line

    Switch to using the Base64 encoder and decoder provided by the JRE rather than the version provided by Commons Codec. The internal fork of Commons Codec has been deprecated and will be removed in Tomcat 11.

    1 week ago
    I agree, Tim.  It seems that by trying to re-use similar code, they've created a more confusing situation that doesn't quite fit.  There's also more than just one "long form" and one "short form" - e.g. these are also possible, and equivalent to the first version:



    For a one-argument version, perhaps it would be easier to just replace b with a literal of some sort, and skip the "where did b come from?" confusion:
    Honestly, I've been finding the terminology very confusing for this one all along.

    What does a CaseRequestHandler represent?  Is it a case?  A request for a case?  A thing that handles a case?  Those seem like different roles, and this class feels like it might be confused about what its job is.  Does a "handler" handle only one case?  

    Is a case ID a unique thing in the database?  That is, does each case have a different ID?  That's the sort of thing I'd normally assume when I hear of an ID, but not sure here...

    Is this DefaultCaseFactory.CAR - is that an ID for one particular case or case request?  Or is it maybe a type of case or case request?

    (Does it have anything to do with an automobile?  Or some other kind of "CAR"?)

    (And what, roughly, is a Case?)

    Maybe those last ones should have been first.  I'm just having a hard time imagining a situation where this makes sense, so I'm checking assumptions.

    2 weeks ago
    I forget what the trick is to remove the < br /> nonsense - obviously, that wasn't in my original.
    2 weeks ago

    Campbell Ritchie wrote:But you can't use mapToInt() in the following scenario.


    Interestingly though, this code masks a rather inefficient implementation, which is roughly equivalent to:

    This is mostly OK... until we get to the

    which is concatenating a String inside a loop.  This is probably fine for a small number of iterations - in this case, we have just four elements.  But it's O(n*n) performance overall, because every single time we go through the loop, we're building a new String by recopying everything in the previous string, plus one more word.  As the string length increases, the performance just gets worse and worse.  Instead, we'd be much better off with

    Or

    Of course, this effect could also be achieved more easily with

    But that wasn't your point. ;)

    Campbell Ritchie wrote:By the way, read the documentation for reduce() and find out whywon't work correctly.


    Aside from the fact that String has no "-" operator defined?  I guess you meant using the Integer example from before, not the String version you just gave.
    2 weeks ago

    tangara goh wrote:Note: the oracle's site using map instead of stream() really stumbled me...or is there something I did not comprehend about that part that uses


    They aren't using map instead of stream.  They are using a map on a stream.  You don't see the call to the stream() method in their example - instead, they use a variable named "stream" to indicate that they're dealing with something that's already a stream. In your example, you still need the stream() call to convert a List to a Stream.  Compare these two possibilities:

    One gives you a List of Strings, while the other gives a List of Persons.  Which is correct will depend on what you need to do with this list - which do you need?

    2 weeks ago
    Actually I think Jack's original code is wrong, but Carey's code seems to match what Jack said he wants.  That is, in this original code:

    It seems that the condition in line 1 and the condition in line 5 (using the numbering in this post) are exactly opposite - which means that the else in line 8 will be active for the same condition as the original condition in line 1.  That is, if the caseID is not for a car, then you will cancel it, and you will create a case request for a CAR.  And if the caseID is for a car, you will do nothing.  So it's equivalent to this:

    I don't think that's what was intended, but it is what the original code does.  I think Carey's code is probably what you want here, instead.
    2 weeks ago
    Sorry, I meant to post LocalTime.of(7,0).  Or LocalTime.of(7,10) would be good, too.  I see how easy it is to slip in a value that doesn't quite make the point you want to make.


    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/    |