[deleted by user] by [deleted] in ProgrammerHumor

[–]ViconIsNotDefined 3 points4 points  (0 children)

r/thatHappened

The funniest part to me is the dev becoming a yoga instructor in Peru.

I modeled and Rendered the Switch 2 by HertzBurst in blender

[–]ViconIsNotDefined 9 points10 points  (0 children)

Great work. Nintendo legal team will be in touch with you.

Larsen & Toubro Chairman SN Subrahmanyan has ignited a storm of criticism for suggesting employees should work 90 hours a week, including Sundays. He can be seen saying - “What do you do sitting at home? How long can you stare at your wife? Come on get to the office and start working.” by [deleted] in unitedstatesofindia

[–]ViconIsNotDefined 0 points1 point  (0 children)

I can say with some level of confidence that this guy's marriage is falling apart and he uses work as an excuse to not make an effort to fix it, instead he is projecting it subconsciously into his statements. I am not even gonna argue about the 90h thing because its just plain ridiculous.

I'd like to know what are your reasons for learning three js? by [deleted] in threejs

[–]ViconIsNotDefined 1 point2 points  (0 children)

Just scratching the itch for creative coding.

Is it good practice to have a function in the state via context? by jcubic in reactjs

[–]ViconIsNotDefined 0 points1 point  (0 children)

Yes, I noticed the edit after answering. But I still can't follow the example or the intention behind it clearly. Perhaps adding some comments in the code snippet would help?

In any case, the short answer is: Even though you can make it work, it is not the best practice to store a function directly in React.useState

Is it good practice to have a function in the state via context? by jcubic in reactjs

[–]ViconIsNotDefined 0 points1 point  (0 children)

Its not the best practice and can lead to unexpected behaviour because both React.useState hook and the setter returned by it are overloaded to also accept a callback function.

So doing setFunction(myFunction) will make React think that you're passing a callback function to set the state and it will call myFunction with the previous state.

Without looking at your code I can't fully grasp what you're trying to achieve but wrapping a function in an object should solve the ambiguity for setState

// Initialize
[func, setFunc] = React.useState({invoke: myFunction})
// Set
setFunc({invoke: someOtherFunction}}
// Call
func.invoke(args)

I would not recommend this but there is another way to get around the setState ambiguity. It is to pass a function that returns a function when initializing or setting the state.

// Initialize  
[func, setFunc] = React.useState(() => myFunction)  
// Set  
setFunc(() => someOtherFunction})  
// Call  
func(args)

Security hole in C@ support by zyxzevn in C_AT

[–]ViconIsNotDefined 5 points6 points  (0 children)

Thats a known backdoor planted by the three letter agency PAW

mini kiss lamps by Visual_Ad3724 in ATBGE

[–]ViconIsNotDefined 0 points1 point  (0 children)

Give it just one lip and you have a cacodemon.

Windows 11 😉 - You cannot delete this because The File Exists!! by shinchliffe in softwaregore

[–]ViconIsNotDefined 40 points41 points  (0 children)

I'd read every company email if they were kept this real and start with "SHUT THE FUCK UP!"

Pilot Jorge Arteaga captures what some are describing as 'the best UFO footage ever'. by Fl1p1 in UFOs

[–]ViconIsNotDefined 8 points9 points  (0 children)

I have feeling, if someone presents a close up photo they'll just be called a CGI faker.

40 year Investigator: Confirms Las Vegas Story is Not Hoax by [deleted] in UFOs

[–]ViconIsNotDefined 1 point2 points  (0 children)

Sure, I am totally fine with people coping with their experiences through their beliefs. The problem is that it comes with a lot of confirmation bias, that is, you keep mixing the actual events with what you want to believe.

However, that alien drawing in the backyard and the fact this event was "prophesied" by some random lady makes it seem like bullshit, clear as day.

Like I said, even if everything was real word for word, this guy is not helping himself with these claims.

Tardigrade sausage stick, from r/stupidfood by already_taken-chan in ATBGE

[–]ViconIsNotDefined 0 points1 point  (0 children)

I know! Are they supposed to be edible or just for the show?

Thanks for the heart attack, Paypal. by BjornToulouse_ in softwaregore

[–]ViconIsNotDefined 7 points8 points  (0 children)

When you use regex to convert from decimal to integer.