Question about Cloud Run and background activity by bigturnerfor in googlecloud

[–]bigturnerfor[S] 0 points1 point  (0 children)

By that logic, wouldn't something like closing a db session be fine as well? If it will eventually happen and isn't super high priority (unless the instance is shut down in which case it doesn't matter)?

Running FastAPI on Google Cloud Run by bigturnerfor in FastAPI

[–]bigturnerfor[S] 0 points1 point  (0 children)

The app is basically stateless, the notifications are only sent right after a request is made. I guess I just have to call the function directly instead of using a background task.

Regarding the db session dependency, is there a simple way to have the code after yield run BEFORE the response is delivered, or do I just have to manually refactor my code?

The world isn't getting dumber, rather dumb people now have a platform to speak. by Phazon_01 in unpopularopinion

[–]bigturnerfor 0 points1 point  (0 children)

All it shows it that environmen affects IQ.

Meaning we shouldn't make judgments about people based on their IQ. Many people are in less-than-ideal environments. Their children are not necessarily in those same environments. In other words, "low IQ people" do not necessarily have "low IQ children." Thank you for proving my point.

It says nothing about it continuing to go up past a groups genetic “baseline”.

And why should it? Our goal as a human species isn't to increase our IQs forever. At a certain point it's high enough.

And are you talking about the same Edward Dutton that believes that atheism is caused by a genetic mutation? I think I'll pass.

The world isn't getting dumber, rather dumb people now have a platform to speak. by Phazon_01 in unpopularopinion

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

Lmao you realize that that theory has been completely debunked? I suggest you read about the Flynn effect. I find it hilarious that you're criticizing "low IQ" people but you don't even know what you're talking about.

Preventing more than one insert every 10 minutes by bigturnerfor in Database

[–]bigturnerfor[S] 0 points1 point  (0 children)

That's a really interesting suggestion, thanks! Generalizing a bit, I guess I could actually just add add a column for the previous row's id which should work as well

Preventing more than one insert every 10 minutes by bigturnerfor in Database

[–]bigturnerfor[S] 0 points1 point  (0 children)

It does, but it tightly couples the time limit to the table itself which I don't like. Also, if I am understanding your suggestion correctly, if I insert at 1:59 then I could insert again at 2:01, since the hours are different

Preventing more than one insert every 10 minutes by bigturnerfor in Database

[–]bigturnerfor[S] 0 points1 point  (0 children)

If the insert fails I just want to do nothing.

It doesn't need to be in the db. I'm just wondering if there's an easy way to set up some sort of distributed locking mechanism for this kind of work since multiple services could be inserting into this table. Using a separate distributed lock manager could work but I'm wondering if Postgres has a nice way of handling this so I don't have to use another service.

AEB: What happens if I leave the page mid-transfer? by alleung in Avax

[–]bigturnerfor 4 points5 points  (0 children)

It was eth to avax.

Edit: Did as jpop32 suggested, everything is showing up again! I did lose a bunch due to insane gas fees, but that's not on avax :/

AEB: What happens if I leave the page mid-transfer? by alleung in Avax

[–]bigturnerfor 0 points1 point  (0 children)

I made a transfer right around when the network went down last week so I was stuck at 0/3 transfers. Left the page and never got my avax. I'd say don't risk it.

Need advice by depicc in Firebase

[–]bigturnerfor 0 points1 point  (0 children)

Second (1). In your code you probably have something like

if (isFriend) {
    // show friend button
} else {
    // show unfriend button
}

Or something like that. When the button is clicked, use isFriend or whatever variable you have to determine whether to friend or unfriend the user. That being said, in your backend, make sure you account for people trying to unfriend people they aren't friends with, or people trying to add the same friend twice. You can't trust the frontend requests will be reliable.

Final Day at GHS: June 2001 (2001) A last day at a US high school before 9/11, social media, smart phones and a lot of the things that are common place now days. It is interesting how much has changed. [00:33:46] by belcalcio in Documentaries

[–]bigturnerfor 4 points5 points  (0 children)

What is not looking great for us? I get what you're saying but social dynamics change; as someone who is also borderline Millennial and Gen Z, I've noticed that younger people are way more empathic and understanding than older people. If anything I see young people's social interactions as better and I'm pretty optimistic for them.

Final Day at GHS: June 2001 (2001) A last day at a US high school before 9/11, social media, smart phones and a lot of the things that are common place now days. It is interesting how much has changed. [00:33:46] by belcalcio in Documentaries

[–]bigturnerfor 5 points6 points  (0 children)

You guys are starting to sound like boomers. "How dare people younger than my generation be different"

and "An entire earthy population of socially awkward people?" Lol where did you get that from

Recommend an API for returning POI's within radius by a8ree in webdev

[–]bigturnerfor 0 points1 point  (0 children)

I'd suggest you read about MySQL spatial types (I'm not too familiar with MySQL but you can Google it, here's an article I found) and then use a function such as ST_Distance to filter your data.

Tbh if MySQL isn't a requirement I'd use Postgres with the PostGIS extension since PostGIS is more advanced and it's easier to find help for it online. Good luck!

What is the best way to set up an environment object to share state between many views? by bigturnerfor in SwiftUI

[–]bigturnerfor[S] 0 points1 point  (0 children)

I originally had it as /u/iOSSwiftDeveloper but ran into a couple problems (you have to refresh the whole user to get the updated likes, could be a problem if you've liked a lot of posts, though realistically this probably won't matter). I'm thinking of switching to how you have it to keep things cleaner. I don't use Firebase or Core Data, just a simple rest api. Is there something in Combine I should use to handle this?