Chris Barrett

Bartender
+ Follow
since Dec 05, 2013
Chris likes ...
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
24
In last 30 days
0
Total given
2
Likes
Total received
132
Received in last 30 days
0
Total given
116
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Rancher Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by Chris Barrett

I don’t believe the first screenshot is MVC. That looks more like MVP (Model View Presenter). In MVP, the Presenter is both Active View and Controller (while the V in MVP is an interface View).

MVP is a derivative of MVC used in .NET apps. I’ve had to use it in C# with Window Form apps, but never seen it used in Java. At least in my experience, MVP can lead to code duplication as each Windows Form is siloed from other Windows Forms.
Can anyone shed light on why you would want to return an immutable list (or map, or set)?

Just spent the afternoon working on a legacy system that had some sweet logic like:

Which, years later, was used like:

And everything worked until BarImpl's constructor got passed an null. Of course, there were a bunch more layers between the constructor call and the attempt to add to the immutable List.

As I contemplate replacing a bunch of emptyList() with ArrayList<>() so that no one can accidentally add to an immutable List I'm left to wonder when does it make sense to create an immutable List and how would you stop future users of your class from making the same mistake as above?

Cheers!
Chris
6 years ago
Hi Dana,

As the exception name would indicate, NoSuchElementException, usually means that the element wasn't present on the page when Selenium attempted to find it.
(Link here to the  org.openqa.selenium.NoSuchElementException API as the link above will go to  java.util.NoSuchElementException ).

Two common reasons:
  • It's a totally valid error. Someone changed the page and either deleted the element or accidentally changed the id. If that was the case, you would want to know.  
  • Selenium tried processing the page before the page was fully loaded.

  • In your case, since the test sometimes pass, I would think it's the second reason.

    Are you using a WebDriverWait statement to make sure the element has loaded before Selenium attempts to access?

    While you could use that to reference the specific id in question, a better approach is to put at the very bottom of the page (usually through a shared footer or something just before the </body>) a placeholder id for WebDriverWait to hook into:
    <div id="wait_holder"></div>

    Cheers!
    7 years ago
    Hi Maribeth,

    Welcome to the Ranch!

    Which version of Java have you installed, and did you install the JRE (Java Runtime Environment), or the JDK (Java Development Kit)?

    The JRE only includes the software needed to execute (run) Java applications. To compile Java source code into a runnable program using javac, you need to have the Java Development Kit (JDK) installed. Just Google "jdk java 8" and you'll find the link right away.
    7 years ago
    I would start by double checking the two references match. The validatorId value should match the value of the @FacesValidator annotation that registers the validator.

    Take a close look at the code you posted, and you'll note that one is employeeTitleValidater and the other is employeeTitleValidate

    Oh, and I would recommend you use the fully qualified name in order to eliminate any chance of ambiguity.
    7 years ago
    JSF
    Hi Michael,

    Welcome to the Ranch!

    The tutorial you are following may indeed have been written using a different version of Java, but that generally wouldn't matter. Usually with tutorials, it would only be an issue if you were using a version of Java older than the version the tutorial was written. And even then, unless this is a very old tutorial, most tutorials written in Java 5, 6, or 7 should work fine against Java 8.

    Have you defined a main method using the signature exactly as provided in the error message?

    The main method provides an execution entry point for your program. Without one, or if there are any mistakes in the signature ( such as writing the method name as 'man' instead of 'main', or writing the parameter type as a String instead of a String[] ), the Java runtime won't understand where to begin. So, I would start your debugging process.

    Unless this is a JavaFX application. Then the process would be different as the error message indicated.
    7 years ago

    Jack Goodman wrote:I can't find normal free online courses about HTML/css. Can you recommend something please?



    Coursera offers many free university level courses - including HTML & CSS, such as: https://www.coursera.org/courses?languages=en&query=html
    If you prefer setting your own pace, Code Academy offers free introduction courses: https://www.codecademy.com/learn/web
    7 years ago
    Hi Jack,

    Welcome to the Ranch! I did something similar as you - I had a career in finance, but I loved technology, and just recently completed that transition to a software engineer with a major firm. I also worked part-time as a web developer while putting myself through night school to learn the skills.

    In my experience, it is incredibly difficult to make money as an freelance web-developer. The barrier to entry is super low (a cheap computer, some understanding of HTML, CSS and WordPress). In addition to what Jeanne said, as a web developer with limited experience, you will also learn "exciting" terms like scope creep when dealing with clients. Scope creep killed my profitability all the time - I found myself agreeing to a "simple" build that I guessed (having had no experience) would take 10 or 15 hours for $500. I would also rush to build before having really locked the client down to a design (imagine building a house and then having the client say, "Yeah, that's not what I was thinking it would look like..."). Builds would often run 30 hours or more in length. And since I knew nothing about contracts, and didn't want to upset the client, etc... my hourly income was well below that of McDonald's. And the income is very intermittent.

    What eventually worked for me was I started spending a lot of time on WordPress free support forums posting helpful solutions. That gave me a "portfolio" of solutions that highlighted my professionalism and ability to articulate with different types of users. I used that "portfolio" to approach some of the professional WordPress theme developers (you can find many WordPress commercial market sites if you search Google) to see if I could help in their support forums. These are generally private forums that the developers' paying clients use for support posting. Often developers are obligated under marketplace rules to provide support, but many freelance developers don't really want to do it. They were happy to "unload" the support under their watchful eye. I started doing that a few hours a day, which gave me a predictable income stream. As I got to know the theme developers, I was able to learn more and more, plus they became references when I finished school.

    Not sure if that approach will work for you, but might be worth trying. Good luck!
    7 years ago

    chenchih lee wrote:Do anyone have any idea what should i changed in order to let all browser can used.
    I don't really know how to used jquery.


    Sorry, but what you need to change is the technology being used. You need to choose a technology that is supported by default by all browsers. That is not ActiveX. That is JQuery/JavaScript.

    Maybe you wonder why non-IE browsers don't support ActiveX?

    Firefox does not support ActiveX technology for multiple reasons.
  • ActiveX is only available on Windows operating systems, and as a result webpages that require it will not work on Linux or Mac.
  • ActiveX integration with the Windows operating system has made it a target for malicious software.

  • That's direct from Mozilla, makers of Firefox: https://support.mozilla.org/en-US/kb/ActiveX

    Paul Clapham wrote:I'd be interested to see how that works, because if you pick any integer, there are zillions of different Strings which have that integer as their hashcode.



    Because I was curious, too. I did some Googling. On the surface:
    The switch statement compares the String object in its expression with the expressions associated with each case label as if it were using the String.equals method; consequently, the comparison of String objects in switch statements is case sensitive. The Java compiler generates generally more efficient bytecode from switch statements that use String objects than from chained if-then-else statements.
    For reference: http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html

    At the nuts & bolts (JVM) level:
    The general approach used is to translate a single string switch statement into a series of two chained switch statements: the first a synthesized statement switching on the argument string's hash value and computing a string's position in the list of original case labels, if any, followed by a second switch on the computed integer value.  The second switch has the same code structure as the original string switch statement except that the string case labels are replaced with positional integer constants starting at 0. The first switch statement can be thought of as an inlined map from strings to their position in the case label list.  An alternate implementation would use an actual Map for this purpose, as done for enum switches. ... The generated code assumes that the hashing algorithm of String is the same in the compilation environment as in the environment the code will run in.  The string hashing algorithm in the SE JDK has been unchanged since at least JDK 1.2.  Since the algorithm has been specified since that release as well, it is very unlikely to be changed in the future.  Different hashing algorithms, such as the length of the strings or a perfect hashing algorithm over the particular set of case labels, could potentially be used instead of String.hashCode.
    For reference: http://hg.openjdk.java.net/jdk7u/jdk7u/langtools/file/41b81b3e37cd/src/share/classes/com/sun/tools/javac/comp/Lower.java#l3397
    7 years ago
    It's legit. It's not SPAM.

    Eric Ligman, Microsoft Director of Sales Excellence, hosts an annual free eBook give away on his blog.
    Topics include: Windows 10, Office 365, Office 2016, Power BI, Azure, Windows 8.1, Office 2013, SharePoint 2016, SharePoint 2013, Dynamics CRM, PowerShell, Exchange Server, System Center, Cloud, SQL Server.
    https://blogs.msdn.microsoft.com/mssmallbiz/2016/07/10/free-thats-right-im-giving-away-millions-of-free-microsoft-ebooks-again-including-windows-10-office-365-office-2016-power-bi-azure-windows-8-1-office-2013-sharepoint-2016-sha/
    7 years ago
    Hi Shakku,

    Welcome to the Ranch!

    I have not tried compiling your program, but I'm curious to know about this part:



    Why is that part needed?  It seems to be overly complex and the lack of {} makes following the blocks difficult.
    7 years ago
    Hi Ronald,

    Welcome to the Ranch!

    Java DB is included in the JDK from Java 6 onwards. It's an embedded database, meaning if you compile your program for distribution to a user, the database will be included. It works great for small, standalone type apps. PostgreSQL or MySQL are not required to use Java DB. PostgreSQL or MySQL would require more complex configuration setups, so if your goal is to learn Java not databases, I would stick with Java DB for the time being. Once you are comfortable with how Java works with databases, then look at learning to configure a PostgreSQL or MySQL database for connection to Java.

    I wouldn't say Java DB is another name for Apache Derby, though, technically. The Java DB product includes Derby without any modification whatsoever to the underlying source code, but I believe Oracle has added wrapper code to help simplify the configuration with Java. From a usability perspective, Java DB and Derby have the same functionality and therefore the Java DB documentation often refers to the core functionality as Derby.

    fred rosenberger wrote:The point is, PMG was responsible for us doing something together, using our GPS to find stuff.


    A friend of mine spent three hours on Sunday with her son wandering their community looking for Pokemon. Her son asked strangers for help, made eye contact, learned to use the map, and talked animatedly with his mom about Pokemons. Her son is 7. He is autistic. Any game that can do that is great.
    7 years 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/    |