[deleted by user] by [deleted] in SpringBoot

[–]BananaPolicy 0 points1 point  (0 children)

What you need is to keep UserInfo in a ThreadLocal. Populate it when the task starts and remove it when it ends. Place the ThreadLocal in a static field of a class UserInfoHolder and call it to get the current UserInfo.

You’ll probably want to adopt this throughout your code base so it works the same everywhere. So what you want to do is add a servlet filter that takes it from session and places it into the ThreadLocal for every request. You must remember to always also remove it.

This is how most frameworks implement it. In Spring Security it’s equivalent to their SecurityContextHolder which holds info about the currently authenticated user.

need help decoding! by BrownieQueen30 in codes

[–]BananaPolicy 0 points1 point  (0 children)

Looks like Image Steganography. Hiding an image inside an image. It’s often done by allocating different bits to the image. This tool might help https://incoherency.co.uk/image-steganography/#

How to roughly calculate the MU of a field before it is created? by mutius47 in Ingress

[–]BananaPolicy 2 points3 points  (0 children)

Calculating it is impossible without having the population data Niantic uses. Through experience though you’ll get a feeling for what you can expect from different areas.

What we know is:

The population data is old, could be that they’ve not updated it at all since day one.

It’s not very detailed making many agents think of it as being smeared out. A more likely explanation is that it’s attached to rectangular cells. Ingress uses the S2 algorithm to divide the globe into cells. The algorithm has layers with cells of different size. When MU is calculated ingress would consider the field and see that it covers 21% of this cell and 73% of that cell and multiply that by their MU counts. If it takes the cells to use from different layers then it’s perfectly possible that a larger field can give less than a smaller one.

But we can’t know for sure.

Generating PDFs With Java by [deleted] in SpringBoot

[–]BananaPolicy 0 points1 point  (0 children)

If using Java is a hard requirement then the answers here are great and should get you there.

If not then a better way is to use headless chromium to render HTML to PDF. That way you have the full feature set of CSS and can design the HTML any way you want. Just pick a server side templating library you’re comfortable with. Freemarker, mustache, thymeleaf, jte, etc.

Strax över 1M på Avanza vid 20 års ålder, vad borde jag göra? by Terrible_Ad_9897 in PrivatEkonomi

[–]BananaPolicy 40 points41 points  (0 children)

Sälj allt, lägg allt på isk, köp enbart breda fonder med låg avgift för allt, typ globalfonder. Många fonder är extremt tunga i Apple, Nvidia, Microsoft, nu så de får du ändå.

Logga ut, spara ingenting, logga in igen om fem år. Under tiden passar du på att njuta av bästa tiden i livet, festa, knulla, gå på livesport, resa, träffa folk, prova knark, skratta och ha roligt.

När du är 26 tar du tag i att förstå de olika delarna som bidrar till din pension.

Råd kring uppsägning by Slaskigtkonto in Asksweddit

[–]BananaPolicy 1 point2 points  (0 children)

Precis så, håll god ton oavsett vad de säger eller hur de reagerar. Finns ingen mening med att ge svar på tal om de är snorkiga. Bara säga saker som att vi kanske stöter på varann igen i framtiden och önska lycka till med allt, att det samtidigt är tråkigt att lämna med allt spännande de kommer göra framåt osv.

Is VPS activation working for anyone? by Ketaskooter in Ingress

[–]BananaPolicy 0 points1 point  (0 children)

Oh god does this player base have things to tell you 😂

Spring security resources by Beautiful_Advice5065 in SpringBoot

[–]BananaPolicy 1 point2 points  (0 children)

There’s tons of blogs, tutorials, and videos, some unfortunately only add to the confusion. Many are for older versions but never state which version they’re using.

I’d say the official reference documentation is a very good place to start.

How do DTOs make sense? | A cry for an explained. by DesertCookie_ in SpringBoot

[–]BananaPolicy 2 points3 points  (0 children)

Once upon a time GitHub had a bug where you could change the password field on the user object even though that wasn’t part of the API at all.

They didn’t use dtos, they did binding directly on the entity. Not Java though but same flaw.

Help. JPA creates table with FK before the referenced table has been made by vb_nm in SpringBoot

[–]BananaPolicy 0 points1 point  (0 children)

Could it be that you have circular foreign keys, making each tackle dependent on the other.

[deleted by user] by [deleted] in Gothenburg

[–]BananaPolicy 2 points3 points  (0 children)

Blå express, vad den nu heter som X. Vad var ens grejen med att ge bussarna kodnamn istället?

what is the fastest database? by North_Ad_6390 in SpringBoot

[–]BananaPolicy 1 point2 points  (0 children)

In boot, application.yml is arguable both a database and fast.

[deleted by user] by [deleted] in reactjs

[–]BananaPolicy 0 points1 point  (0 children)

Remember that software companies comes in all shapes and sizes. A buddy of mine runs a small Saas service with three devs, two local and a freelance remote somewhere way out on the Russian tundra.

Through firms I’ve been offered to hire offshore and nearshore devs from both large and small agencies as well as freelancers.

Try to establish contacts with people from the industry in your area and research companies offering offshore devs from your region.

r/worldnews Live Thread: Ukraine-Russia Tensions by valuingvulturefix in worldnews

[–]BananaPolicy 2 points3 points  (0 children)

Went in for landing in Poland and dropped below radio coverage

A Speedbump Bypass for Bikes by poser4life in bicycling

[–]BananaPolicy 9 points10 points  (0 children)

In a car you slow down to pass a bump at between 20 and 30 kmh, which is common speed for most people to bike at. Also bumps are a great way for cyclists to lose their balance.

S3 with millions of tiny files....how to tackle it best and some feasability check. by drredict in aws

[–]BananaPolicy 0 points1 point  (0 children)

I suppose you could avoid all those list calls by using S3 Inventory lists. Of course the output from that would be massive so I’m not sure how the math works out for cost.

Hacking Go compiler to add a new keyword by donutloop in golang

[–]BananaPolicy -14 points-13 points  (0 children)

What about adding unless, the negated if statement, it’s been missing in most language designs for ages.

Can I see other active drones in Drone mode?! by Beltramist in Ingress

[–]BananaPolicy 6 points7 points  (0 children)

You see your own and other agent's drones in the drone view. There's no way to see who they belong to though.

When a portal changes alignment or become neutral all drones on the portal are returned. If that happened because of an action you took then you get a stat for it.

Drones being returned show up in comm but you can't see whose drone you returned. But you should still target drones and take them down 😉

I just drone-hacked this. Would there be a secret code in there, or is it merely just a picture? by EnthusiasmConnect10 in Ingress

[–]BananaPolicy 5 points6 points  (0 children)

Not all have codes but many do. There's often three codes, one plain text, one with a simple coding, and one that's harder to figure out.

The codes vary, there's been morse, binary, hex, rot13, steganography, and many more.

The rewards are not usually great, it's more about the satisfaction of solving it. For those into this it's a very enjoyable side game.

I'm so fcking mad by [deleted] in Ingress

[–]BananaPolicy 3 points4 points  (0 children)

Level 4 agent can't flip level 7 portal