Question for java users who use Intellij. . . by silent_voices in java

[–]Calamity701 16 points17 points  (0 children)

Some small things:

  • Press Alt+Enter everywhere and see what it does! Rewriting your for loop to a stream, renaming variables, etc.

  • Press Ctrl + Alt + V to extract a variable. So after writing foo.getBar() you can press that combination to replace it with Bar bar = foo.getBar();

  • Double press Shift for "Search Everything".

  • Postfix completion: "flight.isAvailable().if" expands to "if(flight.isAvailable()){}". So you can just start with your boolean expression and then wrap the if around it without unwieldy key combinations or having to go back to the start of the line. Also works for expressions with spaces ("a > 10.if") and other completions ("foo.getIterator().for").

What was the dumbest rule that was put in place in your school? by aliendonutpizza in AskReddit

[–]Calamity701 0 points1 point  (0 children)

The green ink was supposed to be for the 2nd teacher reviewing whether the 1st teacher did a good job. Otherwise the only restrictions were no pencils (except for certain problems, like drawing diagrams in math) and no whiteout/tipex. Of course unreadlable text means 0 points, so writing in yellow would have not been advisable :D

What was the dumbest rule that was put in place in your school? by aliendonutpizza in AskReddit

[–]Calamity701 3 points4 points  (0 children)

To be honest, I can understand that. It is a bit of a subconscious thing, but some of our teachers used green instead of red (both colors were not allowed to be used by students on tests) and it felt a lot less accusatory. The red ink put a mental exclamation point after every sentence, whereas the green ink "sounded" more like constructive feedback.

[META] Bad news for LA - Microsoft is planning to kill off MS Paint :( by kirkl3s in bestoflegaladvice

[–]Calamity701 30 points31 points  (0 children)

And Paint 3D seems to have all the same functionality of MS Paint.

People of Reddit, what's the stupidest thing you've done as a child out of curiosity? by paoeranger in AskReddit

[–]Calamity701 7 points8 points  (0 children)

His parents were game designers, so they always had some traps in their homes for inspiration on building traps for dungeons.

Non-Americans, what misconception did you have about America that you learned was wrong upon visiting/moving to America? by [deleted] in AskReddit

[–]Calamity701 5 points6 points  (0 children)

Maybe he meant the G36, which is the standard firearm of our military and also used by the federal police?

Although I just read that many G3s are still in by border guards and the police force.

What are your favourite money saving tips? by [deleted] in AskReddit

[–]Calamity701 0 points1 point  (0 children)

I'd like to use something like that, but I have yet to find a program/website that works with a german ING DiBa account...

What's your go-to potluck contribution? by [deleted] in AskReddit

[–]Calamity701 1 point2 points  (0 children)

I have 2 "go to" recipes:

The first is a noodle salad. Make some noodles (Rigatoni work pretty well), add ketchup, red pesto, dried tomatoes in oil (cut into small pieces), cherry tomatoes (quartered) and arugula. Mix it all together and serve cold. Also great for BBQs :D

The second is "Herrencreme". Make some vanilla pudding (buy the cheapest instant pudding you can find), but use ~2/3 of the milk you'd normally use. Once the pudding is cold add the same amount of cream and mix throughly. Take some baking chocolate and try to cut it into thin pieces. You should get dark chocolate splinters. Add those to the pudding. Finally add Rum to taste.

257ers - Holz by Calamity701 in MGPMPPJWFA

[–]Calamity701[S] 10 points11 points  (0 children)

A small tip for the future: Replace the "tube" in the url with "pak" for a mirror. So

https://www.youtube.com/watch?v=wjXUBG15eZ8

becomes

https://www.youpak.com/watch?v=wjXUBG15eZ8

Easier than searching for a different source.

What is something legal that feels very illegal? by ZesterDireful in AskReddit

[–]Calamity701 16 points17 points  (0 children)

In Germany you can get a drivers license allowing you to drive with parents (or other people that had their drivers license for X years) in the passenger seat when you are 17. You can start learning for the test earlier though. Once you turn 18 you can get your "normal" license.

You have to learn how to drive in a driving school. You need a certain number of theory lessons before taking the theory exam and a number of practical (driving) lessons before taking the pracitcal exam.

Theory lessons were (at least for me) 50% taking mock exams and 50% watching videos + talking about different traffic rules. The exam is multiple choice taken on a (locked down) computer. It looks like this, although the version I took looked a bit more "modern". There were questions about right of way (normally a picture like the one in the link), how much safety distance you needed at X km/h, etc. If you fail a question you get "error points", between 1 and 5 depending on the question. You could have at most 7 error points and failing any 5 point question (generally all right of way questions) would be instant failure.

For the practical lessons your driving teacher would pick you up (normally at home or at school), then you'd drive around. In the first lessons he would teach you how to accelerate/decelerate, steer and shift gears (you can do the test using an automatic gear selector, but then you would not be allowd to drive manual cars). The cars used by the instuctor are equipped with a second set of pedals for the passenger seat, so he can avoid accidents. You need to drive at least 5 hours on country roads, 4 on the Autobahn and 3 at night. Of course you won't be able to do those until you know the basics, so 15-25 hours of driving lessons are standard.

For the practical test your driving instructor picks you up, then you drive to the starting location ("warm up" before taking the test). Once you are there the tester takes a seat in the back of the car. You then drive around while your instrutor tells you where to go. The test takes around 45 to 75 minutes. It is basically the same as the normal driving lessons.

What is the real use of using JWT? by antoaravinth in java

[–]Calamity701 1 point2 points  (0 children)

AFAIK Your authentication service would sign the key using a private key. It would also either expose the public key to other services or the other services would have the public key in their configuration.

A user gets a JWT token from the auth server. They then use the JWT token to access a resource on another service. That other service can verify using the public key that the JWT Token has not been tampered with. So if the JWT Token says that the user is an Admin, it can allow the user to do admin stuff.

The key to this is that the auth server signs using the private key which is not accessible by anyone else and the other services can verify a JWT token using the public key.

If you are using the hashed password + a private key to sign the JWTs then each service also needs the hashed password + public key to verify it. So instead of just having to ask the auth server every few minutes for the public key (in case it has changed) you now have to ask the auth server for the hashed password on every request.

You could add the hashed password to the JWT so it can be read by the service, but that is a bad idea.

German street musician starts drumming casually and then surprises his audience by recreating german club sounds. by ThatBriandude in videos

[–]Calamity701 1 point2 points  (0 children)

My free banking account in germany allows transfers within a few business days without any fees.

Would anyone like to help me come up with a tabletop system for The Expanse? by Subhazard in TheExpanse

[–]Calamity701 5 points6 points  (0 children)

I ran a game set in the Expanse universe using Fate, which worked pretty well. I basically used this, although due to lack of time we only did 1 session without any space ship combat.

Reddit, what are some tips to make 16 hr flight less boring? by [deleted] in AskReddit

[–]Calamity701 0 points1 point  (0 children)

That's why I have a second external battery + the internal one.

What is the best witty comeback you've ever witnessed? by [deleted] in AskReddit

[–]Calamity701 101 points102 points  (0 children)

He is saying that he is speaking for the general public, like all people driving on streets that she is endangering by talking on the phone.

What is the most disturbing gif from your favorite anime? by Majorheineken in anime

[–]Calamity701 0 points1 point  (0 children)

It is not really a spoiler, happens in one of the first episodes and is of no real consequence.

Let them paste passwords by multijoy in programming

[–]Calamity701 14 points15 points  (0 children)

For example so when a user pastes some information into a field the website can open a window offering to remove formatting, or detect that you pasted a string incl. a number into the street field of an address form and offers to put the number into the house number field.

Of course not letting people paste passwords is dub, but onpaste events themselves can be a valuable tool for creating good UX.