mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-12-03, 18:59   #1959
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Hmm, that looks fine. (From your shot of the Explorer window I thought it might have been named codes.gp.txt since Notepad likes to tack that on the names of all files.)

Try this: Open a new GP session and type ?0. What do you get?
well i used notepad to change it so that's why it shows it. I see 3 files windows doesn't recognize lol. could that be part of it lol.

That's why
Code:
***   [pipe:] 'C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6 -fromgp  '@1'' failed.
pops up. gphelp isn't recognized so it can't open it.

Last fiddled with by science_man_88 on 2010-12-03 at 19:02
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:05   #1960
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

You must be typing the wrong thing because what I asked you to type doesn't use gphelp. (??gcd uses gphelp but ?0 does not.)

Here's what it look like on my Windows machine:
Code:
11:13>?0

A059389                 AKS                     Crocker
DickmanRho              FaR                     LambertW
Li                      Mfactor                 Pascals_triangle_puzzle
Psi                     R                       RLE
bad                     bases                   bestappr2
bigdiv                  bigfactor               binomialInterval
binomialIntervalEst     bisect                  check
contfracback            countPowerful           countSquarefree
countweird              dag                     deBruijnXi
diffset                 digits                  eps
findPeakedMax           findrec                 findrecd
first                   firstbig                foo
forbigprime             generalizedBinomial     go
gpf                     guess_the_number        guessnumber2
hamming                 ierfc                   initial
is                      is1                     isSPRP
isTriangular            isabundant              isprimepower
isprimitiveroot         istwo                   isweird
largestSquareFactor     latest                  lg
li                      list                    list1
lpf                     lucaslehmer             medial
oddres                  pBounds                 palindrome
piBounds                ppi                     prC
---- (type RETURN to continue) ----

prC2                    precpow2                predicate
primeZeta               primorial               quad
rad                     repeat                  res3
reverse                 rhoest                  rsp
secant_root             sopf                    star
sumdigits               sumpolyk                sumset
sunconj                 term                    test
testA064708             testA064708_1           testA064708_2
testrange               trinv                   vecgcd
veclcm                  vecprod                 vecsum
ways2                   ways3
By contrast, here's ??gcd:
Code:
14:03>??gcd
  ***   [pipe:] 'C:/Program\ Files\ (x86)/PARI/perl.exe C:/Program\ Files\ (x86)
PARI/gphelp -cu 6 -fromgp  'gcd@3'' failed.

Last fiddled with by CRGreathouse on 2010-12-03 at 19:06
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 19:06   #1961
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
You must be typing the wrong thing because what I asked you to type doesn't use gphelp. (??gcd uses gphelp but ?0 does not.)

Here's what it look like on my Windows machine:
Code:
11:13>?0

A059389                 AKS                     Crocker
DickmanRho              FaR                     LambertW
Li                      Mfactor                 Pascals_triangle_puzzle
Psi                     R                       RLE
bad                     bases                   bestappr2
bigdiv                  bigfactor               binomialInterval
binomialIntervalEst     bisect                  check
contfracback            countPowerful           countSquarefree
countweird              dag                     deBruijnXi
diffset                 digits                  eps
findPeakedMax           findrec                 findrecd
first                   firstbig                foo
forbigprime             generalizedBinomial     go
gpf                     guess_the_number        guessnumber2
hamming                 ierfc                   initial
is                      is1                     isSPRP
isTriangular            isabundant              isprimepower
isprimitiveroot         istwo                   isweird
largestSquareFactor     latest                  lg
li                      list                    list1
lpf                     lucaslehmer             medial
oddres                  pBounds                 palindrome
piBounds                ppi                     prC
---- (type RETURN to continue) ----

prC2                    precpow2                predicate
primeZeta               primorial               quad
rad                     repeat                  res3
reverse                 rhoest                  rsp
secant_root             sopf                    star
sumdigits               sumpolyk                sumset
sunconj                 term                    test
testA064708             testA064708_1           testA064708_2
testrange               trinv                   vecgcd
veclcm                  vecprod                 vecsum
ways2                   ways3
I know I'm saying now I know why when i do the help it doesn't work lol.
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:09   #1962
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I know I'm saying now I know why when i do the help it doesn't work lol.
Start a new session and do it again. I suspect what you actually typed was ??0 or ?? which are entirely different (and do go through gphelp, unlike ?0).

Last fiddled with by CRGreathouse on 2010-12-03 at 19:11
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 19:11   #1963
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Start a new session and do it again. I suspect what you actually typed was ??0 which is entirely different (and does go through gphelp, unlike ?0).
Code:
(15:10) gp > ?0


(15:10) gp > ??
  ***   [pipe:] 'C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6 -fromgp  '@1'' failed.
(15:10) gp >
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:15   #1964
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Great, so ?0 worked.

Would you post your .gprc again?
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 19:16   #1965
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Great, so ?0 worked.

Would you post your .gprc again?
Quote:
colors = "boldfg"
datadir = "C:/Program Files/PARI"
help = "C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6"
prettyprinter = "C:/Program\\ Files/PARI/perl.exe C:/Program\\ Files/PARI/tex2mail -TeX -noindent -ragged -by_par"

prompt = "(%H:%M) gp > " read "codes.gp"
that help ?

Last fiddled with by science_man_88 on 2010-12-03 at 19:17 Reason: red lines are pointless as neither final file is recognized by windows on my machine.
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:19   #1966
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
reverse(string)={
my(v=Vec(Str(string)),c="");
forstep(y=#v,1,-1,
           c=concat(c,v[y])
           );c
};
repeat(string,x)={
for(y=1,x,
       print1(string)
    );
};
guessnumber2(b)={
my(c=0,d=b,a=0);
for(x=1,b,
     for(y=1,b,
          if(a<c||a==c||a==d||a>d,
             a=random(b),
             break()
            )
          );
        print("I guess "a" am I h,l,or e ?");
        g=input();
           if(g==h,
               d=a,
               if(g==l,
                  c=a,
                  if(g==e,
                  break()
                  )
                )
             )
  );
};
palindrome(string) ={ 
my(string=eval(Vec(Str(string))));
for(x=1,ceil(#string/2),
           if(string[x]!=string[#string-(x-1)],
              break(),
              return(string)
           )
   );
};
Pascals_triangle_puzzle(topvalue=151,leftsidevalue=40,bottomvalue1=11,bottomvalue2=4) = {
y=(topvalue-(4*(bottomvalue1+bottomvalue2)))/7;
x=leftsidevalue-(y+2*bottomvalue1);
z=y-x;
print(x","y","z); 
};
pascals_triangle(N)= {
my(row=[],prevrow=[])
for(x=1,N,
    if(x>5,break(1));
         row=eval(Vec(Str(11^(x-1))));
         print(row));
         prevrow=row;
for(y=6,N,
   for(p=2,#prevrow,
         row[p]=prevrow[p-1]+prevrow[p]);
         row=concat(row,1);
         prevrow=row;
         print(row);
     );
};
RLE(string)={
my(number=1,string=eval(Vec(Str(string))),Letter=string[1]);
      for(x=2,#string,
           if(string[x]==Letter,
              number+=1,
              print1("("number")"Letter);
              Letter=string[x];
              number=1)
         );print1("("number")"Letter)
};
guess_the_number(N=10)={
 my(a=random(N));
print("guess the number between 0 and "N);
for(x=1,N,
      if(x>1,
        print("guess again")
        );
     b=input();
         if(b==a,
           break()
        )
     );
print("You guessed it correctly")
};
sumdigits(n) ={ 
if(n%9!=0,
   return(n%9),
   return(n%9+9)
   );
};
lucaslehmer(p)={ 
s=Mod(4, 2^p-1);
for(x=1,p-2,
      s=s^2-2
      );
if(s==0,1,0);
};
FaR(string_to_search,string_to_find,string_to_replace_with)={
my(s1=Vec(string_to_search),s2=Vec(string_to_find),s3=string_to_replace_with,good,c="",d="");
for(i=0,#s1-#s2,
      good=1;
         for(j=1,#s2,
                if(s2[j]!=s1[j+i],
                     good=0;
                     c=concat(c,s1[i+1]);
                    break
                    )
                );
         if(good,
            d=concat(c,s3);
            print1(d);
            c="";i=i+#s2
            )
      );
};
this is my code file.

Last fiddled with by science_man_88 on 2010-12-03 at 19:20
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:26   #1967
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
that help ?
Yes. Change it to
Code:
colors = "boldfg"
datadir = "C:/Program Files/PARI"
prompt = "(%H:%M)"
read "codes.gp"

Last fiddled with by CRGreathouse on 2010-12-03 at 19:33
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 19:28   #1968
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Yes. Change it to
Code:
colors = "boldfg"
datadir = "C:/Program Files/PARI"
help = "C:/Program Files/PARI/doc/users.pdf "
prompt = "(%H:%M)
read "codes.gp"
Code:
Reading GPRC: /cygdrive/c/Program Files/PARI/.gprc ...
  ***   expected character: '"' instead of.
...skipping line 4.
Done.

                           GP/PARI CALCULATOR Version 2.4.2 (development CHANGES-1.1971)
                             i686 running cygwin (ix86/GMP-4.2.1 kernel) 32-bit version
                   compiled: Dec 23 2007, gcc-3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
                                   (readline v5.2 enabled, extended help enabled)

                                       Copyright (C) 2000-2006 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500000
  ***   error opening input file: codes.gp
                                  ^--------
... skipping file 'codes.gp'
?

Last fiddled with by science_man_88 on 2010-12-03 at 19:28
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 19:33   #1969
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Oops, missed the closed quote. I corrected my above post.
CRGreathouse is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 22:51.


Fri Aug 6 22:51:14 UTC 2021 up 14 days, 17:20, 1 user, load averages: 3.65, 4.04, 3.89

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.