klimi
like vim?
vim is just editor
klimi
like vim?
like codeblocks, visual studio, clion
Dima
like codeblocks, visual studio, clion
codeblocks feels like really outdated rn
J
i'll try clion
Clion is not free and Codeblocks is outdated
Dima
klimi
codeblocks feels like really outdated rn
still easier to explain than how to set up vim
Dima
still easier to explain than how to set up vim
nah. I wouldn’t call it developing unless writing js or some other retarded language
Anonymous
and so.. buy it?
😂 lol i don't think i can afford it
Anonymous
Clion is not free and Codeblocks is outdated
i don't know what to say now, i was diverted to another route and that's dead end already
Dima
visual studio community then
J
still easier to explain than how to set up vim
I can explain that. Install vim, open .vimrc. :set sets commands. Use Plug to install packages and you can set bindings using map and variables can be set using let
klimi
codeblocks feels like really outdated rn
well it is not really recent but it has gcc8 so you are fine with c++17
J
i don't know what to say now, i was diverted to another route and that's dead end already
What I actually meant is why do you choose others if Visual Studio is free and has intelli sense and a better debugger by default
klimi
there is some availability to use clang in vs
sure, i haven't been on windows for years now
Anonymous
sorry for the trouble you all.
Anonymous
visual studio community then
yes, that's were I am finding issue setting up.
J
you think user that failed to set up vsc will be successful with this description?
Or I can create a .vimrc file and you can copy it in your home folder(linux)
klimi
Or I can create a .vimrc file and you can copy it in your home folder(linux)
even if you set up vimrc you won't set up the compiler and stuff :D
J
But at first, you have to learn how to quit vim :p
klimi
ZZ
Adriano
I want to add a new feature to a program, which involves file io (I want to add export capability to a new format), but it's burried in a place with a lot of dependencies. I would like to isolate only the code I need in a new executable so I can work faster than using the GUI to open and export the file at every iteration. I tried doing that, beginning only with the file and includes I needed for the first file I was working on, and then went on to add additional includes and libs until everything compiled. However, when I linked everything together, the executable just sigfailed in one of the libraries/objects included, not in my code. Is there a recommended step by step procedure to do that in a way that I would be more likely to succeed?
Ludovic 'Archivist'
Is there any support from compilers/build systems to automatically generate several versions of one code and to add the fallback code?
Msvc can do that for intrinsics, replacing them with a function, but I do not know. If you find anything like it I would be mighty interested
Ludovic 'Archivist'
Then I'll be using already existing iterator
Sorry, I am a pretty tired hooman right now
KBS
Please what is the wrong with this code and solution
P
Hey dears which ide is good for c programming
P
Is here anyone
Kevin
P
Are these free?
Kevin
Is good..
P
How to install and write code in vs code?
Kevin
Are these free?
Yess.. this is free and available on internet
Ruslan
Are these free?
Emacs, Qt Creator
Kevin
?
Download it from Google
P
Tnx
Kevin
?
https://code.visualstudio.com/download
Anshul
The question doesn't tell you when the vector passed in to your iterator is populated. So the calling code in Leetcode could be something like. vector<int> nums; PeekingIterator it(nums); nums.assign({1,2,3}); it.peek(); it.next(); it.peek(); .... In such cases, your PeekingIterator may be invalidated which would cause Undefined Behavior.
But if the vector is changed don't you think the answer will change too Like suppose when passed, vector was (1,2,3) Now in the next line you change it to (3,4,5) Now we have calls to peek and next It.peek. 3 It.next. 3 It.next. 4 And in the question it is said that you can't store vector and have to directly manipulate the existing vector In that case we can't produce answers for previous vector that was (1,2,3)
Anshul
So you mean (1,2,3) now become (1,2,3,3,4,5)?
Anonymous
So you mean (1,2,3) now become (1,2,3,3,4,5)?
No. Suppose say the question requires the vector to hold the values 1,2,3. It could be done like this: vector<int> nums{1,2,3}; PeekingIterator it(nums); it.peek(); it.next(); .... or vector<int> nums; PeekingIterator it(nums); nums.assign({1,2,3}); it.peek(); it.next(); .... Your code would most likely fail in the latter case
Anonymous
Yea in 2nd case my code will fail but then how can we write next and hasnext to such a case Because you haven't stored vector and neither you're getting vector as an argument to next and hasnext
You should use Iterator::next and Iterator::hasNext which is the point of the whole exercise. For all you know, the Iterator class implemented by LeetCode stores a reference to the vector and it's methods would work fine.
Anonymous
Where is it said it stores a reference to vector😅
I said "for all you know" meaning it may. You shouldn't be concerned about how Iterator is implemented. You should be concerned about how you implement peek method in PeekingIterator using the methods already implemented in Iterator class. Anyway I don't have the time to coach you on this. Feel free to do what you like.
Anshul
Alright thanks for your help
Pr
Hai can anyone help me to write a c program To display 10 most common words in a text file
Pr
Please help me
Pr
10 MOST COMMON WORDS #include <stdio.h> #include <string.h> #include <stdlib.h> #include<ctype.h> int main() { FILE *file; char *line; size_t len = 0, read; char words[1000][1000], word[20]; int i = 0, j, k, maxCount = 0, count; //Opens file in read mode file = fopen("data.txt","r"); //If file doesn't exist if (file == NULL){ printf("File not found"); exit(EXIT_FAILURE); } //Since, C doesn't provide in-built function, //following code will split content of file into words while ((read = getline(&line, &len, file)) != -1) { for(k=0; line[k]!='\0'; k++){ //Here, i represents row and j represents column of two-dimensional array words if(line[k] != ' ' && line[k] != '\n' && line[k] != ',' && line[k] != '.' ){ words[i][j++] = tolower(line[k]); } else{ words[i][j] = '\0'; //Increment row count to store new word i++; //Set column count to 0 j = 0; } } } int length = i; //Determine the most repeated word in a file for(i = 0; i < length; i++){ count = 1; //Count each word in the file and store it in variable count for(j = i+1; j < length; j++){ if(strcmp(words[i], words[j]) == 0 && (strcmp(words[i]," ") != 0)){ count++; } } //If maxCount is less than count then store value of count in maxCount //and corresponding word to variable word if(count > maxCount){ maxCount = count; strcpy(word, words[i]); } } printf("Most repeated word: %s", word); fclose(file); return 0; }
Pr
This code shows only one common word but I need to display 10 common words
Pr
I think logic is incorrect can anyone correct it
\Device\NUL
10 MOST COMMON WORDS #include <stdio.h> #include <string.h> #include <stdlib.h> #include<ctype.h> int main() { FILE *file; char *line; size_t len = 0, read; char words[1000][1000], word[20]; int i = 0, j, k, maxCount = 0, count; //Opens file in read mode file = fopen("data.txt","r"); //If file doesn't exist if (file == NULL){ printf("File not found"); exit(EXIT_FAILURE); } //Since, C doesn't provide in-built function, //following code will split content of file into words while ((read = getline(&line, &len, file)) != -1) { for(k=0; line[k]!='\0'; k++){ //Here, i represents row and j represents column of two-dimensional array words if(line[k] != ' ' && line[k] != '\n' && line[k] != ',' && line[k] != '.' ){ words[i][j++] = tolower(line[k]); } else{ words[i][j] = '\0'; //Increment row count to store new word i++; //Set column count to 0 j = 0; } } } int length = i; //Determine the most repeated word in a file for(i = 0; i < length; i++){ count = 1; //Count each word in the file and store it in variable count for(j = i+1; j < length; j++){ if(strcmp(words[i], words[j]) == 0 && (strcmp(words[i]," ") != 0)){ count++; } } //If maxCount is less than count then store value of count in maxCount //and corresponding word to variable word if(count > maxCount){ maxCount = count; strcpy(word, words[i]); } } printf("Most repeated word: %s", word); fclose(file); return 0; }
Isn't getline is POSIX Extenstion ?
Pr
Can you please write the code and share me
Pr
Software Requirement Specifications Multi-Threaded File Processor . Problem statement Multi-Threaded File Processor Let's say, you have 10 000 000 random words in a file Write a multithreaded application that finds The average word length Longest word, Shortest word 10 most common words. Longest line Shortest line Implement a multi-threading by simply splitting the word analysis to multiple threads and then in the end combining the outputs of all those threads together to give you the final stats.
Pr
Can anyone know this can you please share the answer for me
Pr
Its very urgent please help me
Pr
C programming
klimi
Its very urgent please help me
How come it is urgent?
Pr
Atleast any one know 10 most common words in a text file this program
Anon
Hey,has anyone used FKTK?
Ludovic 'Archivist'
Hey,has anyone used FKTK?
Please do not send dumb questions in several groups like this. Also dontasktoask.com
Abdulwahab
Help me do it correctly
Danya🔥
Anonymous
Help me do it correctly
This is not a "Help me with my assignments" group. Ask pointed and specific questions
Abdulwahab
Do it yourself
Okay. Is alright!
Danya🔥
No one is gonna solve your assignments
🙋🏻‍♂️
Hello guys, can someone help me for this?