Profile for hikari

Header for hikari
Avatar for hikari
Display name
Kanbaru 🌟 (one hikari of too many)
Username
@hikari@noyu.me
Role
admin

About hikari

Bio

from another world; anime girls on the internet who are terrible at playing guitar and slightly less bad at programming; EN/SV/DE/日本語

Stats

Joined
Posts
18736
Followed by
1560
Following
200

Recent posts

I don’t know who needs to hear this, but

trait FooBar: Any {
  fn as_any(&self) -> &dyn Any {
    &self as &dyn Any
  }
}

sadly will not work, no matter how many apostrophes you add. you also can’t just call .downcast_ref() on a FooBar.

previously, when having to do this, i just gave up.

but it turns out there’s a practical workaround:

trait FooBar: Any {}
pub trait AnyFooBar {
    fn as_any<'a>(&'a self) -> &'a (dyn std::any::Any + 'static);
}   
impl<T: FooBar> AnyFooBar for T {
    fn as_any<'a>(&'a self) -> &'a (dyn std::any::Any + 'static) {
        &*self
    }   
}

I hope this helps avoid suffering for someone else!

Open thread at this post

i will stab the next person who tells me that there are hard and soft sciences and the distinction is whether you can empirically verify propositions. every scientific field has some degree of unfalsifiability lurking within it. i may or may not just be bitter because my degree is in linguistics which is supposedly a soft science, and so many STEM-bros do not realise that we too have experimentally verifiable propositions. it’s easier to prove various facts about language development than it is to prove your pharmaceutical works

Open thread at this post

i set a limit on how many concurrent requests nginx will proxy to GoToSocial, let’s see if that saves my server from certain death the next time marcan replies to me lol

(i deleted the original post i made about this problem and it seems like it took the thread with it? i’m very confused…)

Open thread at this post