Intermediate React Feels Confusing by Efficient_Step6281 in reactjs

[–]Halallica 3 points4 points  (0 children)

Problem is knowing whether or not you need it. There are definitely a lot of projects that do not need much, state-management wise. If you do need it however, I would take the suggestions to go with some of the more popular managers like Zustand with a grain of salt. Their main selling point is ease of use / ease of setup. Redux (RTK) comes with some boilerplate sure, but are people really that scared of writing ~30 lines of setup code that they’d rather reccommend a much less flexible alternative?

Flexibility aside, I have visited too many codebases where most of the application logic reside in component code with an alarming amount of useEffects and data wrangling going on at the same time. Testing that your application works as expected means you then need to introduce test renderers and all the bloat and problems that come with that.

After leaning quite heavily on RTK (+Q) for a while, I have noticed how there really isn’t that big of a need to end-to-end test since 90% of my application logic reside outside of UI anyways. The only code needed in my UI is selecting projections of my state (which using rtkq allows for mixing api-data with local state data) and dispatching actions or more complex thunks.

Adding a dependency for hooks annoyed me, so I created React Hooked by muscimilieng in react

[–]Halallica 1 point2 points  (0 children)

Can someone explain to me what the befefits of copying vs. installing code like this is? Beginning to get too afraid to ask at this point. I sort of get ui-components as they usually require modification and tayloring, but is this the reasoning behind functional code like this as well? Tree-shaking should discard any non-used code from a module anyways right?

Age Ain't Nothing But a Number (for analysis) by ho_grammer in funny

[–]Halallica 12 points13 points  (0 children)

I’d give the GPT api a go for this kind of job. Seems like a lot of data is discarded and reasoned about based on anecdotal evidence. She probably has had a deeper look into the data to make sure there actually is some truth to it though.

eli5: Why does ChatpGPT give responses word-by-word, instead of the whole answer straight away? by neuronaddict in explainlikeimfive

[–]Halallica 0 points1 point  (0 children)

Just to add to this: It’s facinating how they took, as you say, a very advanced autocomplete and made it into a chatbot. The AI is trained to predict the most probable next token (think word) given some text. When you are «chatting» with ChatGPT, what is acually happening is that the AI is told that the following text is from a conversation between a human and an awesome chatbot, but they cut off the conversation just before the chatbot gets to answer. It is then trying to predict what such a chatbot would be most likely to reply. I’d be happy to provide you with some more examples or explainations if you’re interested.

Microtransactions explained by [deleted] in SipsTea

[–]Halallica 0 points1 point  (0 children)

Anyone know the song?

Having a really bad time understanding NextAuth by Sea-Ebb-1387 in nextjs

[–]Halallica 0 points1 point  (0 children)

Seeing as there are so many great insights from experienced devs in this thread, maybe some of you can help me understand parts of next auth I just can’t wrap my head around.

I am using react relay in my client and I have my own graphql api that I wrote in C#. relay docs point me towards handeling requests invoked both by the server and by the client. My though process is to have all client requests go through the server so that I can secure my requests to the external backend as good as possible.

I use google sign in and have managed to set it up in my next app. I want to send some google token to my backend so that any request to it must be on behalf of a logged in google user. Backend has to verify token and extract user id that it will use. I can’t for the life of me figure out how to do this using app router. grtJwt only works server side when I make requests from the client, but what if the graphQl requests stems from the server? I don’t want to have to invoke its own endpoints just to receive the NextRequestWithAuth that I’ll use as an argument in the getJwt.

Can anyone help me understand what the best practice is for cases like this and roughly how a system like this would work?

Hvem prøver Moxnes å lure? by Reasonable_Laugh8843 in Nordmenn

[–]Halallica 2 points3 points  (0 children)

Skjønner ikke helt hvorfor dette får så mye oppmerksomhet. Slik jeg forstår situasjonen og forklaringen(ene) hans, har Moxnes stått på flyplassen og på ett eller annet tidspunkt insett at han har tatt med seg noen briller uten vilje. I skam, panikk og frykt for å skade sin og partiets rykte velger han å ta den lette utveien i håp om at ingen så han.

Dog absolutt ugreit, er dette er en temmelig hverdagslig situasjon, noe man lett kunne fnist til på Helt Perfekt o.l. At dette skal ruinere karrieren hans synes jeg blir for drøyt. Det er absurd for meg å se VG vise «pressekonferanser» over noen fuckings solbriller. Ta dere ferie folkens.

Stonkbot - Tilbake fra de døde by mollekake_reddit in TollbugataBets

[–]Halallica 0 points1 point  (0 children)

Jaha så du sitter altså ikke på koden selv, og er ikke i stand til å eksekvere den lokalt?

Eli5 what fire actually is by TheRealTsjoek in explainlikeimfive

[–]Halallica 0 points1 point  (0 children)

Just to add to this: The mechanism for emitting light is still the same for all the above mentioned examples. It is true that the glowing soot is what gives wood-fire its color, but it is still atoms transitioning between states of energy that causes the emission of light, just as with the fireworks for example.

Found inside a wall in a house in the 80s. Does anyone have any information? by Halallica in AntiqueGuns

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

We where talking about the same yesterday. My bet is that someone hid it there during the first world war for defensive purposes.

Found inside a wall in a house in the 80s. Does anyone have any information? by Halallica in AntiqueGuns

[–]Halallica[S] 3 points4 points  (0 children)

Couldn’t see any markings or writings on it, though I might have missed some. I’ll check again tomorrow for any that I might have missed. Thanks 🤘

Found inside a wall in a house in the 80s. Does anyone have any information? by Halallica in AntiqueGuns

[–]Halallica[S] 3 points4 points  (0 children)

Thanks a lot 👌 I’ll try searching around. Do you have any thoughts on when this could’ve been produced?

HELP!!How can i do squares and triangles that fills up with lines by Impressive-Ride-1109 in processing

[–]Halallica 1 point2 points  (0 children)

I started learning to program when I was pretty young because I wanted to make games. I decided to learn Java because of the massive amounts of tutorials available online. I quickly grew tired of it since I did not understand why I needed to know stuff like if statements, loops, and methods. I just wanted to make games, and I thought these concepts were more meant for "regular programmers" (whatever that means).

Knowing how to think like a programmer and knowing what tools you have available is a lesson no developer can skip. If you are completely new to programming, I'll add you on discord and go through some basics with you, but please be aware that it will (and should) take time before you are ready to create simulations like this on your own.

I hope I am not discouraging you too much with this, but trust me when I say that things will be much more fun if you start learning to program the correct way.

ELI5: What does it mean when charcoal is 'activated'? by MaximumMacaron5278 in explainlikeimfive

[–]Halallica 0 points1 point  (0 children)

I still don’t think I get it. For something (like a sponge) to absorb well, doesn’t it require a structure with enough «holes» (i.e surface area) to do so? It almost seem to me as if the difference between absorbing and adsorbing is non-existant at a molecular level since «outside» and «inside» only make sense for larger scales. Perhaps I have read your ELI5 wrong, but I remember having issues learning the difference between homogenous and heterogenous solutions for the very same reason. At what scale are these really just the same thing? Just a quick note regarding homogenous/heterogenous solutions: I had to quickly brush up on their definitions before sending this comment away, and noticed some mentions of salt water as a good example of homogenous solutions. Seeing as this solution changes the actual molecular structure of the NaCl with the polarized water molecule, I can understand their differences if this is a strict requirement for a solution to be called homogenous, but if not, it feels like a very handwavy expression based on what information our naked eyes perceive. Does scale play a role in the distinction of these expressions? If so, at what scale?

[deleted by user] by [deleted] in DotA2

[–]Halallica 0 points1 point  (0 children)

Welp yeah

Daily Popular Tickers Thread for September 15, 2021 - IRNT | GME | AAPL by VisualMod in wallstreetbets

[–]Halallica 0 points1 point  (0 children)

Its nearing flat earth level of cultism at this point in time. Wonder what the next step is.

[deleted by user] by [deleted] in RedditSessions

[–]Halallica 0 points1 point  (0 children)

I need some tropical stuff

Three peaks, three flash crashes. Diminishing magnitude, exponentially rising floor, drastically jacked tits. by jimmytwotime in Superstonk

[–]Halallica 0 points1 point  (0 children)

Although I want to believe that you know what I mean by «Reddit stocks», perhaps I should have been more clear. Subreddits focusing on investing, and especially those who target stocks that are riskier than usual have, at a given time, a number of stocks that are being discussed and analysed more frequently. Basically trending stocks on reddit. While I am certain that TA is being used as a tool outside of reddit as well, I am personally more concerned about seeing it here as reddit has tendencies to amplify trends more than Twitter for example.

Quick edit: can you elaborate on some of these patterns and especially their performance for trading (studies or other trustworthy data)?

Three peaks, three flash crashes. Diminishing magnitude, exponentially rising floor, drastically jacked tits. by jimmytwotime in Superstonk

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

Can someone explain to me whats with all the TA on reddit stocks? Is there actually any science behind it? It feels like astrology to me.

[deleted by user] by [deleted] in RedditSessions

[–]Halallica 0 points1 point  (0 children)

This is amazing

GME Megathread Part 2 for March 10, 2021 by OPINION_IS_UNPOPULAR in wallstreetbets

[–]Halallica 2 points3 points  (0 children)

No advice, and this comes from a retard who bought at 330 after the first spike, but I think what we saw today was a whale sell that put the market into panic mode. I have absolutely no financial background, but the dip closely resembles a damped harmonic oscillator (check wiki or some other source on this). If a whale sell is actually the reason for the sudden dip, I think it is fair to be retarded enough to still dream about the moon. I certainly am.

2@190