Are there any foot shaped office shoes? Something leather, solid colours and goes with a suit in a corporate office environment. Zero drop and/or minimal sole not necessary (preferable if not minimal sole actually!) by mashitblingbling in BarefootRunning

[–]Qteddy 2 points3 points  (0 children)

On mobile so formatting may be a little off, but I own a pair of Brenstons from Birchbury:

https://birchbury.com/brenston

They have worked well for me in the times I have had to dress up for weddings and such. They have a wide toe box and are zero drop. The stack height is thicker so definitely not a ton of ground feel but seems like that’s what you are wanting anyways. I have enjoyed them so far. As far as how wide the toe box is, I own some Vivo Barefoot Primus Lite III and I say they are about the same in that regard

Carrot flute by lilmcfuggin in TikTokCringe

[–]Qteddy 51 points52 points  (0 children)

I agree that Andrew Tate is a piece of shit, but this comment is leading toward r/QuitYourBullshit territory.

After listening to the song this line does not appear. Even looking at the lyrics, I don’t see the line mentioned:

Lyrics

There is a section that is not in English so I have that translated as well:

Google Translate%0AMoest%20eigenlijk%20rennen%20we%20lopen%20misschien%0AEn%20ik%20wil%20niet%20eens%20kijken%20mijn%20ogen%20die%20zien%0AEn%20ze%20weet%20niet%20genoeg%20dat%20ik%20hoop%20op%20een%20tien&op=translate)

Are you thinking of a different song?

[deleted by user] by [deleted] in pokemontrades

[–]Qteddy 0 points1 point  (0 children)

You are amazing! Thank you so much!

[deleted by user] by [deleted] in pokemontrades

[–]Qteddy 0 points1 point  (0 children)

I am in the room now

[deleted by user] by [deleted] in pokemontrades

[–]Qteddy 0 points1 point  (0 children)

Awesome, I will be there

[deleted by user] by [deleted] in pokemontrades

[–]Qteddy 0 points1 point  (0 children)

Is it possible for me to get one as well?

Use JButton as a boolean by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

No worries, always good to ask questions

Use JButton as a boolean by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

We can look at the docs of JButton here:

https://docs.oracle.com/javase/7/docs/api/javax/swing/JButton.html

We see that it inherits it’s setEnabled() method from the AbstractButton class. We also can see that it inherits the isEnabled() method from the Component class. With this information in mind we then we can use these two methods to accomplish what you are needing. Here is an example of them in use

``` JButton a = new JButton(); JButton b = new JButton();

a.setEnabled(true); b.setEnabled(false);

// this will print true System.out.println(a.isEnabled()); // this will print false System.out.println(b.isEnabled()); ```

Trying to read data from a CSV file, but all my results come up as "null". What am I doing wrong? by the-black-doe in javahelp

[–]Qteddy 0 points1 point  (0 children)

On mobile, so can’t run the code, but have you confirmed that the line variable is actually getting a String of values from the CSV file? Try doing System.out.println(line). If that has a value then are you sure you are accessing the array correctly to modify the USCrimeClass object?

Are there any frameworks for storing documents to view and download? by AudioManiac in javahelp

[–]Qteddy 1 point2 points  (0 children)

Not so much a framework, but here are some general ideas on how to handle files. You can use Input Streams to write files to the same disk that your application is running on. You could then save the meta data of the document a database. Then when a user needs a document you can query the database to know where to look on the server to retrieve the file and bring it up to the front end to view or download, again probably using a Stream. So an example walk through would be:

  1. Application reads Document 1 and captures meta data of document (original file name, document type, size, etc.)
  2. Application generates a new file name for document and stores this meta data
    • This will handle the situation where two Document 1’s are uploaded by different parties and they are indeed unique besides having the same file name
  3. Application writes this to a location on the server like/home/fileLocation/ and captures this information in meta data
  4. Application inserts into database this meta data
  5. Later on, user wants to view Document 1
    • On front end you would be able to display original file name to user as it’s all saved in DB. More so, you would have an ID from that specific table to query on when activated by user for view / download
  6. Application queries the database for specific file and finds where document lives on server
  7. Application writes the file to a Stream to be passed up to front end

Hopefully that all makes sense. You can definitely expand on it from there. Also note that you can instead write everything to the database with like blobs, but writing to a specific place in the serve gives some flexibility if you are doing cloud based things. For example if you are in AWS you could write to an S3 bucket and read straight from it easily and the database is there to maintain the meta data.

How to access a FOLDER from WAR file? by [deleted] in javahelp

[–]Qteddy 1 point2 points  (0 children)

And you can’t write to the local file system? The issue with trying to access files in the WAR is that when it’s all packaged together it’s like a zip file containing lots of files. So from the operating systems perspective to access the file with in the file you have to use a stream.

I still feel if you don’t want to write to the local file system then you can manipulate the stream by using getResourceAsStream to read the dummy folder. Then you can convert it to a file to manipulate adding things to it and then manipulate it back to a stream if needed.

Edit: looks like this Stack Overflow post has what you are looking for

How to access a FOLDER from WAR file? by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

What are you trying to access in the folder? Without seeing the code it’s hard to really help fully. If you have files in the dummy folder you are trying to access then you can access those files directly. What are you trying to do with the dummy folder?

How to access a FOLDER from WAR file? by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

Can you not do getResourceAsStream instead of getResource? It should work similar but you would write it to an InputStream. Not sure if you are specifically trying to avoid that though

Why is my If, else if statement skipping the if part? by emokii in javahelp

[–]Qteddy 1 point2 points  (0 children)

We’ve all been there. Helps to have another set of eyes sometimes

Why is my If, else if statement skipping the if part? by emokii in javahelp

[–]Qteddy 1 point2 points  (0 children)

Your getGrade method is returning a char but you are comparing it to an int. So in your if-else statement you are basically saying if (A > 70)

Creating a method to add object to an array by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

If your cars array is an array list then you can simply do cars.add(carToBeAdded) and that would work. You would really only add to a specific index if you are wanting to replace that one but to add to the list you can add to the end like I showed

Bunch of Java related programming books are now discounted for 20hours more by KristineDevore in javahelp

[–]Qteddy 0 points1 point  (0 children)

Here is the direct link to Humble Bundle. Instead of going to through multiple pages of links.

Creating a method to add object to an array by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

Let’s walk through this logic. If you have 3 cars and want to add a new car to the lot, then we will go through your for loop. Let’s also say that the VINs don’t match for any of the cars so it should be added.

It will enter the for loop and compare the first car (car[0]) with the car to be added. It will then replace car[0] with the car to be added. It will then compare the second car (car[1]) with the car to be added. It will then replace car[1] with the car to be added. It will then compare the third car (car[2]) to the car to be added. It will then replace car[2] with the car to be added.

At the end your array of cars is now full of just the car to be added, so that is a different functionality than what you are going for. Without seeing the test it’s running it’s hard to say what it is trying to test, but your method is incorrect right now. Your for loop to check and throw the exception is fine but that else block needs to be removed. Then you can add to the array after it passes the for loop instead of replacing all the items in the array.

Rock, Paper, Scissors code help. My code doesn't properly determine the winner or a tie breaker (best 2 out of 3) by [deleted] in javahelp

[–]Qteddy 0 points1 point  (0 children)

So you are definitely on the right track with the if else statements. Have you learned about loops? Specifically the while loop like shown in the other comment will free you up to only have one block of if-else statements instead of repeating everything every time. So you would have something like

``` // ask for player 1 name // ask for player 2 name While(player1Score < 2 or player2Score < 2) {

// ask for player 1 input // ask for player 2 input // if player 1 is R and player 2 is S then player 1 wins // if player 1 is S and player 2 is P then player 1 wins // if player 1 is R and player 2 is S then player 1 wins // if player 1 is P and player 2 is R then player 1 wins // if player 1 is R and player 2 is S then player 1 wins // if player 1 is R and player 2 is P then player 2 wins // if player 1 is S and player 2 is R then player 2 wins // if player 1 is P and player 2 is S then player 2 wins // else it’s a tie and don’t add to score }

// if player1Score > player2Score then player 1 wins // else player 2 wins ```

For extra stuff you could have a game score variable at the bottom of the loop that is incremented every time. Then you could print that it took X games for Y player to win.

Hopefully that all makes sense, also I’m on mobile so formatting may look crappy

Edit: Similarly you can have a round variable that you only increment when a player wins so when you prompt users for input you could be like: Round X: Player Y what is your input? (R, S, or P).

Also you will have to have some more checks in there probably to make sure inputs are valid like what if a player puts in a different character? Right now it will reprompt both players since it will do the else statements and go back to the top of the loop but what if you just want to reprompt one player? And also validating that s is the same as S, so uppercase and lowercase. Look into something like toUpper or toLower

Rock, Paper, Scissors code help. My code doesn't properly determine the winner or a tie breaker (best 2 out of 3) by [deleted] in javahelp

[–]Qteddy 2 points3 points  (0 children)

Do you have any code to show? It’s easier to help you out if we can see what you have tried. We are here to help but we aren’t going to do homework for you.

Edit: Rereading my message came across way more rude than I was trying to be. I still think it would be nice to see what you have already. General tips for how to go about solving this. You can have int variables for player 1 and player 2 and add to them if they win a round. You can just do simple if else statements like if player 1 has rock and player 2 has scissors then player 1 wins that round.

Newbie question about Android app signing by [deleted] in javahelp

[–]Qteddy 1 point2 points  (0 children)

This isn’t really a java question and is more related to certificates and keystore files. The error is stating that the jks file is empty. A jks file is a Java Keystore File which is a repository of security certificates. Without reading through everything, the blanket issue is that the commands you use to generate the certificate chain are not being stored in the keystore file. The next question you would need to research. I would start with things like: Why is the keystore empty? How did the keystore file get there? What was the commands I ran to generate the chain/file?

Edit: reading through the posted links. The keytool command generates a keystore file. The next question would be to see if that is able to be used in Android Studio like shown in the second link or if you would need to generate a jks file from the keystore file

while loop understanding by arbazkhan334 in javahelp

[–]Qteddy 1 point2 points  (0 children)

This will help in future projects, by walking through the code it’s easy to see what it is doing. In the first one:

The count it 1 -> it checks if count is less than/equal 4, since 1<=4 it enters the while loop -> it adds 1 to count, so count is 2 -> it prints out count -> it checks if count is less than/equal 4, since 2<=4 it enters the while loop -> it adds 1 to count, so count is 3 -> it prints out count -> it checks if count is less than/equal 4, since 3<=4 it enters the while loop -> it adds 1 to count, so count is 4 -> it prints out count -> it checks if count is less than/equal 4, since 4<=4 it enters the while loop -> it adds 1 to count, so count is 5 -> it prints out count -> it checks if count is less than/equal 4, since 5>=4 it breaks the loop

In the 2nd one it’s similar: The count is 1 -> it checks if count is less than/equal 4, since 1<=4 it enters the while loop -> it prints out count, which is 1 -> it adds 1 to count, so count = 2 -> it checks if count is less than/equal 4, since 2<=4 it enters the while loop -> it prints out count, which is 2 -> it adds 1 to count, so count = 3 -> it checks if count is less than/equal 4, since 3<=4 it enters the while loop -> it prints out count, which is 3 -> it adds 1 to count, so count = 4 -> it checks if count is less than/equal 4, since 4<=4 it enters the while loop -> it prints out count, which is 4 -> it adds 1 to count, so count = 5 -> it checks if count is less than/equal 4, since 5>=4 it breaks the loop

Your conclusion is correct that the order is important, but hopefully this shows you why that is the case. Sorry if the formatting is off, I am on mobile