[-] maegul@lemmy.ml 3 points 12 hours ago

Haven't seen it but only heard good things from anyone who has.

[-] maegul@lemmy.ml 2 points 13 hours ago

And over to the Fedi Film Club to nominate this

Done.

[-] maegul@lemmy.ml 3 points 13 hours ago

Big Trouble in Little China

See this post and comment ... but basically it's a classic, and I've never seen it!

[-] maegul@lemmy.ml 4 points 15 hours ago

Ohh JFC I’m so hype about this.

Their channel is prob what sold me on YouTube. I was legit hanging out for their vids to drop back in the day. It was sad when they shut down! This is awesome news! Thanks!

[-] maegul@lemmy.ml 2 points 15 hours ago* (last edited 13 hours ago)

I wonder if Harris (VP) is now going to cause a Sarah Palin dynamic.

I’m not a USian or plugged in that much, so it might have happened already.

But if she’s as unpopular as I hear, and Biden looks like he’s on his death bed, a Biden vote practically becomes a Harris vote. How does that play out against Trump?


EDIT: lol ... downvotes. There's a difference between a question or thought that's plain wrong and one that you just don't like however relevant it might be. I have no particular views on Harris (and she's clearly no Palin, in a good way) ... I've just heard that she's not particularly viable electorally and figure that this dynamic could be real now in ways it wasn't at all in 2020.

[-] maegul@lemmy.ml 8 points 15 hours ago

Maybe a good candidate for Fedi Film Club?

I’ve never seen it!

[-] maegul@lemmy.ml 2 points 17 hours ago
6

Nice and handy reference with explanations and examples.

[-] maegul@lemmy.ml 15 points 1 day ago

It was a crisis the moment that the Journal system was allowed to be built without any oversight from academia or the government itself.

A whole class of intelligent professionals performing a public good on public funds were tricked into doing most of the work for profitable companies who then charged these same people to read their peers' work. They were tricked by appealing to their ego and longing for prestige.

And so now we have incessant publication/citation metrics and a tsunami of untrustworthy papers while shitty corporations rob the public funds of money that could much better spent.

Once that system was built, it was a crisis. Not just because it exists (and naturally leads to the current situation and worse). But because it was allowed to come into existence, which speaks to an intrinsic inability to self-govern on the part of the academic community.

[-] maegul@lemmy.ml 3 points 1 day ago

I think that immunity for explicitly delineated powers makes sense purely from a logical point of view: the constitution says the president can do a thing, therefore a law saying they can’t do that thing is either unconstitutional, or doesn’t apply to the president.

Yea, it's an interesting one. AFAIU, the delineated powers are basically command of the military and the power to pardon. I really don't see how a Crime can generally be applicable to either of those. It's not like "commanding the army" can just become a crime.

But regulating what the army can legally do ... seems like a very natural thing. I don't know if individuals of the military in the US can be responsible under ordinary law for anything. If so, then I don't see why that would extend to the president should they order something that's obviously a crime. If not, then that's that. And again, there are probably natural exceptions to carve out regarding the very nature of military action that would lead to preposterous inconsistencies if they could possible be made generally criminal ... where again, it seems to me that you don't need immunity ... it's just the nature of the power that is amenable to falling within the meaning of legislative regulation.

Beyond all of that though ... there's the opening line of Article II:

The executive Power shall be vested in a President of the United States of America

WTF is "the executive power"?! I'm sure there have been attempts in the US to give it some shape ... but I'd also wager it's been left somewhat nebulous too, involving elements quite distinct from whatever powers Congress/Law can confer. Does that count as an enumerated power?

Otherwise ... yea I'm with you. The "official acts" thing seems more than wonky to me ... seems downright expansive. Excluding military action and whatever "fuzzy" powers may be considered intrinsic ... I'd imagine most of the executive's powers come from legislative laws. So the body conferring power can't constrain it to "not doing something criminal"??!!

I've wondered since having a brief look at the decision that the SCOTUS is playing a game here ... where they do not want Trump's trials to affect the election and are hoping to clarify this decision and what "official" means at a later date after the election.

[-] maegul@lemmy.ml 16 points 1 day ago* (last edited 1 day ago)

It’s reasonable to me to say you cannot sue the president for vetoing a bill, or criminally prosecute the president for commanding the military. The constitution says the president can do those things, and that the check on presidential power is congressional acts including impeachment.

Yea I dunno ... why not just have no immunity? It's not like the whole idea of the separation of powers is to ensure power is freely exercised ... it's the opposite.

If a president has to pause for a moment before doing something to ask their lawyer if it would be a crime ... maybe that's the point of having fucking legal system and constitution?

Sotomayer's dissent provided pretty good evidence (AFAICT) that the framers would have put criminal immunity into the constitution if they thought it wise ... because it was a known idea at the time that had been done by some states regarding their governors. They didn't. Cuz that's the whole point ... "no man is above the law".

And as for Congressional impeachment being paramount ... I'm not sure that's either necessary or even consistent with the Constitution (again, as Sotomayer's dissent addresses).

For example ... Article 1, section 3 (emphasis mine):

Judgment in Cases of Impeachment shall not extend further than to removal from Office, and disqualification to hold and enjoy any Office of honor, Trust or Profit under the United States: but the Party convicted shall nevertheless be liable and subject to Indictment, Trial, Judgment and Punishment, according to Law.

In short (AFAICT) ... impeachment and general legal liability are not the same thing ... and the latter totally still applies.

Beyond all of that, the general law probably achieves everything that the majority's decision was worried about (while they were conspicuously not worried about all of the other things that one should be when crowning a king). Civil immunity is a well established doctrine (government's just too big and complex a thing for civil responsibility to make sense). And while I don't know anything about it, there are similar-ish ideas around criminal responsibilities that just don't make sense for the very nature of a governmental responsibility, war, I think, being a classic example. Sotomayer again speaks about these things.

Overall, once you start to squint at it, the whole decision is kinda weird. To elevate the separation of powers to the point of creating literal lawlessness seems like plain "not seeing the forest for the trees".

The bit I wonder about, without knowing US Constitutional law/theory well at all ... is whether a democratic factor has any bearing. A criminal law is created by the legislature, a democratic body. And also caries requirements for judgment by jury. So couldn't an argument be made that the centrality of democratic power in the constitution cuts through any concerns about the separation of powers that the SCOTUS had, and enables democratically ordained law to quash concerns about whatever interference the judiciary (or legislature?) might exercise with the executive.

I know there's the whole "it's not a democracy, it's a republic" thing ... but the constitution dedicates so much text to establishing the mechanisms of democracy (including the means by which the constitution itself can be altered) that it seems ridiculous to conclude that democratic power is anything but central.

[-] maegul@lemmy.ml 7 points 1 day ago

Science coms whinge: not a single graph! Come on!

Otherwise, my own experience … exam hall exams are awful … they’re distracting, the number of people around is distracting, they’re often either cold or warm … this result makes sense.

I’ve taken exams in smaller spaces and they definitely felt more calm.

5
submitted 2 days ago* (last edited 2 days ago) by maegul@lemmy.ml to c/learningrustandlemmy@lemmy.ml

You've gotta be familiar with Traits to try to work this out.

Just in case you want to try to work it out your self firstGotta say, after hearing that rust is not an OOP/Class-inheritance language, and is strongly and explicitly typed, the Deref trait feels like a helluva drug!

Obviously it's not the same thing, but working this out definitely had me making a couple of double takes.

Somewhat awkwardly, I worked it out through the standard lib docs before reading ch 15 of the book (it's more fun this way!).

And for those who want a quick answer:

  • Read the Deref docs, especially the deref coercion part
  • This allows a variable of a particular type to be implicitly substituted with another variable of a different type.
  • It happens any time a reference is passed in/out of a function, including self in method calls.
    • And obviously requires that Deref be implemented.
  • So sort() isn't implemented on Vec, it's implemented on the slice type ([T]).
  • But Vec implements Deref, substituting [T] for Vec<T> in all function/method calls.
  • Which means Vec gets all of the methods implemented on [T] ... almost like Vec is a subclass of [T]!
  • And yea, OOP people want to abuse this (see, eg, rust-unofficial on anti-patterns)
26
submitted 3 days ago by maegul@lemmy.ml to c/movies@lemm.ee

Please suggest a film for July's "Fedi Film Club"!

Anything that either you'd like to watch or would recommend to the community.

Please make sure it's more than a year or two old so that it will (hopefully) be available somewhere.

And if possible, provide a quick description for why you'd like to watch or why you suggest it.


70
submitted 3 days ago by maegul@lemmy.ml to c/movies@lemm.ee

I watched them roughly once every night or two. And I'd previously seen them all.

And I was rather surprised at how I felt about the films afterwards. It seemed really clear that the quality of the films went continuously down after Casino Royal.

I thought Skyfall would stand out as the best followed by Casino Royal. But, in sequence, nah. Despite having clearly positive qualities, it seemed bloated and empty by comparison.

I also thought Quantum of Solace would rank pretty low as I recall thinking little of it at the time it came out. Instead, I thought it paired really well with Casino as a great follow up.

In fact, it felt like the Craig-era was basically Casino + Quantum and "other things". And yea, the "post-Skyfall" films just didn't feel like they were worth the effort. I thought they'd be more passable than they were, but after Casino + Quantum, which, for me, had a real punch and through-line, Spectre + No-Time-to-Die just felt like they were going through the motions and taking up space. At times, they really seemed to be badly flawed. And that's where my impression of Skyfall really hit ... it seemed that was the "what do we do now with this character?" moment and that Skyfall belonged with Spectre etc not the other way round.

Is this common among Bond fans or am I off base here?

21
submitted 4 days ago by maegul@lemmy.ml to c/movies@lemm.ee

About 10 mins. Focuses on some of the shooting and camera choices in Alien.

Specifically how "dirty shots" were used ("dirty" meaning some unfocused object "dirties" up the shot) and how the 2 camera setup were used.

I think the video was trying to make a point about how Alien was kinda "modern" in this regard. I don't know cinema theory well enough to know ... definitely interesting though!

Either way ... it's some Alien appreciation and this little snippets are definitely good reminders of how awesome the film is.

4

Continuing on from Chs 5 & 6 of "The Book" (see "Reading Club" post here), I don't think the Copy and Clone traits were quite given sufficient coverage.

So I thought I'd post my understanding here.

Tl;Dr

Copy Clone
Implicit Explicit (v.clone())
Simple (memcpy) Arbitrary
"cheap"/quick Potentially expensive
Simple types Any type

Derivable Traits

  • These are traits which have a standard implementation that can be freely and easily applied to structs and enums (IE, custom types).
  • The ones available in the standard library are listed in Appendix C of The Book. Other libraries/crates can apparently implement them too (though I don't know of any).
  • They are part of and use the Attributes syntax (see Documentation in the Rust Reference here): #[ATTRIBUTE].
  • To derive a trait we write #[derive(TRAIT1, TRAIT2, ...)] above our type declaration
#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

The Three Step Ladder

  • The two traits, Clone and Copy, are about providing opt-in options for custom types around what "ownership semantics" they obey.
  • "move semantics": are what we know for most types and have learnt about in ch 4. There is no copying, only the moving of ownership from one stack to another or the use of references and the "borrow checker" that verifies safety.
  • "Copy semantics": are what basic types like i32 enjoy. No ownership movements. Instead, these variables get implicitly copied, because they're simple and copying involves the same work involved in passing a memory address around.

The RFC for these traits puts it nicely ...

From RFC 0019 - Opt in built-in traits document on the Copy Trait

Effectively, there is a three step ladder for types:

  • If you do nothing, your type is linear, meaning that it moves from place to place and can never be copied in any way. (We need a better name for that.)
  • If you implement Clone, your type is cloneable, meaning that it moves from place to place, but it can be explicitly cloned. This is suitable for cases where copying is expensive.
  • If you implement Copy, your type is copyable, meaning that it is just copied by default without the need for an explicit clone. This is suitable for small bits of data like ints or points.

What is nice about this change is that when a type is defined, the user makes an explicit choice between these three options.

IE, "move semantics" are the default, "copy semantics" can be adopted, or clone for the more complicated data types or for where it is desired for duplication to be explicit.

  • Note that Clone is a supertrait of Copy, meaning that we have to derive Clone if we want to derive Copy, but can derive Clone on its own.
struct Movable {
	field: i32
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}

Example

Demonstrate how a struct with Copy obeys "copy semantics" and gets copied implicitly instead of "moved"

  • Declare structs, with derived traits, and define a basic function for taking ownership
fn check_if_copied<T: Clone>(x: T) -> T {
    println!("address: {:p} (from inner owning function)", &x);

    x
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}
  • Instantiate variables of both structs, cl that has Clone and cp that has Copy.
  • cl is moved into check_if_copied and so is no longer live or usable afterward.
  • cp is not moved into check_if_copied and lives beyond the call of check_if_copied.
let cl = OnlyClonable{field: 0};
let cp = Copyable{field: 1};


// OnlyClonable type obeys "move semantics"

check_if_copied(cl);  // cl gets moved in as it's not copyable

// COMPILER ERROR.  Can't do this! As moved into `report_if_copied`!
println!("address: {:p}", &cl);

// Copyable obeys "copy semantics"

check_if_copied(cp);  // cp is implicitly copied here!

// Can! as not moved but copied
println!("address: {:p}", &cp);

Demonstrate the same but with mutation

let mut mcp = Copyable{field: 1};

let mcp2 = check_if_copied(mcp);  // as mcp was implicitly copied, mcp2 is a new object
mcp.field += 100;

// values will be different, one was mutated and has kept the data from before the mutation
println!("mcp field: {}", mcp.field);
println!("mcp2 field: {}", mcp2.field);

prints ...

mcp field: 101
mcp2 field: 1

Application and Limitations

Copy

  • Copy is available only on types whose elements also have Copy.
  • Such elements then need to be the numeric types (i32, f64 etc), bool and char. So custom types that contain only basic data types.
#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}
  • Any field with a non-copyable type such as String or Vec cannot be made Copyable
// Copy cannot be derived as `f2: String` does not implement Copy
#[derive(Copy, Clone)]
struct NotCopyable2 {
    field: i32,
    f2: String
}
  • But custom types that have the Copy trait as fields work fine, like Copyable from above as a field:
#[derive(Copy, Clone)]
struct Copyable2 {
    field: i32,
    more: Copyable
}
  • Beyond this, Copy is not overloadable and can't be implemented in rust (without using unsafe presumably). It's really just a primitive of the language it seems (see source code for the Copy trait).

Clone

  • Like Copy, Clone relies on the struct's fields also implementing Clone.
  • A number of standard library types have implemented Clone (see list of implementors in the documentation), including the fundamental collections you'll find in chapter 8 of The Book: String, Vec, HashMaps and also arrays.
  • Thus the code below, which involves a more complex Struct with fields that are a String, array and Vec, compiles just fine.
  • With the clone() method, Clonable is now able to be duplicated allowing the original to be usable after being passed in to check_if_copied().
#[derive(Clone)]
struct Clonable {
    name: String,
    values: [f64; 3],
    data: Vec<i32>
}

let clonable = Clonable{
    name: "Sam".to_string(),
    values: [1.0, 2.0, 3.0],
    data: vec![111, 222]
};

// clonable is duplicated with the `.clone()` method
check_if_copied(clonable.clone());

// original still usable as it was never moved
println!("Name; {}", clonable.name);
  • But, unlike Copy, is overloadable, which means you can implemented Clone for your custom types however you want if necessary.
  • This would be jumping ahead a bit to Traits, but we could implement Clone for our struct above ourselves with something like the below:
struct Clonable {
    name: String,
    values: [f64; 3],
    data: Vec<i32>
}

// Just use each field's `.clone()` implementation, much like the default would do
impl Clone for Clonable {
    fn clone(&self) -> Self {
        Self {
            name: self.name.clone(),
            values: self.values.clone(),
            data: self.data.clone()
        }
    }
}
  • Or we could see how Clone is implemented for Option:
impl<T> Clone for Option<T>
where
    T: Clone,
{
    fn clone(&self) -> Self {
        match self {
            Some(x) => Some(x.clone()),
            None => None,
        }
    }
}
  • Basically relies on the implementation of Clone for the inner value inside Some. Note the where clause that limits this to Option variables that contain values that have the Clone trait.

Deep or Shallow Duplication

  • In the case of Copy, duplication should always be "deep".
    • Which isn't saying much due to the simplicity of the types that can implement Copy.
  • In the case of Clone ... it depends!
    • As the implementations of Clone on the fields of a custom struct/enum are relied on, whether the duplication is deep or shallow depends entirely on those implementations.
    • As stated in the RFC quoted above, Clone is for complex data structures whose duplication is not trivial such that compromises around performance and duplication depth may need to be made.
    • A clue can be discerned from the signature of the implementation. For Option, above, the inner value was restricted to also having implemented Clone, as the value's .clone() method was relied on. Therefore, Option's is deep.
    • Similarly, the Clone implementation for Vec has the same restriction on its elements: impl<T, A> Clone for Vec<T, A> where T: Clone, (see source code), indicating that its implementation is at least one level deep.

Overall, this seemed a fundamental part of the language, and I found it weird that The Book didn't address it more specifically. There's nothing really surprising or difficult here, but the relative roles of Clone and Copy, or the "three step ladder" are important to appreciate I think.

16

Relevant for @sorrybookbroke@sh.itjust.works 's next stream next week as they're hitting smart pointers.

cross-posted from: https://programming.dev/post/16059115

Found this on Mastodon https://fosstodon.org/@dpom/112681955888465502 , and it is a very nice overview of the containers and their layout.

72
submitted 1 week ago by maegul@lemmy.ml to c/movies@lemm.ee

The Idea

  • Watch and discuss movies together (kinda like a book club)
  • "Crowd source" recommendations for not-entirely-new films (IE, older than a year or so, let's say)
  • Aim for generally bettering or curating our film "diet"

How it will work (at least at first)

  • 1 film a month
  • First, a post to take nominations/suggestions
    • Post any film you want to watch, or have heard good things about, or recommend to everyone else
  • Second, a post to take votes on the nominations
  • And then we watch and discuss the winner

First round will start next month (July)

Please share any thoughts/feedback, though we'll likely run this at least once first before making any changes, just to feel it out

60

Not the prettiest graph, but a neat way of putting all this information into one image.

Wiki Commons page: https://commons.m.wikimedia.org/wiki/File:Generation_timeline.svg#mw-jump-to-license

Wikipedia page on Generations: https://en.wikipedia.org/wiki/Generation

69
submitted 1 week ago* (last edited 1 week ago) by maegul@lemmy.ml to c/movies@lemm.ee

Edit: Here's the exact same clip on the standard YouTube Watch page.

courtesy of zagorath


Brandon Sanderson the fantasy author

For those uninterested in watching a youtube short (sorry), the theory is pretty simple:

COVID and the death of theatres broke the film industry's controlled, simple and effective marketing pipeline (watch movie in theatres -> watch trailer before hand -> watch that tailer's movie in theatres ...) and so now films have the same problems books have always had which is that of finding a way to break through in a saturated market, grab people's attention and find an audience. Not being experienced with this, the film industry is floundering.

In just this clip he doesn't mention streaming and TV (perhaps he does in the full podcast), but that basically contributes to the same dynamic of saturation and noise.

Do note that Sanderson openly admits its a mostly unfounded theory.

For me personally, I'm not sure how effective the theatrical trailers have been in governing my movie watching choices for a long time. Certainly there was a time that they did. But since trailers went online (anyone remember Apple Trailers!?) it's been through YouTube and online spaces like this.

Perhaps that's relatively uncommon? Or perhaps COVID was just the straw that broke the camel's back? Or maybe there's a generational factor where now, compared to 10 years ago, the post X-Gen and "more online" demographic is relatively decisive of TV/Film sales?

12
submitted 1 week ago by maegul@lemmy.ml to c/videos@lemmy.world
5
submitted 1 week ago* (last edited 1 week ago) by maegul@lemmy.ml to c/learningrustandlemmy@lemmy.ml

After Chs 5 and 6 (see the reading club post here), we get a capstone quiz that covers ownership along with struts and enums.

So, lets do the quiz together! If you've done it already, revisiting might still be very instructive! I certainly thought these questions were useful "revision".


I'll post a comment for each question with the answer, along with my own personal notes (and quotes from The Book if helpful), behind spoiler tags.

Feel free to try to answer in a comment before checking (if you dare). But the main point is to understand the point the question is making, so share any confusions/difficulties too, and of course any corrections of my comments/notes!.

view more: next ›

maegul

joined 1 year ago
MODERATOR OF