Jabz

433 Reputation

5 Badges

12 years, 130 days

MaplePrimes Activity


These are replies submitted by Jabz

 

Why don't i get the original list ([104, 101, 108, 108, 111]) when i use F(33,7,X). It shoud decrypt the list shouldn't it?

 

restart:
document:= "C:\\Users\\x\\Desktop\\Hello.txt":
outputfile:= "C:\\Users\\x\\Desktop\\test3.txt":
readbytes(document, infinity);
fprintf(outputfile,"%a",%);
close(document, outputfile);

                          [104, 101, 108, 108, 111]
                                     25
L:=parse(readline(outputfile));
convert(%,bytes);
close(outputfile);
                          [104, 101, 108, 108, 111]
                                   "hello"
F:=(n,e,L)->map(x->x^e mod n,L):
X:=F(33,3,L);
                              [26, 8, 3, 3, 12]
F(33,7,X);
                              [5, 2, 9, 9, 12]

How do i turn it back into letters.

restart:
with(FileTools[Text]):
document:= "C:\\Users\\X\\Desktop\\Hello.txt":
outputfile:="C:\\Users\\X\\Desktop\\test3.txt":
readbytes(document, infinity);
 

      fprintf(outputfile,"%a",%);
   

         close(document, outputfile);



                          [104, 101, 108, 108, 111]
                                     25

 

x:=ReadLine(outputfile);
     ReadLine(outputfile);
x:=convert(%,list);
convert(x,bytes);
["[", "7", "0", ",", " ", "1", "1", "7", ",", " ", "9", "9", ",", " ", "1", "0", "7", ",", " ", "3", "2", ",", " ", "8", "9", ",", " ", "1", "1", "1",  ",", " ", "1", "1", "7", "]"]
Error, byte list must contain only integers

 

How do i turn it back into letters.

restart:
with(FileTools[Text]):
document:= "C:\\Users\\X\\Desktop\\Hello.txt":
outputfile:="C:\\Users\\X\\Desktop\\test3.txt":
readbytes(document, infinity);
 

      fprintf(outputfile,"%a",%);
   

         close(document, outputfile);



                          [104, 101, 108, 108, 111]
                                     25

 

x:=ReadLine(outputfile);
     ReadLine(outputfile);
x:=convert(%,list);
convert(x,bytes);
["[", "7", "0", ",", " ", "1", "1", "7", ",", " ", "9", "9", ",", " ", "1", "0", "7", ",", " ", "3", "2", ",", " ", "8", "9", ",", " ", "1", "1", "1",  ",", " ", "1", "1", "7", "]"]
Error, byte list must contain only integers

 

Thank you so much now i can see clearly what's happenning.

 

much much appriciated

Thank you so much now i can see clearly what's happenning.

 

much much appriciated

thank u for the post. I was really wondering how to convert the contents of a txt file without entering the content again.

For example

if i open a a file

filename := "C:\\Users\\x\\Desktop\\testing.txt":
 

Text[WriteLine]( filename, "FileTools example" );

what is the code that i have to type for maple to open the file read the data and convert into ascii and display it?

 

thank u

 

thank u for the post. I was really wondering how to convert the contents of a txt file without entering the content again.

For example

if i open a a file

filename := "C:\\Users\\x\\Desktop\\testing.txt":
 

Text[WriteLine]( filename, "FileTools example" );

what is the code that i have to type for maple to open the file read the data and convert into ascii and display it?

 

thank u

 

Thank You.

I don't understand this line of code "err:=evalf(abs(a-x)):" why do you have to take away x from a?

&

I have one more  problem i cannot get it to not go to infinite loop for equations like f(x)=x^2+2.

Thanx

Hi kin

I tried to implement the above for my program bt it comes up with an error saying that  `else unexpected`.

The parts in italics are the new changes to the above program the rest is the same.

 

A:=1:  
M:=0.0001:
while (A<>false) do

   A:=Maplets[Examples][Confirm]( "Would You Like To Find Another Root?" ):
     if A=true then
      B:=readstat(`Initial Value One?`):
      C:=readstat(`Initial Value Two?`):
     
    else
       NULL;
else

    if B >= C then
          printf("Incorrect Values %a",[a,b]);
   else ..........
 

 

P.s when i delete the else it works but not properly.

Hi kin

I tried to implement the above for my program bt it comes up with an error saying that  `else unexpected`.

The parts in italics are the new changes to the above program the rest is the same.

 

A:=1:  
M:=0.0001:
while (A<>false) do

   A:=Maplets[Examples][Confirm]( "Would You Like To Find Another Root?" ):
     if A=true then
      B:=readstat(`Initial Value One?`):
      C:=readstat(`Initial Value Two?`):
     
    else
       NULL;
else

    if B >= C then
          printf("Incorrect Values %a",[a,b]);
   else ..........
 

 

P.s when i delete the else it works but not properly.

Thank you so much for your help. I have been stuck on this for about a week i just could not find the problem.

Thank you very much

Thank you so much for your help. I have been stuck on this for about a week i just could not find the problem.

Thank you very much

Hi I'm really new to programming so i dont really know much about the layout and that but thank you for showing me the correct way.

The problem that i had still exists. I tried looking for the other roots but it just gives me the previous any soln?

Hi I'm really new to programming so i dont really know much about the layout and that but thank you for showing me the correct way.

The problem that i had still exists. I tried looking for the other roots but it just gives me the previous any soln?

thanx

help much appriciated

First 6 7 8 9 Page 8 of 9