Anonymous
What do you guys think about GTK for UI?
I've never used GTK so I can't say more I think it's also a good choice Qt is also because of Feature Integration in QtCreator IDE which makes UI development much easier It also allows styling with CSS which makes the UI more fluid.😎😎
Anonymous
Also good
Yes it’s 🙃
itsmanjeet
Hey can we have any condition when map<string,SomeStruct> on clear or ~() gave segfault SomeStruct{string,int,int} I am getting SEGSEV on exit of program, and don't even know what's happening and how to debug that
Anonymous
So, any adoption in the wild?
For C11 yes. There are quite a few projects out there. Just search for it on GitHub with C11 as a tag
AlanCcE
Hey guys, I'm planning to create a terminal-based messenger focused in privacy and anonymity using C. Can you share your thoughts if it's feasible to make this entirely in C? I'm thinking of using XMPP protocol and TLS encryption for direct user connections. Any similar projects or potential challenges I should be aware of?
AlanCcE
My suggestion: don’t use C unless you have plenty of time
I do have a plenty of time, but if this application should have some weird ass challenge im open to use something (maybe Rust?) to make my like easier
布丁
I do have a plenty of time, but if this application should have some weird ass challenge im open to use something (maybe Rust?) to make my like easier
I try not to mention Rust to prevent myself being kicked out from this group😂 You can expect lots of manual resource management. If you miss a single point then bad things can happen.
布丁
It requires you to have a high level design of shared states, object lifecycle and concurrency etc.
布丁
Debugging can be annoying also when it comes to multithreading
DaviChan
Hey guys, I'm planning to create a terminal-based messenger focused in privacy and anonymity using C. Can you share your thoughts if it's feasible to make this entirely in C? I'm thinking of using XMPP protocol and TLS encryption for direct user connections. Any similar projects or potential challenges I should be aware of?
yeah, this surely is possible in c. I think libpurple is in C also cimpletley (pdigin) this could give you an example implementation. Im my experience Rust even adds to initial development time, it reduces maintainance time most likely though. I think C is a perfectly fine choice for this task. For SSL there is the openSSL library. I like wolfssl (small for static linking) and LibreSSL also. These libraries should be used to handle all socket creation. From what I saw using raw posix sockets almost always led to unwanted "features". not too familiar with the XMPP protocol, but im sure you can find a specification online. First try to think about the structure of you application very in depth. And try to get a pure tcp chat working first, then add ssl, and then go through the specification of XMPP. (maybe read through it before you start also, so there are no surprizes)
DaviChan
no problem :) Good Luck with the project! There are quite some implementations of xmpp clients. You should probably make a code review of some other clients before you start. This usually helps me to get design ideas. Think about what to copy/imitate and what you want to avoid. For me I always try to minimize coupling of "modules" for example. They should be as independent as possible
Віктор
Hello, I have a question. In this summer i want enter to internship in cdprojektred. And i must write CV. Can I write in cv, that i make 50+ problems on leetcode or it will be useless information?
DaviChan
for an internship i guess it can be mentioned ofc. ... I'm not involved with hiring people though at all.
DaviChan
if not anything else this shows some dedication. For me personally github or something where i can see your work would be really nice. But also HR doesnt want to spend a whole lot of time on each resume, so make the most impressive things very easy to see
DaviChan
ah okay ^^ Nice choice haha ❤️😂
DaviChan
I honestly don't know modern C, so its hard to compare, but in the past namespaces and classes where things i was missing in ANSI C to structure code better. But honestly, I love C++, but the mere amount of features in the language makes it hard to enforce code guidelines on a larger project and makes it therefore again harder to maintain. Mhmm at the end i think it is 99% preference as long as its not asm. If you say asm or haskell, you might need to reconsider your language choice... anything else for regular console applications should be good 😅
Костя
Hi! Please help me figure out how to implement this in code. I searched for information on StackOverflow, but I didn't find anything. The exercise for the lab is to create a CBigNumber, which is a large integer with a size of 128 bits (equivalent to two long long numbers)
Костя
😅😅😅
DaviChan
Use something to check code style. like clang-tidy
we do. I even wrote some clang tidy plugins for some rules we enforce.
DaviChan
it is still an issue, because C++ is too flexible. Just think about how to initialize variables, when to use auto, when to return etc.
DaviChan
almost impossible to have everything in the style guide and actually have people follow it. 😅
DaviChan
clang tidy is really cool though. You can even have automatic fixes and you can be very specific to what you want. Really appreciated tool! (your code needs to compile with clang though)
ynwqmv
rate pls💕
Anonymous
Hello everyone i need help Write a function that receives three numbers as parameters and then returns their sum, product, and average using: 1-a pass-by-reference parameter 2-an array to return the required values
ynwqmv
c or c++
Anonymous
C++
ynwqmv
ok
Anonymous
ok
Thanks
ynwqmv
#include <iostream> using namespace std; void calculateStats(int a, int b, int c, int& sum, int& product, float& average) { sum = a + b + c; product = a * b * c; average = static_cast<float>(sum) / 3.0; } int main() { int num1, num2, num3, sum, product; float average; cout << "Enter three nmbers here..: "; cin >> num1 >> num2 >> num3; calculateStats(num1, num2, num3, sum, product, average); cout << "Sum: " << sum << endl; cout << "Product: " << product << endl; cout << "Average: " << average << endl; return 0; }
Anonymous
https://pastebin.com/6vgfHq0q Am I using headings correctly?
ynwqmv
yes but it returns nothing
ynwqmv
we can only write return; (yeah, just return) to exit the function
ynwqmv
does anyone want to test it? ;D
DaviChan
DaviChan
from the description alone.
DaviChan
what do you mean by "SHA256 Encryption" ?
DaviChan
did you mean aes256?
DaviChan
i like that ur using asio for the networking though
DaviChan
will read through it later :)
Віктор
hello, i`am stupid monkey, and i can't understand, how i can correct this mistake
Віктор
Line 18: Char 19: error: no member named 'size' in 'ListNode' b = head->size() / a; ~~~~ ^
Віктор
it`s a leetcode problem, and i can`t understand, why i can`t use "size".
ynwqmv
what do you mean by "SHA256 Encryption" ?
the host and port are encrypted using the SHA256 algorithm. this is just a simple example that I wrote in a few hours; D
Anonymous
the host and port are encrypted using the SHA256 algorithm. this is just a simple example that I wrote in a few hours; D
But SHA256 is not an encryption algorithm. So how will you decrypt the host and the port later?
ynwqmv
No, bro. you don't understand me. here's a piece of code for you and I'll try to explain: std::vector<std::shared_ptr<tcp::socket>> sockets; std::unordered_map<std::string, std::shared_ptr<tcp::socket>> data;. all connected sockets are stored in sockets, and data is stored in the socket and its hashed IP:port, and what do you mean, I'm working on it to make encryption for the entire network for secure communication))))))
ynwqmv
so data map container contains socket and hash for its host:port
ynwqmv
i made this for i think to provide some anonymously;D and to send private messages; /send recipient message
ynwqmv
that's it ...)
ynwqmv
madhu bro ... i dont encrypt whole network using SHA256. The program is simple chat-server. User can start the server and connect to it. Server can accept many connections so each nodes(users) can communicate and synchronise the chat . so when someone is connected to server, each users get its host and ports in the form of sha256 hash. By this hash users can send private message for the recipient only(only the recipient will see the message) ....
heaoven
SHA256 is digest algorithm,no encrypt algorithm, but RSA or AES is encrypt algorithm.
ynwqmv
i use the "encrypt" word to describe what happens with host n port of each users) im tired ;D
heaoven
Got it, you use hash to divide user?
ynwqmv
I'm experimenting with asio/ssl.hpp for encryption ....
ynwqmv
i said i wrote it +- in 2 hours ))))) dont hate me
ynwqmv
its like 248 lines of code u can see the source code in my githubrepo
-
Hi I’m working on a DFS algorithm on a graph. But I don’t know how to mark the wrong nodes which the program start to traverse from them an ends in a wrong answer. Any idea how to solve it ?
Anonymous
Hi I’m working on a DFS algorithm on a graph. But I don’t know how to mark the wrong nodes which the program start to traverse from them an ends in a wrong answer. Any idea how to solve it ?
What do you by mean wrong nodes? DFS will visit all nodes reachable from a given node. If you don't wants specific nodes to be visited, create a set of such nodes and in each call to visit check if the node is in this set. Continue only if it is not in this set
Prabakaran
Is there any reference for dos and don’ts on C/C++? Like what does the static analysis tools do to make sure all the potential threats are identified. Any book or reference will be helpful
Null
https://github.com/cpp-best-practices/cppbestpractices
Olivia
int y=3^2^2*5/2+3; cout<<y; i got 9 answer why?
Olivia
oh