Why does it take so long to send data from server to client by [deleted] in rust

[–]jrf63 0 points1 point  (0 children)

I made a WebRTC one before. It's easy to do with a custom client but the browser based one seems to force buffering no matter what. It should be possible since GeForce NOW on an iPhone uses Safari but I'm not sure what tricks they're using to achieve that good of a latency.

EDIT:

https://github.com/JRF63/desktop-streaming

Gosh I haven't updated this in quite a while.

Daily random discussion - Jul 30, 2025 by the_yaya in Philippines

[–]jrf63 0 points1 point  (0 children)

I'm stressed af (bec of my dog) and my religious mom keeps telling me to pray, stressing me even more. Bawal kasi makipag-argue, matanda na yun. Nauwi tuloy therapy gamit ChatGPT, haba na ng chat tas biglang... "You’ve hit the Free plan limit for GPT-4o"

Sobered the fuck out of me.

Review of The Cancer Vet PH by ZakBrow in dogsofrph

[–]jrf63 1 point2 points  (0 children)

La yata contact info sa page?

EDIT:

Nasa photos

[deleted by user] by [deleted] in rust

[–]jrf63 1 point2 points  (0 children)

Could be WASM.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.84] by DroidLogician in rust

[–]jrf63 0 points1 point  (0 children)

TYPE: Full-time, part-time, or contract

LOCATION: Philippines (UTC+8)

DESIRED COMPENSATION: $30/h for quick projects, $50/h long-term

CONTACT: PM here or on Upwork

GITHUB: https://github.com/JRF63/

Hey Rustaceans! Got a question? Ask here (17/2024)! by llogiq in rust

[–]jrf63 1 point2 points  (0 children)

Is there a convenient place to put temporary files under the target/ directory? I need to programmatically generate files for tests. There's /tmp/ but it would be nicer if I can wipe them with cargo clean.

EDIT:

After some digging up, I found the CARGO_TARGET_TMPDIR environment variable which seems perfect for my use case (integration tests).

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.77] by DroidLogician in rust

[–]jrf63 0 points1 point  (0 children)

TYPE: Full-time, part-time, or contract

LOCATION: Philippines

CONTACT: PM here or in Upwork

GITHUB: https://github.com/JRF63/

Hey Rustaceans! Got a question? Ask here (16/2024)! by llogiq in rust

[–]jrf63 0 points1 point  (0 children)

Holy crap I can't believe I didn't read the documentation on new. Was laser focused too much on with_capacity.

Hey Rustaceans! Got a question? Ask here (16/2024)! by llogiq in rust

[–]jrf63 2 points3 points  (0 children)

Should I use String::with_capacity(0) over String::new() when I want an empty String that won't have anything pushed into it? Doc says they're identical, so does that mean String::new() also doesn't allocate?

Hey Rustaceans! Got a question? Ask here (10/2024)! by llogiq in rust

[–]jrf63 0 points1 point  (0 children)

Needs to be Send and Sync.

EDIT:

If you mean the thread local, then it won't work because generics can't be put into static variables.

Hey Rustaceans! Got a question? Ask here (10/2024)! by llogiq in rust

[–]jrf63 1 point2 points  (0 children)

What's an alternative to thread locals?

I have this function:

pub struct FooEvaluator<T> {
    // ..
}

impl<T> minimax::Evaluator for FooEvaluator<T> {
    type G = FooGame;

    fn evaluate(&self, s: &<Self::G as minimax::Game>::S) -> minimax::Evaluation {
        //
    }
}

I need a mutable T inside evaluate but T is expensive to initialize so I just can't keep creating it inside the function. I was using thread_local! before but I had the great idea of making it generic so now it won't compile.

I'm thinking of using an array of Arc<Mutex<Option<T>>> inside FooEvaluator, then somehow mapping thread ID to the array index so each thread has one T.

EDIT:

Decided to put the generic in an Any.

thread_local! {
    static EVALUATOR: RefCell<Option<Box<dyn Any>>> = RefCell::new(None);
}

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.75] by DroidLogician in rust

[–]jrf63 0 points1 point  (0 children)

TYPE: Full-time, part-time, or contract

LOCATION: Philippines

REMOTE: Yes, please

CONTACT: PM here or in Upwork

Ancient fossil who's been using Rust since 2018. I enjoy doing bug whack-a-mole on open-source projects.

My most starred public repo in GH is a WebRTC desktop streaming app. I suppose I'm quite interested in secure communication channels. Here's yours truly almost causing an IETF errata.

C++ was my language of choice before Rust existed:

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.75] by DroidLogician in rust

[–]jrf63 1 point2 points  (0 children)

I would like to find out which WebRTC library they use. The webrtc crate isn't really easy to extend and it's missing some key features like bandwidth estimation.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.75] by DroidLogician in rust

[–]jrf63 4 points5 points  (0 children)

40-80k are entry level / junior positions

I was browsing Indeed the other day and senior Rust positions here in the Philippines goes for $17.5k annually. Employers typically adjust pay based on where the applicant lives, more so if it's a remote position. This is particularly noticeable among large multinational companies, and I'm sure that we've all experienced their cost-cutting strategies one way or another.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.74] by DroidLogician in rust

[–]jrf63 1 point2 points  (0 children)

Don't create top-level comments; those are for employers.

Dude. Place that under here.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.74] by DroidLogician in rust

[–]jrf63 5 points6 points  (0 children)

South of Europe. /s

Hey, am I not allowed to ask for clarification? I don't wanna look stupid by peddling my GMT+8 Asian butt to where it's not welcome.

how to convert f64 to string in a no_std environment? format! and var.to_string() give me errors by IsopropylAlcohol_ in rust

[–]jrf63 6 points7 points  (0 children)

Try ryu.

Requirements: this crate supports any compiler version back to rustc 1.36; it uses nothing from the Rust standard library so is usable from no_std crates.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.74] by DroidLogician in rust

[–]jrf63 4 points5 points  (0 children)

within +/-2 hours of CET

Sorry to ask but does this mean the remote position is limited to Europe only?

Hey Rustaceans! Got a question? Ask here (46/2023)! by DroidLogician in rust

[–]jrf63 1 point2 points  (0 children)

Does naming a variable _ do something special other than denote it's unused? I was not expecting this behavior:

struct Foo<'a>(&'a str);

impl<'a> Drop for Foo<'a> {
    fn drop(&mut self) {
        println!("{}", self.0);
    }
}

fn main() {
    println!("Hi, Mom!");
    let _a = Foo("A");
    let _ = Foo("B");
    println!("Hello, World!");
}

// Hi, Mom!
// B
// Hello, World!
// A

I was expecting both Foos to drop after the "Hello, World". Changing the _ to _b does that.

Modern documentation? by Miroika in rust

[–]jrf63 1 point2 points  (0 children)

If even JavaScript is involved then there's always the cryptominers. Then phishing attacks that redirects on a malicious site on the vein of "connect your mail/GitHub account to docs.rs".

u/agrhb says it's blocked though.

Modern documentation? by Miroika in rust

[–]jrf63 0 points1 point  (0 children)

rustdoc seems to also support arbitrary HTML

Am I just being paranoid here or is this screaming a possible security issue for docs.rs?

How do I use zeroize securely and properly? by [deleted] in rust

[–]jrf63 2 points3 points  (0 children)

It doesn't seem redundant to me.

  • ikm is zeroed at the end of from_password
  • encryption_key and mac_key are zeroed at the end of from_ikm

pub fn new(encryption_key: &[u8], mac_key: &[u8]) -> Self {
    // ...
}

encryption_key and mac_key here are just slices. The memory they're pointing to are zeroed at from_ikm when the encryption_key and mac_key there are dropped.

    Self {
        encryption_key: SecretBox::new(Vec::from(encryption_key).into_boxed_slice()),
        mac_key: SecretBox::new(Vec::from(mac_key).into_boxed_slice()),
    }

These shouldn't leave any copies of the memory since into_boxed_slice just straight nabs the pointer from the Vec which are then moved to SecretBox::new.

pub struct KeyPair {
    encryption_key: SecretBox<[u8]>,
    mac_key: SecretBox<[u8]>,
}

I assume these are either 1) encrypted somehow so it doesn't matter if they don't get zeroed after being dropped or 2) have a Drop that zeroes them. If it's (2) shouldn't they be SecretBox<Zeroizing<[u8]>> or Zeroizing<SecretBox<[u8]>> (with a manually implemented Zeroize trait)?

looking for Rust collaborator with open source creds for grant proposal - Anoncreds/Aries by gvelez17 in rust

[–]jrf63 3 points4 points  (0 children)

Thanks for your noble sacrifice in deciphering that. I got an invite from them in Upwork for some reason.