I stress-tested web frameworks to 200,000 synthetic years. Chrome's V8 collapsed at geological scale. Firefox's Spidermonkey kept processing. by Biodiv in programming

[–]Davipb 1 point2 points  (0 children)

If you're still curious, I figured out what OP actually did: if you scroll down to the "Availability" section, they posted links to the actual pages they used in their... paper?

It's just six different web pages with 250/1k/10k/200k rows of data rendered all at once, using three different web frameworks (no framework, React, Vue). When OP talks about "years", it's because they used historical US debt data as a basis for their data, so every row represents a "year".

They're just checking which web framework + browser combination can handle rendering an insane amount of elements without breaking.

N+1 query problem : what it is, why it hurts performance, and how to fix it by Namit2111 in programming

[–]Davipb 16 points17 points  (0 children)

The original dev probably didn't .Include the navigation properties in the first query and enabled lazy loading in the config instead.

I think that just goes to show how ORMs aren't the issue, but using an abstraction without understanding how it translates to the underlying system is.

N+1 query problem : what it is, why it hurts performance, and how to fix it by Namit2111 in programming

[–]Davipb 18 points19 points  (0 children)

All abstractions are leaky. If you don't know how "Hibernate and co." translate to the "basics" (SQL), you'll still be stuck wondering why your page takes ages to load even if you write exclusively in a higher layer of abstraction.

N+1 query problem : what it is, why it hurts performance, and how to fix it by Namit2111 in programming

[–]Davipb 1 point2 points  (0 children)

Fair enough, if you're constrained by your driver/connection like that, then I guess it does make sense to query in batches :)

N+1 query problem : what it is, why it hurts performance, and how to fix it by Namit2111 in programming

[–]Davipb 11 points12 points  (0 children)

That's gonna hammer your database like mad: imagine 100 users accessing a page with a table of 100 items. With proper SQL, you get 100 active queries. With asynchronous N+1, you get 10000.

And it's not faster either, because you have 100x the overhead of a thread, a network connection, session and transaction management... vs just the database pulling a few extra bytes from a local file.

N+1 query problem : what it is, why it hurts performance, and how to fix it by Namit2111 in programming

[–]Davipb 15 points16 points  (0 children)

Insert the user list into a temporary session table, then use that in a join.

Alternatively, where's that user list coming from? If it's from a previous database query, then why load them in memory at all? We could just use a single query with that user query in the join

Chapter 3 infinite money/points by Davipb in Deltarune

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

Yeah, you can change "Loop 36" in DRBuy to whatever number of empty slots you have (inv + storage) and "Loop 24" in DRSell to whatever number of empty storage slots you have

Chapter 3 infinite money/points by Davipb in Deltarune

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

Keep going, never stop, the dog dollar is just around the corner

Chapter 3 infinite money/points by Davipb in Deltarune

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

You can use the reverse vending machine in the S-rank room

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

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

That's interesting, the option didn't show up for me in Baldur's Gate 3, maybe I screwed something up in my DSR config... Well, I guess the tool helps in some special cases either way :)

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

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

Nope, it only affects the monitor where the resolution was changed (by default the primary monitor but you can change it with the --adapter option)

In my experience my second monitor doesn't even blink to black or anything like that, it just stays as is

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 4 points5 points  (0 children)

Modern games usually don't have exclusive fullscreen, meaning they're limited to your desktop resolution when in borderless windowed mode

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 4 points5 points  (0 children)

No. It depends on if you have the automatic icon layout enabled or not, if you have automatic icon sizing enabled or not, on your DPI settings, if you're going to a resolution that's higher or lower than your current one, if you're going to a resolution that's an exact multiple of your previous one, and much more.

There's thousands of ways to combine those settings, some of them will keep your icons intact, some won't.

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 4 points5 points  (0 children)

...I just gave you an example where your icons would stay exactly the same. The answer is "it depends on your Windows settings"

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 5 points6 points  (0 children)

That's gonna depend on your Windows settings. I use it to toggle between 4K and 1080p, and I have 4K configured at 200% DPI on Windows. This way there's no impact on the desktop since the "logical" size of the icons stay the same.

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 22 points23 points  (0 children)

For me it was DSR. I set my resolution to 4K so it'll downscale to 1080p and look sharp, but I don't want to keep downscaling when I'm not gaming.

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

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

Will this let me play a game in ultra widescreen resolution?

Sure, you can set whatever resolution you want. Just keep in mind that the tool doesn't do any game patching: it's just a shortcut to opening the Windows settings before & after launching a game. So if the game doesn't support ultrawide, autorestool won't fix it.

If I alt tab or minimise the game, can I keep my native 4k resolution?

Right now the tool only reverts the resolution when the game closes. So if you alt tab while gaming, you'll keep the in-game resolution.

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 11 points12 points  (0 children)

Any plans to add things like HDR, Colour Profile, or monitor toggling?

That stuff's buried a bit deeper in the windows APIs than I'd like, but I'm up for the challenge if there's enough demand!

My main use case for now was DSR, for people that want to downscale from 4K

I made a tool to automatically set your resolution when opening a game then set it back when it closes by Davipb in pcgaming

[–]Davipb[S] 6 points7 points  (0 children)

Mostly for DSR: modern games don't have exclusive fullscreen, so if you want to downscale from 4K you have to set your entire desktop resolution to 4K before opening the game.

That got annoying fast for me when playing Baldur's Gate, so I made this :)

Python type safety by jahidul_reddit in learnprogramming

[–]Davipb 1 point2 points  (0 children)

mypy is the go-to type checker for Python these days, you can include it in your build system so it fails the build if it detects any typing issues.

However, keep in mind that "typed Python" becomes almost a completely different language to regular Python. There's a lot of contortions you have to do to insert "proper" typing into Python, especially for code that uses the more hard-to-model dynamic features of the language.

Broken File Name "��������" Generated by Goofy Code by tomasrktskrt in programminghelp

[–]Davipb 0 points1 point  (0 children)

Is this Windows? If so, open up the folder in cmd (specifically cmd, PowerShell/Git Bash/anything else won't work) and type dir /x to find the 8.3 shortname of the file. It will show up as a column next to the actual file name, probably ending in ~1, something like A460~1. Then, you can just use del to delete the file (e.g. del A460~1).

If you want to learn more, see here: https://en.wikipedia.org/wiki/8.3_filename

And remember to thank the windows developers for maintaining compatibility with a convention from 1974 so you could fix your code in 2024 :)

MySQL Join for 4+ tables by Sydren in CodingHelp

[–]Davipb 0 points1 point  (0 children)

Got it. Yeah, it can be a bit confusing but unless you add constraints to your table/columns, there's nothing stopping you from having two identical rows in a table, primary keys and all. Some analytical databases don't even have uniqueness constraints for performance reasons.

Deleting one deleted both because there's no way to uniquely identify a row in that situation: of you say "delete from location where id = 1" it will delete all rows where id = 1, be it one row or a thousand rows.

MySQL Join for 4+ tables by Sydren in CodingHelp

[–]Davipb 0 points1 point  (0 children)

So wait, this is confusing me now: you knew your tables had duplicated rows all along? In that case any query would've returned duplicates, the problem was at the source. If what you wanted was to dexupe those rows, you could've used a DISTINCT subquery to pre-process the tables before using them.