@freeradical@mastodon.online avatar

freeradical

@freeradical@mastodon.online

Godless Commie Fur-ner Scientist. @Free_Radical1 on Twitter. 🇺🇦🇨🇦

This profile is from a federated server and may be incomplete. Browse more on the original instance.

pamelafox, to random
@pamelafox@fosstodon.org avatar

my 4 yr old wanted watermelon. i got her watermelon, she ate a slice. NOONE ELSE IN THIS HOUSE LIKES WATERMELON. what the heck do I do with so much watermelon? ugh why are they so big.

freeradical,
@freeradical@mastodon.online avatar

@pamelafox cocktails!

nedbat, to python
@nedbat@hachyderm.io avatar

Remember that dicts can have tuples as keys! Consider a dict with (x,y) keys instead of nested lists for a grid. It simplifies sparse grids, "resizes" are automatic, it doesn't matter where (0,0) is, and you can use negative positions:

Adding more to the board in flexible ways. https://gist.github.com/nedbat/f22b03f70ceb9686881c4bcd442fad11

freeradical,
@freeradical@mastodon.online avatar

@nedbat One thing I learned from Advent of Code is that using complex numbers instead of tuples(e.g. 1+ 2i instead of (1,2) ) has many advantages. Those should work as dict keys too, right? (hashable)

SRDas, to Japan
@SRDas@mastodon.online avatar

A fair bit of train(s) rides this morning - to get to in
Will grab lunch first and then some walk around. Original plan was to spend a couple of days - perhaps in Shirahama but the cold wasn't too helpful for the beach or camping so just a day trip

freeradical,
@freeradical@mastodon.online avatar

@SRDas Where I grew up in Canada, Japanese oranges (“Christmas Oranges”) were a tradition. They came in cardboard boxes, individually wrapped in green tissue paper. Mom always put one in the toe of our Christmas stocking.

AlSweigart, to random
@AlSweigart@mastodon.social avatar

deleted_by_author

  • Loading...
  • freeradical,
    @freeradical@mastodon.online avatar

    @AlSweigart Extra points for using a fake Einstein quote to troll people.

    ZachWeinersmith, to comics
    @ZachWeinersmith@mastodon.social avatar
    freeradical,
    @freeradical@mastodon.online avatar

    @ZachWeinersmith Design of Sexperiments

    ZachWeinersmith, to random
    @ZachWeinersmith@mastodon.social avatar

    What food do you think has the most intermediate production stages where it is recognizably some other food (not just an ingredient). For example, processed cheese:

    1. Milk
    2. Fresh cheese
    3. Aged cheese
    4. Emulsified cheese
    freeradical,
    @freeradical@mastodon.online avatar

    @ZachWeinersmith Hmm.

    soy bean
    soy milk
    douhua
    tofu
    stinky tofu, pickled tofu etc.

    ?

    SwiftOnSecurity, to random
    freeradical,
    @freeradical@mastodon.online avatar

    @SwiftOnSecurity Did… did they also tinfoil the outhouse? (Right side of image)

    ZachWeinersmith, (edited ) to random
    @ZachWeinersmith@mastodon.social avatar

    Boole: invented new logic, possibly accidentally killed by his wife making him sleep in cold wet sheets when he had pneumonia

    Frege: invented new logic, late in life was shattered by a discovery of Russell's, wound up a sad angry anti-semite

    Cantor: invented new logic, everyone hated him, severe depression, conspiracy theories

    Turing; invented new logic, hounded by government, forced to take hormones against his will

    Godel: Godel

    Lesson: don't study logic

    freeradical, (edited )
    @freeradical@mastodon.online avatar

    @ZachWeinersmith See also: Statistical Mechanics

    mariatta, to random
    @mariatta@fosstodon.org avatar

    Python 3.12 is out!!

    Download it from python.org

    Some features I'm excited about:

    • Improved ‘Did you mean …’ suggestions for NameError, ImportError, and SyntaxError exceptions 💡
    • asyncio performance improvements ⚡
    • f-strings!! Expression components inside f-strings can now be any valid Python expression

    What's new in Python 3.12:
    https://docs.python.org/3.12/whatsnew/3.12.html

    freeradical,
    @freeradical@mastodon.online avatar

    @mariatta pathlib.Path.walk() 🤩

    mcc, to random
    @mcc@mastodon.social avatar

    I have another Python question. It's kind of a Best Practices question.

    Python Pip has an "extras_require" feature which I interpret as being equivalent to Rust "features". If you pip install packagename[blargarg] you activate the blargarg extra and some additional packages will be installed.

    Imagine a function in a package requires an extra. A user does not install the extra, then calls the function that requires it. What would you expect it to do? Throw an error? Which one?

    freeradical, (edited )
    @freeradical@mastodon.online avatar

    @mcc I’m facing this with my library. In order to use it in a PyScript web context, I’d have to remove a requirement for a library that’s not bundled with PyScript but makes the scientific calculations faster. I have both slow and fast private calc functions, and I plan to refactor my library so the user-facing API chooses one based on the “try: import X” result. The user wouldn’t have to change their code if run in different contexts.

    lowqualityfacts, to random
    @lowqualityfacts@mstdn.social avatar

    Uh oh.

    freeradical,
    @freeradical@mastodon.online avatar

    @lowqualityfacts You can’t fool me with that photo of Volodymyr Zelensky.

    dabeaz, to random
    @dabeaz@mastodon.social avatar

    My kid has finally reached the age where's he's taking a math class that I've actually taught. I'm now his worst nightmare.

    "Dude, I would take off all points for the way you just wrote that answer."

    "What?"

    "Penmanship."

    (annoyed stare....)

    freeradical,
    @freeradical@mastodon.online avatar

    @dabeaz My niece is a freshman university student. My wife and I have a standing offer to help with chemistry. I wonder if at some point we’ll be tsk-tsking her pentavalent (aka “Texas”) carbons.

    mariatta, to random
    @mariatta@fosstodon.org avatar

    We harvested the potatoes from our backyard and yesterday I used them to make pierogies 😋🥟🥔🥓

    Homemade potato, cheddar, and bacon pierogies.

    freeradical,
    @freeradical@mastodon.online avatar

    @mariatta Nice! Also: which Asterix?

    treyhunner, to python
    @treyhunner@mastodon.social avatar

    Knowing when to use a set in can be VERY handy sometimes.

    no_neighbors = [
    n
    for n in nums
    if n-1 not in nums
    and n+1 not in nums
    ]

    If "nums" is a list of 500,000 numbers, this takes 54 minutes.

    Convert "nums" to a set and this taken less than 1 second.

    Why?

    It's all about that "in" operator.

    Checking for containment in a list requires looping over the whole list.

    Checking for containment in a set uses the magic of hashing to return an answer without looping.

    freeradical,
    @freeradical@mastodon.online avatar

    @treyhunner I wonder how that would compare to creating two more sets: one { n - 1 for n in n_set} and another for n + 1, and taking their intersection. If n isn’t in that intersection, it has no neighbors.

    AlSweigart, (edited ) to random
    @AlSweigart@mastodon.social avatar

    deleted_by_author

  • Loading...
  • freeradical,
    @freeradical@mastodon.online avatar

    @AlSweigart Create abstract base class “lock” with required method led_flash(). In the spirit of YGNI (You’re Gonna Need It), also include methods led_on() and led_off().

    Then, create subclasses “lock_caps” and “lock_num” that inherit from the lock class.

    gabek, to random

    It's probably time for me to make the switch to Firefox. I was a full time Firefox user back in the day, but as Chrome got mainstreamed I moved to that, and then later to Brave, since I felt like "at least it's not Chrome". But it's hard to even justify that now.

    freeradical,
    @freeradical@mastodon.online avatar

    @alassek @nicknisi @gabek No Safari 😭

    freeradical, to random
    @freeradical@mastodon.online avatar

    Well, maybe I’ll drop this photo of Moraine Lake. This is the actual color; this photo was not digitally altered.

    pamelafox, to random
    @pamelafox@fosstodon.org avatar

    Reviewing Jupyter notebook diffs: decidedly not my happy place. (At least not in GitHub standard PR view, maybe there's a better way)

    freeradical,
    @freeradical@mastodon.online avatar

    @pamelafox The only help I know is running nbstripout before every commit.

    APBBlue, to random
    @APBBlue@zirk.us avatar

    There's a guy in my office who simply won't shut up. He is my nemesis. He has no idea he is my nemesis.

    freeradical,
    @freeradical@mastodon.online avatar

    @APBBlue Anonymesis.

    freeradical, to random
    @freeradical@mastodon.online avatar

    Last boost is the start of an interesting thread by @timkmak ☁️💥🔥

    lowqualityfacts, to random
    @lowqualityfacts@mstdn.social avatar

    Thanks for all the birthday wishes! If you want to help celebrate my birthday, you can:

    1. Tell me your favorite thing about my cat Fishy. Yes, I will read all of your comments to him. English is not his first language, but I believe he has a basic understanding of most of the words.
    2. Subscribe to my Patreon so I can continue to write all the dumb silly things that I write.

    I may create Low Quality Facts, but I am very grateful for all of my high quality friends here.
    https://patreon.com/lowqualityfacts

    freeradical,
    @freeradical@mastodon.online avatar

    @lowqualityfacts My favorite thing is he looks like my cat Bucky minus the pink nose.

    freakboy3742, to random

    Vale, Storm. Occasionally a frustrating idiot, but always a good kitty, right to the end. Thank you for 19 years of companionship.

    freeradical,
    @freeradical@mastodon.online avatar

    @freakboy3742 I’m sorry for your loss. 19 years is a good run.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • osvaldo12
  • InstantRegret
  • thenastyranch
  • magazineikmin
  • everett
  • rosin
  • Youngstown
  • slotface
  • cubers
  • cisconetworking
  • kavyap
  • GTA5RPClips
  • DreamBathrooms
  • megavids
  • tacticalgear
  • khanakhh
  • mdbf
  • Durango
  • ngwrru68w68
  • tester
  • normalnudes
  • ethstaker
  • provamag3
  • modclub
  • Leos
  • anitta
  • lostlight
  • All magazines