Anonymous
No
Mat
No
😂
klimi
klimi
Does dm mean "don't mess"?
Aditya
can i ask abount rdbms?
Aditya
means i havr doubt in er diagram ?
Aditya
have*
Nicola
I have to create a program that exchanges (or associates) another value, for example to 1-> 13 2-> 8 etc.
Nicola
How solve I this shit problem😂?
Mat
Which's the algorithm?
Diana
hi
Talula
I have to create a program that exchanges (or associates) another value, for example to 1-> 13 2-> 8 etc.
The values would be permanent or Random all the time? Are you thinking about Encoding and Decoding?
Nicola
Permanent
Talula
Use XOR
Talula
#include <stdio.h> int main() { int a = 12, b = 25; printf("Output = %d", a&b); return 0; }
Talula
A will change and B will remain as Key...
Nicola
that is, they must be random all the time in order to perform the decoding
Talula
You'll always get a different value.
Nicola
Use XOR
I can not use the XOR must be causal associations
Talula
Talula
http://www.cs.miami.edu/home/harald/enigma/enigma.c
Dima
Nicola
for example, enter 4 (100b) in the box and exit 7 (111b)
Anonymous
you cannot use switch/case?
Mat
Let's say no
Create an array with all your numbers as input and save an output array from a function that randomly change array elements' position
Talula
Look best way to do it is make an array if you simply want numbers... array[10] and generate random number from 0..10 But make sure numbers aren't repeated... then on every number like let us say 1 you select the number in the array[1]
Luigi
Hi guys! some C or Unix guru can help me for this excercise? create 2 pipes and a child (the 2 pipes will be used for two-way communication between the parent and son);  after creating the child, take a file name and a character as input from the user;  send the child the file name and the character using the first pipe;  make the child look for the number of strings in the file that start with the character taken from the input father and let the father communicate this number using the second pipe;  have the number of occurrences received by the child printed to the father.
Nicola
So I created a vector of integers filled from 0 to 15 (the size is 16), after I made a shuffle and finally using the index, I can take the value exchanged
Talula
what do you think of this solution?
That is what I said, if you want to add random numbers you could by doing simple C program, do you want me to write it for you?
Talula
@Tazmikar can help me please?
I'm not Unix Guru
Luigi
I used first pipe to send the informations to child. Then I launched execlp() to use grep system call for calculate occurences. How can I now send the output to father?
Anonymous
Yeah, cause IPC via pipes is a absolut new thing
Anonymous
Never saw that before
Luigi
Never saw that before
For me it's the first time. Google sometimes give you the solution, sometimes only some tip. If there is a group on Telegram there is a reason:)
Talula
#include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int i = 0; int x = 0; int array[10]; srand (time(NULL)); while(i<10) { int r=rand()%10+1; for (x = 0; x < i; x++) { if(array[x]==r) break; } if(x==i) array[i++]=r; } for (int i = 0;i<=9;i++) printf("number [%d] = %d\n\r",i,array[i]); }
Anonymous
For me it's the first time. Google sometimes give you the solution, sometimes only some tip. If there is a group on Telegram there is a reason:)
https://www.tutorialspoint.com/inter_process_communication/inter_process_communication_pipes.htm Maybe this helps
Luigi
https://www.tutorialspoint.com/inter_process_communication/inter_process_communication_pipes.htm Maybe this helps
Unfortunatelly no, because I'm using execlp(), I have to redirect the output. it's not a pipe problem
Anonymous
Maybe it's better when you post your code via pastebin, so we can have a look. Lets have a look
Dima
lol
Anonymous
dat bot...
Luigi
Hahahhahaha Damn
Luigi
/JhijPCM6
Luigi
this is the path
Nicola
use a sbox array
What is it?
Anonymous
/JhijPCM6
Does it compile?
Ariana
Basically an array with like a[input]=output
Luigi
Yeah
But I need to resolve the last point: send the result of occurences to father and print it
Talula
What is it?
Check the program I made above it does the random in Array without repeatation.
Anonymous
But I need to resolve the last point: send the result of occurences to father and print it
Pipes can't read and write in both directions. One process reads, the other writes. If you only want to write from child to parent, simply use write(pipe_array[index], your_string, size_of_string)
Anonymous
If you want both, just use two pipes or a socketpair
Luigi
the solution it's this: alumni.cs.ucr*edu/~drougas/code-samples-tutorials/pipe-redirection.c
Talula
don't work
It's tested and it does.
Anonymous
Explain me what is template work
Nicola
Nicola
I search number 6 and my result is 6 but when I search again 6, my result is
Nicola
5
Talula
I just gave you the way to create random numbers that don't repeat... you expect me to write the whole program?
Nicola
no sorry
Anonymous
Hello everyone I have a question
Anonymous
Why does if (a,b,...) exist in c++? It seems so useless
Anonymous
For example
Anonymous
int x = 1, y = 0; if(x,y) puts ("yes"); else puts ("no");
Mat
So?
Mat
What's the output