Pete Letkeman

Saloon Keeper
+ Follow
since Jul 06, 2017
Pete likes ...
Android Chrome IntelliJ IDE Java MySQL Database
Canada
Cows and Likes
Cows
Total received
74
In last 30 days
6
Total given
34
Likes
Total received
391
Received in last 30 days
11
Total given
79
Given in last 30 days
8
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Pete Letkeman

I'll see if I can step though the code tomorrow to see if I can pinpoint the issue.
I have noticed before what with some SAP software which uses Java that there is a limitation as to how long a directory name can be.
Other people have programmed against SAP software have also noticed this issue.

SAP is a rather large company which has annual revenue of more then a few million with many developers so I would not have expected them to ship software products with this limitation.
The last time I ran into this issue was about three years ago when I was programming a widget for a SAP project using Java and JavaScript.
1 minute ago
Working a existing Java 8 project and there is a plain text configuration file which has an entry that points to the front end html pages.
The full entry is something like
cms.dashboard=c:\\folder1\\folder2\\folder3
When others use the same project and but use a short values for the directory names it works fine e.g.
cms.dashboard=c:\\users\\ed.smith\\dashboard
However when I tried to use with with a longer directory name the program would not work as expected. I used something like
cms.dashboard=c:\\users\\peter.letkeman\\dashboard
Note that my directory name is much longer then the others provided, but that is the only thing which changed and everything else stayed the same.

Is there a limitation as to how long a directory name can be according to Java? If so, is there a programming work around for this?

This may be related to the NIO libraries or it could simply be bad programming.
I do not have full access to the project source code yet or when I'm at home as I am currently.
3 hours ago
You are correct Norm, thanks.
22 hours ago
Some initial thoughts on what objects we may need and what are some of their properties:
  • Card Object:
    • Each card has a suit
    • Each card has a letter/number value
  • Deck Object:
    • Each deck as a collection of cards
    • The collection of cards could be randomly ordered or order by suit then by letter/number
  • Hand Object:
    • Each hand will have two or more cards.
    • The dealers hand will always be shown face up
  • Player Object:
    • Each player will have money for betting
    • First name
    • Other possible statistical data
    • History, even if it is only session history which is reset after each start of the program
  • Game Rules Object:
    • Each rule will affect who the game is played in some way. This could a be a good use case for interfaces
  • Game Object:
    • One dealer
    • One or more players
    • One or more decks
    • A collection of money bet on the game
    • A collection of game rules
    • History

This is not a final listing of all the objects and their properties and this could easily change.

My preference is to start with the smallest unit and go from there.
  • You can't have a game without any rules, players and decks.
  • Players can have names, and a collection of cards (hands).
  • Without any cards you cannot not have any hands/decks.

  • As for behaviors we need to think about things like:
  • What can a player do and what can a dealer do?
  • These are two have some common behaviors, like add card to hand, bet, win game etc.
  • However they also have unique behaviors like deal, split, shuffle, etc.

  • Aside from the dealer and the players we have other classes/objects and things to plan for.
    Also, what behavior belongs to what object? Some times a behavior could be for more then one object.
    Given that we need to make sure that they are named differently if they different behaviors or if they are the same, then maybe we need to create an interface or an abstract class.

    Usually you will discuss some of these details with other members of your team.
    These is only a snapshot into how I think about things and it may not be the same as the way you think about things which is totally fine.
    1 day ago
    Is the SDK level (Android version) used for your program in Android Studio the same as your physical device?
    Have you gotten around to use the HDPI, LDPI layout directories?
    What is the type of view for your root view?
    How are you positioning the elements (absolute, relative)?
    How are you spacing/placing the elements using DP, Pixels, etc?
    3 days ago
    How did you assign the IDs to the layout elements? Did you assign them using the XML view or the GUI layout view?
    I suspect that the XML view would do a better job.

    For your root view what are you using (listview, textview,  constrained, frame, etc)?
    How are you setting up your view (relative, absolute, etc)?

    Remember the that more number of views that you have the longer Android will take to respond and render.
    Try your best to not use nested views.
    3 days ago
    This is a great starting point, keep up the good work.

    Adrian Grabowski wrote:Ok, so that's how I see it, I'm a newbie so please don't laugh.

    The CodeRanch BeNice rule is in effect for all postings on CodeRanch, so no one is going to laugh.
    If or when they do they risk having their post be deleted and their account be closed.

    Adrian Grabowski wrote:AFAIK Blackjack uses standard 52 card deck.

    The rules and setup for the game are explained in the Wiki article in the first post.
    You are correct, that a 52 card deck is used, but more advanced games allow for more then one deck to be used.

    You have some great properties, but objects need to interact with each other some how using actions and behaviors. 
    Here are some possible behaviors and/or actions to think about:
  • Can any player be the dealer and what does the dealer do as they are not a normal player?
  • What does the player do as they are not the dealer?
  • How do you determine the winner of the game?
  • How do you determine the when the game is over?
  • How do you determine if the player can be dealt another card? At some point in time the player will be over 21.

  • How would you implement game rules? The least of which is how much you can bet.
    There are also different game rules and styles as list in the Wikipedia for those who want to go into more advanced programming/options.

    It is also important to not over complicate things. Sometimes you may not need an inner class or inner interface or feature x.
    Some features help with unit testing, but may not help with program design and vice versa.

    Once again, I think you have a great start and this planning phase can last anywhere from five minutes to a few hours for some projects so it is very important that this step not be skipped for any project.
    That said, it is not uncommon for the final objects/coding to not use follow the first plan all the way.
    This plan will be constantly refreshed as the needs on the project/client change and as the understanding of the project increases.

    I will post my objects definitions in a few days, which may not be the same as yours. Yours can be right, and mine can be right both at the same time because we are working on separate projects.  
    4 days ago
    You can do this all alone if you choose to or you can follow along with the Corral postings if you choose to. In the end it's up to you.
    I realize that not everyone is at the same skill level and that not everyone will be able to commit the same amount of time to the project.
    I will try to make at least some progress each week, and some weeks may haev more progress more then others.

    The first challenge that most people have to face is planning of the project, at least in very general terms.
    Java likes to use objects and object oriented programming has many different parts.

    What object do You suggest be used and what properties and behaviors do you think these objects should have?
    This can be small point form listing with only a few objects or this can be an extensive listing, the choice is yours.

    You should try to ask yourself some questions like the following when thinking about objects:
  • What is the minimum each object should do?
  • Would/should this be an abstract class?
  • Should I create any interfaces?
  • How would I write a unit test to verify that the methods or objects work as expected?
        Many people use BDD and/or TDD which can be somewhat hard to understand/implement as noted here.

  • These objects will change over the life of the project, but you should not simply write code without doing any planning.

    Please post your listing of objects to the Corral, maybe reply to this post. In a day or two I will post a break down of the objects and their properties as I see them.
    Your objects would be how you see them and that listing could be totally different then my listing and this is 100% okay.
    In a team environment you and your teammates would probably have to at least briefly discuss (maybe in a five minute meeting) what objects you plan on making.
    5 days ago
    I am not convinced that this feature is for me, I've been using Windows 10 for over two years now and I haven't had a need for this feature yet.
    I really don't see how it would increase my productivity/workflow enough or at all for me to use it.
    1 week ago
    I noticed that the github project you posted has a setup for both Gradle and Maven. Which dependency manager did you use Gradle or Maven?
    What if you tried the other one dependency manager out?
    Have you tried building the project which was not working using only command line tools?
    1 week ago
    As stated the first steps would be deciding if you need a relational database management system system (RDBMS) like MySQL, MS SQL Server or Postgre or if you would need a NoSQL system like MongoDB.
    RDBMS have been around for decades and usually does a very good job with structured data.
    Often times you will end up using some SQL (Structured Query Language) command for manipulating the data.
    NoSQL systems, which actually means Not Only Structured Query Languages, are usually used for unstructured data.
    Most NoSQL systems have their own proprietary commands for  manipulating the data which could vary a fair amount between systems.

    In today's world we have a lot of both structured and unstructured data, both of which are increasing daily.
    A system/site like a WordPress site would probably have a lot more structured data then unstructured data and therefor would probably use a RDBMS.
    Project management solutions like Trello would probably use NoSQL to store the much of their data which is probably unstructured.
    I suggest that instead of providing a single compressed file for download that you post the code on a site like https://github.com that way anyone who wants to view the code and made edits can quickly with their own github account.
    Currently, the link to the file you have provided could contain more then what is needed for the project or possibly may not contain the project at all.

    Please take the time to use the code tags when provided code as stated here https://coderanch.com/wiki/659781/Code-Tags.

    Sometimes colors in postings can be distracting, so generally you may want to use only one of the colors other then black.
    Please keep in mind that not all people view all the colors as expected (color blind) or other possible issues.

    Did the projects which you are working on locally on your system come from a tutorial somewhere? If so where?
    By providing the location others could put the projects into it's proper context which could be very helpful.

    I suggest that you stick with a newer version of Spring, something like 1.5 or maybe 2.0. I'm unsure if 1.3 is supported anymore, and there is an end date for 1.5.
    1 week ago
    Windows 10 came with Virtual Desktops. I know that some Linux systems have had this feature for many years before Windows got it.
    I suspect that the Mac system has this feature as well.

    But do you use it? If so, how do you have setup your virtual desktops?

    When I have too many programs open I find that my computer slows down, so I try to limit this.
    I know that "too many" is subjective and may change from user to user.
    Does Virtual Desktops encourage more open programs?

    Side note: I may not be a typical user:
  • I can remember Windows 3.1 and DOS 5.
  • I know about RAM, hard drive speed etc.

  • I'm genuinely interested if Virtual Desktops can help make you a more productive user/programmer and how it does it.
    1 week ago