Bradley Martsberger

33 posts

Bradley Martsberger

Bradley Martsberger

@bradmarts

Python programmer, Chess player

Spartanburg, SC Katılım Haziran 2009
51 Takip Edilen17 Takipçiler
Bradley Martsberger
Bradley Martsberger@bradmarts·
Wordle 922 1/6 🟩🟩🟩🟩🟩 Same starting word every day and it finally happened.
English
0
0
0
25
Avetik GM Grigoryan
Avetik GM Grigoryan@GmAvetik·
In won positions, you shouldn't look for the best moves. You should look for the best PRACTICAL moves. And often, you should ignore what the engine suggests. (For example here 1.Rc8!?) It's White to play. What's the move you should play here in 1 second?
Avetik GM Grigoryan tweet media
English
64
14
116
21.6K
Bradley Martsberger
Bradley Martsberger@bradmarts·
@CraverSan @Elismal4 @ChessVonDoom started by recognizing the two checks and calculating neither works immediately. If the black knight on c5 is gone, Qxc8 Qxc8 Ne7+ wins the exchange. Looked at b4, but Nxa4 gives up too much material. Looked at whether it helps to get the bishop out of danger, found Bd7.
English
0
0
1
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@nedbat It also maps to a math meaning. Are any of the numbers in the empty set equal to 1? No. Are all the numbers in the empty set equal to 1? Less obvious, but yes, there is no number in the empty set that isn't equal to one, all of the numbers that are in the set are equal to 1.
English
0
0
5
0
Ned Batchelder
Ned Batchelder@nedbat·
People are surprised by any and all on empty sequences: >>> any([]) False >>> all([]) True It’s so that these equivalences are true: any(x + y) == (any(x) or any(y)) all(x + y) == (all(x) and all(y))
English
6
10
92
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@treyhunner Not for exiting the repl, but I’ve always been amused that sys.exit() will exit a script whether you remembered to import sys or not.
English
0
0
0
0
Trey Hunner
Trey Hunner@treyhunner·
I found a new way to exit the Python REPL: >>> import venv.__main__ # Prints out an error message and exits #pythonoddity
English
4
2
43
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@AdamChainz How does setUpTestData compare to setUpClass, which also runs only once per TestCase class instead of every test? I have always used setUpClass for this reason and not sure if there is an additional benefit to use setUpTestData.
English
1
0
0
0
Michael Kennedy
Michael Kennedy@mkennedy·
Anyone know of an in-memory structure (e.g. dictionary++) in Python that lets you have multiple indexes? Like dict[user_id, user] but can also search by user.email, user.favorites.title, etc. Not SQLite, just a simple Python data structure.
English
39
9
83
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@wsv3000 I let the pygments library (pip install pygments) give me formatted html (with syntax highlighting, line numbers, etc.) and then send that html to the template in the context and render it with mark_safe. Comes out beautiful.
English
0
0
1
0
Robert Roskam
Robert Roskam@raiderrobert·
Today I started at @dmarcian, and I've received an extremely warm welcome from the team! Happy to be aboard!
English
1
0
13
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@ChatDjango Really enjoy your show. In the latest episode (27, MySQL with Adam Johnson) it was mentioned that Postgres does not support replication that allows writes to the replicated DB. Postgres introduced Logical replication in version 10, which does allow this.
English
0
0
1
0
Bradley Martsberger retweetledi
I Am Devloper
I Am Devloper@iamdevloper·
the last 10% of a side project
GIF
English
211
4.8K
15.8K
0
Bradley Martsberger
Bradley Martsberger@bradmarts·
@pycoders After the sun sets, it comes back the next day. Are we expecting python2 to come back? No? Can we call this graveyarding instead of sunsetting?
English
0
0
0
0