/dpt/ - Daily Programming Thread

Old: What are you working on, Any Forums?

Attached: komputer-2.gif (800x450, 1.22M)

Other urls found in this thread:

docs.microsoft.com/en-us/dotnet/maui/get-started/first-app?pivots=devices-android
twitter.com/NSFWRedditImage

nth for hopefully done memelang hopping for quite a while

I'm currently on a .NET Maui kick, I think it's going to work too.

Pythcel/react webdev here wanting to learn real programming. Like, compiled languages that run on a real machine, not a vm in "the cloud".

Am I right to say that C#, ASP.NET, .NET, C++, Objective-C are all just a superset of C? That, in their core, their all just the same?

I have the feeling coding in C++ but mostly in C-style (procedural) and ignoring most C++-functions is the way to go.

But will still have to import OS-specific libraries, or? What are the names of those libraries for: linux and windows?

What exactly is this doing in the .NET Maui example?

SemanticScreenReader.Announce(CounterBtn.Text);


docs.microsoft.com/en-us/dotnet/maui/get-started/first-app?pivots=devices-android

C# is actually a vm in "the cloud", don't let the C in its name make you think otherwise.

>Am I right to say that C#, ASP.NET, .NET, C++, Objective-C are all just a superset of C? That, in their core, their all just the same?
No, they are completely different.
>I have the feeling coding in C++ but mostly in C-style (procedural)
That's a stupid limitation to impose on yourself.
> and ignoring most C++-functions is the way to go.
Why would you even think do this?

did this rn
#include
#include
#include
#include
#include
using namespace std;
inline void keep_window_open() { char ch; cin >> ch; }

using namespace std;

int main()
{
int val1, val2;

cout > val1 >> val2;
if ((val1%2) == true) {
cout

Sometimes it is perfectly acceptable to use a C function in C++.

something like getch() is one of those times

I suppose the likelihood of finding someone familiar enough with MuPDF to answer this is low, but it does hurt to ask.

I'm using Mutool's run function to edit PDFs using JS and it's working fine, save for what seems to be one missing feature. It can read streams just fine, in case they're compressed the program automatically decompresses it when reading, yet it doesn't do that when writing. MuPDF's scarce documentation explicitly says that the methods to write to stream indeed don't automatically compresses data like e.g. flate encoding, and there seems to be no method to do so.

So it's simple to read a stream, edit it and re-insert it back, but there seems to be no function to recompress it before that. I tried using JS's DecompressionStream but the program uses some old engine which doesn't have that. Not even polyfills work because even shit like the >>> operator isn't recognized.

getch isn't even a standard function in C.

or you can use the C++ equivalent, std::getchar in this case

nope, because as with every single other C++ console input method, it stops reading when you press enter, not after it has read the amount of chacters.

>programming classes assignment
>make simple crypto app, NFT app

>design classes assignment
>make a prototype of a game store app, prototype of streamer app, art store, app

being in compsci makes me realize that i'm happier doing more on the creative side not on the greedy corpo side

Not getchar, it returns after any character.

user means that console buffers input by line, so it will not pass it to your program until you press enter.

How to put acommand in variable i python?

because C++ is bloated and niggerlicious. No need for garbage collection, OOP, most standard library functions

use _getch()

or append variable if not empty

python command? either write is you lazy bastart, or make it a function

>C++ is bloated
>no reflection
>no windowing
>no networking
It's not that C++ is too big, it's that average person's brain's too small.

you clearly havent worked in a engineer office, working with dozens/hundreds of other developers on a huge code base.

You have no idea how important simplicity and compartmentalization is for software quality.

And I dont mean how nicely the text document (code) looks to the eye and is formatted and "refactored". Simple = minimal abstractions. The norm is to abstract every tiny thing.

The actualized, non-autsitic programmer who cares about (long-term) quality keeps it simple. Has nothing to proove

I wrote something link
if args.variable:
run the code here
else:
run duplicate code here without the variable

I want to make it 1 or 2 lines and get rid of othe duplicate

are you from india? smelling major low-iq vibes here.

I am iterating over a directory within a ranged for loop in c++
Something like
for (const auto &directoryIt : fs::directory_iterator(myPath))[/code]
At every 2 iterations, I want to access the following file, as in directoryIt + 1, as my data is in pairs like that. How do I do this? directoryIt + 1 gives a binary operation error.
If this where a normal index based iteration what I want to do is:
for (auto idx = 0u; idx < max; idx+=2){auto a = myArray[idx];
auto b = myArray[idx + 1];
}
(Fucked up previous post)

No EE.
I am learning python right now.