Oceas Anderson

Greenhorn
+ Follow
since Feb 21, 2014
Oceas likes ...
Android Chrome Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Oceas Anderson

What kind of framework are you using to make your "web gui"? If it was made in JSF or JSP you might get better assistance referring moving this to those specific sub-forums.

Campbell Ritchie wrote:I am not at all convinced that is the way I would do that. You can do largest, smallest, average or total without recording the numbers anywhere.



Good point, when writing up the example it just seemed to be the simplest at the time but I imagine a cleaner solution would be to store the first value inputted and then compare the value of the next system input to the current recorded smallest value and replace it if it is a smaller value.
3 years ago
The requirements are pretty straight forward but perhaps a more detailed console output on what the final product can look like will help clarify for you.


Console
----------
"How many integers are you inputting?"
3 <- Record number of expected numbers
40<- Record each integer input most likely stored in an array or another collection type
20<- Record each integer input most likely stored in an array or another collection type
79<- Record each integer input most likely stored in an array or another collection type

"The smallest integer is 20" <- Output to the user the smallest integer that they inputted


3 years ago
Welcome to Java Ranch and the world of Java in general!

I myself am a student in University for Computer Science and have an internship working with EE Java development on a daily basis for the past year now. I sadly do not have the proper knowledge in recommending if formal classroom lecturing is required for certifications so I'll leave that to some more experienced.

As for good material to start learning Java I highly reocmmend a youtuber MyBringBack who has a Java tutorial series which teaches alot of the core fundamentals from variables to threads and even basic gui deisgn https://www.youtube.com/watch?v=fEApt1B8ycs&list=PL691F825EFC74A181 . The time it took me to become proficient was about two months to get the core java skillset to work on my own projects but depending on what aspects of Java such as Java Swing developement or Java Server Faces this time can greatly increase for me learning JSF has taken close to six months focusing just on it to become really skilled in it.

I hope this helps and good luck!
4 years ago
Yes the file was being found and was easily displayed however I have resolved the issue thank you for your response.
I currently am having a hard time trying to read metadata from a .jpg file with javascript. The goal is to store a caption for a particular image in the "title" field of meta data for a .jpg image and read it to display on a web applet. I've looked into ImageInfo and what few examples I could find do not seem to work and I'm finding any kind of documentation for it sparse. At this point I'm completely at a loss at where to look (and yes we really have to use javascript for this) thank you very much in advance.

Edit: Here are two code snippet attempts I have made


One easy method would be to iterate through using a simple for loop after your length comparison statement to guarantee they are the same size. And cycle through comparing the integers at each index on both arrays if a match is found then simply increment a int sum.

Also try to UseCodeTags to make it easier for your code to be viewed.
4 years ago

Tim Holloway wrote:Incidentally, putting JavaScript or CSS inline in a View Template can be a real pain, so I normally only do it for testing purposes. To be absolutely safe, I wrap such constructs in an XML CDATA within a JSF f:verbatim tag.

Definitely use "!important" to override CSS, but first check to see if the styleClass you're using is correct. JSF frameworks typically provide a standardized set of abstract CSS styles for their controls, and when you "skin" an app, those are the actual classes you want to override, not the low-level stuff.



I have tried the correction of the css to just be its name and not file name in two different versions and still I don't see any change in the look("beyond in-line ofc"). The following in an exert of what I made for revisions.

First .xhtml revision


Second .xhtml revision


Following .css file stored in a folder css/masterPW.css



@Tim Halloway: To my understanding your saying that there may be some elements such as pf:commandlink that even though have in-line .css file added there might have a default .css class that super cedes it? If that is the case where could you possible find this. The only confusing part I can e with this though is that another element works as desired (show below) on the same .xhtml file as my commandlink above but I suppose it acts differently since one it default jsf and not pf.


4 years ago
JSF
Currently I am having difficulties styling a particular prime faces element in a JSF application for work. I'm tasked with giving the ui a styling and color scheme acceptable to our project design. However I am finding myself unable to "hook" a particular pf element with an ID so that I can proceed with styling a imported .css file. Any suggestions on how this can be done?

I'm trying to style the commandLink button to display in Orange 20px font with Italic but when I inspect the element in chrome after being rendered It doesn't even show its style linked to the assigned ID. The class style for mainMenuItem is being applied to the commandlink but is immediately over written by ui-widget. I'm trying to style that one single component(override/replace ui-widget with the properties in the #loggedInUserID)

Current .XHTML code and the css file has been linked with


Current CSS code
4 years ago
JSF
Currently I have sorted the array to check to see if there is a straight, not I'm trying to do a two pair. However I'm not entirely sure on how to make sure I get to distinct pairs and not a three of a kind. Down bellow is currently what I have but still not finished




5 years ago

Tony Docherty wrote:

Oceas Anderson wrote:

Joel Christophel wrote:
^That is about to become your best friend. Once your array is in ascending order, things obviously become a lot easier. I'd even recommend you using this to redo your current method for finding one pair, and you can even combine it with finding two pairs. Straights also become much, much easier once the numbers are ordered. Good luck! If you get stuck, you can feel free to ask.



That definitely will make things much easier for a straight. Thanks and I most likely will but Ill implement this part first.


Joel gave you some excellent advice, I suggest you take it before "implementing this part first".

Think about how you would check for pairs, triples etc if the hand is in order.



Alright that is actually my next step. However I found that my issue was that if the first hand was declared a pair in the result string. When the second hand was evaluated since it wasn't reset, even if a pair was not found it will still return the value pair from the first hand.
5 years ago

For some reason for my second hand I'm getting some pairs declared for invalid hand combinations. Such as (7,Queen,2,Ace, 8), and (7,10,4,2,13) having a pair. I'm thinking during the loop a single card is compared to itself but I don't see how. Anyone else spot a reason?

Queen = 12
Ace = 1

5 years ago

Joel Christophel wrote:
^That is about to become your best friend. Once your array is in ascending order, things obviously become a lot easier. I'd even recommend you using this to redo your current method for finding one pair, and you can even combine it with finding two pairs. Straights also become much, much easier once the numbers are ordered. Good luck! If you get stuck, you can feel free to ask.



That definitely will make things much easier for a straight. Thanks and I most likely will but Ill implement this part first.
5 years ago
Currently I am writing a java program where it creates a deck and shuffles it to deal out two hands. I then need to evaluate each hand to determine what set value each hand has such as (pair, two pair, three of a kind, four of a kind, straight, or flush) I can ignore high cards straight flushes, royal flushes, and rivers. Currently I am having a hard time coming up with the syntax for two pair and straight and suggestions? This part can be found in the class file DeckOfCards in the method getHandValue.

Main.java


Card.java


DeckOfCards.java
5 years ago

Stuart A. Burkett wrote:

Oceas Anderson wrote:Thank you, and that did work.


No. Get rid of the for loop. The first time in the for loop, the while loop will ensure that the whole file is read. The next 9999 through the loop will then just confirm that there is nothing left to read from the file.

If the file may be bigger than 10000 lines and you only want to read the first 10000, then you need to modify your while loop to inclde that check - your code at the moment doesn't do that.




Corrected



And even though this works for displaying out the entire document is their a way to just simply call for the next character? I'm needing to do a encryption for each letter but plaintText.input.nextChar() doesn't seem to exist the ("nextChar()") part.
I'm really wanting to store all the characters into a array for the while. So that I can then use the hill cipher and encrypt it using the matrix input file that does work. Thanks in advanced .
5 years ago