Profile for hikari
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
- 17739
- Followed by
- 1566
- Following
- 197
hey, does anyone know who maintains the cc crate for Rust? it seems like it exists in a weird kind of limbo, it’s not exactly part of the main Rust project but it is on their GitHub?
(i have an open pull request, that’s why i’m curious: https://github.com/rust-lang/cc-rs/pull/761)
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!
forming a gang of soft scientists from subfields that are empirically verifiable. we’re gonna go crash the hard scientists’ party by screaming at them about their unfalsifiable subfields. let’s go
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
someone should invent unsigned integers but offset by one
to put you in the festive spirit, here is some german christmas music from sweden https://www.youtube.com/watch?v=2A3kMTZwSQ8
why are there so many feline females in tech? it’s simple folks. you can’t spell catgirl without irc
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…)
suppose I want to implement a memory allocator, and I want to optimise for simplicity, clarity and ease-of-implementation, rather than being optimally efficient. what is a good strategy? I do need to handle a mix of small and large allocations and freeing needs to work.
#import "Foundation/Foundation.h"
#include <objc/message.h>
#include <objc/runtime.h>
@interface Infinite: NSObject
@end
@implementation Infinite: NSObject
@end
int main(void)
{
class_addMethod([Infinite self], @selector(loop), objc_msgSend, "@@:");
[[Infinite new] loop];
return 0;
}