@carlton@fosstodon.org
@carlton@fosstodon.org avatar

carlton

@carlton@fosstodon.org

Veteran software engineer and open source juggler 🤹 I work mainly on and with the Django web framework. When I’m not doing that it’s parenting, cooking, and philosophy. He/him

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

hynek, to random
@hynek@mastodon.social avatar

Ohhh nice Return to Monkey Island is coming to Apple Arcade in June! Absolutely loved playing it on my SteamDeck: https://apps.apple.com/de/app/return-to-monkey-island/id6476317779

carlton,
@carlton@fosstodon.org avatar

@hynek Wowser. A game I actually want to play in Arcade. That’s a novelty 🥳

khalidabuhakmeh, to random
@khalidabuhakmeh@mastodon.social avatar

I made a ServiceWorker intercept calls and manage state inside of the ServiceWorker process all in-browser.

The downside is it takes a few seconds for the service worker lifecycle to start, so it's likely only available on page refreshes. Still a neat concept.

Service worker handling click events for HTMX with count going up on each click.

carlton,
@carlton@fosstodon.org avatar

@khalidabuhakmeh could you share that example? It would be good to see.

carlton,
@carlton@fosstodon.org avatar

@khalidabuhakmeh super thanks.

It’s something I’ve been half-pondering, so to have an example to begin from will be really handy. (Never wrote a service worker yet)

🎁

carlton, to random
@carlton@fosstodon.org avatar

Explain Chomsky’s theory of “manufacturing consent” in a single screenshot.

From: @eb
https://social.coop/@eb/112411289896922707

bmispelon, to django
@bmispelon@mastodon.social avatar

New article on my blog: a ORM technique I found for combining JSONObject and Subquery to build model instances: https://blog.bmispelon.rocks/articles/2024/2024-05-09-django-getting-a-full-model-instance-from-a-subquery.html

carlton,
@carlton@fosstodon.org avatar

@lilyf @CodenameTim @bmispelon I wonder if using ArrayAgg, rather than JSONObject, would let you select the raw values without the conversion 🤔

Awesome post! 🎩

https://docs.djangoproject.com/en/5.0/ref/contrib/postgres/aggregates/#arrayagg

carlton,
@carlton@fosstodon.org avatar

@bmispelon @lilyf @CodenameTim OK, missing what you mean there. I need to play, since I don't have all that in RAM 🤔

Thought was exactly as you have it in the post, but with ArrayAgg at the JSONObject step. PG can return an array of fields, as native values, for a single output field. (Like a composite type, but here from a subquery)

Is your test project cloneable?

carlton, (edited )
@carlton@fosstodon.org avatar

@bmispelon @lilyf @CodenameTim Ah, yes, you'd want a DictAgg (or such) so you'd know what fields to pass.

🤔

Nice.

You could probably do something with a namedtuple, so the ordered subfields in an array mapped back to names.

🤔

Nice.

🤔

carlton,
@carlton@fosstodon.org avatar

@bmispelon @lilyf @CodenameTim Super thanks!

(Not sure my ArrayAgg idea will work… « types… varying cannot be matched » 😔)

carlton,
@carlton@fosstodon.org avatar

@bmispelon welcome aboard! ⛵️

Every day there are more of us 🥳

carlton,
@carlton@fosstodon.org avatar

@bmispelon maybe 🤔 I shall potter on the project. (Much easier than me half hacking it together myself.) There must be some incantation to get PG to return it like an ad hoc composite type.

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

@elliotjaystocks Can I ask, what do you use to manage your fonts locally?

Like, I’m pootling with FontBook, but wondering if there’s a better option you’d recommend? (Glyphs looks nice, but is more than I can justify at me level, so likely it’ll be that 😅)

xahteiwi, to random
@xahteiwi@mastodon.social avatar

WTF, CC?

You honestly argue that the content I put out under the International version of CC-BY-SA can be snarfed up by an LLM because of the "fair use" doctrine that's specifically USian, rendering the licence conditions moot?

https://creativecommons.org/2023/02/17/fair-use-training-generative-ai/

carlton,
@carlton@fosstodon.org avatar
carlton,
@carlton@fosstodon.org avatar

@webology @xahteiwi

> there were other motives too, one example being that the value of the land enclosed would be substantially increased

Nodding.

> Enclosure riots are seen by historians as 'the pre-eminent form' of social protest from the 1530s to 1640s.

🤔

carlton,
@carlton@fosstodon.org avatar

@xahteiwi @webology Yes. I don’t disagree with the principle of it.

I believe they will “ride roughshod” over all of it.

Happy for some philanthropist to sue the fuck out of them though.

carlton, to random
@carlton@fosstodon.org avatar

> 77% of respondents believe global temperatures will reach at least 2.5C above pre-industrial levels, a devastating degree of heating

But at least there's a new iPad.

https://www.theguardian.com/environment/ng-interactive/2024/may/08/hopeless-and-broken-why-the-worlds-top-climate-scientists-are-in-despair

carlton,
@carlton@fosstodon.org avatar

@webology then saw this earlier, which is like double-chocolate…

https://mastodon.social/@mrchrisadams/112405965157733230

benjaoming, to django

Interesting lesson? Last August, a contributor wanted to fix something in -money's contrib.django_rest_framework. The PR had no tests, a few people mentioned that they'd like to have it merged.

So 9 months later, a maintainer (eh me), gives up and helps to write a few tests and get this thing merged. But no one with acclaimed DRF skillz had reviewed it.

Afterwards, it broke DRF integration in two ways: Two great new contributors came by, fixed it w/ tests!

carlton,
@carlton@fosstodon.org avatar

@benjaoming Seems like a success to me. In the bazaar (of users at least) every code branch is covered somewhere, and a breakage is picked up and fixed, and the package is improved.

As a user I need to make sure I have tests on the bits I’m using. If a breakage comes in I can pin the old version while we work out a fix.

Seems like the only alternative to that is to have infallible maintainers, which we don’t 😜

carlton,
@carlton@fosstodon.org avatar

@benjaoming That might help 😀

“Look, if you’re going to use this, be aware you’ll be getting your hands dirty.”

fallenhitokiri, to random
@fallenhitokiri@social.screamingatmyscreen.com avatar

The new iPads look like a pretty good upgrade, especially the display. But we are five or six years in and Apple still refuses to fix the software side to make them actually useful but for some niche application :/

If they’d announce macOS support at WWDC you could count the minutes between the announcement and me ordering one with the new keyboard case…

carlton,
@carlton@fosstodon.org avatar

@fallenhitokiri 💯 My much loved 2020 model isn’t in danger of being upgraded: the hardware isn’t the issue.

josh, (edited ) to random
@josh@joshthomas.dev avatar

What’s your typical async application look like in Django? I’m starting to dip my toes in after primarily just working sync and am running in to brick wall after brick wall.

I’ve got a “toolbox” app at work with a few small Django apps to help out our small department in various things and wanted to async something to deal with GitHub webhooks. Using Django 5.0 and daphne.

carlton,
@carlton@fosstodon.org avatar

@josh Yes, this. Run your main app with WSGI, as you always did. Then run a little sidecar, handling all your ASGI bits, for where you actually need async: long-lived connections, realtime updates, two-way comms.

You can do the whole app as ASGI but WSGI scaling patterns are super well known, and all the edge cases have been dealt with over the years.

carlton,
@carlton@fosstodon.org avatar

@romanroe @josh not normally I’d say. (Like you can do all that if you need to, but likely you don’t.) Literally you’re just serving an asgi.py instead of a wsgi.py.

Your asgi app maybe has Channels bits. Maybe has a different URLConf, to only serve the URLs you want. Maybe different middleware…

BUT your reverse proxy has to decide which requests to route where, so likely you don’t need to be too clever.

carlton,
@carlton@fosstodon.org avatar

@josh Glad to be of service 🎁

carlton,
@carlton@fosstodon.org avatar

@josh Yeah, basically every utterance unwittingly carries with it an abominable history.

carlton, to random
@carlton@fosstodon.org avatar

@andrew a nice little piece on the eclipse I thought you might like.

https://www.lrb.co.uk/the-paper/v46/n08/chris-lintott/short-cuts

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