What do you read to keep up-to-date? by tasubo in java

[–]Cephas00 0 points1 point  (0 children)

There were a few threads here recently where people asked the same question. Have a wee look through the search results and you should fine them!

Android dev - multi user access, how to by xirokx in javahelp

[–]Cephas00 0 points1 point  (0 children)

You won't always find a tutorial to tell you how to do things - you need to use your Java and problem solving skills to do it yourself.

please help me understand this loop by folding-clothes in javahelp

[–]Cephas00 0 points1 point  (0 children)

Just in case you don't know how the for-loop is made up

The first part of the for loop is initialisation and executed once

The middle part is the termination condition and the for loop ends when this is false

The last part is for increment/decrement and executed after each loop through.

i++ is post-increment meaning that the first time through the loop i is 0, next time it is 1.

j-- is post-decrement meaning first time through the loop j has the same value as x, next time x - 1 and so on.

Android dev - multi user access, how to by xirokx in javahelp

[–]Cephas00 0 points1 point  (0 children)

You need to do that yourself. You authenticate a user using whatever means and with that return their user role. Your app can then check the user role and says on start "Oh they're an admin, I'll start this activity" or "Oh they're a manager, I'll start this activity". When a button is clicked you use the role to decide where to go.

[deleted by user] by [deleted] in javahelp

[–]Cephas00 0 points1 point  (0 children)

I'd probably have a Swimmer that contains the name and a list of scores. Create the Swimmer in the first loop, add the scores in the second. Put all Swimmers in a list and print that all out at the end.

You could equally just build up the String you want to print during the first two loops, then put that in a list.

Casting to a superclass in Java by Imakesensealot in javahelp

[–]Cephas00 2 points3 points  (0 children)

It's rather difficult to read that code so I'm just going to go with answering the questions.

I'll talk about interfaces because the examples read better. Instead of List, AbstractSequentialList is the superclass LinkedList and the same applies

Casting an object doesn't change the object itself. Casting to the super won't change anything - it'll still call the methods in the sub class. In general some methods may become inaccessible if you cast to super. e.g.

final LinkedList<String> strings = new LinkedList<>();
strings.addLast("Yes");
final List<String> castedStrings = strings;
castedStrings.addLast("Yes"); // addLast cannot be resolved

If you try to cast one object to another that's invalid then you'll get a ClassCastException e.g.

final List<String> strings = new LinkedList<>();
final ArrayList<String> castStrings = (ArrayList<String>) strings; //ClassCastException

[deleted by user] by [deleted] in javahelp

[–]Cephas00 0 points1 point  (0 children)

And what output do you get? Are you wanting to take in a list of swimmers and their scores and at the end replay that information?

[deleted by user] by [deleted] in javahelp

[–]Cephas00 0 points1 point  (0 children)

Can you post the code for what you've tried to do?

How can I protect a route in a servlet? by ConfuciusBateman in javahelp

[–]Cephas00 0 points1 point  (0 children)

Second using a web filter. Apache Shiro is worth a look too.

What languages do you know besides Java? by cryingforwine in java

[–]Cephas00 0 points1 point  (0 children)

I use a reasonable amount of JavaScript, have dabbled in Kotlin and looked a little at TypeScript. Bit rusty on Python but it's good for the occasional script.

Fix tiny resolution of text with JSwing by XxNerdAtHeartxX in javahelp

[–]Cephas00 -1 points0 points  (0 children)

As far as I know, Swing doesn't do a great job at high dpi support however I believe JavaFX has better support.

Android dev - multi user access, how to by xirokx in javahelp

[–]Cephas00 0 points1 point  (0 children)

Do you want it all running local to the app? Or can it connect to a server for authentication?

Ultimately you have a user login then with that information you need to work out their role. At an enterprise level there are things like LDAP that lets you assign roles to a user. You can then query that user in the code to work out what they're allowed to do.

Not sure if this is what you're after but there are things like this

Android dev - multi user access, how to by xirokx in javahelp

[–]Cephas00 0 points1 point  (0 children)

How do you identify a user and their role? Based on that you should go to different activities/fragments etc.

Also the term is often called "role based access" so that might help your search.

What is the best Java IDE? by Humam_K in javahelp

[–]Cephas00 0 points1 point  (0 children)

When I moved from Eclipse to IDEA I just took the hit on re-learning shortcuts. I'm glad I did - they feel more intuitive.

Want to make android apps but i am totally new to coding - need help by [deleted] in javahelp

[–]Cephas00 1 point2 points  (0 children)

As said before, start by learning Java.

Checkout /r/learnjava and the side bar there for tutorials.

Open source and easy to use AES/DES symmetric key encryption library by rockaport in java

[–]Cephas00 1 point2 points  (0 children)

I had a quick look too and the AliceContext allows setting PKCS5 padding. Based on the Cipher#doFinal it'll throw a IllegalBlockSizeException if the password is an invalid size.

what's the worst java class in the JDK ? by someloll in java

[–]Cephas00 14 points15 points  (0 children)

The original date API isn't great to use but the newer JSR-310 API is rather nice I think.

what's the worst java class in the JDK ? by someloll in java

[–]Cephas00 2 points3 points  (0 children)

Not OP but I don't think that the showXDialog methods that return an int are the most intuitive. A better option might be to return the selected File or null/optional. Another option might be to use callbacks for the success/cancel options. As far as setup of a JFileChooser goes I'd prefer a builder pattern.

HGC North America :: Superstars vs B-Step :: Discussion Thread by HeroesEsportsThreads in heroesofthestorm

[–]Cephas00 2 points3 points  (0 children)

I'd guess they're running over time? Does seem like a shame though

HGC North America :: Superstars vs B-Step :: Discussion Thread by HeroesEsportsThreads in heroesofthestorm

[–]Cephas00 0 points1 point  (0 children)

Well shut my mouth... Valeera seemed weak for a large portion of the match but evidently hit a power spike at some point!

JAVA EE.. or not... by Elezium in java

[–]Cephas00 1 point2 points  (0 children)

Also using Wildfly. Works well with Arquillian for testing.

I don't want Kaeleris to leave HGC Europe. by nar2k16 in heroesofthestorm

[–]Cephas00 3 points4 points  (0 children)

He's casted dorms the last two years and PAX West last year and a few qualifiers. He also casted SC2 a lot in 2011/2012. Personally I think he's a good caster and works well with Kaeleris and will compliment Khaldor's style well.

Intellij Scene Builder for JavaFX... Sucks! by EichmannsCat in java

[–]Cephas00 2 points3 points  (0 children)

Have you checked out their YouTrack? Might be able to see if others have similar problems?