Gary Palmer

79 Reputation

11 Badges

14 years, 2 days

 

 

 

Mac w OS X, 10.4.6, 3.06 GHz Intel Duo with 4GB RAM, Maple14 Student

MaplePrimes Activity


These are replies submitted by Gary Palmer

I see that a year ago you were using JavaViewLib on OS X with Maple 13. I would like to try using it with Maple 14, but I haven't been able to get it to work in spite of exporting a path to the folder in .bash_profile. Can you reconstruct the installation process? Do I have to run an initialization file?

I have this in an .mw file:

restart:

myPath := "Users/gary/bin":

libname := (libname, myPath):

with(JavaViewLib):

The JavaViewLib folder has permission rwx, but I get this error message:

"Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received JavaViewLib"

 

Specifying the full path to Java view in libname ("/Users/gary/bin/JavaViewLib/bin/") and writing "with(javaview)" produced the same kind of error:

 

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received javaview

 

It did load one time, but I don't remember doing anything differently and I can't reproduce it.

Mac w OS X, 10.4.6, 3.06 GHz Intel Duo with 4GB RAM, Maple14 Student

@Alejandro Jakubi 

 

I noticed a couple of those little intrusions of semicolons and NULL before I tried to execute it, but I didn't take the time to investigate their source. Thanks.

@Alejandro Jakubi 

 

I noticed a couple of those little intrusions of semicolons and NULL before I tried to execute it, but I didn't take the time to investigate their source. Thanks.

@Gary Palmer 

I found that I could save a 2D program as Maple Input and open it in BBEdit, so the Maple Input (mpl) format seems to be an ordinary text file. I added a shebang line pointing to /usr/bin/maple and it executed in the console. I'm slow, but I'm learning.

@Gary Palmer 

I found that I could save a 2D program as Maple Input and open it in BBEdit, so the Maple Input (mpl) format seems to be an ordinary text file. I added a shebang line pointing to /usr/bin/maple and it executed in the console. I'm slow, but I'm learning.

I followed the links. It's true that I could accomplish the reorganization by reading and writing files to disk, and I am doing some of that, both with libraries of procedures and with data from Exel files, but the question is,

How does one write the input and output procedures in maple programs so they function in pipes with other scripting languages such as ruby? The sample script pipemaple.sh should read one line from the output of ls.

A secondary question is, why is the syntax of my sample script, receive.mpl, breaking? if I run the "receive.mpl" script  from within BBEdit, it does not show a syntax error (but it doesn't get STDIN, either), but it breaks in the Terminal (console).

 

Mac w OS X, 10.4.6, 3.06 GHz Intel Duo with 4GB RAM, Maple14 Student

I followed the links. It's true that I could accomplish the reorganization by reading and writing files to disk, and I am doing some of that, both with libraries of procedures and with data from Exel files, but the question is,

How does one write the input and output procedures in maple programs so they function in pipes with other scripting languages such as ruby? The sample script pipemaple.sh should read one line from the output of ls.

A secondary question is, why is the syntax of my sample script, receive.mpl, breaking? if I run the "receive.mpl" script  from within BBEdit, it does not show a syntax error (but it doesn't get STDIN, either), but it breaks in the Terminal (console).

 

Mac w OS X, 10.4.6, 3.06 GHz Intel Duo with 4GB RAM, Maple14 Student

@Gary Palmer 

 

I said in a previous message that I would report back, so I am doing so now, in a way, by posting a new question regardng how to read standard input in a pipe.  The location of the question is:

http://www.mapleprimes.com/questions/123516-How-Read-From-Standard-Input-In-Pipe

@Gary Palmer 

 

I said in a previous message that I would report back, so I am doing so now, in a way, by posting a new question regardng how to read standard input in a pipe.  The location of the question is:

http://www.mapleprimes.com/questions/123516-How-Read-From-Standard-Input-In-Pipe

 

Should be N := 5 with assignment symbol rather than "=". But why not return all instances if there are repeats?

 

restart;

a := [11, 12, 13, 14, 15, 13, 16];

locate := proc (list, target)
local b, i;
description "Linear search for target element in list";
i := 0;
b := [];
for i to nops(list) do
if list[i] = target then
b := [op(b), i]
end if;
end do; 
b;
end proc;
locate(a, 13); [3, 6]

 

 

Mac w OS X, 10.4.6, 3.06 GHz Intel Duo with 4GB RAM, Maple14 Student

@Alejandro Jakubi 

 

Very interesting findings and comment. Since posting the script, I noticed that the procedure

ptPlotsG := proc (thePts, col, symb, symbsz, transp) options operator, arrow; 
[seq(point(thePts[i], color = col(i, 'Nθ'), symbolsize = symbsz, transparency = transp),
i = 1 .. nops(thePts))] end proc

should have been

ptPlotsG := proc (thePts, col, symb, symbsz, transp) options operator, arrow; 
[seq(point(thePts[i], color = col(i, nops(thePts)), symbolsize = symbsz, transparency = transp),
i = 1 .. nops(thePts))] end proc

This is just a fairly subtle aesthetic change. Sending nops(thePts) to the col(i, n) function in place of the global 'Nθ' gives a better spectrum of colors.

@Alejandro Jakubi 

 

Very interesting findings and comment. Since posting the script, I noticed that the procedure

ptPlotsG := proc (thePts, col, symb, symbsz, transp) options operator, arrow; 
[seq(point(thePts[i], color = col(i, 'Nθ'), symbolsize = symbsz, transparency = transp),
i = 1 .. nops(thePts))] end proc

should have been

ptPlotsG := proc (thePts, col, symb, symbsz, transp) options operator, arrow; 
[seq(point(thePts[i], color = col(i, nops(thePts)), symbolsize = symbsz, transparency = transp),
i = 1 .. nops(thePts))] end proc

This is just a fairly subtle aesthetic change. Sending nops(thePts) to the col(i, n) function in place of the global 'Nθ' gives a better spectrum of colors.

This is the script that didn't work with plotsetup(maplet) inserted prior to the call of animation. It was first saved as Maple input and cleaned up, so it's possible that a bug was introduced in that way.

milky_way.mw

 

 

 

This is the script that didn't work with plotsetup(maplet) inserted prior to the call of animation. It was first saved as Maple input and cleaned up, so it's possible that a bug was introduced in that way.

milky_way.mw

 

 

 

@Gary Palmer 
I will follow this with the script. I am hoping it will be accessible to members. One second equals approximately 250 million years, so perhaps I will learn to slow it down a little bit.

 

1 2 3 4 Page 1 of 4