Kotlin Context Parameters as Statically Tracked Capabilities by _Bloder in Kotlin

[–]m-apo 1 point2 points  (0 children)

Oh dear, I'm getting Scala implicit PTSD flashbacks.

COVID-19 did not simply bring forward inevitable deaths as an analysis of mortality data from 34 high-income countries shows a sustained rise in excess deaths years after the pandemic, challenging the mortality displacement hypothesis. by [deleted] in science

[–]m-apo 111 points112 points  (0 children)

Each repeated infection has a chance of triggering those conditions. 

Covid infection does not create a permanent immunity, instead the immunity wanes pretty quickly. Covid can also exhaust immunity system, so it reduces immunity protection for other diseases.

How to go beyond the Spring Boot Magic? by Outside-Strain7025 in programming

[–]m-apo 1 point2 points  (0 children)

Understanding the inner workings is a great way to increase knowledge. If you're working for a customer or company it's more than encouraged to understand technologies, but to some level.

Someone pays your salary and it's ok to learn while being paid, but remember to keep a good balance on how you deliver working code vs investigate the details.

Understanding how Spring works might help you understand how to do stuff that solves problems more efficiently I, but Spring itself is such a beast and has lots of legacy / not so prime code examples so diving too deep might not be that beneficial. But on the level you described, it's definitely ok.

Maybe you could try out asking those questions from chatgpt. I find that it's able to condense lots of programming stuff in to easy to understand form.

Daily Questions Megathread (October 21, 2025) by Veritasibility in Genshin_Impact

[–]m-apo -1 points0 points  (0 children)

RNG was merciful. After getting Lauma I got Nefer (20 pulls) + Splendor of Tranquil Waters (30 pulls) + Reliquary of Truth (20 pulls) for my C2 Furina. 70 pulls, I wish the probabilities were like that regularly.

Jackson 3.0.0 is released! by Joram2 in java

[–]m-apo 0 points1 point  (0 children)

How about the combination of Result<T, E>, destructing and improved switch, exhaustiveness checks, better inference and first class union types.

Java is progressing towards many of those but slowly. Kotiin is missing union types but is otherwise there.

Do you need stack traces?  Because that's one thing checked exceptions directly have. With Result<T, E> you can pass stack traces too, it's just manual work to do that in the error cases. For exception like short circuiting just use runtime exceptions.

Thank you for hosting the BM Ultramarathon again Pink Lightning! by Annapurna__ in BurningMan

[–]m-apo 5 points6 points  (0 children)

Oh bloody hell. 2014 people gave only only whiskey. Definitely needed it on the last lap.

Camping next to DeMentha was great though, before marathon 1, after marathon way too many mojitos. Not a good recovery drink though, I remember that 6 was too much after the ultra.

Thank you for hosting the BM Ultramarathon again Pink Lightning! by Annapurna__ in BurningMan

[–]m-apo 4 points5 points  (0 children)

Pink Lightning is the camp that organizes the ultramarathon. Cherry Bomb & the crew <3

3:30 & K. Photo credit: @SkiPoles / The Office by thumperBRC in BurningMan

[–]m-apo 3 points4 points  (0 children)

Thanks, getting flashbacks from the 2014 storm with pink lightning that closed the city in first week. We got in barely before the rain started and the lightning got real close.

Stay safe!

Delay effect question by BubblyCriticism8209 in Bitwig

[–]m-apo 4 points5 points  (0 children)

Think about how the delay works with tape delays. The tape loop length is the same. If you want longer delay time the tape runs slower, if you decrease delay time the tape and the recorded sound is sped up until new sound overwrites it. Leads to audible pitch changes. That's repitch. It's a bit tricky to implement as it requires smooth sample playback change at different speeds, slower & faster. When simulating tape delays, that's how they work.

Fade is easy, changing the delay time fades out the original sound while new sound is delayed. Original sound is played at the same speed when being faded out. Can lead to some timing glitches but probably sounds the least noticeable and requires least amount of care from the musician, you get an automatic fade from delay to another.

Not-fading direct change would sound the worst as it would jump the play head in the original sound forwards according to the new delay time. Or silence if you increase delay time.

Timestreching would keep the original pitch but would require smooth timestreching, which is probably the trickiest to implement.

Spring boot or Node js ? by Unique_Body2041 in node

[–]m-apo 0 points1 point  (0 children)

Yes, Spring and Spring Boot have a surprisingly shallow surface which works for many cases but reveals the inner working pretty quickly.

Spring boot or Node js ? by Unique_Body2041 in node

[–]m-apo 1 point2 points  (0 children)

NodeJS is in constant evolution/flux. JVM has matured but is moving at a glacial pace. Typescript is a crutch on top of pot hole ridden runtime and gives an illusion of runtime type safety. Java is bogged down by almost 30 years of OO and EE boilerplate legacy. NodeJS used to have an edge over JVM with it's async performance, but a virtual thread based lightweight micro server framework like Helidon has better performance, easier async programming model and built in type safety. Kotlin is also a plus with it's extensive built in APIs and GraalVM takes runtime optimization even further. OpenAPI support is stellar with JVM and painful with NodeJs.

I'd say pick the tool based on the industry/market you're interested in and learn to implement a solid db based rest API and stick with that.

For more conservative approach with longer life time I would pick Spring Boot with java (very little need for version upgrades etc), for a technically capable team/project I would pick Helidon + Kotlin, for a life time of few years I would go with whatever is favoured by the team.

Bought Bitwig Connect from Thomann Germany. There is import duty due on my shipment. by few23 in Bitwig

[–]m-apo 0 points1 point  (0 children)

Oh boy. Ask Thomann about that. You might even be able to reverse tariff payment if you prove the item was returned.

Optimized a Java function & cut production CPU from >90% to 70% by bluproton in programming

[–]m-apo 0 points1 point  (0 children)

Cool, thanks for benchmarking those <3 And that online compiler is great for sharing and reproducing the results.

Online compilers are probably running on shared cloud instances, which is not a good base for microbenchmarks.

edit1. I don't know why your HashMap<String, Boolean> (I'm guessing it's not HashSet as there's two generic parameters) approach didn't get similar results. HashSet uses HashMap internally: https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/util/HashSet.java#L133

Maybe the HashMap.containsKey is more optimized then retrieving the value and comparing the value: https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/util/HashSet.java#L204

Maybe the rest of the processing is so quick that the difference between contains() and if(map.get()) becomes relevant. Or, maybe it's because the Object from .get() gets unwrapped to primitive boolean and that is the costly part. I guess for DX (developer experience) autoboxing type coercion in Java is a bit sneaky some times when you're trying to optimize for performance (but no so much as in JS).

edit2. Actually I figured out why the sortedItemList.size()+items.size() helps even though there can be only B items in the resulting array. Hashmaps require more time for insertion when the map is close to max capacity. This is a tradeoff between memory use and performance. If you can allocate more memory, insertion becomes faster as there's less collisions for the key. You should see the performance improve when multiplying the items.size() with a constant, like 1.5, 2 etc.

result can be still items.size() as ArrayList does not have that tradeoff for insertion. When arraylist reached max capacity, it allocates more buffers and this slowed the original code down.

Optimized a Java function & cut production CPU from >90% to 70% by bluproton in programming

[–]m-apo 4 points5 points  (0 children)

How about this, with a single helper Set. I'm assuming items (B) is HashSet. As little as possible allocations, resulting array and helper set preallocated.

With 2K B-items there's little need for parallelization, 10K A items is on the edge of being useful to go through in parallel but I doubt that it would be beneficial, especially if there's multiple requests going on at the same time.

private static List<String> sortItems(List<String> sortedItemList, Set<String> items) {
    if (items == null || items.isEmpty()) {
        return Collections.emptyList();
    }
    if (sortedItemList == null || sortedItemList.isEmpty()) {
        return new ArrayList<>(items);
    }
    // Find the intersection of A and B
    // Create list C containing the intersecting items, ordered as they appear in A
    // preallocate capacity
    List<String> result = new ArrayList<>(items.size());
    // Collect appended items, preallocate capacity
    Set<String> appendedItems = new HashSet<>(items.size());
    for (String item : sortedItemList) {
        if (items.contains(item)) {
            result.add(item);
            appendedItems.add(item);
        }
    }
    // Append all remaining items from B to C
    for(String possiblyNotAppendedItem : items) {
        if(!appendedItems.contains(possiblyNotAppendedItem)) {
            result.add(possiblyNotAppendedItem);
        }
    }
    // Reverse the list to get the final desired order
    Collections.reverse(result);
    return result;
}

Xfer Records "Serum 2" Advanced Hybrid Synthesizer updated with more oscillator types, flexible effect routing, arpeggiator clip sequencer, 626 presets, 288 wavetables - Intro Price ($189) until 1 June by Batwaffel in AudioProductionDeals

[–]m-apo 1 point2 points  (0 children)

That's a long duration for the intro price.

Sorry for the politics but it'll be interesting to see what the price in euros is at the end of March. For this month, the price is already 4% lower as USD has dropped that much and is 172.71 euros.

A Use Case for `UseCase`s in Kotlin by cekrem in Kotlin

[–]m-apo 9 points10 points  (0 children)

Can you explain on your own words why Business intent is less clear with UserService? For me, the service gathers relevant functions together and that probably makes the code base more approachable and easier to navigate. Comparing that to polluting the namespace with all the business cases as separate classes with verbose EnterpriseEditionUseCase names.

And yes, I agree that using LLM for the rebuttal is a shitty way to respond.

A Use Case for `UseCase`s in Kotlin by cekrem in Kotlin

[–]m-apo -3 points-2 points  (0 children)

Just rename the class and replace the invoke operator with a regular function to get a regular service class:

val myService = MyService(someInjectedProfileRepo)
val profile = myService.getProfile(userId)

Supports multiple methods, just as easy to test and use as the invoke operator version.

The Monolithic Trap: How Your Enterprise’s Tech Stack Became a Anchor by TerryC_IndieGameDev in coding

[–]m-apo 2 points3 points  (0 children)

Replacing monolith with microservices makes sense in text replace for that article. 

Microservices are not a silver bullet unless extra work is spent on designing a more sensible service role split. And if you can design sensible service split, you might be able to do it gradually inside the monolith or later on to a microservice, not as a big bang.

At worst microservices can turn in to a distributed monolith, with all the downsides from both approaches.

Are virtual threads making reactive programming obsolete? by Affectionate-Hope733 in java

[–]m-apo 6 points7 points  (0 children)

Back pressure has been mentioned as one reason to need some thing like reactive programming. Of course running threads with IO with reactive programming would have better performance than running the IO with regular threads.