Vlad
hi, guys, does anyone know why this code isn't working?
struct sched_param thread_param;
thread_param.sched_priority = priority;
pthread_setschedparam(tid[current_thread - 1], SCHED_RR, &thread_param);
where tid is an array of pthread_t
all i want is to change the priority of thread
● Igor
what is the disadvantage of using C++ instead of C?
why Torvalds and some other people hates C++?
● Igor
just out of curiosity
● Igor
● Igor
but you can avoid many silly (but harmful) mistakes using C++
Hussein
Hi
I’m building on a simple database in C it uses memory mapped files instead of write()/read() to improve performance
I’m wondering if used the O_DSYNC flag with memory mapped files will the kernel passes any changes done to the file to the hardware right away? which will increases it’s chance to be actually written on the disk compared with regular file I/O
is there any way to tell the kernel or give it a hint to do that using memory mapped files?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, I'm writing a password checker software in C. I got as far as checking the lenght (minimum 8 char), and it must feature a number, a special carachter and an uppercase letter. So far so good, it's pretty easy to do. The problem is that I want to provide a much stronger service.
In fact, usually a password like ImTakingTheTrain1 is weak, but also 1mT4k1ngTh3Tr41n1!, while satisfying previous requirements, it's pretty easy to guess (nowadays...). Therefore, I wanted to provide a service capeble of understanding wether a password is "strong" or "weak".
I know I need Machine Learning algorithms. That I can't affors, of course, but maybe there's another way: sending the password to a site (like avast, for istance), and get a bool back on the socket. If it's true, thank it's ok, otherwise I ask for a new password.
Can you point me to a tutorial? I searched on youtube but nothing seems to be what I'm looking for, maybe you know something that might help me.
Thanks!
ʙʀʜᴏᴏᴍ ⑇
#include <iostream>
#include <vector>
using namespace std;
struct Student
{
int id, age, phone, degrees[6];
string name;
};
void add(vector<Student> &a);
int main()
{
vector<Student> students;
add(students);
}
void add(vector<Student> &a)
{
for (int i = 0; i < 2; i++)
{
a.push_back(Student());
cout << "id : ";
cin >> a[i].id;
}
}
ʙʀʜᴏᴏᴍ ⑇
Deepak Chaurasia
Deepak Chaurasia
Add iostream.h header files
Remove } ";"
Make coreect logic and intize proper variable
klimi
Hi guys, I'm writing a password checker software in C. I got as far as checking the lenght (minimum 8 char), and it must feature a number, a special carachter and an uppercase letter. So far so good, it's pretty easy to do. The problem is that I want to provide a much stronger service.
In fact, usually a password like ImTakingTheTrain1 is weak, but also 1mT4k1ngTh3Tr41n1!, while satisfying previous requirements, it's pretty easy to guess (nowadays...). Therefore, I wanted to provide a service capeble of understanding wether a password is "strong" or "weak".
I know I need Machine Learning algorithms. That I can't affors, of course, but maybe there's another way: sending the password to a site (like avast, for istance), and get a bool back on the socket. If it's true, thank it's ok, otherwise I ask for a new password.
Can you point me to a tutorial? I searched on youtube but nothing seems to be what I'm looking for, maybe you know something that might help me.
Thanks!
do you have any background for the claims that "ImTakingTheTrain1" is weak?
H
Does anyone know dynamic_bitset with boost
Swara
No
H
I am facing issue with last bit of each array is always set true even when it is 0
Руслан
Help, i use rand(), and after every run i see "41"
unsigned long number;
number = rand();
printf("%lu", number);
Руслан
MUHAMAD SHUKRI
hye and hello
i have a question regarding my assignment about registration and log in system.
first off all, the registration coding run very well.
but then when i make the log in, it states that users did not registered, even though i have already registered. can someone help me to check the coding ? its 130 ++ lines of coding
klimi
MUHAMAD SHUKRI
never mind sir . thanks
klimi
Mr
Руслан
Mr
Dima
use pastebin please
Camry
Ok
ʙʀʜᴏᴏᴍ ⑇
how to loop through vector of struct
I search on google and I get more errors!
This is my struct:
struct Student
{
int id, age, phone, degrees[6];
string name;
};
and this my main function:
vector<Student> students;
for (size_t i = 0; i < 2; i++)
{
add(students, students.size());
}
sort(students.begin(), students.end(), compare);
print(students);
Now in print function I want to do for each loop!
olli
Anupam2.7
olli
Asker
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int sum=0;
long a,b;
cin>>a>>b;
if (0<=a,b<=pow(2*10,9)) {
for(a; a<=b ; ++a){
sum+=a;
cout<<sum;
}
}
}
Asker
Hi everyone I have logical problem at code
Asker
I want to find sum of each number in [a,b] interval please help me
Anonymous
Asker
Pavel
Asker
Pavel
Anonymous
+
Anonymous
#include<iostream>
#include<cmath>
using namespace std;
int main(){
long sum=0;
long a,b;
cin>>a>>b;
if (0<=a && b<=pow(2*10,9)) {
for(; a<=b; a++){
sum+=a;
cout << "the sum is: " << sum;
}
}
}
Hussein
Hi
I’m building on a simple database it uses memory mapped files instead of write()/read() to improve performance
I’m wondering if used the O_DSYNC flag with memory mapped files will the kernel passes any changes done to the file to the hardware right away? which will increases it’s chance to be actually written on the disk compared with regular file I/O
is there any way to tell the kernel or give it a hint to do that using memory mapped files?
Anonymous
Asker
try it
Thanks it works now
Asker
Asker
#include<iostream>
#include<cmath>
using namespace std;
int main(){
long a,b;
cin>>a>>b;
if (0<=a,b<=pow(2*10,9))
cout<<(a+b)/2*(b-a+1);
}
Asker
/
Help
/
i have a problem7
/
i want to strip symbols from my so file
/
i have tried using this
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
/
it doesnt work
/
help
/
i tried also this add_link_options($<$<CONFIG:RELEASE>:-s>)
/
help me
Pavel
Hm, is there a way of having a piece of non-initialized memory for elements (like std::array<MyType, Size> but not initialized) as part of a class?
So if I create my class on a stack, this memory will be taken as part of it.
What I want to do with it is basically something like std::array for objects that don't have default constructor (that I also don't construct right away).
I can play with union, but that feels too ugly, also I want to be able to work with it as with normal array when it's filled, e.g. pass around like span, not sure if objects that are unions could do that.
Pavel
Unknown
My assignment is in cpp, writing a program to control traffic light on a 4 way junction road ,Where equal time intervals of 30 second s allocated to each road there is traffic at all the signals, then the system will work normally by controlling the signals one by one.
If there is no traffic near a signal, then the system will skip this signal and will move on to the next one. For example, if there is no vehicle at signal 2, 3 and currently the system is allowing vehicles at signal 1 to pass. Then after signal 1, the system will move on to signal 4 skipping signal 2 and 3.
If there is no traffic at all the 4 signals, system will stop at the current signal and will only move on the next signal if there will be traffic at any other signal
mito
Nuriddinov
Hello guys
who has a gif made in c++
Ludovic 'Archivist'
Hi guys, I'm writing a password checker software in C. I got as far as checking the lenght (minimum 8 char), and it must feature a number, a special carachter and an uppercase letter. So far so good, it's pretty easy to do. The problem is that I want to provide a much stronger service.
In fact, usually a password like ImTakingTheTrain1 is weak, but also 1mT4k1ngTh3Tr41n1!, while satisfying previous requirements, it's pretty easy to guess (nowadays...). Therefore, I wanted to provide a service capeble of understanding wether a password is "strong" or "weak".
I know I need Machine Learning algorithms. That I can't affors, of course, but maybe there's another way: sending the password to a site (like avast, for istance), and get a bool back on the socket. If it's true, thank it's ok, otherwise I ask for a new password.
Can you point me to a tutorial? I searched on youtube but nothing seems to be what I'm looking for, maybe you know something that might help me.
Thanks!
You can do something better, get the password hash list from https://haveibeenpwned.com/Passwords and store it in a bloomfilter and/or a quotient filter and do cardinality checks on that
Ludovic 'Archivist'
To improve space efficiency, you can make 2 bloomfilters of around 4MB each and get around 99.96% confidence if I have not fumbled my math
Nuriddinov
¯\_(ツ)_/¯
Who has ready lines like this?
Nuriddinov
In c++
Hala
I am new to programming...i am learning programming from YouTube.can you guys suggest me a site where i can get beginner level problems.
Anonymous
Hello brothers I need C programing
Anonymous
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Tom
#include <stdio.h>
#include <stdio.h>
int main()
{
int mpesabalance;
printf("Enter mpesabalance");
scanf("%d", &mpesabalance);
if (mpesabalance >=500);
{
printf("dish pizza");
}else if
(mpesabalance>=200 && <500);
{
printf("dish chips");
else
{
printf("take tea only");
}
return 0;
}
Anonymous
Tom
Anonymous
what's up with the code?
You mean apart from the missing closing brace } for the else if condition and the semicolon at the end of the else if condition?
Tom
klimi
and the missing ________ < 500 in the "else if"