A bug in CRA and time complexity of list and set operations
Here are a few things I noticed in week 7.
I was creating a React app using create-react-app
and ran into this error:
After googling around I saw a workaround by installing v5 locally. ⋯
Here are a few things I noticed in week 7.
I was creating a React app using create-react-app
and ran into this error:
After googling around I saw a workaround by installing v5 locally. ⋯
The more I program, the more I find myself realizing the why of some of the basics.
You can use either a method or a function to sort or reverse a list in Python. One works in-place, meaning the order of items in the original list is changed. The other works on a copy of the list and returns an ordered version of that copy as a new list.
list.sort()
and list.reverse()
are methods of the list class. They are both verbs, suggesting they take actions on an instance of the list
class. And as methods that are internal to a list, they are understandably “allowed” to change the internal order of list items. ⋯
A few things:
Handling date and time is more complicated than I expected. python-dateutil
is quite helpful when you need to parse a datetime string.
I tried updating a field in a MongoDB document using MongoEngine. The value of that field was an embedded document that contained four sub-fields. I intended to change the value of subkey2
. But the entire embedded document was overwritten. ⋯