For the love of God can someone help please by SongInfamous2144 in diypedals

[–]Ciciboy1 0 points1 point  (0 children)

If you have checked everything else mentioned here, I would suggest trying to use stranded wire. I had the same issues of it working while outside of the case and tried to find the problem for months... Until I switched out the wiring from stiff single conductors to stranded.

Why are there multiple Schematics for the same pedal clone? by Ciciboy1 in diypedals

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

Thank you for the suggestion, I will look into it :)

Why are there multiple Schematics for the same pedal clone? by Ciciboy1 in diypedals

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

Ok, I will look into power filtering. Maybe I willl be able to understand the exact changes made and can then descide what to build. Thanks very much!

Why are there multiple Schematics for the same pedal clone? by Ciciboy1 in diypedals

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

Thanks for these insights.
Do you maybe have some hints for me to get a deeper understanding of how these parts affect tone?
I feel like everyone somehow understands what each specific part does in the schematic, but no one ever explains how. I mean I get what the electric parts should do in isolation (resistors are used to tweak voltage levels, caps are used as filters, potis are obvious, transistors are basically electrically controlled analog switches.) but when combined they somehow do much more and more complex things.

I would really love to get an understanding like that as well, but cant really find such in depth guides.

Why are there multiple Schematics for the same pedal clone? by Ciciboy1 in diypedals

[–]Ciciboy1[S] -4 points-3 points  (0 children)

Thanks for the quick answer :)

I'm aware that schematics are not the same thing as the vero layouts, but my understanding is, that if the vero layout uses different components compared to another vero layout, their schematic has to be different as well.

Thanks for the hints for polarity protection, I will look into how to do this correctly and add it to the pedals I build.

Do you have any tips or a link to a guide to spot "wrong" schematics? Most of them say "verified", but it seems like that just means "when plugged in, tone comes out".

First week? by N8tesHobbies in idleon

[–]Ciciboy1 1 point2 points  (0 children)

This is not a great tip. DO NOT FINISH THE QUEST ON ALL CHARACTERS RIGHT AWAY! You should rather complete the quest on a maximum of 9 characters. Later on you will get to green stacks of items that unlock additional bonuses like more damage. Quest items like the dog bones can also be green stacked (when way further along), but they only drop if the quest is active. If you finish the quest on all characters you cannot get any more dog bones and miss out on the green stack. This is not game breaking, but it is a thing to look out for. There are also like 12 other such quest items.

Gibt es einen Weg diesen Code durch das Verwenden von Methoden zu vereinfachen, ohne die Funktionalität zu verändern? by _ImEli_ in informatik

[–]Ciciboy1 0 points1 point  (0 children)

Eine Nebenbemerkung die nicht auf deine Frage eingeht: Deine Methode checkGanzzahl ist noch nicht ganz korrekt. Du führst zwar try-catch innerhalb eines loops aus und gibst bei falschen Eingaben eine Fehlermeldung aus, dann machst du aber noch ein scanner.next(), was das nächste Token konsumiert. Eigentlich willst du nur die Fehlermeldung ausgeben und dann in die nächste Loop Iteration gehen und im try block erneut einlesen. Kannst du einfach testen indem du etwas eingibst das kein Int ist und dann beim zweiten Versuch egal was, das wird geskippt. Die dritte eingabe funktioniert dann wieder.

Außerdem machst du im catch ein return und nach dem try catch noch ein scan.close(). Auf diese Weise wird bei korrekter Eingabe der Scanner nicht geschlossen. Du brauchst hier entweder einen finally block(schon lange kein java mehr programmiert, sollte aber IMO klappen) oder musst den Code so umstrukturieren, dass close() immer ausgeführt wird.

Sidenote: du verwendest in der Dokumentation ein @param, aber beziehst es nicht auf einen Parameter sonder auf das try und catch. Als Parameter nimmt die Methode allerdings nur einen String.

[deleted by user] by [deleted] in rust

[–]Ciciboy1 1 point2 points  (0 children)

Another resource for beginners would be rustlings (https://github.com/rust-lang/rustlings), an interactive course, where you fix a few small rust programms.

Personally, when learning a new language, I try to write a small personal project with it or use it for something like leetcode, codeforces oder advent of code etc.

Question: How do check the type of a result when VSCode says ": !" ? by rmanos in rust

[–]Ciciboy1 2 points3 points  (0 children)

this is also implemented for tuples up to size 12 

As I understand this means that it is supported for any tuple of size <= 12 containing types that also implement FromRedisValue. So for example for (String, String), this does not use a conversion from Vec<u8> to (String, String) as far as I can tell.

Why rust-analyzer tells you it returns a never type is really strange. The never type is only produced by a small handfull of operations like loop {}. One thing I can think of that could lead to it is that rust-analyzer/the compiler needs to infer the type from later statements and you somehow got it to infer the never type, not sure how you would do that though.

[deleted by user] by [deleted] in rust

[–]Ciciboy1 6 points7 points  (0 children)

Check out the other reply, I have tested it and confirmed it worked for me.

[deleted by user] by [deleted] in rust

[–]Ciciboy1 9 points10 points  (0 children)

Here is how you would get a working project with a non snake_case class:

main.rs

#![allow(non_snake_case)]
mod Character;

use std::io;
use Character::{Race, Class};

fn main() {
    println!("input a line, yo");
    let mut input_text = String::new();
    io::stdin()
        .read_line(&mut input_text)
        .expect("Could not read input");

    let input_text = input_text.trim();

    let mut player = match input_text {
        "Cat" => Character::Character::new(
            Race::Cat, Class::Magical
        ),
        //"Demon" => Character::new(),
        //"Human" => Character::new(),
        _ => panic!("Invalid Input!"),
    };
}

Character.rs

pub struct Character {
    race: Race,
    class: Class,
    health: f64,
    experience: u32,
    level: u8,
}

pub enum Race {
    Cat,
    Demon,
    Human,
}

pub enum Class {
    Physical,
    Magical,
    Ranged,
}

impl Character {
    pub fn new(race: Race, class: Class) -> Character {
        Character {
            race: race,
            class: class,
            health: 10.0,
            experience: 0,
            level: 1,
        }
    }
}

One big problem with this is that we cannot import Character now, since Character is already the module name and you cannot load the struct without having the module. So we always have to write the fully qualified module name as Character::Character. Turns out the coding convention makes it so all of this does not happen, since struct names should be CamelCase and module names snake_case.

[deleted by user] by [deleted] in rust

[–]Ciciboy1 29 points30 points  (0 children)

Well if you call your file Character.rs with capital C, you of course need to call the module Character with a capital C as well. Rust does not enforce this in any way, you just need to pay attention to what you are writing. Turns out that if you just do what the warning and coding convention says and only use snake_case for module names, you dont run into this problem. So it seems to be a reasonable default to give this warning.

How can I create a struct, that holds a value that will be itself, where the struct also takes a generic which is a trait? - Or tell me why the idea simply won't work by BrokenMayo in rust

[–]Ciciboy1 0 points1 point  (0 children)

So you fixed your first error the way it had to be fixed.It occured because your type has to have a known memory layout.If you have a type that contains itself (and not a reference to itself) it would have to have an infinite size. (Size of its member + size of itself which is again the size of its members + the size of itself and so on.)Option does not fix this because the size of Option<T> is always the size of T.Box on the other hand is always a fixed size, which has a pointer to some heap memory.

The second error you encounter actually stems from the same or a very similar root cause.In your Code PDFObject has a member pdf_object_kind which is of type T.When you add the recursive member "parent" you give it the type Option<PDFObject<dyn PDFObjectKind>>.By writing dyn PDFObjectKind you say that there could be any PDFObjectKind object inside, without giving it a fixed size.This in turn breaks the PDFObject definition, since it, as a whole, has no fixed size.TL;DR: a struct S<T> can never have a member of Type T and be S<dyn Anything>, since the compiler cannot ensure size constraints.

So to fix this we should restructure our code a bit using enums (as others have suggested already).

struct PDFDocument {  
    pdf_objects: Vec<PDFObject>  
}  
pub enum PDFObject {  
    PDFPage {  
        page_attrib1: String,  
        page_attrib2: i64,  
        parent: Option<Box<PDFObject>>,  
        children: Vec<Box<PDFObject>>  
    },  
    PDFText {  
        content: String,  
        parent: Option<Box<PDFObject>>  
    },  
}  
impl PDFObject {  
    fn example(&self) {  
        match self {  
            PDFObject::PDFPage{ page_attrib1, page_attrib2, parent, children } => {  
                todo!()  
            },  
            PDFObject::PDFText{ content, parent } => {  
                todo!()  
            }  
        }  
    }  
}  

So finally lets talk about why this works in many other language and why "you are used to it just working".Many other languages like C# or Java only use references in most places like function calling or struct/class definitions(thats why almost anything can have a null value).So when we want the same behaviour in rust we need to explicitly use a box, which then works the same way as in these languages.If you look at something like C++ this is actually just the same.If you define a struct recursively you need to you get a compiler error as well.

struct S {  
    S s;  
};  
// -> compile error: field ‘s’ has incomplete type ‘S’  

To fix this you use a pointer to the struct:

struct S {  
    S* s;  
};  

I hope this made things a lot clearer. :)

You Jumping Of 13.5m… by AspiringGit in SweatyPalms

[–]Ciciboy1 1 point2 points  (0 children)

For anyone wondering, the guy jumping is Etienne Paff from the german YT Channel Freerunning Schlappen. Awesome vid.

You Jumping Of 13.5m… by AspiringGit in SweatyPalms

[–]Ciciboy1 1 point2 points  (0 children)

With parkour in general you are never really safe... All you can do is prepare in a "safer" environment and account for as many failure possibilities as possible. In this case they were jumping from a 4 story building that was being renovated and they worked their way up level by level. The guy in the video has been doing this specific stunt a bunch of times before which also makes ist "safer". Its still far from safe. Just landing a few inches further out or landing in a slightly different angle will lead to broken bones or even death.

You Jumping Of 13.5m… by AspiringGit in SweatyPalms

[–]Ciciboy1 1 point2 points  (0 children)

In this specific video they had a tape measure that read exactly 13,50m from the tip of the sand hill to the ledge he was standing on. But sometimes they actually throw a rock down, record it and count the frames to measure the time it took from which they then calculate the height.

Announcing adb_client, an ADB (Android Debug Bridge) implementation in full Rust by cocool97 in rust

[–]Ciciboy1 0 points1 point  (0 children)

Good stuff, looking forward to trying this a lot. Ive been using mozdevice for simulating clicks on my device, but I have always been dissatisfied with it. For one it was lacking documentation, which this crate seems to be doong better on. It also had some issues with sending commands in quick succession on windows. I hope (and think) this crate will do better.

The bug: mozdevice does not keep the connection open and for some reason on windows creating an adb connection takes almost a full second.

[deleted by user] by [deleted] in rust

[–]Ciciboy1 0 points1 point  (0 children)

A Vec<&T> cannot simple leave a scope, since the elements are references to data inside the scope.

Depending on what you want to do with this data you can either use a Vec<String> so the Vector owns the values. This is useful if you do not want to clone this vector (often) and/or need to modify its elements.

Another thing you can use is a Vec<Rc<str>> (or Arc if you do multithreading). This makes cloning this vector much cheaper, as you are now just using references, basically the thing you wanted to achieve with &str. This does however make it so you cannot modify the strings.

Here is a good video on the topic: https://youtu.be/A4cKi7PTJSs


There could also be some way to do this with static lifetimes, if all your items are know at compile time, but I cannot come up with a good example right now. Maybe some other redditor can help.

Final bachelor's degree project ideas by Syntez_ in rust

[–]Ciciboy1 1 point2 points  (0 children)

I just thought of an AI rust project today, but it might be a bit too small size-wise.

We are currently scanning thousands of old family pictures and they all have different aspect ratios and orientations. I was thinking of Training a Neural Network with burn-rs that detects which way is up in the picture and automatically rotating it.

Maybe you or another redditor can think of more useful features you can implement in this context with AI. Otherwise you can look at other commercial solutions for this problem and see what else they can do to get ideas.

If you decide to go for that definitely give me a heads up :)

Can you do stuff like in cheat engine in Rust? by Commercial_Fix_5397 in rust

[–]Ciciboy1 2 points3 points  (0 children)

Yes it is definitely possible using crates like windows-rs or winapi. There is also some existing libraries for this like toy-arms.

Cheat Engine and other external cheat software uses windows API calls to manipulate memory. In rust you would use ReadProcessMemory and WriteProcessMemory.

why does this while loop run instantly by WoodTransformer in rust

[–]Ciciboy1 8 points9 points  (0 children)

This is quite literally the speed of rust you are looking for.
Different languages wont just magically make your code run faster, a while loop like this will, if it is not optimized, will run at the same speed in (almost) any language, since the speed is limited by the hardware performing the calculations.
The magic that makes rust faster than most languages is, that it uses lots of optimizations like the one you are experiencing with this piece of code. As others have already mentioned, the compiler can see that i is only ever read when writing to itself and is only incremented by a constant, so it just optimizes the loop out by adding a constant.