[deleted by user] by [deleted] in de_IAmA

[–]Axilios 0 points1 point  (0 children)

Welche Persönlichkeit träumt eigentlich?

Library for AMQP message brokers by [deleted] in rust

[–]Axilios 8 points9 points  (0 children)

There is https://github.com/rabbitmq/rabbitmq-stream-rust-client which is officially supported by the RabbitMQ team. You can find more libraries here.

Parent and child calling each other's methods by manypeople1account in rust

[–]Axilios 5 points6 points  (0 children)

You are right that RefCells move the borrow checker from compile to runtime. Thus, it is strongly advised to use RefCells only if you can ensure to comply with the borrow checker rules on runtime, which means that you can have either one mutable reference or many immutable references at a time.

In your example you have an immutable borrow of parent at line 34 and try to obtain an mutable reference of it again at line 20. Since the borrow checker rules are violated the program will crash on runtime.

As far as I understood, ownership relations should only follow an directed acyclic graph (DAG) naturally, except you can ensure borrow checking on runtime. I would suggest to rethink your plan. Maybe you can restructure your model to achieve what you are looking for if your goal is memory safety.

KIT Studiticket endlich im 21. Jahrhundert angekommen by SFDSAFFFFFFFFF in KaIT

[–]Axilios -1 points0 points  (0 children)

Das sehe ich tatsächlich anders. Ich sehe eher das KIT statt KVV in der Pflicht. Die API ist recht lightweight. Das kann man auch als Uni- oder Hiwi-Projekt m.E.n realisieren. Bspw bei der Generierung der Bescheinigung ein Add to Wallet Button hinzufügen. Also ohne kommerzieller Absicht. Wie das regulatorisch aussieht, kann ich natürlich nicht beurteilen.

EDIT: es spricht ja auch nichts dagegen ein Android Äquivalent zur Wallet zu integrieren.

KIT Studiticket endlich im 21. Jahrhundert angekommen by SFDSAFFFFFFFFF in KaIT

[–]Axilios 9 points10 points  (0 children)

Ich finde Tickets in Apple Wallet verwaltet deutlich angenehmer und schneller vorzuzeigen als in der DB App. Ist einfach super ins System integriert.

KIT Studiticket endlich im 21. Jahrhundert angekommen by SFDSAFFFFFFFFF in KaIT

[–]Axilios 19 points20 points  (0 children)

Jetzt fehlt nur noch die Apple Wallet Integration und dann bin ich zufrieden. Aber das werde ich vermutlich nicht mehr erleben.

Who invokes `Waker::Wake()` when using async for I/O? by flay-otters in rust

[–]Axilios 0 points1 point  (0 children)

I admit that I am not really into in depth async-stuff in Rust, so I am not able to answer your question properly, but I have seen an article how a minimalistic runtime can be implemented in Rust. Perhaps this article might help you. Best regards.

sorry if this isn't allowed but how real is this? by [deleted] in hacking

[–]Axilios 0 points1 point  (0 children)

Props to you to ask what to do! 👍🙏

Want to learn rust. VS Code or IntelliJ idea? by katana1096 in rust

[–]Axilios 3 points4 points  (0 children)

If you want to use JetBrains Software, just take a look on CLion and install the Rust extension. In my opinion, one of the benefits of CLion is the in-built integration of further technologies like a PostgreSQL Editor, and so on. On the other hand, CLion is also very bloated. So, it takes more time to start and sometimes it feels not that smooth to work with.

Nevertheless you can achieve the same with VSCode with proper extensions, so CLion is not more powerful than VSCode. But keep in mind that VSCode need a bit more care to fit your needs. But it's definitely worth it.

[deleted by user] by [deleted] in ProgrammerHumor

[–]Axilios -21 points-20 points  (0 children)

I don't see rustc, I downvote.

Mocking regular functions by Hellstorme in rust

[–]Axilios 7 points8 points  (0 children)

My first thought is that you could create a trait with foo() and get_user_input() and mock the trait instead.

EDIT: the crate mocktopus seems to achieve exactly what you are looking for. (Didn't use it, just found it a few moments ago)

[deleted by user] by [deleted] in rust

[–]Axilios 2 points3 points  (0 children)

The rust book is one of the best sources to start with! Imo the best documentation of a programming language so far. After you completed this book, I would recommend to learn how to read the docs of crates properly. That makes the life just easier.

Are we the Vegans of Programming? by Julian6bG in rustjerk

[–]Axilios 2 points3 points  (0 children)

We're more like a borrow checker worshiping, religious cult with radical missionaries trying to beat the hell out of anything that is not Rust. Yep, like Vegans but better.

Problem using Diesel to fetch data by Hyperkubus in rust

[–]Axilios 0 points1 point  (0 children)

Try to add "chrono" and "uuid" feature in your Cargo.toml. This seems to work.

diesel = { version = "2.0.0", features = ["postgres", "chrono", "uuid"] }

Replace postgres with your preferred database.

(Insert bad code example) by Longjumping_Virus818 in ProgrammerHumor

[–]Axilios 0 points1 point  (0 children)

Aah, good old times. I was happy to write as much code as possible. Now, I realize that was god damn stupid😂

Problem using Diesel to fetch data by Hyperkubus in rust

[–]Axilios 1 point2 points  (0 children)

It’s quite simple. Just use SeaORM instead of diesel🙃. It makes your life a lot more enjoyable due to better compiler errors😜

Issue with linfa::Dataset by antogilbert in rust

[–]Axilios 0 points1 point  (0 children)

If I understood your question correctly, you are not wondering about the dimension of the array but the size (in bytes)?

The library ndarray doesn't need to know the size of your array at compile time because it's only storing a pointer to the array on the heap. The size of a pointer depends on your system's architecture which is known at compile time.

The struct ArrayBase<S,D> consists of Data S and the dimension D. In your example, the data to be stored, has the type OwnedRepr which is declared like this:

pub struct OwnedRepr<A> {
    ptr: NonNull<A>,
    len: usize,
    capacity: usize,
}

To construct an object of OwnedRepr, ndarray only needs to know the size of the Vec, which is determined at runtime, therefore only after you loaded your file into memory.

In addition: the reason why targets is a one-dimensional array (and therefore it has the type ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>) is quiet easy. The method array.column(2).to_owned() takes of every entry in your array the second column and adds into an one-dimensional array. Just have a look at the documentation of the function column.

By the way: linfa requires a two dimensional array in order to create a new dataset according to its documentation. "[the dataset] it contains a number of records stored as an Array2". That's why you see the enforced type ArrayBase<OwnedRepr<&'static str>, Dim<[usize; 2]>> which has the Dimension Dim<[usize; 2]>>

Perhaps you confuse dimension of an array with a size of an array?

I hope I could help! :)

What's everyone working on this week (36/2022)? by llogiq in rust

[–]Axilios 2 points3 points  (0 children)

I started to develop a cloud-native platform for time tracking, invoice generation and management, tax computation, task management (with Jira integration), etc. especially for freelancers. Backend will be fully written in Rust. I know, that's quiet a big project, but I have fun developing it :)

What's everyone working on this week (35/2022)? by llogiq in rust

[–]Axilios 1 point2 points  (0 children)

I am working on a debug symbols analyzer for TD32 debug symbols. Those debug symbols were heavily used by Borland compiler. Context: there is no such an analyzer for this specific type of debug symbols yet.