@ehmatthes@fosstodon.org
@ehmatthes@fosstodon.org avatar

ehmatthes

@ehmatthes@fosstodon.org

Author, teacher, programmer, outdoor guy · ehmatthes.com · Python Crash Course · django-simple-deploy

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

seachanger, to random
@seachanger@alaskan.social avatar

nbd we're just cruising through a magnitude g4 solar storm rn

ehmatthes,
@ehmatthes@fosstodon.org avatar

@seachanger G5 now!

ehmatthes,
@ehmatthes@fosstodon.org avatar

@seachanger I'm jealous of all these pictures from Europe. I hope we do get some nice skies tonight.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@seachanger We are so jealous! It clouded over just before dark. A few people got a few overhead glimpses, but that was it. Glad you got to see it!

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Anybody in the northern hemisphere worried about their electronics today?

https://www.swpc.noaa.gov/products/wsa-enlil-solar-wind-prediction

ehmatthes,
@ehmatthes@fosstodon.org avatar

I know enough about this kind of event to be fascinated, but not enough to know whether damage is likely.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@carlton Here's an explanation of the scale for rating these events. What's confusing to me is this is the first G4 event since the early 2000s.

Yet this scale indicates that G4 events happen about 100 times per cycle, where a cycle is 11 years. So ~10 per year?

https://www.swpc.noaa.gov/noaa-scales-explanation

webology, to random
@webology@mastodon.social avatar

👋 If you have any tech books you no longer need and are attending , kindly bring them with you and donate them. https://mastodon.social/@webology/112412883477592922

ehmatthes,
@ehmatthes@fosstodon.org avatar

@webology I would add that people should make sure the books they're donating are up to date enough that it's worth students' time to learn from them.

When I dealt with donations of tech books as a teacher, we spent a fair bit of time filtering out books that were good, but outdated enough that they'd only lead to frustration for students.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Part 5 of the Django from first principles series is out this week.

In this post: modeling data, and working with data in the Django shell.

https://www.mostlypython.com/django-from-first-principles-part-5/

AlSweigart, to random
@AlSweigart@mastodon.social avatar

Free mobile game idea: Identify f**ked up artifacts in AI-generated images. It's easy to make content and fairly simple program.

What's up with the mini three-legged table? Why does his suit jacket have mold spores? What's the word on his laptop? Why is the laptop asymmetrical? What's with the shape of the red couch? Why is a table coming in from the other room?

ehmatthes,
@ehmatthes@fosstodon.org avatar

@jblake @AlSweigart It's tables, all the way down.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

People who use reveal.js, do you end up duplicating slides with slight tweaks in order to get the effects you want sometimes?

It feels pretty hacky and inelegant, but much simpler than trying to code up what I want to see sometimes.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Yes Gmail, I really do want to leave the page.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

We had a nice spring rainbow last night. :)

SilverSalmonAK, to Alaska
@SilverSalmonAK@alaskan.social avatar

6:00AM: 43F, woke up to rain.

Still expecting rain today, tomorrow, then heavy rain Thursday. We have a large system hitting the panhandle and Sitka will get a big share of that.

SE40kt gale tonight - no fishing for John!

Attached is a pic of a lovely, super bright rainbow last night.

No rainbows without rain!

ehmatthes,
@ehmatthes@fosstodon.org avatar

@SilverSalmonAK That was one of the most perfect rainbows we've ever seen!

diazona, to python
@diazona@techhub.social avatar

I remember having a discussion about argument parsing in a while ago where someone recommended a small library that was kind of like argparse except that instead of returning an argparse.Namespace, it returns a fully typed object (which you define), a dataclass or something similar. Anyone know what I'm talking about? I wanted to try that library but I forgot what it is and I can't find the discussion.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@diazona Was it Click, or something much smaller than that?

https://click.palletsprojects.com/en/8.1.x/

ehmatthes,
@ehmatthes@fosstodon.org avatar

@diazona @pawamoy I'm glad you asked about this, Cappa looks really interesting. I've been looking for something more than argparse, without going all the way to Click.

ambv, to python
@ambv@mastodon.social avatar

The core․py podcast wasn't dead, it was just sleeping! Pablo Galindo and I return to talk about the upcoming new REPL in 3.13 ♒️

Join us for our signature professional takes just in time for Python 3.13 beta 1 and 🛜

https://podcasters.spotify.com/pod/show/corepy/episodes/Episode-10-The-Interactive-REPL-e2j788i/a-ab7uiak

ehmatthes,
@ehmatthes@fosstodon.org avatar

@ambv core.py is my new favorite podcast! Thanks so much for all the work that goes into it.. :)

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

In part 4 of the Django from first principles series, we start modeling data and working with a database:

https://www.mostlypython.com/django-from-first-principles-part-4/

ehmatthes,
@ehmatthes@fosstodon.org avatar

For people curious about the series but not following closely, this is where it makes sense to break out into a manage.py file.

This is also the point where you really have to break out into an app-based structure, in order to support migrations. But it's also a very inuitive organizational step.

I really like how this process is playing out.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

All right, here's a fun Django question:

You start a simple project, using SQLite locally. You write a model, then call makemigrations, then call migrate.

At what point is the db.sqlite3 file created?

ehmatthes,
@ehmatthes@fosstodon.org avatar

@CodenameTim I had the same assumption, but the behavior was quite interesting when trying a few minimalist approaches.

With runsever active, saving settings.py after adding the DATABASES dict with SQLite as default resulted in an empty db.

Without runserver active, calling makemigrations results in a new db file.

If I call migrate without a db file present, a new db is created.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@CodenameTim Your mention of the django_migrations table led to a little more source code diving. I had always assumed there was a command somewhere in Django that created the db.sqlite3 file if needed.

TIL that creating a connection to SQLite creates the db file if it doesn't already exist.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@ryanhiebert @CodenameTim I believe makemigrations looks at the database to see which migrations have been applied:

https://github.com/django/django/blob/c187f5f9242b681abaa199173e02066997439425/django/core/management/commands/makemigrations.py#L137

More specifically, I think it's looking for inconsistencies in which migrations have been applied:

https://github.com/django/django/blob/c187f5f9242b681abaa199173e02066997439425/django/db/migrations/loader.py#L307

ernie, to random
@ernie@writing.exchange avatar

At this point I am not trying to be too judgmental about people who use Substack—hey, it’s your paycheck.

But I will point out to them where possible that they are making an ethical choice to go with a platform with a questionable track record.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@ernie That's an interesting idea. I"m not too sure how to model that well.

For mailgun, the cost depends on how often you publish. So someone who posts 3x/ week will have triple the cost of someone who posts once a week. I suppose that's just one more input, "How many times do you publish each month?"

Also there's some subjective decisions around droplet size as usage scales.

ehmatthes,
@ehmatthes@fosstodon.org avatar

@ernie Everything else on the tool is objective. This would be the only subjective set of numbers.

I also think the people actually capable of self-hosting an email newsletter are the people most able to make these kinds of comparisons without a dedicated tool, at least to an order of magnitude.

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

What's everybody using to make their talk slides these days?

I've given a number of talks, but they've been spread out enough over the years that I've never developed deep familiarity with any one tool. I've mostly used PowerPoint and Keynote.

If you use reveal.js, do you use the basic setup? Full install? Hosted version?

ehmatthes,
@ehmatthes@fosstodon.org avatar

@pamelafox Thanks again for sharing this. I'm just starting my slides, and this was really helpful to run through. :)

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