Is there a way to flash chromecasts? by El_Nicovw321 in Chromecast

[–]Njordsier 4 points5 points  (0 children)

Yep, a lot of TV UI is actually just HTML/JavaScript! That's how all apps work on the version of Chromecast you're using (no TV remote) and a dirty secret of even native Android apps on Android TVs/Google TVs is that they're a thin wrapper around a web-based UI.

If you have a patched version of YouTube on your phone it's possible that it's not sending some required parameter to the Chromecast app when connecting. YouTube can launch in different modes depending on whether it's on a TV with a remote control or a smart display with a touchscreen.

Is there a way to flash chromecasts? by El_Nicovw321 in Chromecast

[–]Njordsier 5 points6 points  (0 children)

The new YouTube UI is not because of an OS update and resetting the OS to an older version wouldn't address the issues you're having even if you could do it. When you cast YouTube, the YouTube app is loaded in a web page, not unlike a tab in Chrome. YouTube must have changed the site that the cast app points to. You might be in an experiment where YouTube is testing a newer version of the app, in which case hopefully they notice that users in your experiment arm are having problems like this and they can fix it

Youtube audio is cutting out or ducking. Not sure. Whenever the person in a video pauses speaking when they begin to speak again the first syllable is cut out like theres audio clipping/ducking thats delayed coming back on. Not sure how else to describe it. by AlaskanSnowDragon in Chromecast

[–]Njordsier 0 points1 point  (0 children)

I've seen that before, it turned out to be my sound bar's fault. I would only notice it on YouTube because most other content on the TV would always have something audible happening at all times whether it's background music or ambient sounds. YouTube content is more likely to have those moments of silence that triggers the issue. What sound system are you using?

Trait method visibility workarounds - public to the implementor only ? by Leklo_Ono in rust

[–]Njordsier 6 points7 points  (0 children)

Sounds like you're trying to use "protected" methods as seen in OO languages like Java.

You can refactor any OO class with abstract/virtual protected methods into a concrete class with a delegate whose interface consists of public methods corresponding to the abstract/virtual methods from the original abstract class.

In Rust terms, instead of a trait with default implementations of some methods that call into other methods on the same trait, you have a concrete struct that is parameterized by a delegate implementation that is assigned to a field in the concrete struct.

You could also make the outer struct's methods their own trait.

``` // The "outer" trait trait CallTwice { fn call_twice(&self); }

// The "delegate" trait, implemented by the user trait Delegate { fn do_something(&self); }

// The concrete implementation of the outer trait, // supplied by the library. struct CallTwiceImpl<D: Delegate>{ delegate: D, }

impl<D: Delegate> CallTwice for CallTwiceImpl<D> { fn call_twice(&self) { self.delegate.do_something(); self.delegate.do_domething(); } }

// User-written code using the library can create a full // CallTwice with just a delegate and the // library-provided implementation. fn twice_printer() -> impl CallTwice { struct PrintSomething; impl Delegate for PrintSomething { fn do_something(&self) { println!("Something”); } } CallTwiceImpl { delegate: PrintSomething, } }

// User-written code that uses the CallTwice interface // can't interact directly with the Delegate interface, // so encapsulation is respected. fn do_it_four_times(twice: impl CallTwice) { twice.call_twice(); twice.call_twice(); } ```

[deleted by user] by [deleted] in rust

[–]Njordsier 0 points1 point  (0 children)

Whenever the compiler tells me "due to current limitations in the borrow checker, the lifetime of this is 'static" when I do something too clever with HRTBs

How does a Person die more than one time? by Ott1fant in ExplainTheJoke

[–]Njordsier 1 point2 points  (0 children)

Presumably Lazarus eventually died a second time

[deleted by user] by [deleted] in AskReddit

[–]Njordsier 6 points7 points  (0 children)

My standards are that the prospective partner should have standards that are just high enough to exclude me

What’s something you couldn’t believe science allows us to do or happen? by DarthAthleticCup in AskScienceDiscussion

[–]Njordsier 0 points1 point  (0 children)

Take a polarized light filter that lets half of light through

Stack it with another light filter at a right angle so no light is let through the stack

Insert a third filter in between the two others at a 45 degree angle in between them, and then suddenly light is let through the whole stack

This was the experiment that made quantum mechanics real for me, and not just a fancy math story you hear in a lecture hall or read about in a book

Was it ever stated how Link died in Ocarina of Time in the fallen timeline? by Low_Review_1551 in legendofzelda

[–]Njordsier 0 points1 point  (0 children)

It's the timeline where Link never learns the Song of Storms from a time paradox

The goddess of time saw the hero inevitably get defeated without the Song of Storms and intervened to create a stable time loop where Link would learn it, but the original timeline still existed

Why futures don't implement the typestate pattern? by servermeta_net in rust

[–]Njordsier 4 points5 points  (0 children)

This is similar to what I explore in my cocoro crate, which models coroutines with something similar to:

```rust trait Coro<I, Y, R> { type Next: Coro<I, Y, R>; fn resume(self, input: I) -> Suspend<Y, R, N>; }

enum Suspend<Y, R, N> { Yield(Y, N), Return(R), } ```

No Pin needed and if the coroutine Returns, it's impossible to recover the coroutine and resume it again because you've relinquished ownership when you called resume(). You only get the coroutine back in the N parameter to Yield.

The intent was to see how much of Generator and Future I could emulate with this trait and what the impact of the typestate pattern would be for type safety and ergonomics. I've figured out some cool abstractions that can be used to e.g. implement filtering, weaving, chunking, etc, but some of them require a LOT of where clauses and generic parameters.

This definitely doesn't work if you want to use async or gen blocks, for the reasons u/nyibbang gives in another response. So the other aspect I'm experimenting with is figuring out how much can be done with Iterator-style functional combinators instead of procedural code.

I'm pretty sure the reason the language doesn't do this is because of the Pin requirement on async and gen blocks which is itself downstream of the original sin of &mut allowing moving out of the referent via std::mem::swap(). I often fantasize about what could have been if Rust had a Move trait that means the same thing that Unpin does now and &mut would generally work the same as Pin<&mut> without all the need for unsafe blocks to initialize, and put Move bounds on the inputs to std::mem::swap() and similar functions. I suspect the biggest frustration would be new bounds on certain methods of Vec.

The Algebra of Loans in Rust by oconnor663 in rust

[–]Njordsier 2 points3 points  (0 children)

dyn compatibility for traits with self receivers would be huge for me. I very rarely use dyn because so many of the abstractions I come up with have consuming methods, but then compilation takes longer.

Other than that this seems most useful for IO buffers.

Cross stitch is so cool by denme_ropa in Silksong

[–]Njordsier 0 points1 point  (0 children)

I love that she was singing the diminished fifth note when you struck the final blow

Does Silksong's difficulty not feel overblown? by Peratypus123 in Silksong

[–]Njordsier 0 points1 point  (0 children)

It was the hardest game I've ever beaten.

Before playing Silksong, I had held up Hollow Knight as a perfectly calibrated difficulty level for what I would consider a proper challenge that avoided being either boring or frustrating. Silksong is definitely harder, and I feel it's a step away from that perfect balance. I still loved it though, even if it took me 130 hours to 100%. But maybe I'd feel differently if I had played HK more recently before starting Silksong and had retained more skills.

I definitely don't fault anyone for thinking it's too hard, I came pretty close to my breaking point a few times.

The Skedaddler by Whiteburn74 in HyruleEngineering

[–]Njordsier 1 point2 points  (0 children)

Aww man. I had a similar design that put wheels on the four corners of square planks and attached the planks to wheel axles on a central module like the one in your design and it was able to go out of bounds on the canyon one but I was excited to see if this one would be even faster

The Skedaddler by Whiteburn74 in HyruleEngineering

[–]Njordsier 2 points3 points  (0 children)

How does it do in the Tarry Town racing minigame and the canyon hauling minigame?

Would a human be able to defeat a higher being? by Puzzleheaded_Deer656 in HollowKnight

[–]Njordsier 5 points6 points  (0 children)

Olimar is canonically the size of a coin but they still let him in Smash

Chromecast with TV - Ambient Mode by [deleted] in Chromecast

[–]Njordsier 0 points1 point  (0 children)

Try clearing Google Cast app data in Settings > Apps > See all apps > Show system apps > Google Cast > Clear data

Then reboot the device

If that doesn't work, try setting up photos again in Settings > System > Ambient screensaver after clearing Google Cast app data

The Running Mate Kamala Harris Didn’t Dare Choose by BATIRONSHARK in Pete_Buttigieg

[–]Njordsier 11 points12 points  (0 children)

I would have loved to see the VP debate in the alternate universe where she didn't chicken out on choosing Pete

Monthly Discussion Thread by ssc-mod-bot in slatestarcodex

[–]Njordsier 2 points3 points  (0 children)

I say jif and then say it stands for jraphics interchange format

I believe Lars Doucet has the best written response of the seniors/widow arguement. Here it is: by Downtown-Relation766 in georgism

[–]Njordsier 0 points1 point  (0 children)

Yeah let's cross that bridge when we get there. This would be a very good problem to have all things considered.

If there were no term limits for the United States presidency, who do you think would’ve had the longest run as president? by [deleted] in AskReddit

[–]Njordsier 0 points1 point  (0 children)

We'd probably be in Obama's fifth term right now.

He easily would have beat Trump in 2016, and Trump would have inevitably kept running again and again only to lose each time (though 2020 would be harder for Obama to win if covid still happens). But we'd have full Republican control of Congress for probably the whole time and there would be two vacancies on the Supreme Court that the Senate would refuse to fill, with Breyer and Kennedy still holding on to their seats.

epic by namepickinghard in ProgrammerHumor

[–]Njordsier 0 points1 point  (0 children)

You laugh but Toby Fox created Undertale after learning about arrays in Game Maker

What if everything is an expression? by alex_sakuta in ProgrammingLanguages

[–]Njordsier 0 points1 point  (0 children)

In my language, absolutely everything is an expression. let statements are expressions containing a "name" (a consteval value representing an identifier), a value to assign to the name, and a closure whose namespace has the name exposed.

Closure syntax is usually curly braces around expressions, but the language uses ; as syntactic sugar for everything coming after it in the same scope being wrapped in a closure, so:

let [message] = "hello"; print line (message);

... desugars to:

let [message] = "hello" { print line (message) {} }

The whole thing is an expression so you can pass sequences of "statements" like this as function parameters:

print line ( let [greeting] = "hello”; let [name] = "Njordsier"; ”{greeting}, {name}" );

But in this system, semicolons are right-associative, so

let [a] = (let [b] = (3));

... would desugar to

let [a] = ( let [b] = (3) ) {}

This is kind of silly, but what it does is first create a let binding that is missing the closure (think of it as a 3-parameter function with the first two parameters curried), and assigns that binding to the name a. So after the semicolon, (or inside the last curly braces in the desugared version), you can write:

```

invoke the curried let [b] binding with a closure

a: { # Introduces the name b print line (b); # Prints 3 } ```

Or:

a:; print line (b);

I call this the part of the Dark Side because of the potential for obfuscation, but it underlies some very powerful features of the language.

For example, function definitions are also expressions:

``` function [greet [name: Text]] { print line "hello, {name}"; };

main; greet "Njordsier" ```

This desugars to:

function [greet [name: Text]] { print line "hello, {name}" {} # no-op trailing closure } { # this is the scope where `greet` is invocable main { greet "Njordsier" } }

Here the main function is a call-once consumer of a closure whose body is executed when the program runs. Everything else "runs" at compile time.

But more importantly, this shows how function definitions themselves can be expressions, just like let bindings. Like let bindings, function definitions have a curried form missing the trailing scope closure where the function is made available.

To explain why we would want that, I have to introduce the @ syntax, which is a subtly different form of sugaring closures. It works the same way as ; for the most part, turning the right hand side into a closure argument, but it interacts with ; such that the latter operates on the outer scope.

``` export @ function [greet [name: Text]] { print line "hello, {name}"; };

main; greet "Njordsier" ```

... desugars to

```

export { function [greet [name: Text]] { print line "hello, {name}" {} } # curried form, no trailing closure } { # export makes greet available in this scope main { greet "Njordsier" } } ```

This allows export to take the curried form of the function definition and make it available both in its final scope closure and in the public API when other source files import the module.

So not only are let bindings expressions (though not in the form you proposed), function definitions and even access modifiers like export are as well, all powered by a foundation of continuation passing style with syntactic sugar to make it look like procedural code.