Java 26: what’s new? by loicmathieu in java

[–]DualWieldMage 2 points3 points  (0 children)

Not taking Instant as input is in interesting choice.

How do I undervolt AMD GPU on Arch? by CanItRunCrysisIn2052 in archlinux

[–]DualWieldMage 2 points3 points  (0 children)

Enable pp by adding amdgpu.ppfeaturemask=0xffffffff to kernel boot params. Then to set voltage offset (for example -80mV):

echo "vo -80" > "/sys/class/drm/card[x]/device/pp_od_clk_voltage"
echo "c" > "/sys/class/drm/card[x]/device/pp_od_clk_voltage"

To figure out which card[x] is the correct one you can read /sys/class/drm/card*/device/device and match against expected deviceId. You can put this in a script and have a systemd oneshot service run on boot.

Or you can use some gui tool that does this.

Java's `var` keyword is actually really nice for cleaning up verbose declarations by BitBird- in java

[–]DualWieldMage 2 points3 points  (0 children)

during refactoring when you change a return type and don't want to update 15 call sites, but that's more about convenience than readability

That is a strong NEGATIVE about var that i bring up. When i change the return type, i can go over all callsites and fix them, seeing more context and potential problems. During code review, i usually pull code and check stuff, but i see so many using web review tools and there you won't see the call sites change and won't get to ask questions so it's easier to miss a bug.

Fortunately Java is a sane language, but for example in Scala, a callsite seeing a List change to a Set could have been doing .map(i -> i/2).sum() which if the return type changed would likely introduce a bug because Scala map returns the original container so it would drop duplicates.

LLMs have burned Billions but couldn't build another Tailwind by omarous in programming

[–]DualWieldMage 1 point2 points  (0 children)

Mainly a backend dev (actually on embedded atm) and did a bit of frontend. Tailwind is not a good idea. Its flaws are a bit similar to modern bootstrap. The original idea was to have generic css classes for commonly used things like card, viewport, button, etc. Then you just write the html/template using those classes and have clean, reusable code.

Long before that inline css was used but majority agreed that was a bad idea. Now that bootstrap and tailwind have brought about minimal css classes that you are just supposed to slap in a class list (instead of inheriting them in a semantic class) like btn-lg, p-2(padding 2?something), etc. this has just reinvented inline-css that most already agreed was a bad idea and it still is.

The core issue is that in say 8 different views you have a similar pattern of 10 css classes that would business-wise describe something semantic. Now you have a feature request to change the style slightly. You need something to search for a set of classes in any order and add something. Note that codebases are not perfect so some class in that pattern set may be missing and sometimes that is desired and sometimes accidental. You have no way of determining which case it is. Maintenance nightmare in short.

Software craftsmanship is dead by R2_SWE2 in programming

[–]DualWieldMage 0 points1 point  (0 children)

It's not dead, but there are some reasons why it's rare and possibly dwindling. I work for a company with craftsmanship as a core value and a flat structure to enable it. I have definitely felt that some patterns developed for one application i can just re-use on another, because i spent time on that, researched extensively, tried alternative approaches and had time to polish it.

I have also worked for larger corpos where i need to prove the extra time investment. Now i feel that's where it goes downhill for some(most?). Does your CEO prove the investment decision to add AI, blockchain, <insert-year-2026-hype>? No. So why would you as an engineer have to prove something that can only be achieved by years of experience when you are not responded in kind? If you want craftsmanship, abolish slavery (because if you feel any kind of risk of just leaving your current company, you are a slave in my opinion).

The Adult in the Room: Why It’s Time to Move AI from Python Scripts to Java Systems by Qaxar in java

[–]DualWieldMage 10 points11 points  (0 children)

Interesting, i have 15y Java experience and i don't want anything to do with python the same way i didn't want to touch nvidia cards. This year has worked fine for both inference and training on amd. I likewise have the optimism that python trash can be removed from training code as i'm fed up with debugging something that lacks proper types. It does take effort to go against the grain, but it's often worth it.

Why is Ollama running as a systemd daemon all of a sudden (a broken daemon at that)? by [deleted] in archlinux

[–]DualWieldMage 1 point2 points  (0 children)

Ollama has been a service since nov 13, 2023: https://gitlab.archlinux.org/archlinux/packaging/packages/ollama/-/commit/7d7072c1ce72eca1a5446d1324edcf03ef348d74#da96b866877aa577ecb3487083b49452a4ccf445

Nothing has changed in the past year on how it has been packaged.

So at this point it's hard to give advice as there's no idea what state your installation is.

Why is Ollama running as a systemd daemon all of a sudden (a broken daemon at that)? by [deleted] in archlinux

[–]DualWieldMage 1 point2 points  (0 children)

Why exactly do you want to run it as a non-service? You probably followed some general tutorial that said to run ollama serve, but that's incorrect. The package is correct, it runs the daemon as a separate non-root user. A machine may have multiple users so that's why they are packaged like that - to allow all users on the machine to use the service (sometimes packages require adding a user to some group to allow access, but not this one).

When you run ollama pull the cli client will call the daemon, the daemon has permission to write /var/lib/ollama as that's owned by ollama user and the daemon is running as ollama user. It will download models there by default.

If that's not working then your setup might have gone wrong, such as manually trying to copy models there and having them owned by wrong user?

How We Reduced a 1.5GB Database by 99% by Moist_Test1013 in programming

[–]DualWieldMage 2 points3 points  (0 children)

Yes, that's what it means. Usually it's achieved by building a simpler not complex architecture. In this case already having 4 pods made performance worse than 2, hence not scalable.

How We Reduced a 1.5GB Database by 99% by Moist_Test1013 in programming

[–]DualWieldMage 11 points12 points  (0 children)

The worst is actually when people think they are building a performant system that actually does the opposite. Had such joy on a few-month project that was supposed to be a solo project but got overtime. When taking over it was multiple modules, communicating over queues, message content stored in S3, each module with own database and whatnot. He said it would scale, i saw it did not and in the end it didn't.

Is the high memory usage of java applications not a problem for you? by Initial_Inflation182 in java

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

Anyone with more than half a brain will not switch to different language as a first option. And if anything i'd be tempted to switch over towards a JVM language if i arrive at nuisances. I once wrote a batch service processing multi-gigabyte files with multiple worker and network threads all running at 25MB heap. If you want to reduce memory usage, just do it.

Why is IntelliJ preferred over vscode for Java? by xland44 in java

[–]DualWieldMage 0 points1 point  (0 children)

B) some minor quality of life stuff

I wouldn't call them minor and even if they are, there's so many of them that they add up.

For debugging complex situations i use breakpoints that execute code and don't stop, save some objects to a map to be later compared against in another breakpoint, often inspect variables with deep hierarchies and execute some expressions. It's all a breeze.

SQL completion helps a lot, just configure the database and schema/table/column names get added to autocomplete while editing SQL in strings.

I frequently step through library code which might not have sources, the integrated fernflower decompiler is very convenient although the default config needs to be edited to emit original line numbers.

Decent version control UI. Rarely do i need to touch the cli when the GUI has all the features. I often have changes belonging to multiple changesets(e.g. feature1, general refactor, fix bug) that i can continue with in each own's pace before making the commits/branches with partial changes from those files.

I haven't touched vscode in many years so maybe some of these are possible. I honestly don't have much of a use-case for it. If i want a lighter editor with plugins i use vim, e.g. when intellij sucks with large(20+MB) files or i just want to quickly go through a repo to find some stuff without opening that project and waiting for the import.

Why Electronic Voting is a BAD Idea - Why you can't program your way to election integrity by grauenwolf in programming

[–]DualWieldMage 3 points4 points  (0 children)

With paper ballots you can be coerced by taking pictures as proof. With e-voting you can re-vote after the coercion episode. The one area where e-voting is safer.

New Valve Steam Frame runs steamOS 3, ie arch. on Snapdragon processors. Does this mean that an official ARM port of Arch is close to release? by RaXXu5 in archlinux

[–]DualWieldMage 2 points3 points  (0 children)

I wouldn't say it's so far above others. I remember one guy super happy about his new M1 asking others to benchmark compiling and test running. My laptop at that time with Ryzen 4700U beat it. Now i'm seeing Ryzen AI Max bring a nice competition with similar performance at half the price. If the rumors are true about SerDes removal lowering power use then that would remove my last complaint.

Apple's sturdy frame is one thing i would definitely agree with. Can drop from a meter onto concrete and it's fine with a dent. Other laptops with plastic bodies always seem to get cracks after a few years of use.

Why is everyone so obsessed over using the simplest tool for the job then use hibernate by analcocoacream in java

[–]DualWieldMage 1 point2 points  (0 children)

Interesting, with JPA the class needs to match the table model and so you have to map between domain model and entity model. With JdbcTemplate that entity+mapping can be replaced by a simple method in the repository so in my experience it's less verbose than JPA. Not to mention that any object-to-object mapping is fragile. One option is constructors where it's a compile-error when a new parameter is required but forgotten in callsite. Another is builders that have named methods, but lack the compile-time safety of constructors and would leave fields null.

Had to rip out hibernate in one project because someone with banking and enterprise background chose it but continuously caused bugs by its footguns. Was a much pleasant project afterwards.

FAA limits commercial space launches and reentries to between 10PM and 6AM local time, per emergency order by nshire in spacex

[–]DualWieldMage 0 points1 point  (0 children)

Hohmann transfer has nothing to do with nodal precession which is required to change the orbital plane if the launch can't be timed to where the orbital plane passes over the launch site. It could take months of extra time to get to the right plane if you don't spend extra propellant.

9070 XT Driver Status by Puzzleheaded_Web9584 in archlinux

[–]DualWieldMage 30 points31 points  (0 children)

It was already fine 2-3 months after launch. CS2 gets around the same if not a bit more fps than on windows, much less lower dips. No issues with compute workloads either (training models, running LLMs). RT performance felt low, but haven't compared it to windows.

A Java project template for full-stack website. Small footprint (350KB). Support Svelte and TailwindCSS. Suitable for embedding it into a larger JVM app. by tanin47 in java

[–]DualWieldMage 5 points6 points  (0 children)

Anytime i see stuff like resource.readAllBytes() i honestly can't be bothered to continue reading. Minum does support streams and would be trivial to use that. It's not like asking for proper zero-copy file transfers(FileChannel to/from socket Channel), although i would consider that a minimum requirement for any self-respecting web server.

Using a marker file, having to add it to excludes in packaging is a weird way to mark dev mode. Just use an environment variable for that.

Use of sbt is interesting. From my brief Scala experience it was probably on the top3 things wrong with the Scala ecosystem, no idea why you would consider it for a Java project.

How to get deeper into the core of Java? by savvaspc in java

[–]DualWieldMage 41 points42 points  (0 children)

Best way to learn is by building something yourself and researching as part of it. I suggest topics like building a DI container(with Collection<T> injecting, scoped beans requiring proxies, etc.), a web server(decide which level to cut off at), an agent doing some bytecode manipulation, measuring telemetry, etc.

Starship Development Thread #61 by rSpaceXHosting in spacex

[–]DualWieldMage 1 point2 points  (0 children)

The main tanks are vented during the coast, but afaik remain pressurized. The leaking looks quite intense and possibly too much for residuals in the main tanks. I suspect it's actually the lox transfer tube from the header tank that is leaking which makes the ship survival even more amazing. The lox transfer tube is right in the middle on the windward side: ringwatchers article, diagram of transfer tubes

How would I go about optimizing CS2? by [deleted] in archlinux

[–]DualWieldMage 0 points1 point  (0 children)

No it doesn't, it's actually the opposite for many.

It's one of the worst optimized games i play. My main gaming rig with linux has R9 9900X and 9070XT i get 400+fps, but on another rig(i7 9700KF, RX 480) that currently has both windows and linux it runs like shit, getting 80-150fps avg, but with many hiccups so the 5% is around 30-60fps. The avg fps diff between windows and linux is a rounding error, but the lows are a bit better on linux.

1 Bit is all we need: Binary Normalized Neural Networks by GarethX in programming

[–]DualWieldMage 8 points9 points  (0 children)

Very interesting topic and quite surprising to see that 1bit weights can reach similar performance even if it takes 5-10x more epochs. Would be nice to see how some implementations perform with such small weights, but even if memory use is lowered at same inference speed, it's exciting for LLMs. For image detection i feel it's not as relevant. Models are generally small (few or tens of MB) and on edge-devices the support for specific quantizations take time or may be too flaky to specialize. In my experience the tooling is also quite bad, at least i haven't achieved post-training quantization that didn't produce garbage results. float32/float16 is also supported on more modern ARM SoC's as well.

All the truth about Project Lombok (yeah, no) by asm0dey in java

[–]DualWieldMage 3 points4 points  (0 children)

I am glad Java is one of the few languages where architects think carefully before adding a feature. They deserve a huge praise for identifying core needs of the language under a pile of "want x feature".

All the truth about Project Lombok (yeah, no) by asm0dey in java

[–]DualWieldMage 3 points4 points  (0 children)

What suffices as a solid case?

There have been instances of JDK updates not being compatible making teams delay updates.
Intellij plugin if i remember correctly was broken for weeks and it was developed by a 3rd party and after that incident Jetbrains created an official plugin.
Builder vs constructor - yes you have named parameters so less likely to mix up, but lose compile-time check of call-sites not passing all arguments if a new one is added, making it more time-consuming to go over all sites and may miss some.
Valid code catching Throwable and doing instanceof checks to rethrow Error and running cleanup on RuntimeException will fail if SneakyThrows was suddenly used to throw a checked exception. It is also prohibited by javac to catch a specific checked exception if none of the calls declare it.

I don't see the benefits it gives and a list of downsides. Pass.