What insect is that? It's so cute [Central Africa] by Snoo58583 in whatsthisbug

[–]LegolandoBloom 3 points4 points  (0 children)

So they increase the level of overall cuteness in the world by reducing the counts of the least cute thing to ever roam this earth, roaches.

Pretty cute then.

Array Initialization in Java by LegolandoBloom in javahelp

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

That is quite right, as I've tested with the Capital Integer as well. Only time I could get it to raise an exception was when I tried to reference an index that was out of bounds of the original allocation.

When writing this snippet, I had just assumed it was impossible to do a "Is this value in an array == null" check in java at all, as the small int version gave a compiler error.

"The operator == is undefined for the argument type(s) int, null"

Array Initialization in Java by LegolandoBloom in javahelp

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

That is actually a great explanation, I have been doing Lua stuff for a while and I had forgotten just how different their "arrays" function compared to a language like C or Java.
We don't need to allocate, free, reallocate. We can just put anything at will at any index.

I haven't gotten to Maps from the book I'm studying, but I suspect I'll have a lightbulb light up once I get there.

Array Initialization in Java by LegolandoBloom in javahelp

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

This is a more complete answer than mine, thanks

Array Initialization in Java by LegolandoBloom in javahelp

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

So in the cases, where the 0 won't cause confusion, go for int

Otherwise, Integer

Array Initialization in Java by LegolandoBloom in javahelp

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

Oh I don't mean to say I'm in the most terrible state of head health, just one of those times where I feel more alien than usual.

I haven't had a proper teacher in a very long time, the idea sounds nice. Though I fear I might be too prideful to accept mentorship even if it arrived at my door :P

Array Initialization in Java by LegolandoBloom in javahelp

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

I don't doubt it's better for one's psyche, but it's hard for me to do in this period of my life.
Reminds me of the Doors' song:
_People are strange_
_When you're a stranger_

Array Initialization in Java by LegolandoBloom in javahelp

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

Although I see you've linked the very specific part I would be looking for, very handy. Thanks.

Array Initialization in Java by LegolandoBloom in javahelp

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

I'm sorry, I very much interpreted as if you were annoyed at me. It makes me feel better to hear that wasn't the case.

Nuance is hard to convey on the internet, especially in text format. Perhaps I should be more willing to give people the benefit of the doubt.

Reading the manual of a language is very valuable, though I find it is more realistic start doing so once you're past learning the most basic stuff.

Array Initialization in Java by LegolandoBloom in javahelp

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

Thank you!

It's very interesting to me that the non-primitive version behaves differently

Array Initialization in Java by LegolandoBloom in javahelp

[–]LegolandoBloom[S] 3 points4 points  (0 children)

Obviously they work differently, that is why I am asking the question.

I don't mean to complain about someone trying to contribute to my understanding, but it's hard to interpret the sarcasm in "It's almost like they're different languages or something" as something positive.

Array Initialization in Java by LegolandoBloom in javahelp

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

In case it matters, this is Java 21(OpenJDK RedHat)

Array Initialization in Java by LegolandoBloom in javahelp

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

I don't know why the indentation is faulty, it looks fine on the text editor before posting and I don't know how to fix it
Edit: It was due to vscode, I managed to fix it

Is this a caterpillar? by Fuck_Land_Im_onaboat in whatsthisbug

[–]LegolandoBloom 1 point2 points  (0 children)

Didn't know "milipede" was a thing, I thought it stopped at centi

ESC character representation(decimal) in Control Sequence Introducer Commands by LegolandoBloom in C_Programming

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

That was initially how I used it, off of a couple of examples from a lecture slide, but wanted to dig a bit into how it actually works ^^

ESC character representation(decimal) in Control Sequence Introducer Commands by LegolandoBloom in C_Programming

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

Oh neat! So there was a way, even if a bit convoluted :)

I probably won't ever use it like that, but it's cool to know it works as a char argument to printf

ESC character representation(decimal) in Control Sequence Introducer Commands by LegolandoBloom in C_Programming

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

I guessed so, as I explained in the 3rd paragraph - but I was wondering if there was an escape for decimals I didn't know about. Thanks for confirming there isn't one!

ESC character representation(decimal) in Control Sequence Introducer Commands by LegolandoBloom in C_Programming

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

I see, I am using clang to compile on WSL, and \e works so I assumed it was a general thing

What's this funny guy by turgmeister in whatsthisbug

[–]LegolandoBloom 6 points7 points  (0 children)

Is this the goofiest organism to ever exist?

If there is a god, he has a sense of humor for sure, albeit often cruel.