Apothum

u/Apothum


r/AnalogRepair•

The light meter gets stuck at the bottom in the orange section under the B where it rests when it normally de-activates after the 15 second auto-shutoff. The issue I face is that on a half shutter (probably 75-90% of the time) the needle will not jump up. If I take a shot, it definetly functions correctly and exposes properly, and often as soon as the shot is taken the needle will jump up to where it should be. The other things that get it to jump up are tapping the back of the camera rather forcefully which I dont enjoy, and sometimes but pointing it upwards (as in i look at the sky through the viewfinder and at ~45 degrees from horizon it will all the sudden jump up and then move normally)

10


r/rust•

I had no idea that when I bought my new microphone I would also end up needing to write a CLI tool to set it up. This is a pretty standard feature in many digital audio workstations (DAW) but I have no need for those and don't want to download/purchase them. I was shocked I couldn't find a CLI tool for level metering, so I made one. This is in early development but it works. I only have a Mac so testing on other platforms will have to come in time. Planning on adding a bunch of the features in the to-do section. Currently displays in dBFS. The UI is handmade and not great so considering switching to tui.

[https://gith

115




r/rust•

I do data compression research and made the switch to Rust a few months back (hopefully I will be able to get a paper out with some Rust in it). One thing I enjoy is writing classic compression schemes in rust and there was no performant arithmetic coder so I ported one from a java project of mine and the original paper.

This is my first project bigger than a main function in rust so I am open to all feedback.

Github

crates.io

*And a huge thanks to this subreddit. I learned a ton from reading posts and used this constantly as a res

211

r/rust•

Projects are compiled with the same toolchain. Same everything as far as I am aware. Project1 passes the tests. Project1 function compiles, runs, and is used multiple times.

The entire structure and files were simply copy-pasted into the project2.

any help would be greatly appreciated.

Project 1:

pub fn pad_to_byte(&mut self) -> Result<()> {
    if self.shift != 0 {
        self.write_bits(0, 8 - self.shift)?;
    }
    Ok(())
}

Project2:

pub fn pad_to_byte(&mut self) -> Result<()> {
    if self.shift != 0 {
        self.write_bits(0, 8 - self.shift)?;
    }
    Ok(())
}

error in project2:

e
15

r/rust•

I am still new to rust and this problem just cropped up in one of my projects.

The example from my project is that I have a struct and an impl for a SourceModel. This has a function called get_low(self, index). There are two implementations of get_low that do the same thing but would be used in different instances. When to use each instance would be known at compile time.

Here is a link to a playground explaining what I am trying to do with a dummy example.

Rust Playground

text from playground:

    /*
So what I am looking for is the ability to choose
w
311

r/rust•

I am writing an arithmetic encoder/decoder and in my playground app I came across something that really confused me. I was so certain it wasn't going to work but I went ahead and tried it and it worked. Can someone explain how this is allowed?

let mut encoder_output:Vec<bool> = Vec::new();
let mut encoder =
    ac::encode::ArithmeticEncoder::new(40, &mut encoder_output); //first mutable borrow

let num_symbols = input_reader.total_bytes;
for i in input_reader {
    encoder.encode(i as u32, &mut symbol_model);
}
encoder.finish_encode(); // this just outputs an eof, doesnt free
symbol_model = ac::source_model::SourceModel::new(&symbols);
57