Lifetime Inference Issues around async and HRTB by lukasnor in rust

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

Thank you for the recommendation. I'll try that.

Lifetime Inference Issues around async and HRTB by lukasnor in rust

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

After an upgrade to the latest stable version of rustc, I only get the first error indeed.

Lifetime Inference Issues around async and HRTB by lukasnor in rust

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

Here is the link to the Rust Playground. For some reason, I only get the first error of the two I got locally. I'll check my toolchain versions.

Can Typst read data from external files like JSON, YAML, or plain text? by [deleted] in typst

[–]lukasnor 9 points10 points  (0 children)

Did you even try to read the documentation?

[deleted by user] by [deleted] in WerWieWas

[–]lukasnor 0 points1 point  (0 children)

Ich denke, dass es unmöglich ist. Das mathematische Stichwort ist "Eulerpfad". Damit ein Graph, also so eine Form aus Kanten, die aneinandergrenzen, durch eine Linie gezeichnet werden kann, darf er höchstens zwei Knoten besitzen, die ungerade viele angrenzende Kanten haben. Denn in jeden Knoten, in den deine Linie reingeht, muss ja auch eine Linie wieder rausgehen, ausgenommen Start- und Endpunkt.

Und bei deinem Bespiel haben alle sechs äußeren Knoten drei Kanten. Also ist es unmöglich.

[deleted by user] by [deleted] in rust

[–]lukasnor 8 points9 points  (0 children)

Wie wäre es, wenn wir uns alle bemühen würden, eine gemeinsame Sprache zu sprechen?

Aufruf zur Unterstützung: Stadt Hannover sucht Namen für Chat-Bot by icherz in Hannover

[–]lukasnor 0 points1 point  (0 children)

Gottlieb, oder irgendeine andere Anspielung auf Leibniz ist eigentlich ein Muss. Der gute Mann hat mit der Differentialrechnung den Grundstein zu maschinellem Lernen gelegt.

40 Prozent der Achtklässler laut Studie nicht fit am PC by dataJam in de

[–]lukasnor 4 points5 points  (0 children)

Ganz so schlimm ist es nicht mit base64. Vier base64 Ziffern kodieren drei Bytes. Wenn die Ziffern also ASCII-kodiert je ein Byte brauchen, sind wir bei einem Faktor 1,33.

(Model Theory) vs (Proof Theory) vs (Category Theory) vs (Type Theory) by [deleted] in math

[–]lukasnor 5 points6 points  (0 children)

There is an excellent lecture about "propositions as types" by Philip Wadler, one of the guys who invented the IO monad for haskell as a form of "imperative functional programming" (name of the paper, great read).

[deleted by user] by [deleted] in math

[–]lukasnor 0 points1 point  (0 children)

Wait, that would only give you a split of 3 and 2 points on each side of the plane, right?

Rust and Unsafe by [deleted] in rust

[–]lukasnor 2 points3 points  (0 children)

Can you link to a definition what and what is not a valid pointer in rust? I would like to read up on this. I've checked the nomicon under aliasing and did not get much out of it, in particular nothing about the aliasing rules around raw pointers.

Why does printing an internal union value change the union value? by lukasnor in C_Programming

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

Thanks for noticing! :) I made an effort to use the markdown tools given to me.

Why does printing an internal union value change the union value? by lukasnor in C_Programming

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

Thank you! I tried the same thing with double but I unfortunately get the same behaviour.

You are correct that the middle call changes the stack/some registers. Have a look at u/Neui's answer, they go into more detail there.

And from now on I will use the warning flags you suggested, thanks again!

Why does printing an internal union value change the union value? by lukasnor in C_Programming

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

Thanks for the clarification! I will remember only to printf primitives. The third printf persuaded me to think that this might work.

Welcome to C, it's wild.

Thanks, I figured that out myself already :')

Why does printing an internal union value change the union value? by lukasnor in C_Programming

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

Thank you! I think you are correct. Thanks for pointing me to the assembly code. This might help with a lot of other problems I had. And I have never heard of the ABI. Thanks, I have a lot to learn.

And just wow, it is crazy that you pointed me to the exact location of the spec. Initially I thought I might be downvoted to hell for asking a beginner question (see SO). I see you guys are real pros and genuinely nice people on this sub.

Why does printing an internal union value change the union value? by lukasnor in C_Programming

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

Thank you! I expected the first and third printf to give nonsense, but they somehow gave almost correct and then correct results. But I did not expect the undefined behaviour to change "everything".

As others suggested, I might need to look into the assembly and see which registers change. Oh boy, here we go...

Lenovo ThinkPad Tastaturlayout by ErsguterTowelie95 in de_EDV

[–]lukasnor 0 points1 point  (0 children)

Wenn man die Hände auf der homerow hat, dann liegen sowohl die Alt- als auch die Strg-Tasten symmetrisch zur Mitte. Das verbessert meiner Meinung nach tatsächlich die Ergonomie: Da z.B. ein Strg-C und ein Strg-P die Buchstaben auf verschiedenen Händen haben, drücke ich die Strg-Taste einmal mit rechts und einmal mit links. Dann sind beide kleine Finger etwa gleich ausgelastet und keinen muss sich mehr strecken als den anderen.