/dpt/ Daily Programming Thread

Previous: What are you working on, Any Forums?

Attached: Screenshot from 2022-07-27 07-47-04.png (2472x1081, 165.06K)

Other urls found in this thread:

github.com/friendlyanon/cmake-init
twitter.com/NSFWRedditVideo

Reminding anons to use github.com/friendlyanon/cmake-init when creating new C++ and C projects!

Give me physics based puzzles game ideas to program

woah! In rust this is just cargo new

Attached: Screenshot 2022-07-27 at 07-52-36 friendlyanon_cmake-init The missing CMake project initializer.png (818x870, 109.66K)

So I tried this, and full disclosure, I'm a super fucking beginner and I hate JavaScript already but I'm trying to apply into Code Platoon, with VETTEC VA benefits.

It's using replit as a node.js emulator and it didn't give me an error

function totalChange(amountPaid, totalCost) {
amountPaid = 100
totalCost = 75
return (amountPaid - totalCost);

}
amountPaid = 10
totalCost = 7.28
return (amountPaid - totalCost)
// ---- TESTS - don't change these ---- //
console.log(totalChange(100, 75) === 25)
console.log(totalChange(10, 7.28) === 2.72)

Attached: 1652543037969.png (1004x655, 450.44K)

find some tutorial to follow that will explain you the basics.

Think, conceptually, about what you are doing. You have a function that accepts two numbers named amountPaid and totalCost, and in that function, you change those numbers to the same thing every time before subtracting. You could literally replace that function with 100 - 75 because that's what it is doing, every time. Your function should only consist of the subtraction. You should not be changing the numbers the user entered.

making a gui with python.
i have a label, with accompanying stylesheet, but now i want to change the background.
when doing so through .setStyleSheet, it changes the background, but also revers all other styles back to default.
how do i change just the background, while keeping everything else, other than just redefininf the entire stylesheet?

My man, array operations are like magic

Attached: file.png (428x158, 14.26K)

Can someone share here that template of a CS student writing bad code. I made one mistake and I need to apply myself.

Just subjugating empires and writing code for my NPC friends.

Attached: 1658869774423712.png (1280x720, 1.14M)

Is bubble sort the king of sorting fully sorted arrays with 1 element out of place?

So are they completely forking from ocaml or what

How the fuck do I fix treesitter highlight for cpp. Gruvbox is giving me good highlights in clion but absolute crap in nvim.

I don't even know if it's treesitter or gruvbox who fucks up. This shit is too bloated but whatever

Attached: Ranma_Chan.jpg (1200x1750, 242.91K)

No, insertion sort is.

complete and utter programlet here, I'm going to a college in september that requires programming after giving up engineering. I haven't had any programming experience since highschool and it's been so long since then, not to mention i slept through classes back then anyways. I hear I'll be using C there, is there a good place to start for a complete beginner (i can't even write hello world)

In theory they'd be equal, the preface was there's only one check case in the alternative.

Anyone else feel like theyre not smart enough for current jobs? Even with my years of experience, I still feel stupid when given out of the blue questions.

Attached: Albert_Edelfelt_-_Louis_Pasteur_-_1885.jpg (2082x2532, 3.41M)

no, my job is so mind numbingly easy it's driving me crazy.

Mines is too. But ive been applying for higher tech jobs and the interview process is insane. I havent passed a single one.

What is a real-time computing? The book says worst-case running time is important because operations must complete by a "deadline"

What is the deadline?

Attached: 1652587131940.png (604x594, 326.35K)

Digital "time" drifts from the analogue concept of time.
A deadline is an absolute hard limit in time, actual time opposed to processing cycles, a process has to perform it's procedures.