I'm at https://brianschiller.com, thanks for making a list :)
HN user
bgschiller
I'm trying to make a spreadsheet interface for solving scheduling problems.
Constraint satisfaction and optimization is exactly the sort of problem we should be using computers for, but there's zero chance your neighborhood cafe can figure out prolog or OR-tools or whatever.
Nice writeup, this is also how I think about OAuth.
I gave a very similar talk at Develop Denver back in 2018: https://www.youtube.com/watch?v=7rGkz9Ib4fQ
My slides even look similar to your diagrams: https://brianschiller.com/lets-build-oauth/#/31/10
Unless you're importing *, pylint will tell you about both missing imports and unused ones.
There are a couple of attempts in that direction with TypeScript[1,2]. A bit more work than if there was direct language support, but I've used "branded types" to distinguish between UserIds and ProductIds, between different types of currency, and between different unit systems.
1: https://spin.atomicobject.com/2018/01/15/typescript-flexible...
2: https://basarat.gitbook.io/typescript/main-1/nominaltyping
E.g. I couldn’t for the life of me annotate the return value of the pipe function
Don't feel bad, no one can do that (yet! I think it should be possible with Variadic Tuple Types, coming in TS 4). There are a couple of attempts[1][2], but they all lack in some way. Redux does it with a boatload of overloads [3].
1: https://dev.to/ascorbic/creating-a-typed-compose-function-in...
2: https://stackoverflow.com/a/53066700/1586229
3: https://github.com/reduxjs/redux/blob/686d29b5d4e2dcb6709c16...
I think you might be underestimating how hard breastfeeding is pushed in US hospitals. Our second night in the hospital with my son, my wife's milk hadn't come in yet.
Our son was screaming because he was hungry. The nurse kept saying this was good, that it would encourage breast milk production. It took several tries to convince her that, while it might be good in the long run, we needed some food for this baby.
This was a consistent experience with all nurses we dealt with. Interestingly, breastfeeding specialists tended to be more understanding.
perhaps it should be called "post-modern"?
I think I'm confused. If you want to delegate _everything_, why not just actually use inheritance? Or even the object itself. What's an example of when you would want an ObjectProxy?
Definitely agree about metaclass magic being a blessing and a curse. That superdelegate library was fun to write and uses a metaclass to make the API pleasant.
Nice write-up! Coincidentally, I wrote on the same topic, also in python just a few days ago [1]
I came to largely the same conclusions, but instead of forwardable, I wrote a new library called superdelegate that is, IMO, more explicit [2]
1: https://brianschiller.com/blog/2019/05/03/two-sorted-lists 2: https://github.com/bgschiller/superdelegate
This reminds me of the Ducks pattern[1] that I've been excited about recently. And also Vue's single-file components.
[1] https://github.com/erikras/ducks-modular-redux/blob/master/R...
I enjoy Statistics Done Wrong https://www.statisticsdonewrong.com
I'm in Denver and would love to help out.
I wrote about my (mac-specific) pass setup at https://brianschiller.com/blog/2016/08/31/gnu-pass-alfred
It uses Alfred to get fast, autocompleted access to passwords.
I also found myself doing that pretty often, so I wrote this:
def nget(d, *ks, **kwargs):
for k in ks:
d = d.get(k)
if d is None:
return kwargs.get('default')
return d
>>> d = {'a': {'b': {'c': 12 }}}
>>> nget(d, 'a', 'd', 'c', default='Not Found!')
'Not Found!'
>>> nget(d, 'a', 'b', 'c')
12This is very cool!
As a piece of constructive feedback, consider waiting until a visualization is scrolled into view to start animation. I'm particularly thinking of the Exponentiation page. Mike Bostock wrote about this recently: http://bost.ocks.org/mike/scroll/#4
This guy keeps quoting his own tweets... from today. http://i.imgur.com/EePKQ.png
I'm glad you enjoyed it!
Good catch! I've fixed it now.