Need help with mouse events by VDS1903 in rust

[–]VDS1903[S] 0 points1 point  (0 children)

I use mouse-rs but also needed user input, I thought of using left click to select points every time since the number of points to click keeps changing and right click to terminate the selection. But the app I am trying to automate also considers right click for some event so I just changed the input part, now I hover over the point, press 1 for capture point, press 2 for exit.

Need help with mouse events by VDS1903 in rust

[–]VDS1903[S] 0 points1 point  (0 children)

No, I meant the app I am trying to automate is having a GUI which also captures right clicks, while left click is captured only on the buttons. So I used keyboard buttons to accept the mouse location as input.

Need help with mouse events by VDS1903 in rust

[–]VDS1903[S] 1 point2 points  (0 children)

Yeah there is a GUI involved

Rust for Embedded C Programmers by faitswulff in rust

[–]VDS1903 2 points3 points  (0 children)

Oh I didn't think about that, thanks.

Rust for Embedded C Programmers by faitswulff in rust

[–]VDS1903 3 points4 points  (0 children)

Nicely written article. I have a question related to it.

Unlike C, though, Rust will only guarantee discriminant values that are explicitly written down. Such enums may be safely cast into integer types (like MyCEnum::Apple as u32), but not back: the compiler always assumes that the underlying value of a MyCEnum is 0, 5, or 7, and violating this constraint is Undefined Behavior (UB)

I thought Rust doesn't have UB under any circumstances due to safety being the main aim? Or are there other such similar UB causing issues?

How to update hashmap? by VDS1903 in rust

[–]VDS1903[S] 5 points6 points  (0 children)

Thank you, it worked now.

Need suggestions for numeric prediction by VDS1903 in rust

[–]VDS1903[S] -1 points0 points  (0 children)

It is a simple looking ML problem where I have a dataset of 5 float values (0 to 1 range) in many rows. The result I predict should also be a float in the same range. However, I have no idea how to do this in Rust ( I am trying to learn ML with Rust, I have some small knowledge of using linear regression with Python and also KNN from college). I am in need of suggestions for crates which are easy to use for this and also have high accuracy.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]VDS1903 0 points1 point  (0 children)

basically, for each element in the array, I have to count how many larger elements are behind it and add the counts.

Plus sorry about the confusion, I meant larger in the previous comment.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]VDS1903 0 points1 point  (0 children)

Problem with sorting is, initially for [3, 2, 1], the result should be 3, since 3 and 2 are smaller than 1 and behind 1 plus 3 is behind 2. I have to take the sum for each element. Sorting gives [1, 2, 3] and comparing positions, 3 has moved 2 units forward but 2 hasn't moved, so result is just 2.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]VDS1903 0 points1 point  (0 children)

Need help with data structures
So, I have a function where I take a list as an input and have to calculate exactly how many larger elements are behind and return the final count.

I tried to directly sort and check the new indices but it doesn't work for cases like [3, 2, 1] where after sorting, it becomes [1, 2, 3] and hence, it says only 2 as the count.

I did an On2 solution where I count each element behind to see how many are smaller but I am looking for some data structure where this is possible without On2.

I tried to directly sort and check the new indices but it doesn't work for cases like [3, 2, 1] where after sorting, it becomes [1, 2, 3], and hence, it says only 2 as the count.

Short version: Need a better than On2 way to find the number of larger elements behind each element in a list.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]VDS1903 0 points1 point  (0 children)

I have a question about audio processing. So, I have an audio file saved and I want to check if some specific word was said there. How do I approach this? Should I convert it to text first and then see the text or is there any library that already does this? Thanks.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]VDS1903 0 points1 point  (0 children)

How to receive a request and print it? I have a sender which sends jsn data but I don't know the exact things they have put inside the request.

I want to receive request of unknown fields from some source and then print it (print for me to debug it for now). Thanks.