Joe Riel

9660 Reputation

23 Badges

20 years, 15 days

MaplePrimes Activity


These are replies submitted by Joe Riel

Here is original with added jpegs.

Download 84_mayan.zip
View file details

Here is original with added jpegs.

Download 84_mayan.zip
View file details

You state that the jerk is 6G.  What is the G?  Giga?  As in giga*m/s^3? 

The "proper" pronunciation of giga is with a leading soft g (jiga), which sounds much nicer than what I usually hear. My wife gives me a hard time when I pronounce it that way.

You state that the jerk is 6G.  What is the G?  Giga?  As in giga*m/s^3? 

The "proper" pronunciation of giga is with a leading soft g (jiga), which sounds much nicer than what I usually hear. My wife gives me a hard time when I pronounce it that way.

For this case, try

tmp := [anames()]:
eval(tmp[1]); # may have to adjust index.

You might be able to use the following screwball approach (I think the actual name `:-2`)

strs := map( str -> str[1], map(convert,tmp,'string'));
member(":",strs,'pos');
showstat(tmp[pos]);

I frequently use a shell tool I wrote, mgrep, for searching and displaying the code in archives.  I thought I might have  uploaded it here, but possibly not.  It's written in awk, and uses calls to cmaple to display code, when desired. For example,

Changer := module()
local ModuleLoad;
    ModuleLoad := proc()
        lprint("goodbye, cruel world");
        assign(procname,'procname');
    end proc:
end module:

!rm /tmp/tmp.mla
LibraryTools:-Save(Changer, "/tmp/tmp.mla"):

Then, in the shell

$ mgrep -c -r . /tmp/tmp.mla
/tmp/tmp.mla:
Changer := 
                     module() local ModuleLoad;  end module

:-1 := 
proc()
    lprint("goodbye, cruel world"); assign(procname, 'procname')
end proc

I'll look into uploading it here this evening.

Another approach is to use march tools.  Use list to find the ModuleLoad, and extractfile to save it to an m-file. You can then load that file without running the procedure, and can so inspect it.

One cannot use <pre> tags to switch between a monotype and proportional font in html, so it isn't going to work here.  I hadn't realized that clicking the Source icon displays the html source; that should make it easy to fix problems.

Dang, I wish I'd thought of that title...

Are you suggesting that there should be more expression manipulation primitives?
 
In thinking about the use of multiseries (above) I was surprised to realize that there isn't a primitive for returning just some operands from an expression but keeping the form of the expression.  That is, select/remove with a range rather than a predicate to specify the operands.  In this case,since the expression is a sum,we could use add
 
p := add(k*x^((k-1)/2),k=0..8):
p_trunc := add(p[i], i=1..3);
Though unnatural, I've frequently wanted the list selection operator to work here, that is, do p[1..3].
 
Are you suggesting that there should be more expression manipulation primitives?
 
In thinking about the use of multiseries (above) I was surprised to realize that there isn't a primitive for returning just some operands from an expression but keeping the form of the expression.  That is, select/remove with a range rather than a predicate to specify the operands.  In this case,since the expression is a sum,we could use add
 
p := add(k*x^((k-1)/2),k=0..8):
p_trunc := add(p[i], i=1..3);
Though unnatural, I've frequently wanted the list selection operator to work here, that is, do p[1..3].
 

Nice reference, thanks.  My objection wasn't so much on the short-circuiting (which Maple's fold operators lack and is significant here) but rather that Maple's andmap applies a predicate to each operand, a predicate that doesn't exist in the procedure you gave.  Maybe I'm being too literal.  I see the connection, it is just a bit more tenuous than your original comment suggests.  What it really gets you is andmap with the identity, if that makes any sense.

Huh?  That isn't even close to being correct.  Did you have some other andmap besides the one in Maple in mind?

Not sure what you mean.  Could you elaborate?  Do you mean, why are `and` and `or` strictly binary functions:

`and`(true,true,false);
Error, invalid input: and expects 2 arguments, but received 3

I suspect it is a historical accident.  Note, however, that the and/or inline operators are not actually associative, unlike + and *, that is

dismantle(x and y and z)
AND(3)
   AND(3)
      NAME(4): x
      NAME(4): y
   NAME(4): z

Presumably this led to the difference.

I don't use match much, but couldn't think of a simpler way to do this. I'm surprised that there isn't a more general degree function, one that works on non-polynomials and non-integral powers. Maybe I'm overlooking something.

First 152 153 154 155 156 157 158 Last Page 154 of 195