Anshul
Okay
Anonymous
Anonymous
hi
Lw
Thanks i hope i learn more and get advanced more 👍
oreZ
Anonymous
Yes
Then just take the inputs in 2 std::vector<int or double>, compute the magnitude and the dot product. Divide the dot product by the product of the magnitudes of the 2 vectors. arccos of this result is the angle between the vectors
Bini
hey My name is Biniam. I am from Ethiopia. I want to be a programer please any suggestion
Anonymous
hello , everyone ,is there anyone who can help me with cyptopp++?
ببب ب
I was wondering, how could i implement my own tuple class, how's that commonly achieved by the C++ libraries?
Sandeep
I was asked to write a c++ program to mask data that is present in a database using any perturbation techniques...where do I begin
Anonymous
Is there anyone who can help me dld..
Puspam
Yes of course
Puspam
Puspam
Sandeep
Steve
Focus on the one which is being taught then go to the other one later.Its not advisable to do both.
shriman_deepak
int n ,count=0;
cin>>n;
while(n != 0)
{
n = n/10;
++count;
}
cout<<count;
if (count == 3){
cout<<"the number is 3 digits."<< endl;
}else{
cout<<"the number is not 3 digits"<<endl;
}
shriman_deepak
You are given an N natural number. Decide whether N has 3 digits or not. Sample input/output:
shriman_deepak
#include<iostream>
using namespace std;
int main()
{
int num,Q;
cout<<"Enter a number =";
cin>>num;
Q=num/2;
if (Q>=50||Q<=494)
{
cout<<"This is a three digit number";
}
}
shriman_deepak
Pavel
to represent a number in some system what you need to do is just divide it by the base in a loop, find a reminder on each step, and that reminder will be the digit (from right to left).
Converting back is essentially multiplication with addition
Here's some math behind it
https://www.tutorialspoint.com/computer_logical_organization/number_system_conversion.htm
shriman_deepak
shriman_deepak
Vikas
https://codeforces.com/problemset/problem/750/A
How to solve this using binary search?
Captain
Adams Scott
Hi
Please i need a mentor to guide me and teach me c language 🥺🥺
shriman_deepak
Yeah
Can you please explain?
Captain
Can you please explain?
Say n = 103
If you divide it by 10 the n becomes 10
And again divide by 10
It becomes 1
Finally when u do 1/10 it will become zero
And while loop exits
And count becomes 3
The program will give exact numbers of digits in a number
Captain
Can you please explain?
Have a habit of using debugger it helps to find bug, how the program executes and in many other ways
ꠋꠋꠋ ☬ ]ᯱꠋꠋꠋꠋꠋꠋꠋꠋꠋꠋꠋꠋꠋꠋ ⨳ࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩࣩ
how can i delete folder in c++?
pleas...
Sandeep
Anonymous
Anyone??
Search for encryption techniques in C++.
Sandeep
Search for encryption techniques in C++.
Yes the results are showing how to encrypt and decrypt..but..what I need to do is connect mysql to visual studio and then write code that masks any data not required by the user when he resqests a query..
I did the connection part..
But I don't know how to write the code in it
Anonymous
I know what data masking is and what it is used for. In the link that you have shown masking is used at the DB level where the data itself is stored after masking it.
But your question was different and you said that you wanted to "mask fields not requested by the user". What better masking can there be than not fetching the data itself.
Sandeep
Anonymous
Sandeep
Anonymous
So after encrypting ..if someone requests the data he can't see anything no..that means I should decrypt that part and show it to him?
Yes. If you are going to show the details there is no point in encryption. The whole point of encryption is to hide sensitive data like PII (Personally Identifiable Information) from others. Only in cases, where you determine a valid use, should you decrypt them. For ex - it is ok to show a user's phone and address when the user logs into your web portal. It is not ok to show it when a support technician tries to access the user's details. So in the former case, you will decrypt it and in the latter case you won't.
But I doubt this is what the person who asked you this question is interested in. He probably wants you to just mask sensistive data on fetching the results. They will most likely be stored in clear text form in the database.
Sandeep
Sandeep
Now how do I do that
Anonymous
Okay the second one it is
Learn about how you retrieve a result set from a user query. Learn about prepared or managed SQL statements.
Once you have fetched the result set, just mask the sensistive fields by replacing the individual characters with X leaving out the first few or the last few characters. Display only this masked result.
Anonymous
Sandeep
Anonymous
Sandeep
???
Should I mask it while creating
Anonymous
Should I mask it while creating
No. You create a view that masks the data. Whenever you are asked to retireve data from a table, you fetch data from that view instead. So here the DB masks the data. The data stored in the DB is in clear text form, but the ones fetched through the view will be in masked form.
I have already suggested 3 options for you. Read about them and see which one is applicable for yout use case
Sandeep
Janvi
#include <stdio.h>
#include <string.h>
struct student
{
char name [50];
int jeerank; // <50,000
int aadharnumber;
float percent10; // >60
float percent12; // >50
char stream[10]={"cse"};
};
student Admission_Bit[99999];
int verify(student abc)
{
if(abc.jeerank<50000 && (int)abc.percent10>60 && (int)abc.percent12>50)
{
return 1;
}
return 0;
}
int payment()
{
int ans;
printf("Did you Paid your Admission Fee of Rs 70,000 ?\n");
printf("Enter 1 for YES 0 for NO: \t");
scanf("%d",&ans);
return ans;
}
int cse=0,ece=0,it=0,bt=0;
void count(student *abc)
{
int k=0
printf("\n Enter your stream");
printf("\n1 for CSE\n2for ECE \n3 for IT \n 4 for BT");
printf("\nenter your choice");
scanf("%d,&k");
switch(k)
{
case 1:
cse++;
strcpy(a,stream,"CSE");
break;
case 2:
ece++;
strcpy(a,stream,"ECE");
break;
case 3:
it++;
strcpy(a.stream, "IT");
break;
case 4:
bt++;
strcpy(a.stream, "BT");
break;
default:cse++;
}
}
int main()
{
int i,x, n, total=0;
printf("\nEnter number of students.");
printf("\nEnter your NAME: ");
scanf("%s",&51.name);
printf("\nEnter your JEE RANK: ");
scanf("%d", &$1.jee_rank);
printf("\nEnter your ADHAAR NUMBER: ");
scanf("%d",&s1.adhaar);
printf("\nEnter your 10th percentage: ");
scanf("%f",&s1.per10);
printf("\nEnter your 12th percentage: ");
scanf("%f",&s1.per12);
x=verify(81);
if(x==1)
{
x=payment();
}
if (x==1)
{
count(51);
admission_bit[total]=s1;
total++;
}
}
printf("\nStudents Enrolled\n\n\nStream\tStudent's Name\n");
for(i=0; i<total; i++)
{
printf("%s\t%s", admission_bit[i].stream, admission_bit[i].name);
}
printf("\nCSE = %d", cse);
printf("\nECE = %d", ece);
printf("\nIT = %d", it);
printf("\nBT = %d", bt);
return 0;
Janvi
find bugs in this program this is not running properly after trying a lot still
Anonymous
Can any one help me in code
Anonymous
I have one que
Prince kumar
Yeah send
Anonymous
Hi
Anonymous
Hello
I
https://practice.geeksforgeeks.org/problems/minimize-the-heights3351/1
I
class Solution {
int getMinDiff(int[] arr, int n, int k)
{
int min=0,max=0,r=0; Arrays.sort(arr);
r=arr[n-1]-arr[0];
for(int i=1;i<n;i++) {
if(arr[i]>=k)
{
max=Math.max(arr[i-1]+k,arr[n-1]-k);
min=Math.min(arr[i]-k,arr[0]+k); r=Math.min(r,max-min);
}
else {
continue;
} }
return r;
}}
Anonymous
https://wandbox.org/permlink/oCI9n8XFUwCmZ7C1 how do i correctly scale my offset?
the main code is in View.cpp calc
Janvi
Do anyone here know C programming well?
Anonymous
virtual viewport : {0, 0, 100, 100}
draw dimensions : {100, 100}
virtual offset : {20, 20}
virtual_canvas_draw_position : {20, 20, 120, 120}
virtual_canvas_draw_position percentage : {0.2, 0.2, 1.2, 1.2}
required virtual size : {20, 20}
resulting draw position : {20, 20, 20, 20}
size : {200, 200}
relative position : {40, 40, 40, 40}
relative percentage : {0.2, 0.2, 0.2, 0.2}
prog.exe: prog.cc:118: int main(): Assertion `a.relativePosition == Rectangle(20, 20, 40*2, 40*2)' failed.
Janvi
Can anyone help me with a C programming
Captain
Anshul
priority_queue <int, vector<int>, greater<int>> g = gq;
Anshul
in this why the vector is passed to the queue
P.S. *priority_queue
Anonymous
Anshul
While using heap STL why we have to pass a vector of the type of heap.
Why we can't just pass the type of heap and the class to compare
Anshul
Like we do in set STL. we just pass the type of set and the class how to sort the elements
Anshul
Anonymous
Anonymous
They could have made the underlying container the 3rd template argument instead of the 2nd butdue to an oversight it remained the 2nd argument. So everytime you want to specify a comparison operator, you must unfortunately supply the underlying container type as well.