Obama
So write it
Help me, I don't know how to write it, I need assistance
MilkBeforeCereal
For humans only
smol pp moment
MilkBeforeCereal
tf is calculating a polynomial lol
Anonymous
Help me, I don't know how to write it, I need assistance
Your statement is similar to "Help me, i don't know how to pay taxes, I need assistance" It's not an attitude you should live with You can ask a specific question here but asking to "assist" you or writing program for you is forbidden
J
wow, what kind of stupid elitist horse shit is that?
Boryan
Hello👋 I want a tiny consultation. I've got a table of float values with column titles from csv file and used to store its as follows: vector <string>hat (due to column order in file) hash<string, vector<float>> dat and make all itarative process through hat. So I want to know, maybe my way is not an efficient(or even bad) and how other people store those structers in programms.
J
what is your way? how are you processing the file? how are you creating and populating the vectors and hashes?
Pavel
Boryan
what is your way? how are you processing the file? how are you creating and populating the vectors and hashes?
I split each line until atEnd(), convert each line element to double and put it in dat dat[hat[I]] << ((ok)? splittedLine[j].toDouble() : nan(), j = 0, hat.size()
J
what did you expect to happen?
Alex
create another identifier more than 31 chars, with common first 31 chars
J
no. read again.
J
the 31 char limit applies to internal identifiers
J
also, forget that limit. that's some shit straight out of 1982
J
I split each line until atEnd(), convert each line element to double and put it in dat dat[hat[I]] << ((ok)? splittedLine[j].toDouble() : nan(), j = 0, hat.size()
okay, so, you've just hand-rolled a pseudo-parser. that's not how you would do it if you're intending to work with actual csv documents. depending on your goal, it may be sufficient though.
J
take a look at this, as an example: https://github.com/d99kris/rapidcsv
J
warning flags enabled? pre-historic standard compliance flags turned on?
J
is your compiler from the 80s?
J
that's the standards mandated minimum significant character count. no compiler in practice actually works at those limits, except maybe "your grand-dad's borland™"
J
hmm... i see it's an IDE app for phones, but i dont see what it calls for the compiler (i dont think androiden comes with pre-installed compilers, which would be super hilarious)
J
maybe it's some fork of clang/llvm that they redistribute. you'd need to find that out first. but defo try the flags first. you're effectively testing the compiler for standard compliance at that point tho
J
if you're feeling extra adventurous - you can maybe grab feature tests from another compiler (gcc, clang) and try building them with that cppdroid compiler. see if it understands all the features.
Garvine
Who has an idea of how you can generate one random number between 1 and 500 using a function then that number should be passed to another function to check if it is prime or not.
J
Who has an idea of how you can generate one random number between 1 and 500 using a function then that number should be passed to another function to check if it is prime or not.
like this, srand(my_turbo_seed) while (true) { int r = rand() % 500 + 1; if (is_my_number_prime(r) == true) break; else /* churn */; }
Garvine
I had thought about the rand function too Thanks 👍😊
Dark
This be a stupid question but I have been looking on google for an answer for 4 hours and got nothing. My problem: I have a CreateWindowW() And I need to change the size of the Window. But I can’t for the life of me
J
are you talking about the Windows API function?
J
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindoww void CreateWindowW( lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam );
J
nWidth and nHeight are what you're looking for
J
hahaha, nah, it's fine
J
we all have our days like that
Dark
hahaha, nah, it's fine
It’s my first time making a GUI in C++
Anonymous
It’s my first time making a GUI in C++
Do not use WinApi for that...
Anonymous
What do you mean?
What don't you understand?
Anonymous
Making GUI using WinApi is terrible
Dark
What don't you understand?
I thought I was using the windows API
J
what if he's writing a facade for WinAPI and X?
J
...and wayland
J
because he wants to?
Dark
I am only using the Window.h library no external ones
Dark
So I think I am using WinApi
V01D
Winapi is fine
Anonymous
because he wants to?
I don't think he wants to do this
Dima
winapi is one hell of a thing
J
well, no one asked what you THINK he wants to do...
Anonymous
So I think I am using WinApi
https://t.me/programminginc/323817 Again..
Anonymous
Winapi is fine
It's not
J
if he'd asked "what my options for writing portable GUIs are?", we could have that discussion.
Anonymous
J
yeah, and your opinionated interjections are as well
Anonymous
Even if the only target is Windows
J
yeah, let the person writing that system be the judge of that
Anonymous
yeah, let the person writing that system be the judge of that
And then switch to Python because he will be thinking that writing C++ is similar to writing with WinApi
Dark
Look I don’t like WinApi but I really don’t want an external library because I want it to be a standalone application
Anonymous
Not a good way to learn C++
V01D
Look I don’t like WinApi but I really don’t want an external library because I want it to be a standalone application
You could: a. Make an installer or b. Ship the dll files with the exe in a folder
Anonymous
Look I don’t like WinApi but I really don’t want an external library because I want it to be a standalone application
WinApi is already an external library because there's no WinApi in C++ standard
V01D
I think he meant he does not want an external lib that is not installed by default
Dark
This is a bad wish
I have not yet hit the worst part yet. The crypto api for windows
Dave
Devs should i learn C or C++
Anonymous
Alex
Devs should i learn C or C++
first of all learn how to be the real man
Anonymous
Why?
WinApi is piece of shit
Dave
Python
I know Python
Anonymous
I know Python
You do not