Python needs an actual default function
addie @ addie @feddit.uk Posts 3Comments 577Joined 2 yr. ago

I feel that Python is a bit of a 'Microsoft Word' of languages. Your own scripts are obviously completely fine, using a sensible and pragmatic selection of the language features in a robust fashion, but everyone else's are absurd collections of hacks that fall to pieces at the first modification.
To an extent, 'other people's C++ / Bash scripts' have the same problem. I'm usually okay with 'other people's Java', which to me is one of the big selling points of the language - the slight wordiness and lack of 'really stupid shit' makes collaboration easier.
Now, a Python script that's more than about two pages long? That makes me question its utility. The 'duck typing' everywhere makes any code that you can't 'keep in your head' very difficult to reason about.
Frezik has a good answer for SQL.
In theory, Ansible should be used for creating 'playbooks' listing the packages and configuration files which are present on a server or collection of servers, and then 'playing the playbook' arranges it so that those servers exist and are configured as you specified. You shouldn't really care how that is achieved; it is declarative.
However, in practice it has input, output, loops, conditional branching, and the ability to execute subtasks recursively. (In fact, it can quite difficult to stop people from using those features, since 'declarative' doesn't necessarily come easily to everyone, and it makes for very messy config.) I think those are all the features required for Turing equivalence?
Being able to deploy a whole fleet of servers in a very straightfoward way comes as close to the 'infinite memory' requirement as any programming language can get, although you do need basically infinite money to do that on a cloud service.
No love for the 'declarative' programming paradigm? You can actually do some useful work with SQL or Ansible...
My bath takes up the entire width of the bathroom - that place looks cavernous. Am sure I could tolerate an apartment that crappy when you can have a game of squash in between dumps.
I found that too. The animations are misleading - just listen for when you need to press the buttons.
The plural of faux pas is also faux pas, because you know, French. But this is less one false step in the dance, than doing entirely the wrong dance altogether.
Permanently Deleted
Yeah, Fark used to be great. That bear headline is a beast.
And then they got rid of the 'foobies' (ie. nudity) links off of the main page in order to appeal to advertisers, then they got rid of lots of extra stuff that upset advertisers, then they started shadow-banning paying subscribers if their posts didn't fit the narrative. And then all the users got fed up of it all and moved ever to Reddit, where the mods were more transparent and there was more of a sense of community. How ironic.
If your core site content is users posting links and commenting on them, then there's probably a lesson to be learned about how important it is to treat your users well and have a welcoming, inclusive community. Probably a lesson that Lemmy users have already learned, mind.
There's two kinds of motion blur, really - camera based, and model based. Camera-based requires calculating one motion vector for the whole screen, which is basically free. Model-based requires projecting the motion of each vertex of the model in the projected view; one matrix multiply per vector is not 'expensive' on a modern graphics card. Depth of field requires comparing the depth buffer, which you'll have already created as part of rendering, and then taking several 'taps' around each point on the screen to calculate the blur for the 'focus distance' compared to the actual distance. The final image post-processing will generally process the whole screen anyway, so you're just throwing a couple of extra steps in for the two effects.
Now, what does it save you? If your engine is using TAA (temporal anti-aliasing) then that's performed by 'twitching' the camera a tiny amount (less than a pixel) every frame. If nothing's moving, then you can merge the last several frames to get a really high-quality anti-alias; all the detail that wouldn't be caught with a 'completely static' camera will be captured, and the result looks great. But things do move; if you recalculate 'where things were' then you can get a reasonable idea of what colour ought to be at each pixel. Since we need to calculate all the movement vectors to do that, then using the same info gives us the motion blur data 'for free' - we can add a little blur in post-processing to hide the TAA mistakes in post processing, and when implemented well(*) then it looks pretty effective. It's certainly much, much cheaper to calculate that 'proper' antialiasing like MSAA.
(*) It is also quite easy to not implement TAA well, and earn the ire of gamers for turning everything into a blurry mess. Doom (2016) does a fantastic job of it - it's in the engine at a low level - and I've never seen anyone complain about that game being blurry or smeared.
It takes time to load high-quality textures and models from disk, and it uses up the RAM budget for each frame. Using lower-quality textures and models for distant objects greatly helps rendering speed and prevents stutter, and a bit of depth-of-field hides the low-quality rendering with a bit of a smear.
Now, if your graphics card greatly exceeds the design requirement (which was probably some kind of console) then you can switch these effects off and the game will look even better, which might make you question why they're there in the first place. To help consoles look better with some 'cinematic' effects, is why.
Although you should give the egg to the thief (he can open it and you can't) and then kill him and retrieve it from his dead body later, otherwise you can't win the game. Obviously.
Broke my first one on the final boss of Sekiro, which can be quite intense in places. Bought another one immediately when they announced they weren't making them any more.
Hesitation is defeat. Although, wish I'd got three as well...
Is that Windsurf? My lot have just added that. Keeps suggesting making the path to every target in the build pipeline the same so that they'd overwrite each other, or perhaps implement the worst null-checking code I've ever seen.
The problem with suggesting 99% stupid shit is that I'm going to ignore the 1% that it identified correctly. If it limited itself to trivial syntax errors then it might have quite a useful hit rate, but we already have tools that do that.
Thinking about it a bit more, would make a great deal more sense if they swapped the characters over? Then you get Catra's "Hey Adora" catchphrase, Catra is a bit less book smart, and Adora gets the blushing response.
Catra's response in the first panel should surely be "Hey Adora" rather than "Yeah", and losing her chill over the offer of a quickie doesn't seem in character either. Did the artist actually watch the show?
English does have some very good bits:
- easiest adjective declension rules of any language, ie. none.
- verb conjugation rules can be scribbled down in their essence on the back of a napkin and there's not that many exceptions; probably the easiest of any Indo-European language.
- no "grammatical" gender; only pronouns are changed for gender and they're mostly as expected from biology
- no polite vs. informal forms of "you" and rules to remember
- loads of words, for subtle nuance and meaning
...and some less good bits:
- loads of words, to confuse learners.
- the spelling rules are the fever dream of a madman. Many words are distinguished by stress, which is not marked. Want to learn the language by reading it? Ha ha no. Also, loads and loads of vowel sounds compared to most languages.
- massive reliance of "phrasal verbs", where the meaning can't be guessed from the parts. A "hang up" and a "hang over" have nothing to do with hanging and nothing to do with each other, despite up and over describing similar concepts
- grammatical concepts that don't exist in other languages, like "do support" for forming questions or negating a statement. Mood and tense of a sentence might be difficult to parse for some learners as that's indicated by "trigger words" rather than anything more concrete
- the native speakers do like to come out with some nonsense, too.
Alas no. Sur-rip-tish-yis-ly. Apparently you can blame Latin for sub + rapere = "secret snatch".
Not very easy, even then. Very pure water will absorb CO2 out of the air to make carbonates, it will strip ions from the surface of most materials you'd want a make a distillation column from. It's a very aggressive solvent.
We used to do that in industrial automation. If you make any changes to the PLC / HMI / SCADA software, burn a DVD with what you changed and leave it next to the rack. No danger of bringing in viruses on a USB stick (the whole system was air-gapped) and you'd still have a backup available.
I've always thought it was an otter, but never up till now have I questioned why it's stolen an orange. They're not the most citrus-loving of creatures.
Another fantastic project that makes gaming on Linux so much easier. It's incredibly strong in configurability and 'robustness'. Yes, you might have to set up all of your Wine bottles and things like that, which can be a faff, but once it's working in Lutris, it just keeps on working on Lutris.
Great for long-running series, too. I've been a big fan of the XCOM series since the Amiga days; in Lutris, it's easy to have UFO: Enemy Unknown / Terror from the Deep running in openxcom
, Apocalypse in DosBox, and connected up to the Firaxis remakes in Steam. Similarly, love me a metroidvania, and have got most of the 40+ CastleVania games lined up and ready-to-go, just a double-click away.
Well now. My primary exposure to Go would be using it to take first place in my company's 'Advent of Code' several years ago, in order to see what it was like, after which I've been pleased never to have to use it again. Some of our teams have used it to provide microservices - REST APIs that do database queries, some lightweight logic, and conversion to and from JSON - and my experience of working with that is that they've inexplicably managed to scatter all the logic among dozens of files, for what might be done with 80 lines of Python. I suspect the problem in that case is the developers, though.
It has some good aspects - I like how easy it is to do a static build that can be deployed in a container.
The actual language itself I find fairly abominable. The lack of exceptions means that error handling is all through everything, and not necessarily any better than other modern languages. The lack of overloads means that you'll have multiple definitions of eg.
Math.min
cluttering things up. I don't think the container classes are particularly good. The implementation of pointers seems solely implemented to let you have null pointer exceptions, it's a pointless wart.If what you're wanting to code is the kind of thing that Google do, in the exact same way that Google do it, and you have a team of hipsters who all know how it works, then it may be a fine choice. Otherwise I would probably recommend using something else.