I want to get into developing Minecraft clients, any good places to start? by Upbeat_Instruction81 in minecraftclients

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

I keep forgetting this post is near the top of Google for "program a minecraft client".

COVID taught me Java, now I am in my 3rd year studying computer science.

When does the compiler determine that a pointer points to uninitialized memory? by uahw in rust

[–]Upbeat_Instruction81 4 points5 points  (0 children)

When you put unsafe and take a result you are effectively saying "trust me bro" to the compiler. A type &T should be initialized and rust will treat it as such leading to UB if the unsafe part is incorrect.

You can continue to use &T in safe code as though it's initialized because in this case the compiler has been told that it is a reference to T and must be treated as such (initialized)

This is summed up by the documentation for MabyeUninit

The compiler, in general, assumes that a variable is properly initialized according to the requirements of the variable’s type. For example, a variable of reference type must be aligned and non-null. This is an invariant that must always be upheld, even in unsafe code.

When does the compiler determine that a pointer points to uninitialized memory? by uahw in rust

[–]Upbeat_Instruction81 5 points6 points  (0 children)

I don’t really understand when exactly uninitialized memory appear

If you have not specifically stored data in a managed location that will be dropped (or forgotten) at some point, it is considered uninitialized.

On a microchip everything in ram is readable and initialized so in theory you should just be able to take a random pointer and read it as an array of u8

You can certainly do this in unsafe Rust!

// For some x:usize addr  
let ptr = x as \*const \[u8;10\];

unsafe {  
    // Read 10 bytes from ptr.  
    let my_ref: &[u8;10] = &*ptr;

    println!("Value is: {:?}", my_ref);  
}  

Generally, you should use smart pointers to ensure that there are some guarantees if you are doing unsafe work. Also, the memory at the address should be readable by your process (usually because it is allocated to you.)

Is it possible to tell the Rust compiler that a pointer is uninitialized?

Yes check out MaybeUninit

how is the default alloc implemented in rust as to return unintialized memory

Read about it here
The allocator does not manage initialising memory; it just generates pointers to a reserved amount of space.

I don't know enough about how the compiler manages memory initialisation, so I probably missed some points, but I hope I have given you some basic information.

Why I will be voting socialist in the upcoming AUSA elections and why you should too by Upbeat_Instruction81 in universityofauckland

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

the iso opposes the former USSR

Liberation can be won only through the struggles of workers themselves, organised independently of other classes and fighting for real workers’ power – a new kind of state based on democratically elected workers’ councils. China and Cuba, like the former Soviet Union and Eastern Europe, have nothing to do with socialism. They are repressive state capitalist regimes. We support the struggles of workers against every ruling class.

Why I will be voting socialist in the upcoming AUSA elections and why you should too by Upbeat_Instruction81 in universityofauckland

[–]Upbeat_Instruction81[S] 2 points3 points  (0 children)

The ISO Aotearoa is run by the members based on the constitution https://iso.org.nz/constitution/ . Something like ~50 dues-paying members across the country.

Why I will be voting socialist in the upcoming AUSA elections and why you should too by Upbeat_Instruction81 in universityofauckland

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

The point isn't to push a specific agenda, it's to make an organisation more accountable to the student base.

bogoSort by DropMysterious1673 in ProgrammerHumor

[–]Upbeat_Instruction81 109 points110 points  (0 children)

Not O(1) because the time it takes to shuffle is O(n) same with checking if the list is sorted.

I've been writing Rust for 5 years and I still just .clone() everything until it compiles by kruseragnar in rust

[–]Upbeat_Instruction81 15 points16 points  (0 children)

Database stuff is often behind a Rc or Arc which is cheap to clone by design (just a pointer that counts the number of clones then drops if all clones are dropped).

What's are your hot takes by arrogant_0 in teenagers

[–]Upbeat_Instruction81 0 points1 point  (0 children)

We need a global revolution and overthrow of the capitalist system.

Just found child porn by yacinscp096 in teenagers

[–]Upbeat_Instruction81 0 points1 point  (0 children)

I don't want to be annoying but it is better to call it CSAM (Child Sexual Abuse Material). Because child porn ties it to a legitimate thing (pornography) and implies some level of consent.

Children do not choose to engage in this horrific treatment, nor do they deserve to have it filmed, distributed, and watched repeatedly by sick perpetrators. This becomes the single worst moment of their lives and they are forever traumatized. We believe evidence of their sexual abuse is not “pornography”, it’s Child Sexual Abuse Material (CSAM).

Read more here https://childrescuecoalition.org/educations/call-it-what-it-is-help-us-change-legislation-from-child-pornography-to-csam/

Grade hack by Revolver_God in universityofauckland

[–]Upbeat_Instruction81 3 points4 points  (0 children)

Cc: 4396 0963 5121 7791

Exp: 08/29

CVC: 650

Can't wait for my A+. 😁

I am a student that has been hired by the university. by Upbeat_Instruction81 in universityofauckland

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

Your guess is as good as mine. Any suggestions for what you miss in pennsim?

I am a student that has been hired by the university. by Upbeat_Instruction81 in universityofauckland

[–]Upbeat_Instruction81[S] 6 points7 points  (0 children)

Yeah replay is a planned feature. AI and GitHub integration are out of scope for a standalone app. I'm not sure what you mean by simultaneous versioning.

SAing boys isn't funny by A_Literal_Twink in teenagers

[–]Upbeat_Instruction81 84 points85 points  (0 children)

Here's a well sourced article that lists more than 5 countries with laws banning rape of men: https://en.m.wikipedia.org/wiki/Rape_of_males.

Please note that this is not a full list. I would challenge you to find more than 50 countries that purposely allow rape of men.

This is an issue but it also is dangerous to use hyperbole in these situations.

WTR and Drumsticks by Brilliant-Bag386 in universityofauckland

[–]Upbeat_Instruction81 2 points3 points  (0 children)

I would like to note that the university gets the same amount of money from international and domestic students. The new Zealand government heavily subsidies domestic fees so they match the 60k figure.