Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
I've been reopening some of my old programs as of late on a new PC on Windows 11 and I noticed a weird behavior with SQL Server where if the RAM saturates above a certain threshold (93% more or less in my case), SQL Server just hangs indefinitely on a query, as if it was waiting for something to be allocated. And I mean it hangs in the sense that even doing SELECT 1 seems to run forever, until the RAM drops below the threshold, where it completes instantly as if nothing even happened. Has anyone experienced a similar issue?

I know, the OS of choice is utter garbage, but that's not up to me
I think you are running into a simular issue to my own, where windows 11 will thrash hard once your ram usage gets too high. For me, I run into issues with copy paste, typing delays, audio fuckery. Eg lots of tiny memory allocations which arent handled well by the windows 11 kernel. If I had to guess the program is allocating a lot of tiny buffers for the query and windows 11 isnt following the same codepath as older versions of windows.
 
I think you are running into a simular issue to my own, where windows 11 will thrash hard once your ram usage gets too high. For me, I run into issues with copy paste, typing delays, audio fuckery. Eg lots of tiny memory allocations which arent handled well by the windows 11 kernel. If I had to guess the program is allocating a lot of tiny buffers for the query and windows 11 isnt following the same codepath as older versions of windows.
Could it be that the ram gets fragmented like an old hard drive, with the pages spread around with gaps too small in between them?
 
Could it be that the ram gets fragmented like an old hard drive, with the pages spread around with gaps too small in between them?
That is my best guess because you can somewhat reproduce the same issue under linux when you overtax the ram and keep the cpu pegged around 95%, its probably fragmentation and swapping on top of the syscall overhead. but I will say if your program is old enough you could be also running into an issue like this one here:

 
None of that stuff, SQL seems to hang even on "SELECT 1" statements when the bug happens. The only thing I noticed is the aforementioned RAM threshold which I just happened to catch by chance
Is your page file on the same physical disk as your OS install? If so, is that disk close to full? That used to cause hangs when high RAM utilization coincided with heavy disk operations on the same disk as the page file.
 
I've been reopening some of my old programs as of late on a new PC on Windows 11 and I noticed a weird behavior with SQL Server where if the RAM saturates above a certain threshold (93% more or less in my case), SQL Server just hangs indefinitely on a query, as if it was waiting for something to be allocated. And I mean it hangs in the sense that even doing SELECT 1 seems to run forever, until the RAM drops below the threshold, where it completes instantly as if nothing even happened. Has anyone experienced a similar issue?

I know, the OS of choice is utter garbage, but that's not up to me
If disk usage also spikes then it's almost certainly paging. You can try disabling the sysmain service and if that fixes it then there you go.
 
Has anyone here passed the screening tests for these data annotation companies offering gig work to "train" AI models?

What are the problems like? And what are they looking for in particular?

I heard only 3% of applicants even pass the screening tests. I'm not retarded, but I don't know if I'm that not retarded.
 
Aren't those a scam?

I think the people who never got offered any work or who completed one assignment then never got anything afterwards were simply incompetent retards. Most people vastly overestimate their capability and I am probably one of them. lmao

My brother got about six months of work on one of those. They can't all be scams at least.

That's what I imagine. It should be at least feasible to get temp work for a competent programmer.
 
Has anyone here passed the screening tests for these data annotation companies offering gig work to "train" AI models?

What are the problems like? And what are they looking for in particular?

I heard only 3% of applicants even pass the screening tests. I'm not retarded, but I don't know if I'm that not retarded.
It's a scam,but you can make money. I've worked for Leapforce before which was the same thing for search engines. You get in and then get a set number of tasks. Once in a while they will ship in a test case they rated themselves, and if you miss on it you're banned or get limited without feedback. The real ones remember the fried Guinea Pig test back in the day, that wiped half the testers out. I took a break that month, only to find nobody cool was left in the company chat. There were tons of those companies back in the day.
 
Last edited:
Has anyone here passed the screening tests for these data annotation companies offering gig work to "train" AI models?

What are the problems like? And what are they looking for in particular?

I heard only 3% of applicants even pass the screening tests. I'm not retarded, but I don't know if I'm that not retarded.
I've learned over the years that if it isn't a job where you are building something for someone, it is a scam of some sort.
They were advertising one of these gigs on a job board I am on and the moment I saw a variable rate with zero being the lowest per day, I know it is a scam.
 
I am not a web dev, so please bear with me, but what is the best way to currently "display a value and sync its current value" with a backend. When I look this up online I see either mega huge sized Javascript libraries to do this, or to make a simple Javascript loop that polls an API route every few seconds. There must be a better way.

Basically I want a text label with up and down arrow buttons next to it, and when the user presses up and down the counter increments by one, and anyone else on the same webpage from a different device sees the change in hopefully as real time as possible. I think maybe I could use a web-socket to a backend and then sync data through that (IE: Button Press event to backend, backend propagates to other web-socket connections), but I'm trying not to overthink it as I have never written Javascript before so hopefully there is an easier way.

When I ask any of the LLM chatbots for help they jump into React and I'd rather blow my head smooth off than make a 50 mb webpage for something that should be simple.
 
I am not a web dev, so please bear with me, but what is the best way to currently "display a value and sync its current value" with a backend. When I look this up online I see either mega huge sized Javascript libraries to do this, or to make a simple Javascript loop that polls an API route every few seconds. There must be a better way.

Basically I want a text label with up and down arrow buttons next to it, and when the user presses up and down the counter increments by one, and anyone else on the same webpage from a different device sees the change in hopefully as real time as possible. I think maybe I could use a web-socket to a backend and then sync data through that (IE: Button Press event to backend, backend propagates to other web-socket connections), but I'm trying not to overthink it as I have never written Javascript before so hopefully there is an easier way.

When I ask any of the LLM chatbots for help they jump into React and I'd rather blow my head smooth off than make a 50 mb webpage for something that should be simple.

There is no magic, and you're already on the right track. You need to get the data from the backend, and it's poll or websockets. Any framework/library will build off of that.

For decades polling (incl. "long polling"[1]) was the industry standard to do this. Websockets are a more elegant alternative of course. If you've never written JS and you're doing a barebones project that only does this, it might be fun to figure out how to do it.

[1] To allow for server-initiated data transfer in a system where only clients can initiate connections, client-side JS issues a request that the server deliberately leaves hanging until there's data to be sent.
 
Basically I want a text label with up and down arrow buttons next to it, and when the user presses up and down the counter increments by one, and anyone else on the same webpage from a different device sees the change in hopefully as real time as possible. I think maybe I could use a web-socket to a backend and then sync data through that (IE: Button Press event to backend, backend propagates to other web-socket connections), but I'm trying not to overthink it as I have never written Javascript before so hopefully there is an easier way.

Day job web dev here. As others have said, your options are websocket or polling. The websocket approach requires a server-side environment which supports websockets, though, and that might not be an option if you're using shared hosting. Even on a VPS or better you might run into headaches if you have too many people connected at once. All this is to say that if you really don't mind if some of your users have an outdated count for up to X seconds, I'd first try getting away with just polling every X seconds for the updated number before I deal with the additional complexity of websockets.

As for LLMs assuming you're using React or other frameworks du jour, I've found they'll behave themselves if you say things like "write all code samples in vanilla JavaScript, and do not assume I'm using or want to install any libraries or frameworks unless explicitly stated."
 
Last edited:
I am not a web dev, so please bear with me, but what is the best way to currently "display a value and sync its current value" with a backend. When I look this up online I see either mega huge sized Javascript libraries to do this, or to make a simple Javascript loop that polls an API route every few seconds. There must be a better way.

Do you already have a backend? If not I'd recommend Svelte, if you dont mind the node ecosystem. While its still a js framework its a bit different than React, hard to explain im neither a webdev nor a programmer really just ask ai or google for explanation.

it includes its own backend so i'd open a SSE connection when the client connects, use a remote function to update the counter i can give you code examples if you want.

Otherwise use the backend of your choice and htmx frontend?
 
Do you already have a backend? If not I'd recommend Svelte, if you dont mind the node ecosystem. While its still a js framework its a bit different than React, hard to explain im neither a webdev nor a programmer really just ask ai or google for explanation.

it includes its own backend so i'd open a SSE connection when the client connects, use a remote function to update the counter i can give you code examples if you want.

Otherwise use the backend of your choice and htmx frontend?
IMO the asp.net backend is one of the best ones out there. But HTMX is pretty goated indeed.
 
Do you already have a backend?
No, no code has been written yet as I like to autistically plan everything out as much as possible to a fault before writing anything. My background in programming is embedded/real time systems work so I was hoping to stick with C++ for the backend with CrowCPP or possibly another C++ framework, but if it would be significantly easier in Svelte I will look into it.

As for HTMX, I looked into it after making my post and it looks very interesting. After a little digging it seems that this is exactly what I need. Thanks.
There is no magic,
Glad to know I am on the right track with web sockets. I did not know about long polling so thanks for the info.
I've found they'll behave themselves
I think I am in some sort of A/B test hell where they are starting to advertise and promote topics unnecessarily. The coding specific tools do seem to be better about this though.
 
It's a scam,but you can make money. I've worked for Leapforce before which was the same thing for search engines. You get in and then get a set number of tasks. Once in a while they will ship in a test case they rated themselves, and if you miss on it you're banned or get limited without feedback. The real ones remember the fried Guinea Pig test back in the day, that wiped half the testers out. I took a break that month, only to find nobody cool was left in the company chat. There were tons of those companies back in the day.
Ahhh, good to know. So even just not showing up for work or missing a secret test can get you canned.
I've learned over the years that if it isn't a job where you are building something for someone, it is a scam of some sort.
They were advertising one of these gigs on a job board I am on and the moment I saw a variable rate with zero being the lowest per day, I know it is a scam.
I have a theory that they are actually using the human applicants themselves to train AI models, and the gig work is just a ruse. They want data on how people think, how they fidget with their mouse when under pressure, all of it.
I am not a web dev, so please bear with me, but what is the best way to currently "display a value and sync its current value" with a backend. When I look this up online I see either mega huge sized Javascript libraries to do this, or to make a simple Javascript loop that polls an API route every few seconds. There must be a better way.

Basically I want a text label with up and down arrow buttons next to it, and when the user presses up and down the counter increments by one, and anyone else on the same webpage from a different device sees the change in hopefully as real time as possible. I think maybe I could use a web-socket to a backend and then sync data through that (IE: Button Press event to backend, backend propagates to other web-socket connections), but I'm trying not to overthink it as I have never written Javascript before so hopefully there is an easier way.

When I ask any of the LLM chatbots for help they jump into React and I'd rather blow my head smooth off than make a 50 mb webpage for something that should be simple.

The simplest solution to this is exactly how you'd imagine it to be between any two concurrently running programs, with the sole difference being that the data is communicated over the internet.

All that really involves is utilizing your hardware's TCP/IP layer. Which, lucky for you, is basically built into every device now.

There is already a library built for interacting with this layer in C. It's the Berkeley Sockets library. Don't be confused with stupid terms like "websockets" or whatever. Literally all HTTP is is an abstraction layer using sockets. A socket is literally just a struct that interacts with and prepares TCP/IP packets. You assign it a port and an IP address and some other options. Boom, done.

You can build your own layer, your own custom data schema too. The signal for an arrow press can be as simple as 1 bit: 1 for up, zero for down. You don't need to send anything else. It's just data. YOU interpret what that means.

Obviously you will need to check on both ends to see if any new messages have been received from the client or host. This is where the idea of "polling" comes in. You check for messages every so often and queue up responses. Your hardware deals with the real queue happening underneathe, but youll probably have a program layer queue if you use some polling library.

If you built a simple client like this you can basically have real time syncing with latency as low as the ping time between your client and server and back. And why wouldn't this be the case? Light travels pretty damn fast lol. It's a little painful when "web devs" chime in and say to check every few minutes lmao. You don't need a 500MB framework to send a bit over the wire lol so your Intuition is spot on.

Protip: ditch the ++ and just learn C. You can still write "C style C++" (lmao) if you absolutely insist.
 
Last edited:
Back
Top Bottom