mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-12-02, 23:33   #1948
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I stupidly recycled it lmao.
Well, now you know what it does. You can also look inside it to see what else it can do.
CRGreathouse is offline   Reply With Quote
Old 2010-12-02, 23:48   #1949
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
Well, now you know what it does. You can also look inside it to see what else it can do.
now I have a way to tell if i'm an idiot oh wait this forum already has a way wonder if i can code it lol, just joking.
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 01:05   #1950
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

I have started to recollect codes I tried here and I made a .gp file and got gp reading it.

but:

Code:
(21:02) gp > FaR("I hate you Alex","Alex","loser")
  ***   not a function: `FaR'.
even though(codes.gp):

Code:
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
            )
      );
}
I uploaded as a text because a .gp isn't allowed lol
Attached Files
File Type: txt codes.txt (2.6 KB, 57 views)

Last fiddled with by science_man_88 on 2010-12-03 at 01:11
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 16:17   #1951
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

You probably aren't reading in the right file, then.

If you have a file like this with all the functions you normally use, I strongly recommend reading it from your .gprc file so
1. You don't need to type the command to read it in each session
2. If you make changes to the file and want to read in those changes, you can just type "\r" instead of "\r filename.gp" since it already has the proper file loaded in the 'last file used' internal string.
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 16:30   #1952
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

first file
Attached Thumbnails
Click image for larger version

Name:	codesgp.jpg
Views:	60
Size:	24.4 KB
ID:	5940  
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 16:31   #1953
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

second file
Attached Thumbnails
Click image for larger version

Name:	path.jpg
Views:	56
Size:	88.5 KB
ID:	5941  
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 16:45   #1954
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

I must have the read set up wrong because I can paste the function in and I'm not given (c)-> stuff to show it's entered but then i can use it but if I don't I don't get it to work.
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 17:44   #1955
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Let's try something first. Can you go to the command prompt for me? (Start, Run, then type cmd and press Enter.) Once there, type

Code:
cd "C:\Program Files\PARI"
dir codes.*
Tell me what shows up.

Last fiddled with by CRGreathouse on 2010-12-03 at 17:46
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 18:23   #1956
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
Let's try something first. Can you go to the command prompt for me? (Start, Run, then type cmd and press Enter.) Once there, type

Code:
cd "C:\Program Files\PARI"
dir codes.*
Tell me what shows up.
Code:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\flec>cd "C:\Program Files\PARI"

C:\Program Files\PARI>dir codes.*
 Volume in drive C has no label.
 Volume Serial Number is 684A-E086

 Directory of C:\Program Files\PARI

12/03/2010  01:42 PM             2,670 codes.gp
               1 File(s)          2,670 bytes
               0 Dir(s)  210,214,907,904 bytes free

C:\Program Files\PARI>

Last fiddled with by science_man_88 on 2010-12-03 at 18:32
science_man_88 is offline   Reply With Quote
Old 2010-12-03, 18:43   #1957
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

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?
CRGreathouse is offline   Reply With Quote
Old 2010-12-03, 18:48   #1958
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?
nothing I also can't get rid of a drive I don't know how it came to be but I can virus scan it any way to get rid of it ? I supposedly don't have the permission to do anything but virus scan.
science_man_88 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.