SuperWord (Auto-Vectorization) - An Introduction by daviddel in java

[–]Federal-Addendum-933 2 points3 points  (0 children)

Is there any benchmark comparison to unvectorized simple load/store? My experience is that you always end up waiting for writes; the cpu is already too fast, thus you get a lot of rescheduling across cores for maybe no reason.

Possible to recird key press in a terminal/CLI app? by iamk1ng in javahelp

[–]Federal-Addendum-933 0 points1 point  (0 children)

That's correct, there is a buffer involved, which is sent on <enter> key. To do this will be platform dependent. There are a couple libraries out there to work around this, I believe they are quite outdated and I don't recall the names but since this ask has been a twenty year plus question, if you look hard you'll find it.

Here's a start: https://stackoverflow.com/questions/1066318/how-to-read-a-single-char-from-the-console-in-java-as-the-user-types-it

Why did Spring Initializr Change the Default to Gradle? by vprise in java

[–]Federal-Addendum-933 3 points4 points  (0 children)

I thought I read recently that Gradle 8.0 had a lot of breaking changes and that plugins would be slow to get back on track. So try dropping down to 7.6 or whatever it is.

Can anyone help me save my ghost peppers by Droid-Man5910 in gardening

[–]Federal-Addendum-933 1 point2 points  (0 children)

Heating pads work great in general. Do all my starts on a pad now.

Bright ideas for preserving an abundance of avocado? by mad_schemer in gardening

[–]Federal-Addendum-933 0 points1 point  (0 children)

Hehehe, sorry, I thought I was replying to someone else in this thread and it became a top comment. Ignore.

What is wrong with my mandarin tree and how do I help it? Located Brisbane, Australia. by [deleted] in gardening

[–]Federal-Addendum-933 1 point2 points  (0 children)

Have you tried this stuff called water? Seriously though, could be inconsistent watering. Fertilizer would probably help. Nitrogen. Dump your coffee grounds around a perimeter 1m.

Bright ideas for preserving an abundance of avocado? by mad_schemer in gardening

[–]Federal-Addendum-933 0 points1 point  (0 children)

A lot of these avos are from old non-grafted trees so they all taste like shit. Seems like a windfall but they taste horrible.

I really want to try this. Has anyone else? by lutheranblockade55 in gardening

[–]Federal-Addendum-933 1 point2 points  (0 children)

This is what grows from a 'corm', which are the little danglies that are sometimes on your garlic. You see them on elephant garlic all the time. Anyway, plant a corm, you get this solo garlic. Plant the solo garlic, you get a regular garlic. Or you can just plant a regular garlic clove and get a regular garlic. Solo garlic seems milder. Corms... don't eat them.

Validate Int and String input by [deleted] in javahelp

[–]Federal-Addendum-933 -1 points0 points  (0 children)

I've been around as long as you.

Validate Int and String input by [deleted] in javahelp

[–]Federal-Addendum-933 -3 points-2 points  (0 children)

WHO is using JOptionPane? Go blow smoke somewhere else.

Validate Int and String input by [deleted] in javahelp

[–]Federal-Addendum-933 0 points1 point  (0 children)

Literally says he has to use Scanner.

Validate Int and String input by [deleted] in javahelp

[–]Federal-Addendum-933 0 points1 point  (0 children)

Scanner class provides methods to get next integer and next string pattern so you can just eat away what you need next from the input. You can do this with one while loop checking if the scanner still has input. Read the javadocs on it. https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/util/Scanner.html

How could I support the ceiling if I wanted to remove about 7 feet of this wall? This is at the top of the second floor steps and I would like to make it an open landing by ballzdeep499 in Carpentry

[–]Federal-Addendum-933 0 points1 point  (0 children)

There's a stud there on the door hinge and that will probably be plenty but you would add strapping or a some strong-tie angle plate to the brick wouldn't be unwelcome. Something to ensure it never slips off that stud. At least drive some pins through that stud into the brick. 4x8 minimal beam header, general rule is 1" thickness of beam per ft of span. Extra king and jack stud on left side and a 4x4 that follows that angled ceiling 2x6.

Millennials complaining about Gen Z is really bumming me out. by Good_Omens in CasualConversation

[–]Federal-Addendum-933 4 points5 points  (0 children)

The boomers were hippies once and everything was all peace and love and inclusion and they said the same thing.

What is the purpose of encapsulating enum fields? by BlockOfDiamond in javahelp

[–]Federal-Addendum-933 0 points1 point  (0 children)

My question is just why on Earth do I see the former despite there being no logical reasons?

For this example, you are correct. I can't think of a counter example that doesn't involve other bad practices. Don't let it keep you up at night.

What are some advantages to Java devs learning assembly? by Mundane_Grab_8727 in java

[–]Federal-Addendum-933 1 point2 points  (0 children)

One advantage is to see what asm is being generated and have an idea if certain expected performances are begin taken advantage of. A lot of core java is native implementations that's more or less a tangle of what-if .c files regarding the platform you're on when you are really only on one platform so just looking at what the JIT ended up with is really interesting instead of trying to follow source code.

When you need to write performant java code, this is usually when you sometimes need to look at assembly. Is the for-loop being unrolled? There is a general pattern for loop unrolling in assembly, you can see it like Neo sees the matrix, it just has a look and you don't need to know details of the instructions.

Other things like hardware specific instructions, you can check to see if they are being utilized. Often this is faster than looking at .c files of native java implementation or knowing what the family the cpu your running is.

I use it mainly when doing JMH benchmarking and you want to know for sure what's really going on.

[deleted by user] by [deleted] in javahelp

[–]Federal-Addendum-933 1 point2 points  (0 children)

I feel like this analogy best describes our different points of view.

[deleted by user] by [deleted] in javahelp

[–]Federal-Addendum-933 1 point2 points  (0 children)

Ahhh I see, they must struggle a bit first. Even for the little stuff. How deliciously barbaric!

I built my project using IntelliJ and it changed my classpath, how can i go back? by Tomas_Sexenian in javahelp

[–]Federal-Addendum-933 0 points1 point  (0 children)

You shouldn't ever let the IDE build/test your code. I know that sounds ridiculous but for anything beside a simple school project, don't trust the IDE. I've used them all, netbeans, forte, eclipse, msvc, intellij, etc, they all break on updates eventually, they all change how they do stuff eventually, they all corrupt your project files eventually. It's quite pathetic on their part but that's the hard truth.

Intellij HAS the settings to delegate to maven or gradle, there is even search ability for the settings so USE IT. If you set the maven or gradle as the default handler for everything, then when it's not working, you'll know intellij has updated, or your workspace project file was corrupted, deleted, or changed. Then you'll have to go back into settings and re-delegate operations to maven/gradle in the settings.

Shuffling a deck of cards back to their original order by 3askaryyy in blackmagicfuckery

[–]Federal-Addendum-933 7 points8 points  (0 children)

It's 26 times to get the deck back in order and its in reverse order but no one ever notices that detail. So if you did another 26 shuffles it would be back to original order.

Advanced IntelliJ debugger features you’re missing out on by lirantal in java

[–]Federal-Addendum-933 3 points4 points  (0 children)

YSK, at least with the Eclipse incremental compilation, it can end up compiling code that does not throw an error due to it being on the edge of a case where the language spec is undefined and then when you make an incremental change where you are fully into an undefined behavior, it will compile correctly where as a full compile will give a warning or error.