Ludovic 'Archivist'
I love this quote
The guy got 12% improvements on an std::sort by calling make_heap before sorting, he is a wizard
Ludovic 'Archivist'
A *consistent* 12%
Ludovic 'Archivist'
Watch his talk "Speed is found in the mind of people"
Anonymous
😔
NXiss7
Yes after c++
I'd advice you the reverse the order 😄
NXiss7
Why?
C++ requires lots of knowledge on inner workings of "metal". Diving into C++ without a programming background would be painful. I've started with Python the got deeper into C++, it was a fluent and joyful experienve to me. Now, I can use/learn any language. I've even passed an top class C# interview (I told them that I don't know about C#) with my C++ and Python knowledge. They offered me the job. 😄😄
Dima
lol python ewwww
Dima
but good job
NXiss7
I don't use Python
NXiss7
But it's good to have. And sometimes you just prototype something. I'm in love with C++, it's my main language. I love low-level stuff, managing memory, types, classes, being cross platform... Anything about it.
Adkhambek
Hi guys. I have questions. Did you know android ndk?
NXiss7
I just write a crypto lib in C++ and tell my compiler to compile it for Linux, boom, compile for Mac, boom, compile for Win32 boom. Write once, run anywhere is C++
NXiss7
Hi guys. I have questions. Did you know android ndk?
Yep, I do. But dunno if I can answer, don't have much time.
Mat
And if it's not related to C/C++
Mat
I just write a crypto lib in C++ and tell my compiler to compile it for Linux, boom, compile for Mac, boom, compile for Win32 boom. Write once, run anywhere is C++
Write once, run anywhere is C++ Until you use some platform-specific stuff. Every language can be compiled for every platform (if the right compiler exists, obv) but that's not what cross-platform means
NXiss7
Write once, run anywhere is C++ Until you use some platform-specific stuff. Every language can be compiled for every platform (if the right compiler exists, obv) but that's not what cross-platform means
I don't use muxh platform specific stuff. And write wrappers or layers around them if necessary. I avoid p-specific as much as possible. It's more WORA than Java for me.
Ludovic 'Archivist'
Mmh, actually I feel like C# is more WORA than C and C++ (particularly NetCore)
Ludovic 'Archivist'
But when I want WORA I tend to turn to Elixir or Erlang
Ludovic 'Archivist'
But when I want WORA I tend to turn to Elixir or Erlang
Only issue with that is that some libraries rely on C compiling which may not happen on some platforms as you would expect
NXiss7
Mmh, actually I feel like C# is more WORA than C and C++ (particularly NetCore)
It dependa on excpectations I think. But since every single code is translated to asm and no one writes assembly but uses C or C++ instead, you can use it pretty much anywhere. That's my experience so far for Windows, Linux and Android. But the real benefit is that you can use almost any language after mastering C++.
NXiss7
guys correct me if i'm wrong, but isn't python full WORA? except threads
Nope, try using it on Android. Try distributing it to a client. Client expects a setup and an exe to click. With Python that's not that stable (freezers and packers so far). C++ is much stable if you write it properly.
Tobias🐾🚲
Wow, retards.
Tobias🐾🚲
Perl Lisp Haskell Yeah, "dead" - idiots. xD
NXiss7
PHP...
NXiss7
On the way
Tobias🐾🚲
PHP...
should !== will
MilkBeforeCereal
MilkBeforeCereal
KEKI
Could someone please tell me why when I pass a 2d array in c, some rubbish value gets sent
Pavel
Could someone please tell me why when I pass a 2d array in c, some rubbish value gets sent
Show us the code. Reasons may be: You didn't initialize it. Your indexes go out of bounds. Your pointer math is incorrect. ...
Dima
/warn not dying anymore
Dima
Lol!
KEKI
Show us the code. Reasons may be: You didn't initialize it. Your indexes go out of bounds. Your pointer math is incorrect. ...
#include<stdio.h> #include<string.h> void printlcs( int i, int j, char x[100], char direction[100][100]) { if(i==0 || j==0) return; else if(direction[i][j]=='d') { printlcs(i-1,j-1,x,direction); printf("%c",x[i-1]); } else if (direction[i][j]=='u') printlcs(i-1,j,x,direction); else printlcs(i,j-1,x,direction); } void lcs(char x[100], char y[100]) { int i,j,xlength,ylength; xlength=strlen(x); ylength=strlen(y); int val[xlength+1][ylength+1]; char direction[xlength+1][ylength+1]; for(i=0;i<xlength+1;i++) val[i][0]=0; for(j=0;j<ylength+1;j++) val[0][j]=0; for(i=1;i<xlength+1;i++){ for(j=1;j<ylength+1;j++) { if(x[i-1]==y[j-1]){ val[i][j]=val[i-1][j-1]+1; direction[i][j]='d';//d for diagonal element + 1 } else if(val[i][j-1]>=val[i-1][j]){ val[i][j]=val[i][j-1]; direction[i][j]='l';//l for from left element } else { val[i][j]=val[i-1][j]; direction[i][j]='u';//u for from upper element } } } // for(i=0;i<xlength+1;i++){ // for(j=0;j<ylength+1;j++) // printf("%d ",val[i][j]); // printf("\n"); // } // for(i=1;i<xlength+1;i++){ // printf(" "); // for(j=1;j<ylength+1;j++) // printf("%c ",direction[i][j]); // printf("\n"); // } printlcs(xlength+1,ylength+1,x,direction); } void main() { char x[100],y[100]; printf("enter string x : "); gets(x); printf("enter string y : "); gets(y); lcs(x,y); }
KEKI
The direction array when passed to prontlcs has some rubbish value
Nameful
That's some compact code
Pavel
#include<stdio.h> #include<string.h> void printlcs( int i, int j, char x[100], char direction[100][100]) { if(i==0 || j==0) return; else if(direction[i][j]=='d') { printlcs(i-1,j-1,x,direction); printf("%c",x[i-1]); } else if (direction[i][j]=='u') printlcs(i-1,j,x,direction); else printlcs(i,j-1,x,direction); } void lcs(char x[100], char y[100]) { int i,j,xlength,ylength; xlength=strlen(x); ylength=strlen(y); int val[xlength+1][ylength+1]; char direction[xlength+1][ylength+1]; for(i=0;i<xlength+1;i++) val[i][0]=0; for(j=0;j<ylength+1;j++) val[0][j]=0; for(i=1;i<xlength+1;i++){ for(j=1;j<ylength+1;j++) { if(x[i-1]==y[j-1]){ val[i][j]=val[i-1][j-1]+1; direction[i][j]='d';//d for diagonal element + 1 } else if(val[i][j-1]>=val[i-1][j]){ val[i][j]=val[i][j-1]; direction[i][j]='l';//l for from left element } else { val[i][j]=val[i-1][j]; direction[i][j]='u';//u for from upper element } } } // for(i=0;i<xlength+1;i++){ // for(j=0;j<ylength+1;j++) // printf("%d ",val[i][j]); // printf("\n"); // } // for(i=1;i<xlength+1;i++){ // printf(" "); // for(j=1;j<ylength+1;j++) // printf("%c ",direction[i][j]); // printf("\n"); // } printlcs(xlength+1,ylength+1,x,direction); } void main() { char x[100],y[100]; printf("enter string x : "); gets(x); printf("enter string y : "); gets(y); lcs(x,y); }
Your code that set the val elements to zero seems to be setting only the first column and the first row. Is it designed like that?
Artöm
k
any one here for friendship please text me
Artöm
val in lcs is wrong
k
No one. Read the rules
sorry but i want learn c++ with friend
KEKI
I see vla, youre doomed. Use mallocs
Could you please explain,😅 just got into Dp
k
No one. Read the rules
very very sorry for that
k
What for?
i want learn c++ and java
KEKI
To compile it
Artöm
If you need to have 2d array with runtime sizes use mallocs and create array of pointers to matrix rows aka dynamic 2d c-style array
Artöm
Arrays val and ditection have runtime size so you need to allocate them dynamicaly, that is, using malloc
Tobias🐾🚲
Will
80% of the internet-facing servers run it, most users' first contact with the web will be "wordpress" or similar and even facebook continues on it. With v8's release, the first one with a JIT, coming soon you can bet it'll keep on going.
Tobias🐾🚲
Well, Facebook doesn't actually uses much PHP, they use their PHP derived language
Still kinda php, and until recently fully code compatible.
Ludovic 'Archivist'
Sorry to tell you but while Facebook is good at keeping money they do not constitute a heaven of good practices
Tobias🐾🚲
"80% of internet facing servers" I am not saying its good, infact i say the opposite. Yet i am realistic and knowing it wont go away, or likely even decline, anytime soon.
Tobias🐾🚲
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
I am not saying its good, infact i say the opposite.
Tobias🐾🚲
Well, it is actually declining and have a very limited use among professionals in development
Yes, among professionals. Doesnt offset the millions of wordpress sweatshops.
Tobias🐾🚲
Which is what keeps the language running worldwide on most servers, cheap hosters and co.
Ludovic 'Archivist'
Yes, among professionals. Doesnt offset the millions of wordpress sweatshops.
Up to us all to make that change, even people that switched from wp to ghost are a step forward
Ludovic 'Archivist'
From php to node is from cow dung to horse crap.
I see you never dug into a dungpile of either or you'd not take that analogy
Tobias🐾🚲
Infact i just came back from one ~2 hours ago.
Ludovic 'Archivist'
I did.
Then you likely know that horse crap smells less and is far less annoying than cow dung
Tobias🐾🚲
Just the general assessment why a 55mb ~100 plugins wp page is overkill for "use static site generators for this".