Posts by burger

    Calling `setQueryData` on a socket event listener does not rerender components.


    I have a React project that uses react-query to manage query related logic. I am also using socket.io rooms for data updates. The client may subscribe to a room and receive update payloads for that specific resource.


    Code
    socket.on("DATA:consumable", (payload: { room: ""; data: unknown }) => {
      const room = payload.room.split(":"); // room: "type:id"
      const resourceType = room[0];
      const resourceId = room[1];
    
      queryClient.setQueryData([resourceType, resourceId], (old) => {
        // old is not touched
        return payload.data;
      });
    });


    In this event listener, I retrieve the `resourceType` and `resourceId`, call `setQueryData` with the appropriate query key, and return the payload data. I am not mutating the old state of this query.



    In these two component, I define `todo` as the react-query state (if defined) or the data provided by the todos component. When the data is updated in the above socket listener, I expect the cache to be set and the Todo component to reflect the updated state. In the react-query devtools I observe that the cache is properly set when new data is emitted.


    Replacing react-query cache with other stores correctly rerenders the Todo component.


    With redux:


    Code
    socket.on("DATA:consumable", (payload: { room: ""; data: unknown }) => {
      ...
    
      dispatch(setTestTodo(payload.data));
    });


    Code
    const Todo = ({ data }: { data: Todo }) => {
    
      const testTodoState = useSelector((state) => state.testTodo);
    
      const todo = testTodoState || data;
    
      return (
        ...
      );
    };


    Here the todo component correctly reflects state updates. Other questions about setQueryData not rerendering components are resolved by cloning the old cache in the updater callback rather than mutating the old cache state. I am updating my cache state immutably so this shouldn't be an issue.

    personally my thoughts are that i don't think of Minecraft builds as art, as i feel that it being a game as well as a 3d digital form makes it feel disconnected, and its extremely difficult to find an emotional connection when viewing Minecraft builds. i think that art needs emotional connection and a sense of connection to the artist as well, in order for it to be considered as art.


    another point i had was that Minecraft builds feel very same same to me, its always grounded and it all feels muddled because of the fact that Minecraft vanilla blocks already have a set style, and while people can use that limitation to showcase creativity, i don't think that showcase can be considered as art. like basically i feel that every Minecraft build is always a building / based around architecture, and even when it deviates from that there never really is a sense of true personal style, simply because everyone is using the same building blocks


    thirdly i think that when i see Minecraft builds i tend to view them from a technical standpoint, eg i don't think "wow! great build! i had an emotional connection to this! this build of mr krabs reminds me of my mother!" its more like "woah!! how did that guy do that? i wonder how they did it and what techniques they used" i think its because i view Minecraft heavily as just a game and less of an experience, and i feel that because its based around code, it could never truly be considered as art in my opinion. because even with the most impressive builds/ experiences/ redstone, my first thought is always about the technical aspects of it, like did they use command blocks, custom models, coding etc. and it really disconnects me from the emotional connection (if there even is one in the build in the first place)

    i have more points but i have dementia

    you're wrong 👍

    Likely not the best way to put my response, but still: This is similar thinking to the bullshit that resulted in things like COPPA and Minecraft's Chat Reporting system. "Little Timmy might be accidentally exposed to something, so we must remove all of it from everywhere!".

    Yes minors play here. No they should not be intentionally exposed to NSFW. That does not mean there is a need to ban every bit of it from the server entirely, at least not in the name of their protection.

    If we are speaking in terms of pure policy and consistency with the fundamental concept of freedom then sure I don't care. However, myself and others are speaking in terms of our own morality. I find it reprehensible and frankly disgusting how sexually driven our culture is today. This is especially applicable when speaking of a video game in which children play. I have a distinct boundary with regards to NSFW content and that line is crossed when you involve children. End of discussion for me.

    i mean if we sanction people for ERP 'n shit i believe in the interest of consistency this sort of stuff should also be prohibited...

    It is also important to consider that this is a server of which children play. Those who make the argument that this server isn't "designed" for kids should still acknowledge that they are active participants in the community. I view it a moral responsibility that we protect them.

    How do you reckon the issue of most minority communities being vastly more poor than white should be handled? E.g. years after slavery has ended the black community is still way behind.


    This policy is a direct way of rectifying this whether you agree with it or not morally.

    I understand poverty in minority groups to generally be caused by inequality in education and the public workforce. I would also argue poor culture ( which has developed from past discrimination such as slavery) to be a further hindrance in the development of these communities.

    I think equity is too rash of an approach in better enabling underrepresented ethnicities, especially in terms of education. Your skin color should not determine your success in life, nor should it determine what school you can go to. We should strive for equality in education, rather than racial preferencing.

    In light of the modern push for equality, many colleges have been burdened with an admission status quo which requires a percentage of the school to identify as a member of an underprivileged ethnicity or gender. Rather than accepting students based on controllable characteristics such as work ethic or grades, schools have adopted a new admission system in which race, gender, birth place, and family income are an overly considered part of your application.


    On August 13th 2020, the Justice department accused Yale of racial discrimination against Asian Americans and White Americans in their admission process. In an investigation conducted by the Trump DOJ, “white and Asian-American applicants were one-eighth to one-fourth as likely to be admitted as African-American applicants with the same academic credentials”. About two months later, Yale was sued by the Justice department, backed by Trump's administration in opposing racially motivated admission in higher education. The suit stated “Yale discriminated against applicants to Yale College on the grounds of race and national origin, and that Yale’s discrimination imposes undue and unlawful penalties on racially-disfavored applicants, including in particular most Asian and White applicants”. When Biden took office at the start of 2021, his Justice department immediately revoked the prior Trump lawsuit stating it would continue a three year investigation into the Yale admission process but that no civil rights laws were broken by the school.


    Democrats are willingly ignoring the discrimination seen in the American education system and elite colleges are willingly implementing it. A prime example being in 2021 when all but two senate democrats voted against a ban which prevented federal dollars going to schools racially discriminating against Asian Americans.


    Ezm1CYKXEAsT-EJ.jpg


    Also, in 1996, anthropology professor Glynn Custred and California Association of Scholars Executive Director Thomas Wood drafted Proposition 209. A text which should ban racial balancing and racial preferences in application processes such as those in public hiring or education. In 1996, Prop. 209 (which was modeled similarly to the Civil Rights Act of 1964) was successfully passed by California voters. Underprivileged ethnic groups participating in the University of California system prior to Prop. 209 was 31.3 percent. In 2014, this number was at 55.1 percent. Just a year before that, the 6 year graduation rate was at an all time high of 75.1 percent. In 2020, however, California Democrats Proposed Proposition 16, a new amendment which would bring back racial discrimination and preferencing in California. Deeming it a “necessary action in assisting discriminated racial groups. As we just saw, underrepresented ethnic groups did not fail with a lack of racial balancing but rather grew significantly in numbers.


    It almost seems as if democrats rely on racial classification in an attempt to divide us. Utilizing our country's genuine racial injustice as a way to gain supporters and power. This gets more into personal interpretation but this is something I have seen multiple times when evaluating inconsistencies in their worldview. Again, this is not to say racial injustice doesn’t exist, this is a criticism of the democrat’s execution in solving these issues. I believe it is in the best interest of our country to support the poor and underprivileged, however, racial classification is not the best approach. Rather than assigning a quota to meet (which I believe to be an offensive standpoint on battling racism anyway) we should be investing effort in assisting people in their education.


    I am not writing a conclusion for this little rant but those are my thoughts. I also disagree with a lot of the conservative approaches towards tackling inequality in America but I find democrats to be more hypocritical in their mindsets. If anyone has a differing position on this I am completely open to debating about it. I just turned 17 so I don’t have all the experience of real world events as some of you may have. Maybe I’ll learn something new and I love talking about this type of stuff.


    Sources:


    DOJ Yale accusation

    DOJ Yale suit

    DOJ suit dismissal document

    Justice Dept. Sues Yale, Citing Illegal Race Discrimination (Published 2020)
    The department says the school’s admissions practices violated the Civil Rights Act of 1964. Yale’s president says the allegation was based on “inaccurate…
    www.nytimes.com

    https://www.npr.org/2021/02/03/963666724/justice-department-drops-race-discrimination-lawsuit-against-yale-university

    - It's finnicky about what you ask it sometimes. I asked it "what are some good pickup lines" and it said using pickup lines is wrong and manipulative. Phrase it differently and it will actually give you some. I thought that was interesting since I would say calling it straight up manipulative is a bit harsh. It's not like I'm asking for a how to tutorial on how to gaslight people (if you actually ask it that, it won't show you how)

    Yeah, I would argue Open AI is giving Chat GPT strict instruction on what behavior it can learn from, respond to, etc. Probably an attempt to not fail like Microsoft's Tay did.

    Open AI's ChatGPT research release reached 1 million users on December 4th following its initial release on November 30th. For reference, it took Twitter two years to hit one million users and Facebook about 10 months. Pretty crazy numbers we are seeing and the ChatGPT hype isn't without reason if you ask me. It's essentially an always available human assistant with knowledge on basically everything seen on the internet. I have been using the AI as an almost complete replacement to Stack Overflow since I began using it and schools have already put a stop to it after people started using it to write college essays for them 💀. Cool technology for sure. Possible a competitor to Google even? After all, scrolling through web pages searching for an answer requires more work than getting a direct, human-digestible answer from a bot. This sort of leads to my primary concern of the chat bot assuming Open AI decides to continue down the route they are traveling:

    - Abuse and bias in information distribution

    In general, gathering information using Google or any other search engine requires some self dependent research ability. This restricts the amount of control big tech corporations have on day to day consumers. As long as we are able to successfully identify false information and understand world events accurately, we can limit the spread of misinformation. Our ability to successfully identify accurate data is what will heavily reduce the spread of false info, not some company telling us what is and what isn't truth. This is exactly why I don't support social media implementing anti-misinformation features and why ChatGPT concerns me. We are gaining the ability to be lazy in researching but losing the ability to govern info validity ourselves.


    From what I have seen, ChatGPT has been very careful in expressing neutral viewpoints concerning sensitive topics such as religion, politics, etc. Usually giving answers such as "Ultimately, it is up to each individual to decide whether they view x as y or z". I have found an exception to this rule while discussing Hitler. Whatever dataset ChatGPT was trained on seems to criticize Hitler (justifiable) more than any other controversial figure I have found.

    Here are the logs from that:


    Anyway what are your thoughts on it

    I am using jwt to authorize users on a react app I am working on. As opposed to using localStorage or sessionStorage to store these tokens, I am sending httpOnly, sameSite: strict, secure cookies as shown.


    My app is successfully able to communicate with my api using the access and refresh tokens while hosted on the same domain as the api server (www.example.com/app, www.example.com/api).


    If I understand correctly the react development server is hosted on an http server running on port 3000. Because this server is considered to be running on a different and unsecure domain, these secure cookies are not able to be properly communicated. I thought reconfiguring these cookies to secure: false and sameSite: "none" would have allowed these cookies to be correctly communicated but it hasn't.


    Why is it that these updated cookies are unable to be sent/received with the development server and what can I do to properly configure them?


    If its any use, here is the request header from each server:


    Production server correctly receives cookies


    Development server

    i know it’s ironic coming from me but frankly dragon you’re immature. these jokes have gotten you in trouble so many times and nobody but you apparently seems to find humor in them. i highly doubt your going to be reinstated now or any time soon based on the communities response and that may honestly be for the better. i’m not going to say totalfreedom had any key affect on my life but sense i stopped being super active my life had genuinely improved. i used to consider myself the awkward unfunny kid but i really don’t anymore. i don’t know you personally so i’m not gonna make any assumptions here but that’s how it went for me and i’m sure many others. it’s sorta crazy that such a big part of my development as a human is linked to a minecraft server but that’s just how it goes I guess. sometimes it’s best to let go and move on and if you feel at all like i do or did i would recommend that. best of luck to ya tho

    Quote

      fleshly seriously where the fuck did you get this idea from, did you time travel to year 2120 and asked someone what they think of abortion?

    He is making the comparison of us looking at our past actions with disgust and future societies looking at our current actions with disgust. An example being infanticide which was a common occurrence during the Roman Empire. This is not at all a crazy comparison to make even though it could have been worded better by enchy.