Anonymous
Anonymous
what modules?
C++ modules
Anonymous
what do you mean?
I mean that compilers have a lot of bugs in C++20 functionality
Ehsan
but would it effect my program?
what’s wrong with c++17?
Anonymous
It can
so I should just use c++17? what do you think?
Ehsan
C++ modules
yeah I just that cmake doesn’t support c++20 modules now
Anonymous
what’s wrong with c++17?
C++20 is much nicer... Ranges, concepts...
Ehsan
C++20 is much nicer... Ranges, concepts...
I understand, but it just came out so you should expect alot of bugs it’s not worth it
Ehsan
also alot of libraries use cmake which means you will get affected
Sharique
C++17 is more stable
What about C++14?
Ehsan
Anonymous
C++17 is more stable
ok, thanks man. I have one more question for you if that's alright? I asked earlier about QT, QML and integrating them with c++. I'd really appreciate it if you could give me some advice and put me in the right path to learn them. cause I'm really confused.
Anonymous
But there were qmlbook and Qt docs
Anonymous
It should help
Anonymous
Thank you
Anonymous
/ban @Phonice99
Vedant
Anonymous
Vedant
PMing
Ohkk..
Anonymous
Good luck with that
SAM
Please admin help i want to send a photo of a problem but I can't I don't know why
MAC
Please admin help i want to send a photo of a problem but I can't I don't know why
Probably telegram don't like you because of stupid questions
Phil
There is the result in the console: for the polynome -2x^3+5x^2 address : r:34366582840 polynome:34366582808 -6.00 x^ 2 from -2.00 x^ 3 -12.00 x^ 1 from -6.00 x^ 2 -12.00 x^ 0 from -12.00 x^ 1 address : r:34366582840 polynome:34366582808
Phil
I don't understand why the memory is over written
Ehsan
can you put the code here and provide a link?
Phil
https://www.codepile.net/pile/dzRBpJz0 in derv() : *polynome is overrwritten by *r
Phil
@kyoko687
Ehsan
@kyoko687
and where is the problem?
Ehsan
in which line
Phil
function derv
Phil
114 in for loop
Mihai
use one of these links to share the code: • https://linkode.org • https://dpaste.org • https://pastebin.com • https://hastebin.com
Phil
sorry all, I didn't realized that it will be sooo long in the chat.. btw I can erase it if you want ?
Ehsan
just provide the link
Phil
@kyoko687 I enable the editing on codepile if needed
Phil
@kyoko687 the commaznd line to run it is ./a.out -2x^3+4x^2-1 derv
Phil
It's really weird I don't understand how this bug happen
Phil
This pile was deleted.
I have still access to it
Phil
I create for you a new one
Phil
https://www.codepile.net/pile/vNxEdDBQ @dixie_cup
Anonymous
https://www.codepile.net/pile/vNxEdDBQ @dixie_cup
This website required javascript + cookies + DOM storage... :/
Phil
@kyoko687 I fixed the line 26 for(unsigned int i=1 ...
Phil
Ok so pastebin is okay for you ?
Ehsan
Ok so pastebin is okay for you ?
sorry I was busy, yeah it’s ok
Phil
https://pastebin.com/r4DWYqEM So there is some update line 26 plus I added some free() but I don"t touch to derv() (where the bug is)
Anonymous
polynome.c:115:45: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat] printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p); ~~~ ^~~~~ polynome.c:115:51: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat] printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p); ~~~ ^~~~~~~~~~~~ polynome.c:124:45: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat] printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p); ~~~ ^~~~~ polynome.c:124:51: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat] printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p); ~~~ ^~~~~~~~~~~~ 4 warnings generated.
Phil
This is only for debug it was to look at the addresses it's not important
Phil
you can delete it if you want
Anonymous
Just compiler warnings, it seems to eval correctly but not do derivatives... It correctly evals polynomials with duplicate exponents.
Phil
What's the bug?
The memory is over written in derv() *polynome is overwritten by *r
Phil
./poly -2x^6+4x^2 derv fin #:-2x^6:+4x^2# -12.00 x^ 5 from -2.00 x^ 6 -60.00 x^ 4 from -12.00 x^ 5 -12.00x^5-60.00x^4
Anonymous
Don't overwrite create a new polynomial from the old! free() both when done.
Phil
For me the bug come from the line 111 : Polynome *r=(Polynome* ) malloc (sizeof(Polynome)); r->p = (Monom*) malloc(polynome->len); r->len = polynome->len; malloc allocate a memory where is already load *polynome
Dark
https://pastebin.com/B4Lv8mZb code above. i have been having problems with my class when i set the values and then as soon as i run Client.Get("/") it shows the values are not what they were before. because when i call httplib::Client cli("http://google.com") it works and shows the values ip, hostname and port but as soon as i run cli.Get("/") this values have changed and well i am not best at classes but i really don't know why. they should be the same as they were when i set them with the first command
Ehsan
I'm confused I created a new polynome called r
I think the problem is with your parsing
Ehsan
sorry I can’t debug it the code is too messy for me
Ehsan
half the time I am trying to decipher what you are doing which is not good code practice 🙂
Anonymous
I would use Horner's method for polynomials but sparse lists is a valid technique also. These lists also handle duplicate exponents.
Phil
half the time I am trying to decipher what you are doing which is not good code practice 🙂
To be franc, is my style code horrible or my algorithmical thinking ? it's cool to have a point of view... What do I need to improve ?
Ehsan
before you entered derv the parse was incorrect
Ehsan
check out how you parsed the string and try again
Ehsan
Polynome *a = poly_write(formating(argv[1])); for(unsigned int i = 0; i < 3; i++){ printf("%d %f\n", a->p[i].m, a->p[i].e); }