@davidr@hachyderm.io avatar

davidr

@davidr@hachyderm.io

Heinlein is problematic for a lot of reasons, but I've always been inspired by this:

"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects."

he/him

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

walkerb, to python

Read a post last night asking about making a python class use different code for different things. It was in the context of a game, so extending the ability of the class with different objects.

It interested me so I thought I'd play with the idea this lunchtime.

Here we have a player object (apologies to Steve Jackson / Ian Livingston for appropriating their combat system) with name, skill, stamina and the weapon and armor they have.

The weapons and armor are defined in different classes as functions representing the damage they do, or absorb.

They are passed into the player object by assigning them.

Then battle commences...

Fun little lunchtime code illustrating the power of object oriented code.

https://github.com/nakedmcse/PyRPGCombat/blob/main/PyRPGCombat.py

image/png
image/png

davidr,
@davidr@hachyderm.io avatar

@walkerb If I understand what you mean "use different code", first class functions are probably a clearer example of this.

davidr, to random
@davidr@hachyderm.io avatar
davidr, to python
@davidr@hachyderm.io avatar

oh jesus, , please stop breaking things like this

https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated

I want naive datetime objects. I want them to be unknowable because I want them to be unalterable.

I don't want some silent function in the middle of something somewhere to "help" me by changing my datetime objects to the timezone I "obviously" mean.

I want to be in charge of my own data representations.

davidr,
@davidr@hachyderm.io avatar

@tshirtman Using "naive" (i.e. unmarked and therefore universal) datetimes has always worked perfectly for me and any attempt to add timezones, even utc, has always broken something somewhere.

This idea is 'helpful" in the sense that garbage UIs are helpful: they think they know what I want better than I do and actually make my life harder.

davidr,
@davidr@hachyderm.io avatar

@tshirtman I deal with space data. It is always and forever utc, period.

If there's no tz attached, "helpful" libraries cannot try to move that time to "local". If there is a tz attached, I 10000% guarantee they will. And my code will break.

Unsubscribe me from this breakage.

villares, to python Portuguese
@villares@ciberlandia.pt avatar

So nice to see how @rougier used Shiffman's Flocking example as inspiration for the spatial vectorization techniques on https://www.labri.fr/perso/nrougier/from-python-to-numpy/#spatial-vectorization

Such a pity that the Processing Foundation has in all these years abandoned Python... but... now we have and + + has a future!

I'll see if I can remove the matplotlib dependecy and use py5 for boids in the next weeks. I have both a bio-simulation educational demo and a "hey, I'm learning numpy in the context of creative coding" presentation in the coming weeks.

davidr,
@davidr@hachyderm.io avatar

@villares @rougier I only skimmed, but the lines with "norm" in them around lines 111-116 look like clamping, not normalization.

davidr,
@davidr@hachyderm.io avatar

@villares aha, I see that now.

I guess perpend_a/_b are the other points of the triangle. but those are just using individual components, which aren't normalized....?

davidr,
@davidr@hachyderm.io avatar

@villares Right, but individual components of a normalized vector can be any length at all. Or maybe I'm not understanding what '[::-1]' means....

Mrfunkedude, to ADHD
@Mrfunkedude@mastodon.social avatar

This week with my brain...

Start a project.

Half way through get an idea for a different project and start working on it.

Half way through realize that you've forgotten about the first project and go back to work on it.

Realize that for whatever reason you just don't care about the first project.

Go back to work on the second project while feeling bad that you abandoned the first project.

Half way through get an idea for a different project and start working on it.

Rinse & repeat.

davidr,
@davidr@hachyderm.io avatar

@Mrfunkedude OTOH, getting busy with a new project helps me feel better about avoiding the old abandoned project

davidr, to cocktails
@davidr@hachyderm.io avatar

Here's a hot take

Irish Whiskey is kinda gross.

Even hotter take

I think I just don't like whiskey. It tastes like licking a dead branch.

davidr, to cocktails
@davidr@hachyderm.io avatar

Over the next couple of weeks, I'm going to try all my favorite Cointreau-containing with limoncello instead.

Like...why is Lemon Drop made with orange liquer?

(Unrelated sidenote: While buying another amaretto, I noticed a hazelnut liquer. We'd already tallied >$100 so that intriguing item goes onto a future list.)

davidr, to food
@davidr@hachyderm.io avatar

Almost all crunchy plant-based food is based on rigid, fluid-filled cells. Celery. Apple. Lettuce.

Almost all crunchy human-made food is based on brittleness. Chips. Crackers.

My fellow madscientists, I propose a new field of satisfyingly crisp food built on the principle of the plant cell. A taut, bursty, fluid-packed membrane.

We made gushers, but we can go farther, reach higher, chew louder.

davidr, to random
@davidr@hachyderm.io avatar

I'm chaotic good at home, lawful evil at work.

Yeah, that make sense.

AkaSci, (edited ) to random
@AkaSci@fosstodon.org avatar

Celestial events to look forward to in 2024 -

  1. April 8, 2024: Total solar eclipse. Most of North America will see at least a partial solar eclipse.
  2. October 2024: Comet C/2023 A3 (Tsuchinshan-ATLAS), which is promising to be bright spectacular comet with apparent magnitude below 0 (lower is brighter). Closest approach to earth is on Oct 12.

https://www.greatamericaneclipse.com/april-8-2024
http://astro.vanbuitenen.nl/comet/2023A3

1/n

davidr,
@davidr@hachyderm.io avatar

@AkaSci I'll see near-totality without leaving my yard!

Maybe I should figure out some thing

I actually want to night sky tracking anyway. Could I work on the sats while building up to the ?

I wonder if there's much camera technology overlap between these goals. Probably not. The sun is pretty bright. Maybe just a solar filter, tho?

davidr, to ADHD
@davidr@hachyderm.io avatar

Was it stupidity, denial or just obtuseness that made me not recognize for 50 years? Not even an "oh, it's that feeling again where I'll do anything I can to avoid this simple 5m task, maybe listening to music will help".

Or . Prooooobably most people aren't assuming that everyone not currently actively praising them is deeply angry at them for unspecified reasons.

Anyway, talk to your doctor and try some medication. It's pretty great.

futurism, to random

AI's Electricity Use Is Spiking So Fast It'll Soon Use as Much Power as an Entire Country https://t.co/zEMOZ5JoY3

davidr,
@davidr@hachyderm.io avatar

@futurism Padme: But at least the benefits outweigh the costs....right?

futurebird, to random
@futurebird@sauropods.win avatar

Ants are the strange members of the hymenopterans. What defines a "bee" or a "wasp" ?

Flying! Stinging! Ovipositing! Bright warning colors!

Ants looked at the main advantages of being hymenopteran and said... nah. I guess stinging is OK... (Though most ants don't sting.) ... but most of this is nothing compared to going eusocial.

Personally I think eusociality is such a huge advantage this makes sense.

But then why aren't the bees who do both more successful? Are they too specialized?

davidr,
@davidr@hachyderm.io avatar

@futurebird Bees seem pretty successful. Other than them and ants, who else in the insect world has an A-list Hollywood movie devoted to them?

lcamtuf, (edited ) to random

deleted_by_author

  • Loading...
  • davidr,
    @davidr@hachyderm.io avatar

    @lcamtuf oh no oh no oh no please hyperfocus don't make me do this too i've got enough going on

    scy, to random
    @scy@chaos.social avatar

    “How do you know all this stuff?”

    “I read the fucking manual.”

    davidr,
    @davidr@hachyderm.io avatar

    @scy "Just by being curious. How do you not?"

    davidr, to random
    @davidr@hachyderm.io avatar

    Got yet another request that ignored my calendar but listed me as "required".

    This time I declined and "proposed a new time". Politely but tersely noted if I was truly required I wouldn't be available at that time but that "my calendar is up to date".

    My proposed new time is in a slot their calendar says busy. Huh!

    tante, to random
    @tante@tldr.nettime.org avatar

    There's a weird gendered thing where after every talk or article of mine coming out some male academic sends me a bunch of their articles or books to read.
    Which is nice at times to see who works on what but it has never been a woman or nonbinary person. Only men.

    I don't know if it's just men being more aggressive in pushing themselves and their careers or if it's men having a hard time making a compliment without overloading it with some weird transaction.

    davidr,
    @davidr@hachyderm.io avatar

    @tante Display behavior.

    lcamtuf, to random

    My son's 1-bit CPU project. Work in progress, so not all bits might be present yet.

    davidr,
    @davidr@hachyderm.io avatar

    @lcamtuf Interested in hearing about the design or seeing a block diagram or something.

    Or even just an explanation of what a "1 bit CPU" means. 1 bit bus? Serial?

    davidr, to datascience
    @davidr@hachyderm.io avatar

    peeps, hear my cry!

    Let's say there's a periodic process that I'm sampling. The period is changing slowly (<1% per cycle). I get a sample on a lot of the cycles, but not necessarily every one.

    I'm sure I can bodge together an to figure out the "fundamental period" and how it is changing over time, but I also bet something already exists.

    What's my keyword?

    davidr,
    @davidr@hachyderm.io avatar

    @recursive Question clarified. No aliasing problem--I know what ambiguity zone I'm in, I just don't know the exact value. But the value is also changing.

    0xabad1dea, to random

    one of these is the leaked official, original source code of Pokemon Emerald and one of these is a decompile made by hobbyists trying to reverse engineer what the game is doing

    and you know I wouldn't be posting this if they were not, apparently, switched at birth.

    screenshot of an absolute disaster of completely obtuse magic numbers. THIS IS THE GROUND TRUTH SOURCE CODE

    davidr,
    @davidr@hachyderm.io avatar

    @0xabad1dea How did it decompile into symbols that apparently were never in the symbol table?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • normalnudes
  • khanakhh
  • magazineikmin
  • thenastyranch
  • hgfsjryuu7
  • Youngstown
  • rosin
  • InstantRegret
  • slotface
  • mdbf
  • PowerRangers
  • tsrsr
  • kavyap
  • DreamBathrooms
  • Leos
  • vwfavf
  • ngwrru68w68
  • ethstaker
  • tacticalgear
  • cubers
  • Durango
  • everett
  • osvaldo12
  • modclub
  • tester
  • cisconetworking
  • GTA5RPClips
  • anitta
  • All magazines