Is this possible to do

I'm relatively new with react. Recently I started working with websockets. I've built a websocket and it got rather large, in order to help keep things organized I decided to create a single object in a separate file with the websocket functionality. So the new object has a function for opening the socket and handling all the interactions with the back end and I passed to it a number of functions for updating my variables.

One of my variables is another objection with functions and variables. Not all the variables get updated with each call to the backend so my code looks like this:

const [tableInfo, setTableInfo]=useState(tableInfoDefaultObject);

...

const UpdateTableInfo = (dictionaryForUpdate)=>{

setTableInfo({...tableInfo, ...dictionaryForUpdate})

and I pass the UpdateTableInfo function to the websocket object. What I'm finding is that it only uses the original default tableInfo. I think it passes the whole function instead of just a reference to it but I'm still a bit foggy on how react does this. Is there a way around this? I'm OK with moving the functionality back into the main web page, just wanted to organize things better and figured that there's probably a way to make this happen.

reddit.com
u/Prize_Shine3415 — 1 day ago

Where can I park if I want to hike a trail at Multnomah Falls?

I wanted to the hike from Multnomah Falls to Larch Mountain. Haven't done it in quite sometime and I was just looking at the info about parking. Sounds like I won't be able to park at the falls. Is there going to be an area near the falls I can park at? I know that if I go down the old highway a bit I'll come to something but wasn't sure if there was a time limit there, also.

reddit.com
u/Prize_Shine3415 — 5 days ago
▲ 7 r/bridge

Bots on BBO

I've been playing for a few years. Is it just me or have the bots seem to have gotten worse in playing of the hands? It could be that I've just gotten better but was curious what others thought about this.

reddit.com
u/Prize_Shine3415 — 6 days ago
▲ 7 r/django

UniqueConstraints

Is there a short hand for creating UniqueConstraints to all fields in a model?

Update: A couple of people have asked why I'm trying to do this. I'm creating a website for people to use to teach a card game to people. In doing so, I want them to be able to create a room where the hands can have certain features that can be saved. There are about 10 features that they can have for each hand and they may have more the one set since there are four hands. For example, the person in first position may have 5 hearts, 1 club and 3 spades. The person in second position may have 5 spades and 4 clubs.

My plan is to have a manytomany that links to hand features. Because many of these hand features could potentially be reused multiple times I'd prefer not to have duplicates. My model is below. If the way I'm planning on doing this is wrong I'm definitely open to constructive suggestions.

class RoomModel(models.Model):
    room_name = models.CharField(default='No Room Name', unique=True)
    hand_features = models.ManyToManyField(HandFeatures, related_name='room_hand_features')


class HandFeatures(models.Model):
    applies_North=models.BooleanField(default=False)
    applies_South=models.BooleanField(default=False)
    applies_East=models.BooleanField(default=False)
    applies_West=models.BooleanField(default=False)
    alternate=models.BooleanField(default=False)
    min_HCP=models.IntegerField(default=0)
    max_HCP=models.IntegerField(default=40)
    partner_min_HCP=models.IntegerField(default=0)
    partner_max_HCP=models.IntegerField(default=40)    
    five_card_major=models.BooleanField(default=False)
    partner_with_support=models.BooleanField(default=False)
reddit.com
u/Prize_Shine3415 — 10 days ago

Question about being a health advocate and malpractice insurance

Apologies if this isn't appropriate. I thought maybe someone here may have experience/opinion on this.

Recently I was approached by a company I'm doing 1099 work for to work as a health care advocate. They have one client in my area who would like someone experienced in medicine to go with them to appointments. I'm still a bit fuzzy about what the client is hoping to gain from me being there. The company claims that I don't need malpractice insurance for this but my instinct says the opposite. The person signed a contract that they aren't getting medical advice from me but it's not clear how if I'm negligent to warn them of something that they can't hold me liable.

Hoping that someone can correct me on this because it sounds like work I might enjoy but I don't want to put myself in a position where I could be putting myself at risk.

reddit.com
u/Prize_Shine3415 — 16 days ago

Question about malpractice insurance and being a health advocate

Apologies if this isn't appropriate. I thought maybe someone here may have experience/opinion on this.

Recently I was approached by a company I'm doing 1099 work for to work as a health care advocate. They have one client in my area who would like someone experienced in medicine to go with them to appointments. I'm still a bit fuzzy about what the client is hoping to gain from me being there. The company claims that I don't need malpractice insurance for this but my instinct says the opposite. The person signed a contract that they aren't getting medical advice from me but it's not clear how if I'm negligent to warn them of something that they can't hold me liable.

Hoping that someone can correct me on this because it sounds like work I might enjoy but I don't want to put myself in a position where I could be putting myself at risk.

reddit.com
u/Prize_Shine3415 — 16 days ago
▲ 1 r/django

Issue with Redis on my laptop

Wondering if anyone might have an idea on what I can do to fix this issue.

I have a project that I'm working on. It uses a consumer and I've been running it with redis. It works fine on my desktop. When I go to use it on my lap top I can't make a connection. It goes through all the code in the consumer and then times out.

I've checked and redis appears to be working fine - my pings give a pong and it appears to be available for a connection. All the installed packages match between my desktop and laptop environments. Both use Windows.

Does anyone have an idea of what else I can look at?

reddit.com
u/Prize_Shine3415 — 25 days ago
▲ 0 r/poker

Someone confirm my decision, please

Midway through a tournament I got moved to another table. Most of the people I know and one I don't know at all, call him Doug, who has about 12BB. I'm BB with about 8 BB. Doug goes all in pre flop. The everyone folds and it gets to the small blind, call him Bob, who is a solid player and has 20BB. He calls. I look at my cards and I have pocket queens.

I'm confident that I have Doug beaten but I'm worried about Bob. I'm trying to think of what he would call with and I thought there was a solid chance that he had A's or Ks so I fold.

Am I being overly cautious? What would you do?

reddit.com
u/Prize_Shine3415 — 26 days ago
▲ 7 r/bridge

Looking for a way to practicing bidding with a partner

I'm teaching my sister and her husband to play bridge. It got me wondering if there was a website where two people can practice bidding with each other using standard american. The bots on BBO cost money and use 2/1 and cost money. Seems like this would be an obvious teaching tool.

reddit.com
u/Prize_Shine3415 — 1 month ago
▲ 8 r/django

Looking for a good tutorial on websockets

I'd like to learn how to use websockets. Typically I can get on youtube or the web and find a good tutorial. I'm finding that everything I look at is giving me something that just ends up not working or the person doing the tutorial has a very thick accent I can't get through. Does anyone have a recommendation for where I can go to learn websockets?

reddit.com
u/Prize_Shine3415 — 1 month ago
▲ 10 r/django

Can I build a two player game with django?

I'm learning django and wanted to build a two player game. Something simple like tic-tac-toe. From what I can see this isn't something that can easily be done, django isn't designed for this sort of thing.

I was thinking that I could build a site where the each time a new game is started the react front end would make a call to the back end to see if the it's the players turn and update the page accordingly. In my head this would work but doesn't seem like the right way to do it. Is there a better way to build the application or is this basically the only way using django?

reddit.com
u/Prize_Shine3415 — 1 month ago
▲ 4 r/bridge

Recommendation for book for 2 over 1

I'm teaching someone bridge. Complete newbie with bridge but they are experienced with trick taking games and I think that they'll do well starting with 2 over 1. Does anyone have a recommendation for a book on 2 over 1 that doesn't require knowing standard first? I liked Audrey Grant's books but I've never seen her 2 over 1 book so didn't know if that required you learning standard american first.

reddit.com
u/Prize_Shine3415 — 1 month ago

I'm relearning physics and was going over vector cross products. Question came up in my mind of what the cross product of two vectors represents. I know that the direction is perpendicular to both of the original vectors and the magnitude represents that area of the parallelogram formed by the two vectors. I can't help but think that there might be someone thing else that that new vector is describing. I tried doing a quick internet search but didn't see anything. Thought that I would post it here.

reddit.com
u/Prize_Shine3415 — 2 months ago