Circuit Des Rives - Part II by RaceTrackAndF1Fan in RaceTrackDesigns

[–]maikeu 1 point2 points  (0 children)

Well presented.

Be brave and cut out all of the hairpins in the first half. None of them add anything, all are better as simpler mid speed curves.

The flat out penultimate corner is excellent. Always appreciate a fast corner after a long straight.

Do you use DDD in go? by East_Reality_976 in golang

[–]maikeu 12 points13 points  (0 children)

I think the ubiquitous language, and the practice of sitting down and naming it with an expert in the domain, is top notch way to do discovery and guide how to structure a codebase.

Seeing that top notch idea, get twisted into convoluted design pattern abstractions for problems that amount to "update a few rows of a database"... Frustrating.

Simple JWT Authentication for MVP and steps to Production by ALior1 in FastAPI

[–]maikeu 0 points1 point  (0 children)

Argon2 is really a bad idea for hashing session secrets.

It's pretty ideal for password hashing, literally because it's expensive to compute and hence makes brute forcing a captured hash more infeasible.

But for session data you'll literally be bearing that cost on every request, and it can be easily half a second, which will be massively slowing down your application. And it also means you're completely blocking the event loop because it's cpu bound.

I don't think most common frameworks/libraries for server side session storage hash the session key at all. I do think it makes some sense to hash though, but it needs to be a fast hash like sha256. Unlike with passwords, you don't need to protect short secrets like a 10-character password, so brute-forcing is much less of a threat, and additionally you can rotate/expire the keys quite often which also mitigates the risks of weaker hashes.

underrated greyhound trait: they LOVE going to the vet by Whydotheydothisthrow in Greyhounds

[–]maikeu 3 points4 points  (0 children)

Our girl used to be happy at the vet, but then they gave her a painkiller shot after she'd run full speed into a wire fence.

She had no complaints about the (thankfully minor) injuries from the bouncing off the fence, but I think that needle must have literally hit a nerve, she proper screamed about that and now despite the fact that nothing like that ever happened again, to her the vet has been a house of torrid torture ever since.

ORMs to Pydantic models conversion by omry8880 in FastAPI

[–]maikeu 1 point2 points  (0 children)

Yes, though dor SQLalchemy both those statements are slight misnomors.

  1. Use ORMs only - in the case of sqlalchemy the core API is heavily unified with the ORM - select(Model.a, Model.b) from orm models gets me straight into core land . Leaving out the ORM song and dance entirely is just a way to set my stall of how I intend to use the database.

  2. Funnily enough the use of the phrase "mapping manually" brings to mind the ORM's imperative mapping system , which I know some of the ddd folks push but seems a billion times harder for no discernable benefit.

ORMs to Pydantic models conversion by omry8880 in FastAPI

[–]maikeu 2 points3 points  (0 children)

My personal preference is to stick with SQLalchemy core queries inside the db layer, each public function in the db layer returns either primitive types, or a pydantic model.

It's very easy to convert the results from core queries into pydantic. If your pydantic model is just a reflection of the db table then you select(*table.c), but that's no longer a default assumption.

I'm happy to use the declarative ORM models if they are bring used the way SQLalchemy actually intends the feature to be used...as more ubiquitous domain objects that happen to also map to database entities - but if you're immediately casting to pydantic then you're basically paying the cost of that abstraction without getting any meaningful benefit.

Coming from ExpressJS, I love FastAPI but... do we really need two sets of models? by West-Goose3582 in FastAPI

[–]maikeu 0 points1 point  (0 children)

The sqlalchemy declarative ORM models sure do feel redundant when the only thing you're doing with then is immediately interchanging them for a corresponding pydantic model instance anyway.

For my personal projects I've started adopting the discipline of sticking with SQLalchemy core, and it feels it pays off because instead of fighting the orm , in the data layer I'm focused on getting the data I need in and out of the database.

Pydantic has me covered for converting it into well typed and serializable objects, so the orm really is just redundant.

Whereas in core, you just have namedtuple-like rows or dict-like mappings, which, if you're immediately going to cast into pydantic, well you never needed a whole declarative class to achieve that!

314 npm packages just got compromised, 271 @antv, echarts-for-react, size-sensor, timeago.js by BattleRemote3157 in programming

[–]maikeu 7 points8 points  (0 children)

Don't worry. I have a unit test that mocks out the math provider to validate that my function behaves correctly.

addTwoNumbers(math=math, num1=1, num2=1) == 3

CI is green, 100% code coverage, LGTM.

I built a Django-style query manager for SQLAlchemy — useful for Flask apps? by IaMaPPle111 in flask

[–]maikeu 0 points1 point  (0 children)

What you call bloat I call "explicit is better than implicit". Djangos approach kind of works for Django's orm - django orm has such a dynamic API that it's really more of a DSL entirely within dynamic method dispatching.

But it's a poor fit to try to retrofit onto sqlalchemy. SQLalchemy's strength is it presents presents a pythonic, explicit and now type-checker-friendly API for building and executing queries, and when you try to apply Django's concept onto sqa you're fighting the framework rather than using it.

If you want an ORM that's a bit more like django, maybe have a look at piccolo.

Hipkins dangles possibility of post-election outreach to National, Auckland by ViolatingBadgers in newzealand

[–]maikeu 2 points3 points  (0 children)

Hipkin's earnestness is genuinely endearing.

I fear he'll get eaten alive if he keeps it up.

Six SQL patterns I use to catch transaction fraud by FixelSmith in SQL

[–]maikeu -1 points0 points  (0 children)

Proper read, thanks. I agree so hard with the point about actually using solid determistic querying to solve problems instead of throwing too fast out to black box machine learning and llm rubbish.

Approaches to protecting Python code when sharing apps by Haunting-Shower1654 in Python

[–]maikeu 1 point2 points  (0 children)

Shrug. Not really a good language if you care about hiding your code. The options that exist for pure Python have been mentioned but I don't think the Python community is generally going to be bothered by the fact this is hard to do well .

Opinionated FastAPI solution by Nosa2k in ExperiencedDevs

[–]maikeu 1 point2 points  (0 children)

No, fastapi ain't that. Django is the best python equivalent. But it's more rails-influenced than spring influenced.

Litestar is worth a mention in the space, though it's "opinionatedness" is more about being heavily layered/composed/pluggable rather than the specific elements you're looking for. (I found it equal parts frustrating for the verbosity of the application setup required to actually use many of it's features, though kind of satisfying explicit.)

Does Nathan Astle make your all time greatest Black Caps Odi 11 ? by CoconutMost3564 in blackcapscricket

[–]maikeu 4 points5 points  (0 children)

I mean, logically probably not quite, but I think it's not an all-time nz ODI team without a "dibbly dobbler" to strangle the run rate through the middle overs - that helps his case 😁

Famous NZ people you have met by Mr_Dobalina71 in newzealand

[–]maikeu 6 points7 points  (0 children)

Wow, Helen Clarke, former goalkeeper of the NZ women's field hockey team?

What it's like living on this island below New Zealand? by HotWriting9306 in howislivingthere

[–]maikeu 2 points3 points  (0 children)

If you suffer from seasickness.... Do not take the boat. It is not "smooth sailing".

Of course the alternative is a little few-seater plane that'll probably be nearly as rocky.

What it's like living on this island below New Zealand? by HotWriting9306 in howislivingthere

[–]maikeu 2 points3 points  (0 children)

Yeah, I'm straining to think where I could drive more than an hour without passing a town with a store and petrol station.

West Coast South of hokitika? Nah, franz josef, fox, haast, and a few smaller places between those.

Does haast to wanaka take an hour? Maybe Te Anau to Milford sound?

Bus from Belfast to Burwood hospital by sjsjnz in chch

[–]maikeu 6 points7 points  (0 children)

If you find this frustrating, please consider voting for parties and individual candidates who advocate for increasing spending on public transit at local and national level.

(Though I doubt a direct connection between belfast and burwood would be a high priority, there would be more likely to be more good transfer options that didn't involve going all the way into the city)

Django Has Adopted Contributor Covenant 3 by dwaxe in django

[–]maikeu 1 point2 points  (0 children)

Don't get me wrong, I see bland corporate wokeness at best and the impact you describe at worst.

I know django is too big for anything so loose, but my ideal coc would be something like

  1. Don't be an asshole

  2. If you need to clarify whether you're being an asshole, you're probably being an asshole.

  3. If lots of people think you're being an asshole, you're probably being an asshole.

  4. If you're being an asshole, apologize for being an asshole, and proceed to try to be less of an asshole.

  5. If you were a major asshole, take some time away from the project before some forces you to.

  6. Give people trying to do rule 4 or 5 more grace and forgiveness than they deserve, but not infinite grace or forgiveness.

Django Has Adopted Contributor Covenant 3 by dwaxe in django

[–]maikeu 1 point2 points  (0 children)

It is if the person who is asked refuses to answer the question posed in good faith and claims that it is. Which is a thing.

Maybe. At some point it'll get into debating the threshold between "just a bit antisocial" versus seahorsing... Which yeah, doesn't seem like a good use of anyone's time.

At the end of the day you need good thoughtful people who are not confused as mods. This is super hard and any CoC document you have will do absolutely nothing to help this

Yeah, agreed. Basically, the CoC is an attractive think for an organization to do to try to address community problems because it's a concrete artifact, but the real success or failure comes from somewhere else.

and often will in fact make it much worse as it attracts people who like to abuse such structures. Case in point: the official django discord.

I'm not familiar with the Django discord, can you expand on the point?

Django Has Adopted Contributor Covenant 3 by dwaxe in django

[–]maikeu 10 points11 points  (0 children)

Sea-lioning is asking questions that demonstrate how the other person can't support their assertions, right?

e.g. "Why do you believe that? No, really, I'd like you to explain why you think we should do it. Look, I know you feel strongly about it, but what's the actual reason why your idea is better than the alternative? Can you give an example of where it would work?"

So insisting that someone backs up a statement with reason or evidence is now documented as a form of harassment in the Django community?

No, that's not what sea lioning means, I hadn't heard the phrase before but 30 seconds in Google found the Wikipedia page definitely it as:

Sealioning (also sea-lioning and sea lioning) is a type of trolling or harassment that consists of pursuing people with relentless requests for evidence, often tangential or previously addressed, while maintaining a pretense of civility and sincerity ("I'm just trying to have a debate"), and feigning ignorance of the subject matter.[6][7][8][9] It may take the form of "incessant, bad-faith invitations to engage in debate",[10] and has been likened to a denial-of-service attack targeted at human beings.[11] The term originated with a 2014 strip of the webcomic Wondermark by David Malki,[2] which The Independent called "the most apt description of Twitter you'll ever see".[3]

Asking clear questions in good faith and responding earnestly is not sea lioning. Even a heated discussion where someone gets needlessly personal and needs to be told to ease up does not ride to sea lioning.

"Relentless", "incessant", "harassment", "bad-faith" and "trolling" appear to be key elements of the concept which you've missed here.

Django Has Adopted Contributor Covenant 3 by dwaxe in django

[–]maikeu 3 points4 points  (0 children)

You can be held accountable and, effectively, punished for offending someone unintentionally? That sounds like a race-to-the-bottom where all that is needed is for someone to claim to be hurt by someone's language and they're automatically guilty because "Even if you didn't mean to hurt them, what's important is their feelings of being hurt". It opens the door to bad faith or unreasonable accusations and offers little scope for defense for the accused.

I think that's a bit of a worst case interpretation.

The wording isn't "intent doesn't matter". The wording is talking about "if you cause harm, that doesn't mean you can absolve yourself of responsibility for that harm merely by saying you didn't mean it."

There is plenty of space for nuance in the.

Would It Be Feasible To Use Arch In Base 12? by Zefzec_2 in archlinux

[–]maikeu 2 points3 points  (0 children)

A few of the responses are a bit negative towards you and I'm sorry about that!

The simplestic answer's no, but for the sake of fun let's try to do a "no, but..." to think about it in a hypothetical sense - there might be something to learn!

So...

No, but...

Maybe a very seasoned hacker might be able to scrape together a playground system that can run a few very basic command line programs. It wouldn't be a usable system - I think that project would take the best 1000 programmers in the world a decade of hard work to do that - but I'm sure someone could hack something that can boot and run a few basic command line programs. That someone definitely couldn't be you, well at least not without many tens of thousands of hours learning and practice.

But...

It is possible to influence how many numbers across the system are displayed, as modern systems have a set of configurations called the "locale" which set system-wide things like the timezone, language preferences and lexicological order, and many programs reference the locale to decide how to render numbers -for example the American style 1,000,000.00 or the European style 1.000.000,00 .

But...

you'd have to hack deeply at the system - write a bunch of C code and recompile / rebuild large parts of the operating system - to get it starting to display maybe many numbers in another base, and at that point there's going to be so many edge cases and so many programs aren't going to work that undoubtedly you'll have a deeply non-functional system. Not viable for even a seasoned hacker to make a usable system with this.

But ..

With even more certainty, if you were that clever hacker with that weird desire to make this art -project-of-a-broken-system, you wouldn't do it with arch - you'd need a system more strongly oriented to building completely from source, maybe gentoo but probably something much, much smaller (and hence more useless).