Anonymous
Anonymous
Anonymous
Can anyone help me with this one?
Anonymous
Can anyone help me with this one?
/warn screen photo and assignment
Dima
Bruh
V01D
Do people not read the pinned messages?
MᏫᎻᎯᎷᎷᎬᎠ
What's genome sequence?
Accel
Oh genes..
Anonymous
It's okay
MᏫᎻᎯᎷᎷᎬᎠ
Is there any rule for the sequence?
MᏫᎻᎯᎷᎷᎬᎠ
I'm not that familiar with biology lol
Asad
Can it be in the form of: AAAAA T ACGT AAAA T AACGT AAA T AAACGT AA T AAAACGT A T AAAAACGT T AAAAAACGT and so on?
Anonymous
Hi, I am using hiredis as redis c client.But it bot not thread-safe.I have tried to use a redisContext per thread but it seems not work.eredis supports thread safety, but few people seem to use it
Asad
What was the time complexity of your approach? Everything I can think of is insanely inefficient... So, it's interesting...
Anonymous
get cppbookguide
Ismael
//input two angles of triangle,calculate the remaining angle,suggest the triangle identity #include<iostream> #include<string> using namespace std; int main() { double angle1, angle2, angle3, sum_angle = 0; string name; cout << " Enter your name\t\t"; cin >> name; getline(cin, name); cout << " Hello " << name << " You can now input the values of two angles of a triangle and find the identity of the triangle\n" << endl; cout << " Enter the values of two angles of a given triangle\n "; cout << " Enter angle 1\t\t"; cin >> angle1; cout << " Enter angle 2\t\t"; cin >> angle2; angle3 = 180 - (angle1 + angle2); cout << " Angle 3= " << angle3 << "degrees" << endl; sum_angle = angle1 + angle2 + angle3; if (angle1<=0 || angle2<=0) { cout << " UNDEFINED VALUES"; } if (sum_angle != 180) cout << " UNDEFINED VALUES"; if(angle3<= 0) { cout<<" INVALID TRIANGLE\n"; } else cout<<" VALID TRIANGLE\n"; if (angle1 == angle2 && angle2==angle3) { cout << " The values of angles you entered are for equilateral triangle\n"; } if(angle1 == angle2 || angle1 == angle3 || angle2 == angle3 && angle1+angle2!=120) { cout << " The values of angles you entered are of isosceles triangle\n"; } else { cout << " The values of angles you have entered are of scalene triangle\n"; } system("pause"); return 0; }
Ismael
//input two angles of triangle,calculate the remaining angle,suggest the triangle identity #include<iostream> #include<string> using namespace std; int main() { double angle1, angle2, angle3, sum_angle = 0; string name; cout << " Enter your name\t\t"; cin >> name; getline(cin, name); cout << " Hello " << name << " You can now input the values of two angles of a triangle and find the identity of the triangle\n" << endl; cout << " Enter the values of two angles of a given triangle\n "; cout << " Enter angle 1\t\t"; cin >> angle1; cout << " Enter angle 2\t\t"; cin >> angle2; angle3 = 180 - (angle1 + angle2); cout << " Angle 3= " << angle3 << "degrees" << endl; sum_angle = angle1 + angle2 + angle3; if (angle1<=0 || angle2<=0) { cout << " UNDEFINED VALUES"; } if (sum_angle != 180) cout << " UNDEFINED VALUES"; if(angle3<= 0) { cout<<" INVALID TRIANGLE\n"; } else cout<<" VALID TRIANGLE\n"; if (angle1 == angle2 && angle2==angle3) { cout << " The values of angles you entered are for equilateral triangle\n"; } if(angle1 == angle2 || angle1 == angle3 || angle2 == angle3 && angle1+angle2!=120) { cout << " The values of angles you entered are of isosceles triangle\n"; } else { cout << " The values of angles you have entered are of scalene triangle\n"; } system("pause"); return 0; }
Can someone please assist me hear
Dima
please format your code
Anonymous
Can someone please assist me hear
We are not a support group for deaf people
Ismael
Can someone please assist me hear
Why does getline function only display the second name not the first while typing in the input ?
Anonymous
Ismael
please format your code
Sorry but I am not in a position
vinícius*
//input two angles of triangle,calculate the remaining angle,suggest the triangle identity #include<iostream> #include<string> using namespace std; int main() { double angle1, angle2, angle3, sum_angle = 0; string name; cout << " Enter your name\t\t"; cin >> name; getline(cin, name); cout << " Hello " << name << " You can now input the values of two angles of a triangle and find the identity of the triangle\n" << endl; cout << " Enter the values of two angles of a given triangle\n "; cout << " Enter angle 1\t\t"; cin >> angle1; cout << " Enter angle 2\t\t"; cin >> angle2; angle3 = 180 - (angle1 + angle2); cout << " Angle 3= " << angle3 << "degrees" << endl; sum_angle = angle1 + angle2 + angle3; if (angle1 <= 0 || angle2 <= 0) { cout << " UNDEFINED VALUES"; } if (sum_angle != 180) cout << " UNDEFINED VALUES"; if (angle3 <= 0) { cout << " INVALID TRIANGLE\n"; } else cout << " VALID TRIANGLE\n"; if (angle1 == angle2 && angle2 == angle3) { cout << " The values of angles you entered are for equilateral triangle\n"; } if (angle1 == angle2 || angle1 == angle3 || angle2 == angle3 && angle1 + angle2 != 120) { cout << " The values of angles you entered are of isosceles triangle\n"; } else { cout << " The values of angles you have entered are of scalene triangle\n"; } system("pause"); return 0; }
Ismael
Thanks for the correction 😊
vinícius*
there you go, buddy
vinícius*
you're doing cin >> name and then the getline
vinícius*
therefore overwriting the first name with the second
Ismael
🤭ow
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
disclaimer: i started programming in april ! a newbie here as well! hello! i searched high and low on stack overflow but i don’t seem to find my answer... so all i want to do is printf ALL my scanf using array! in the first pic is a code that is done with integer. i tried to implement what i have with it to apply it into char but it does not print out the correct things. the second pic is the problem i’m currently encountering.
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
also.. i have been putting notes at the side bc it’s 2am and i have been trying to tweak things but it clearly didn’t work out
Patrick
also.. i have been putting notes at the side bc it’s 2am and i have been trying to tweak things but it clearly didn’t work out
Could you give an example of how you'd want it to work, and what it's currently doing? Like the terminal output/input
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
Could you give an example of how you'd want it to work, and what it's currently doing? Like the terminal output/input
These unknown characters have been appearing. I’m not sure on how to show my messages in Event 0-Event 2
Anonymous
Hi guys
Patrick
These unknown characters have been appearing. I’m not sure on how to show my messages in Event 0-Event 2
Yeahhh, so, follow what Madhu said. char[] is a list of actual characters so each EventE[N] will only get one character up to a nil character. Also note that you are declaring EventE twice - you need to remove the second declaration.
Anonymous
Hello
sree nandhan
also.. i have been putting notes at the side bc it’s 2am and i have been trying to tweak things but it clearly didn’t work out
why have you declared EventE inside a for loop . your printf statement is just trying to print a empty array . right?
particaney 🐸🍲
Guys i have a problem with fifo files. So its in a while loop in the two programs. The first loop works fine. But the second one, the programs who asks a fgets simply do enter without ever asking.
Cengizhan
Generation should be linear, right? Comparison 10^5 strings to 10^5 strings, I do not think so.
su
https://www.youtube.com/watch?v=tdB_YoMr2ck
Dima
bruh
Cengizhan
Thats why you need to describe your expectation about in terms of "strings", "chars" etc. on linear or quadratic way.
Dima
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
Is it so hard to send screenshots?
So sorry! My home wifi is currently down and i’m using data on my phone 😅
MᏫᎻᎯᎷᎷᎬᎠ
Linear in terms of what exactly?
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
also.. i have been putting notes at the side bc it’s 2am and i have been trying to tweak things but it clearly didn’t work out
@lightness_races_in_orbit hello! i didn’t understand what u meant by “ specify the width “ so i went to check it up and edited line 37 and 48 with the width in. im not sure what i did was what you meant in the feedback you gave me.
Noble Friend
Sorry for the late reply friend while( getchar() != 'q') printf("q\b") ; printf("\nq") ;
yeah, but this keeps waiting for a key to be pressed after every execution. that's why i needed the help. (for example, car should keep moving until the driver says stop. so if the driver says 'go' or says nothing, the car should keep moving.) So the issue is the tire turns just once and wait for driver instead of continuous turning. /*Abstract example but explains better. */
particaney 🐸🍲
Hi, how can i make, 2 program comunicating witch each other with 2 named pipe. The program dosnt end but comunicate constantly. (after the first round in the while loop i cant make it work)
particaney 🐸🍲
One program says a number. The other gives a answer and waits back the number from the first program. And this non stop. With 2 distinct fifo file
Anonymous
hello, am glad i found this group and i have some begginer question...is it really necessary to read both edtion of K&R book?
Anonymous
C
jo ʕ•̫͡•ʕ•̫͡•ʔ•̫͡•ʔ
Oh no ... It just prints the last event the user types in. I have actually encountered this previously. 🥺
Anonymous
thanks man
Anonymous
i will tnx for the advice👍🏿
su
i will tnx for the advice👍🏿
i can help you for free if you can chat on twitch, nick the same
Anonymous
no
then only the first ed or the second ed?
su
then only the first ed or the second ed?
i'm doing live streamig, man. Are you serious? Are you gonna to read books crumbled to dust?
V01D
i'm doing live streamig, man. Are you serious? Are you gonna to read books crumbled to dust?
Books arent always bad. Ever tried searching for a keyword in a video tutorial?
Ajay
Reading 10^5 strings with 10^5 characters is 10^10 read operations(when we think in terms of no. of times we read each character). So just reading the input that you described is quadratic. Isn't it? BTW, What's the memory limit to your question?
Ajay
I initially thought of a Trie data-structure that holds each string. So, after inserting all the strings, when we try to generate a given string, then we just check if the none of the strings that have already been inserted have their i_th character to be either of A, T, C, G. If not, then you know that you can choose this i_th character to be this non-occurring character then the rest of the characters can be any thing. For simplicity, I will choose all of these characters be A. But, still going through all these strings and that too character wise isn't a good approach. What do you think?
Ajay
BTW, you didn't tell the time-limit.
Ajay
N here is # of strings or multiplication of length and their count?
Ajay
Ofc, O(something) doesn't give you the exact space that your algorithm use and I don't think the interviewer will have any problem if the data-structure that you use takes an equivalent amount of space that the input itself takes. yes, the time limit is a concern here.
Ajay
Interested to know your approach?
Cengizhan
Create 10^5 hash values for 10^5 strings. And generate new one and compare generated string hash value with existing one. But still it is quadratic.
Cengizhan
Create 10^5 hash values for 10^5 strings. And generate new one and compare generated string hash value with existing one. But still it is quadratic.
Or holding strings as a key map and new generating string would not be inserted into map, it has been already known one.
vinícius*
You can set up a function that returns the "negative" of a given genome
vinícius*
Like, say A is the negative of G (arbitrarily), and something similar for all the rest
vinícius*
because the given set is guaranteed to have no clones, right ?
Anonymous
What about applying to Intel?😏😂
Anonymous
Are the string fixed-length?