I haven't been keeping up with this blog, but I have been keeping busy. A few things I've learned recently:
-
Although JavaScript has a
typeofcommand, it doesn't produce very useful output. In particular, it yieldsobjectno matter whether the structure in question is a Map, an Array, a Set, or an Object. Apparently,x.constructoris how to find out what type something actually is. -
On bash,
whichis a program, not a builtin. So it's not aware of aliases, likepython='python3'. Neither issudo. So you can checkpython --version >= 3but that's no guarantee thatsudo pip installorsudo python -m pip installwill be python3. It makes me rethink the utility of aliases, and possibly virtualenvs. -
Python lists are not implemented with pointers like Lisp lists! Per Peter Norvig, Python list access is O(1); per the Python Design and History FAQ, they are contiguous memory chunks with a head pointer and length value stored up front.
Three things make a post, plus it's dinnertime: fried tofu w/ bbq sauce, risotto, and Sichuan dry-fried mushrooms & peppers.