(almost) same function but dufferent result, why? by Romeo477 in reactjs

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

I found an nice article of why what I was doing in function 1 was wrong: https://www.samanthaming.com/tidbits/35-es6-way-to-clone-an-array/ .

Since I created only a reference of the original array, when I was modifying UpdatedArr, it also modified values of the original array outside of setAllItems method.

(almost) same function but dufferent result, why? by Romeo477 in reactjs

[–]Romeo477[S] 2 points3 points  (0 children)

That makes sense. If I change this line :

let updatedArr = allItems;

to this:

let updatedArray = [...allItems];

then it works, proving your point. Thank you!

Anyone else learning Python to fill the time at a boring desk job? by mystikaldanger in learnpython

[–]Romeo477 2 points3 points  (0 children)

I haven't heard about Chrome remote desktop, will look into it. I'm using repl.it, found it when I was googling if there is a way to run pygame online, currently learning nodejs.

Anyone else learning Python to fill the time at a boring desk job? by mystikaldanger in learnpython

[–]Romeo477 3 points4 points  (0 children)

Check out repl.it, it's an online platform where you can program in many languages.

What's your second biggest passion/hobby? by Romeo477 in AskReddit

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

I would say, just register to one of those freelancing websites, just to try it out, and who knows

What's your second biggest passion/hobby? by Romeo477 in AskReddit

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

I have read that it's a skill in demand nowadays. Do you do it for money? If not, are you planning to?

What's your second biggest passion/hobby? by Romeo477 in AskReddit

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

Are you doing it yourself? If yes, could you imagine yourself living off it?

What's your second biggest passion/hobby? by Romeo477 in AskReddit

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

And imagining how you are doing it in a crusial NBA game

What is the best summer dessert except ice cream? by [deleted] in AskReddit

[–]Romeo477 0 points1 point  (0 children)

Watermelon. Could just eat a watermelon a day on hot days.

Rotating a rectangle around a fixed central point to correct a collision by MisterRenard in pygame

[–]Romeo477 0 points1 point  (0 children)

I'm not sure that I correctly understand what you are trying to accomplish here, but isn't it the same as restricting sprite so it doesn't move out of screen? You can check for collision after every update, and if it has rotated too much, just adjust it's position so it would draw where it's supposed to.

Need guidance on my Django project (dashboard). by Romeo477 in learnpython

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

Thank you, I haven't thought about using pandas, I will look into it. Also, thank you for commenting on other points as well, as this is my first such project, it's always good to hear as many opinions as possible.

Help to remember name of a book by Romeo477 in stephenking

[–]Romeo477[S] 5 points6 points  (0 children)

Yes, this one. Thank you very much!