News for hackers. Stuff that matters.

bgschiller

Re:Ask HN: Could you share your personal website here? on Wednesday January 14, 2026 @04:41PM (#46624006)
I'm at https://brianschiller.com, thanks for making a list :)
Re:Ask HN: What Are You Working On? (October 2024) on Sunday October 27, 2024 @11:45PM (#41967669)
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.

Re:OAuth from First Principles on Thursday September 05, 2024 @02:45PM (#41459395)
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.
Re:Understanding null safety in Dart on Saturday July 25, 2020 @04:23PM (#23952106)
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

Re:Svelte and TypeScript on Tuesday July 21, 2020 @09:20PM (#23912954)
> 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...

Re:Screens Are Bad for Young Brains on Sunday February 16, 2020 @03:01PM (#22343447)
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.

Re:Breaking Chains with Pipelines in Modern JavaScript on Thursday January 16, 2020 @11:35AM (#22066113)
perhaps it should be called "post-modern"?
Re:Inheritance versus Composition on Wednesday May 08, 2019 @11:42PM (#19865181)
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.

Re:Inheritance versus Composition on Wednesday May 08, 2019 @09:03PM (#19864432)
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

Re:Lay Out Your Code Like You'd Lay Out Your House on Tuesday July 10, 2018 @12:53AM (#17495584)
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...

Re:Why Is It Taking 20 Minutes to Mine This Bitcoin Block? on Monday February 26, 2018 @07:01PM (#16470085)
I enjoy Statistics Done Wrong https://www.statisticsdonewrong.com
Re:Show HN: Ask a Dev on Tuesday February 06, 2018 @12:40PM (#16317853)
I'm in Denver and would love to help out.
Re:Ask HN: What is your password management solution? on Saturday July 15, 2017 @10:55AM (#14776925)
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')
   12
Re:Show HN: Explained Visually on Friday November 14, 2014 @09:02PM (#8610601)
This 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

Re:How to be a great software developer on Tuesday April 22, 2014 @10:53AM (#7627997)
This guy keeps quoting his own tweets... from today. http://i.imgur.com/EePKQ.png
Re:Putnam Boxes and Balls on Friday September 20, 2013 @11:13AM (#6418195)
I'm glad you enjoyed it!
Re:Putnam Boxes and Balls on Friday September 20, 2013 @11:13AM (#6418194)
Good catch! I've fixed it now.