I was curious what they used to generate the graphic's and it's their own tool:
1,271 karma · joined August 16, 2023
I was curious what they used to generate the graphic's and it's their own tool:
DerefMut to [T] not Vec<T>.
"Look how easy it is to accidentally bypass the invariant of a rust newtype by transliterating the data shape into Haskell and deriving a new type". Uh, ok.
If comparing the "risk of accident" between a newtype wrapper whose only role is enforcing the the invariant versus manually reimplementing vector and iterator semantics to use a different layout... I'd say the newtype wins that.
It would be good advice to keep a newtype that enforces an invariant as a single purpose primitive type. A building block and not a place to add other features.
There might be times I'd prefer structural enforcement e.g. something serialisation related. Converting into a non-rust format is what they are doing in their "accident"!
You can use all the slice reference methods (that do not require ownership) with:
impl<T> Deref for NonEmpty<T> {
type Target = [T];
fn deref(&self) -> &Self::Target {
&self.v
}
}
impl<T> DerefMut for NonEmpty<T> {
fn deref_mut(&mut self) -> &mut [T] {
&mut self.v
}
}
https://doc.rust-lang.org/std/primitive.slice.htmlIf you DerefMut to a Vec then you won't be able to preserve the invariant.
If you want control over methods to expose then you need wrapper methods for those you want. If you want to expose some of the traits the inner type implements then there are likely derive macros available e.g. with derive_more you could expose just indexing as:
#[derive(Index, IndexMut)]
struct MyVec(Vec<i32>); pub struct NonEmpty<T> {
pub head: T,
pub tail: Vec<T>,
}
You'd have to manually implement the traits to support the ergonomics of slices and iteration and costly reallocation if you need to pass ownership as a Vec:I'd expect:
pub struct NonEmpty<T> {
v: Vec<T>,
}
The constructor would enforce the invariant and then you'd impl Deref and DerefMut for [T] to gain normal len/is_empty/indexing/iteration, passing as &[T] to other funcs and mutating values (which can't break the invariant).To mutate length while preserving the invariant it's dealers choice e.g.
- add .into_vec() for unwrap/mutate/rewrap
- add invariant preserving mutators of your choice
This was me.
Never had a problem with typical eq/effects and even dabbled in dsp/synths but was defeated by EasyEffects. My attempts at basic tweaks had terrible consequences. I'm sure it was pebkac but the experience felt buggy e.g. my attempts to reduce some painful treble caused the bass to vanish, adjusting volume caused static not loundness etc. Most of the modules have more cryptic numbers than I know what to do with giving the feeling of being trapped in an algebraic equation.
However, downloading some community presets and the results were excellent. Some tiny nudges from there were within my idiot grasp.
They've been working on memory use and it dropped to ~7.5GB for a while but the last couple of releases have been nudging up again - currently 9.4GB without major change in the workspace.
It becomes an obstacle on a 64GB machine given I work with multiple workspaces open e.g. for the crates I am using, example projects, other branches etc. so I have to start/stop it when I just want basic type-info/navigation. Trialling a different editor alongside my current one becomes prohibitive when it's going to want another 10GB for it's own RA instance.
99% of the code isn't changing so disk caching does seem like a no-brainer like back in the 90s with intellisense .ncb files... just without the regular corruptions though!
Above low intensity and I am impaired for the rest of the day - struggling with low energy, cognitively dulled and desperate for a nap. This applies even though it's not from sacrificing sleep at 05:00 like some folk do but a leisurely 08:30 or later.
My evening workout schedule (for decades) lets me push to total exhaustion and pass out immediately after eating. One of it's prime benefits was totally solving insomnia/sleep-procrastination of a night owl with an involuntarily regular sleep schedule. I am always spent after exercise not energised.
I find such a striking difference between notation that just swims in front of my eyes:
https://musescore.com/user/14835636/scores/6186772
And a bar graph which I can hear when muted:
https://www.youtube.com/watch?v=ipzR9bhei_o
I have a similar issue with algebraic notation, the signifier and signified never connects. So much misery spending hours with a mass of punctuated greek in a cs paper to discover it describes a triangle. The decryption is not even sticky, I look away for a second and it immediately re-encrypts back to soup.
I don't understand why since programming languages having always felt natural and something I learned as a pre-teen just by being left alone with a BBC micro and a "type in a game" book.
I imagine land is a lower bar to entry, accessible to a much larger criminal base, but security response times and road surveillance is tough.
I'm too much of a land-lubber to know how easy it is vanish from a coastal crime scene by ship. The sea... nowhere to hide but very big. Can satellites track you these days? If wanting to nab a container or two that's a big ship. Not much you could put in a minisub or sub-surface thing. A James Bond villain could cut the supports and drag the whole thing to the hollowed out mountain of their island lair.
I need Michael Mann to make "Heat but on a boat" to educate me.
I think Apple gets sweetheart deals so their partners often lose money. Klarna likely sees this as a marketing coup to have their predatory sussness promoted by the Apple halo brand.
If there was profit to be had, I'm sure Apple could buy a small bank and spin it off as a subsidiary with little drama, it's just not the best of their options.
Wikipedia is intriguingly inconsistent - claims that Marijn is the Dutch variant of Marinus meaning 'marine' like Marius, Mario etc. but other pages claim Marius is more likely to be from 'mars' or 'male' than 'marine'.
A good piece of art changes your consciousness and makes you a different person. The best part of a book for me is not in the reading but how it becomes a part of my own imaginative engine and a new lens with which I can view the world.
I play games too... but I'm aware they are cynical time-vampires that pad out their content with repetitive grinding to jump virtual hurdles hijacking my reward centre with one-arm-bandit psychosis to make draining my life away by a rng feel "entertaining".
Safe cycling is all about vision. If you can't see it's safe, it's not. It isn't simply seeing imminent threats but predicting them e.g. identifying drivers that aren't paying attention and where a car could suddenly emerge like blind turnings, car doors, pedestrians and such, and countering with appropriate caution / road position.
If you find noise useful, IMHO it means you aren't sufficiently aware of your environment.
US gyms might be vast warehouses but in the UK, most only have a couple of benches, couple of cages, one set of db per denomination above 20kg etc. They require working-in and consideration for others.
A couple of unapproachable "heavy users" doing 3 hour sessions across peak hours can ruin the workout for dozens of paying members needing a few min per station for ~5 sets.
It might also be a euphemism for "dickhead" who also tend to be "heavy users". Those that damage, hoard and don't share equipment and repel other customers on many levels besides - threatening, lecherous, loud and smelly.
Doesn't even need malicious intent - can be weirdo bores, forever talking at victims while doing a routine that makes absolutely no sense besides camping on equipment for half a day... 100 sets of incline press 7 days a week... what are you even doing to yourself fella?
Some of the switches started dying at the same time last year. I guess I tipped over the lifetime of cherry switches.
I looked around but there are so few UK TKLs. I didn't want a layout change of page/home/end cluster or lose "useless" keys ins/pause/etc. (I remap them and now rely on them). I didn't like the look of prebuilts from Keychron or want to pay £500 or mess with shady "group buys" for parts.
So I bought a bag of switches and a soldering iron instead and expect to get another 15 years out of them.
Happy customer but I guess not a repeat customer.
A rat taught to do a Westminster-style agility course including slalom cones:
https://imgur.com/gallery/smart-pet-rat-tofu-doing-fun-agili...
A rat driving a car. Not evidence of anything... just fun
It was 40 years ago but clear as day because I really enjoyed it. I made a coastal landscape with boats and it was very programmery to build up a real image from scan-lines. Making an abstract repeating pattern like the examples wouldn't be half as engaging.
I'm just too cheap to pay for them though...
Have recent boards/cpus fixed the instability problems people had with 4 sticks of DDR5 yet?
I was shocked when I saw folk saying you can't use 4 slots. It would mean that a one stick build would have an upgrade path but if you started with 2, you'd have to replace them.
Not sure quite what's going on with that project but when I looked - gpodder.net was a subscription service and the foss project was somewhat hidden and renamed as mygpo. Felt a bit suss and abandoned although I guess an rss server could just be "done".
There is also opodsync that seems to be a bit more alive and popular and says it's gpodder compatible. Not tried it though.
My enthusiasm to self-host my podcast/rss feed was killed dead when I gave nextcloud another go since it can apparently do this. Every few years I set it up having forgotten that the last time I did, I swore to never touch it again. I can't believe it's still such a bad experience.
I suspect that deep-fried-battered haggis might exist which could be very spherical.
I used to use "GTK Title Bar" gnome extension which was abandoned a few versions ago so had to write my own and it's X11 specific. The one drawback is that when windows are reopened, they are offset by the title bar height i.e. it messes up whatever is tracking the size/offset/location.
Anyone have other ways to do this in gnome and do they work on wayland too?
I had a couple of Dust Brothers (a) cassettes before they changed their name after getting a call from the other Dust Brothers (b).
Still can't believe they knowingly copied another band's name "because it sounded cool". Isn't coming up with a shit name half the fun? "I need a handle man".
Out of curiosity, is there an equivalent on ios with that level of support?
For Crusader Kings III, the old versions are listed as betas (cog -> properties -> betas) so you downgrade by "signing up to a beta".
I don't know if it's a common practice but pretty damn necessary for paradox games. A single game might take months and their attitude to backwards compatibility is "new versions will corrupt your game files in ways that only subtly reveal themselves like noticing the King of England owns a county in Mongolia before reaching a game year that will always crash".
A clean install of Ubuntu and the touchscreen and all pen features worked perfectly and never had a hiccup since.