Mat
By default
Mat
It is what I said.
That's a comment before my realization :P
Mat
It is what I said.
Do you need just access to the data inside with little implementation of functions? One struct to rule them all Do you need a complete behavior? Different objects to implement it Now i think i made a good suggestion :D
Mat
Welcome :)
Mat
It is what I said.
I'm sorry if i misunderstood or confused you :/
Anonymous
Do you need just access to the data inside with little implementation of functions? One struct to rule them all Do you need a complete behavior? Different objects to implement it Now i think i made a good suggestion :D
I think so, although the classes and the structs can has the same functionality, the struct would be just for data and the classes just a wrap around the data that need to implement functions. Really i think that it is more a subject about readability.
Anonymous
I'm sorry if i misunderstood or confused you :/
Do not worry bro! There is no problem! It is just a knowledge exercise and it is okey. :D
Anonymous
Lol.
Anonymous
/report
Group Butler
/report
Reported to 0 admin(s)
Mat
@admin
Group Butler
@admin
Reported to 0 admin(s)
Mat
Uh.
Maybe they're offline?
Roxifλsz 🇱🇹
/ban fuck outta here with this advertising
Group Butler
Rokas banned Raden!
Roxifλsz 🇱🇹
Maybe they're offline?
It seems that the admins have to enable the reporting for themselves to be notified by this command
Roxifλsz 🇱🇹
I have set it for myself and will tell the others
Anonymous
do u guys really understand nested loops? I am having hard time with them. Ex: for foo, inside it, for foo2 inside that, for foo 3. damn
Anonymous
isn't it?
harry
gist.github.com/harry-/c39084559171e820a8729f640a33ee7c
harry
this loop never completes
harry
but for the smaller number it does
harry
is this expected behaviour?
Liam
do u guys really understand nested loops? I am having hard time with them. Ex: for foo, inside it, for foo2 inside that, for foo 3. damn
For example, this is a demo for two-nested-loop C program. #include <stdio.h> int main() { const char* A[] = {"♠️", "♥️", "♣️", "♦️"}; const char* B[] = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"}; const size_t lenA = sizeof(A) / sizeof(A[0]); const size_t lenB = sizeof(B) / sizeof(B[0]); for (int i = 0; i != lenA; ++i) { for (int j = 0; j != lenB; ++j) { printf("%s%s ", A[i], B[j]); } puts(""); } return 0; } It gives you the Cartesian Product of array A and B. For elements in the result of A × B, the code prints it out, and of course you could do anything on the elements to replace printf. That's why I say nested loops represent Cartesian Product mathematically.
Anonymous
this loop never completes
if you wait long enough it looks like it should terminate, there are faster algorithms to solve that problem
harry
I'm surprised a simple count down would be that time intensive
harry
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
harry
like this?
harry
ah, yes
harry
guess, I'll try that
Anonymous
I'm surprised a simple count down would be that time intensive
look at the outer loop, it has to go through about 300 billion numbers, of course thats gonna be slow
Group Butler
Start me to get the list of commands
Anonymous
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
does this problem really require you to find every prime up to that large number?
harry
look at the outer loop, it has to go through about 300 billion numbers, of course thats gonna be slow
I know it would be a lot to do by hand, but I dont know how to judge whether it is a lot for the computer
Liam
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Well... Yes, however, the number 600851475143 is too large for sieve on a personal computer. Allocating such a large array will eat more than 69 GiB memory.
Anonymous
Wow
Anonymous
Nice concept
harry
well, my take away from this is not to iterate through something that requires you to use long long
Anonymous
Have you programm c++
Anonymous
If you have please send me
Anonymous
New Doc 2018-01-16.pdf
Anonymous
Anonymous
New Doc 2018-01-16.pdf
Have you C++ if you have please send me
Roxifλsz 🇱🇹
Have you C++ if you have please send me
Stop asking for programs, you can find lots of tutorials and programs online. Just Google it...
Anonymous
Hello. I have problems with loops . I can’t understand how they are working. I know what are doing, but I cannot use them
Liam
Hello. I have problems with loops . I can’t understand how they are working. I know what are doing, but I cannot use them
Making your question more specific with more details helps you getting better answer. Basically, loops do similar tasks (the loop body) many times, within subtle difference (rooted in the loop variable) from one round to another, and then stop (the stop condition). Example: unsigned int sum = 0; for (size_t i = 0; i != 100; ++i) { sum += i + 1; } Here, the loop body represent the codes inside the block ({ ... }) and the codes in the increment part of for loop (++i), the stop condition is !(i != 100), and the loop variable is i. For every round, the loop body does similar task (adding i + 1 to sum), and the loop will stop when the stop condition becomes true. When you look into a round and compare to another, the only subtle difference is caused by the different value of i, which is the loop variable. Another concept might help you to understand how loop works: the invariant condition. An invariant condition is a statement associated with a loop, and is always true at (1) the begining of the loop, (2) the end of the loop body of every round, and (3) the end of the loop. The correctness of invariant conditions of a loop helps you to be confidence of the correctness of the loop itself. In the example, the invariant condition statement could be: "i is the number of how many numbers have been added to sum". You could easily check the correctness at the three timings of the loop, and thus the loop do the task for you: starting from i == 0, add i + 1 to sum for 100 times, with ++i as the increment after the addition every time.
Anonymous
Making your question more specific with more details helps you getting better answer. Basically, loops do similar tasks (the loop body) many times, within subtle difference (rooted in the loop variable) from one round to another, and then stop (the stop condition). Example: unsigned int sum = 0; for (size_t i = 0; i != 100; ++i) { sum += i + 1; } Here, the loop body represent the codes inside the block ({ ... }) and the codes in the increment part of for loop (++i), the stop condition is !(i != 100), and the loop variable is i. For every round, the loop body does similar task (adding i + 1 to sum), and the loop will stop when the stop condition becomes true. When you look into a round and compare to another, the only subtle difference is caused by the different value of i, which is the loop variable. Another concept might help you to understand how loop works: the invariant condition. An invariant condition is a statement associated with a loop, and is always true at (1) the begining of the loop, (2) the end of the loop body of every round, and (3) the end of the loop. The correctness of invariant conditions of a loop helps you to be confidence of the correctness of the loop itself. In the example, the invariant condition statement could be: "i is the number of how many numbers have been added to sum". You could easily check the correctness at the three timings of the loop, and thus the loop do the task for you: starting from i == 0, add i + 1 to sum for 100 times, with ++i as the increment after the addition every time.
Thanks
Buck
Guys, I have a problem with semaphore, look the screen
Buck
Buck
I don't understand how to declare the "union semun"
Liam
I don't understand how to declare the "union semun"
union semun { // ... } test; or union semun { // ... }; semun test;
Liam
union semun { // ... } test; or union semun { // ... }; semun test;
semun is the type name of the union, while test is a variable typed in semun.
Buck
semun is the type name of the union, while test is a variable typed in semun.
Oh shit! It's a very stupid error ahaha Now work, thanks
Anonymous
How to install kde neon in ubuntu
Liam
STFG, it pays.
Anonymous
Anonymous
Do anybody know how to do it?
Anonymous
In c language
Anonymous
How to install kde neon in ubuntu
KDE NEON itself is a distro like Ubuntu
Anonymous
KDE NEON itself is a distro like Ubuntu
Bro u mean i have to install whole kde as an new os...and all my files would be deleted
Anonymous
Oh
Anonymous
or apt-get install kubuntu-desktop
Anonymous
Anonymous
Is it a theme
Anonymous
What will this do
Install KDE desktop on Ubuntu
Anonymous
Ok
Anonymous
Btw
Anonymous
Anthing good in kde
Anonymous
Neon
Anonymous
I m thibking to switch to a newer linux distro