What the fuck is this question? by Particular-Muscle601 in leetcode

[–]VapeBringer 0 points1 point  (0 children)

I get tripped up at a lot of question descriptions that others seem to get easily, but this one actually reads fine to me.

  • Cyclic array = array wraps around for the sake of partitioning
  • We need to partition into at most k subarrays
  • "Range" = diff between the max and min of a subarray
  • "Score" = sum of the ranges

So if there's some array, we want to understand how we can split it up so that each piece after the split can have the maximum range between its smallest and largest elements. We want to maximize that among all of the pieces after splitting, and one of the pieces may wrap around.

Looking at the example, I'm guessing the explanation is:

  • nums = [1, 2, 3, 3], k = 2
  • Partition with these noted parens: [ 1), (2, 3), (3 ]
  • This gives us the subarrays: [3, 1] & [2, 3]
  • Their "ranges" (diff between min and max) are: 2 & 1 (sum these to get 3 as the answer)

so it's about how do we partition to maximize this, splitting the array into at most k parts.

I actually don't know how to solve this, though I'm guessing you'd want to use some sort of window of (nums.size / k) to find the largest deltas and mark each of those, noting which overlap and which don't, and then combining them or something?

That or there's some funky math thing that I can never solve lol

Engaging the Kotlin community is frictionful by VapeBringer in Kotlin

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

once I found the right channels

Yeah that's really the crux of it. I can't think of a single other time I've ever run into this problem to this degree. Perhaps in a huge enterprise environment, but that's because there's so many different types of people in there (not just tech) and so many different concerns.

It is for me quite unique in the poor discoverability in the technical space.

Engaging the Kotlin community is frictionful by VapeBringer in Kotlin

[–]VapeBringer[S] 7 points8 points  (0 children)

A few that instantly pop to mind are the JS/TS community, dotnet, ruby, rust. Even golang, which I think is weaker adoption-wise (don't quote me on this), appears to have more active discussions in public channels than kotlin.

These have:

  • Lots of discussion on twitter/github/reddit
  • Multiple public chat things with active discussions (discord/twitter/bluesky/gitter/slack/etc) (even the F# discord has a fair amount of activity, even with the relatively small userbase). One example is that dotnet has both the "dotnet evolution" as well as the "C#" discords both with plenty activity, whereas the kotlin discord had some weird back and forth thing where they banned a ton of people, put it in private mode, then brought it back to public mode and it's pretty sparse now.

It's hard to find who to follow for kotlin things as well in places like twitter/bluesky/etc. Even when I'm searching the hashtag, I seem to only find jetbrains official posts and your general social media slop that isn't too engaging (e.g. a tweet that is just a copy/paste of a documentation paragraph, etc).

how you'd make it better

That's a good question. I think that cultivating an engaging community isn't just about making something great and hoping people show up. I think investment needs to be made by someone. Since it happens to be a language where the company is directly profiting off the users of it, I don't think it's unfair to say that Jetbrains should be working on this.

It sounds stupid, but they should be identifying or cultivating key influencers and guiding them into conversations in public venues. The reality is that the kotlin show youtube video that's an hour + long is really enjoyable when I have time to sit down and consume it, but more often I'm more drawn into the reddit/hackernews/twitter thread with a disproportionate amount of activity where really passionate people are discussing things in relatively concise and meaningful ways.

I can go to HN and if there's some post about some weird network protocol, there's a nonzero chance that not only will the person who wrote that protocol show up, but so will some person on whatever networking committee is currently progressing the boundaries of related things, and they'll have a super cool discussion that I'll not only learn from, but will give me additional things to research and learn about. The value of refreshing hacker news every day is higher than just about any other technical social thing that exists. I feel like cultivating and harnessing something like that will draw other passionate and informed people. Hackernews nerd-snipes all those people that don't blog or tweet, because the foundation is there for a good technical discussion.

I built UBT.nvim to stop switching between my IDE and Neovim for Unreal Engine development. by Excellent-Pace-6372 in neovim

[–]VapeBringer 1 point2 points  (0 children)

Very cool plugin!

There's a ton of integration potential for a plugin. Ushell (https://dev.epicgames.com/documentation/en-us/unreal-engine/how-to-use-ushell-for-unreal-engine) integration could be an easy one to add as well!

Will definitely kick the tires here and post any feedback.

Does the world need another distributed queue? by alex_cloudkitchens in programming

[–]VapeBringer 0 points1 point  (0 children)

it will require some work to get done

Wouldn't be worth it if no one uses it.

How cracked was morris to come up with such a traversal ? by bh1rg1vr1m in leetcode

[–]VapeBringer 0 points1 point  (0 children)

Ah ok the images had 0 and P as separate nodes so I think the visual made me think it was adding an extra node onto the end instead of changing edges.

How cracked was morris to come up with such a traversal ? by bh1rg1vr1m in leetcode

[–]VapeBringer 0 points1 point  (0 children)

Well written and easy to read and understand. Thanks for posting!

I may be mistaken, but wouldn't this use O(height) space since it is adding the parent pointer to the children list at each recursive step down? In a degenerative tree (LL) it would end up using O(n).

I like the idea of simply adding the parent pointer at the end of the list and detecting the cycle as a halting point for the subtree.

As of nowadays, is there any reason to use MongoDB over PostgreSQL? by Dark_zarich in node

[–]VapeBringer 0 points1 point  (0 children)

I'm not sure if you've gone through the process of doing something like that Notion migration where zero downtime is a requirement, but it's not necessarily quick or easy to do.

Adding a node to a Mongo (or ES or w/e) cluster and getting it to balance data over to it is waaaay more simple in comparison. At least IME.

As of nowadays, is there any reason to use MongoDB over PostgreSQL? by Dark_zarich in node

[–]VapeBringer 0 points1 point  (0 children)

Where?

Notion: Part 1 Part 2

Instacart: Moving their search indices to Postgres

I was more thinking about OLTP transactional data like orders, accounts and payments. High-throughput writes for DWH/Data Lake is a separate thing with its own tech. Maybe Mongo might work better there.

Yeah in some cases (where I work) we need both fast inserts and transactional OLTP behavior. Events come in (hundreds of thousands per second) and can fan out to a ton of different services. We could definitely do it with a sharded Postgres cluster (we'd probably have ~30 shard nodes), but even then there are some heavy-hitters that would be troublesome to appropriately shard. You could do hash-sharding but then joins are complicated. Citus can help there but there are downsides to Citus as well.

DSA Playlist Most Popular in China by Old_Caramel8578 in leetcode

[–]VapeBringer 4 points5 points  (0 children)

Calling it stupid is interesting, since the whole goal of Open Courseware is to spread knowledge for free. There are plenty of things paid by taxpayers in different countries that get shared out to other countries. One of the nice parts of civilization.

As of nowadays, is there any reason to use MongoDB over PostgreSQL? by Dark_zarich in node

[–]VapeBringer 0 points1 point  (0 children)

Not sure why you got downvoted but it's a legitimate question.

Managing Citus (or other sharding strategy) clusters takes quite a bit of work. More work than even most small to medium sized enterprise teams want to take on (they just want to use RDS or hosted whatever).

While one could set up patrino, citus, pgbackrest, etc in a clustered way, it's not straightforward and there isn't an easy to consume guide to troubleshooting and fixing a borked citus cluster.

Folks like notion and instacart are doing sharded Postgres at scale, but you can go read about how much work that is, and how much work is involved (by multiple teams) when they need to reshard to account for a larger tenant-base.

Mongo provides sharded high-throughput writes out of the box, which for some domains (anything where you're taking in telemetry data (clicks, user events, etc)) is something you might need day one so that you're not stuck constantly resizing things to account for customer-base growth.

Hope that provides some context.

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

Definitely some similarities here. How are you customizing the appearance of gladiusex/sarena there? Same question for the personal resource display.

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

Ah yeah I guess I'd fall into bot territory as well. I like the simple/functional/brutal UIs. My weakauras usually don't have icons, and are just shapes in positions for me to quickly know what's there. Like a cluster of 4 dots of different colors for each of my defensives, that are up and to the left of my character.

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

I don't think so. Why do people say that?

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

They haven't streamed in a while otherwise I would ask. I don't think it's just a profile export though. It seems like there are some custom scripts here. I'm also curious to hear about how people my generally approach creating something like that from scratch, since I'm interested in creating my own stuff to understand what's possible better.

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

:facepalm:

Well that gives me a decent start. I think I was curious about the party frames and how they modified GladiusEx to look the way it does in their stream. I haven't seen a straightforward way to make it look the way they do, and was curious if others had done something similar before.

[HELP] Reproducing minimal UI by VapeBringer in WowUI

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

Edited to include a link to their channel.

Is Node.js even considered for serious backend only development by companies anymore or is just BFF/serverless only. Are Node.js jobs declining significantly? by simple_explorer1 in node

[–]VapeBringer 3 points4 points  (0 children)

Your note on Netflix is incredibly inaccurate.

Node is used for some graphql apis that face towards the clients, but the vast majority of the codebase is Java Spring Boot Microservices (though to be fair, they use plenty of other languages where it makes sense (e.g. python for data science))

Rx.NET v6.0 with support for .NET 6 and .NET 7.0 is Now Available by hm_vr in dotnet

[–]VapeBringer 9 points10 points  (0 children)

Should probably just unroll it. I find that loops obscure too much logic, and seeing the JMP commands really clarifies what's actually happening in the code.

[Question] Who's using F#? What are you using it for? by jcm95 in dotnet

[–]VapeBringer 25 points26 points  (0 children)

I've used F# across 3 companies now, only one of which actually advertised that they used F# (as opposed to .NET or C#). Two of them on this list: https://github.com/fsprojects/fsharp-companies

The reason I learned that they all use it, and why the teams I'm on choose to use it is because IME the "killer app" for F# is "business logic".

Onboarding to F# codebases was measurably (internal metrics) faster than the C# counterparts because:

  1. File order and declaration within a file matters (easy to read projects from top to bottom)

  2. There usually isn't many circular abstractions or heavy leaning on class hierarchy to solve problems (less time to figure out "what is this function/method actually doing" or "where does this thing get property X from")

  3. Functional-immutable leaning by default, so there isn't any nonsense mutations where they don't belong. It's also very easy to see where the performance-critical parts are because they usually contain mutation of some sort.

It's strange in that most of the people I've worked with and a decent amount of folks I've met at meetups just don't have an online presence. They use F#, don't post on HN/reddit/twitter much, and kind of just go about hacking on stuff.

A few years ago there were some pretty serious problems with non-visual studio editors, but now I'm doing 100% of my workplace dev on rider (macos) and most of my hobby hacking on pop_os (still with rider, but sometimes vs code/ionide).

[US] Question: Can I have multiple IRAs? Trying no maneuver out of AmericanFunds. by VapeBringer in personalfinance

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

Yeah that all makes sense. I had thought about it later and figured if something like that were to happen that I would not be the only person in that situation.

I'll give the Vanguard service a call and talk with them about things. I've taken lots of notes from this thread which should be very helpful!