Joe Riel

9660 Reputation

23 Badges

20 years, 20 days

MaplePrimes Activity


These are replies submitted by Joe Riel

Hmm, bad news.  I use Gnu-Emacs (not Xemacs) and wrote it for that.  That's not to say it cannot be made to work with Xemacs, but probably not out of the box (its been several years since I've tried it with Xemacs).

Hmm, bad news.  I use Gnu-Emacs (not Xemacs) and wrote it for that.  That's not to say it cannot be made to work with Xemacs, but probably not out of the box (its been several years since I've tried it with Xemacs).

Nice. A suggestion.  Be sure to declare x as local, otherwise this fails  with [f(x)]. From the ?seq help page:

 Note: The index variable i is NOT private to the seq invocation. It is
  recommended that you always explicitly declare the index variable to be
  local inside procedures.

Nice. A suggestion.  Be sure to declare x as local, otherwise this fails  with [f(x)]. From the ?seq help page:

 Note: The index variable i is NOT private to the seq invocation. It is
  recommended that you always explicitly declare the index variable to be
  local inside procedures.

Be sure to use shift-return in the code region (and return at the end of regions).

first line of code <shift return>
second line of code <shift return>
last line of code <return>

Regular text.  Now I select the code, and select formatted. There is some flaky behaviour when adding lines later, but that seems to work well.

Be sure to use shift-return in the code region (and return at the end of regions).

first line of code <shift return>
second line of code <shift return>
last line of code <return>

Regular text.  Now I select the code, and select formatted. There is some flaky behaviour when adding lines later, but that seems to work well.

An example would be helpful.  Can you upload a worksheet that exhibits the problem.

Well, I see his point. By hand I might write

  (100.3)(1.05)^n,  100.3(1.05)^n, 100.3(1.05^n), or 100.3*1.05^n,

but not

  100.3 1.05^n

You might try using the GraphTheory package.  It replaces networks and is being actively developed.  Offhand I do not know whether it allows you to change the directed edge presentation.

You might try using the GraphTheory package.  It replaces networks and is being actively developed.  Offhand I do not know whether it allows you to change the directed edge presentation.

Why would you want parentheses?  3^n seems nicer than (3)^n.

That is not quite correct.  You want to use right quote (forward quotes), not back quotes (left quotes).  That is, do

  x := 'x';

Right quotes delay evaluation of an expression, so the rhs of the assignment evaluates to the name rather than its assigned value.

Left quotes are used to express symbols that contain special characters, that is, that not in the expanded alphanumeric set.  They have no effect on evaluation, and no effect on a symbol that do not otherwise need them.  So `x` is equivalent to x.

That is not quite correct.  You want to use right quote (forward quotes), not back quotes (left quotes).  That is, do

  x := 'x';

Right quotes delay evaluation of an expression, so the rhs of the assignment evaluates to the name rather than its assigned value.

Left quotes are used to express symbols that contain special characters, that is, that not in the expanded alphanumeric set.  They have no effect on evaluation, and no effect on a symbol that do not otherwise need them.  So `x` is equivalent to x.

I see my implementation was flawed.  Because the list is specified to have unique elements, and b[1,1]+1=b[1,2], you do not need to call MakeUnique. Instead just NULL (delete) the element at either index:

replace2 := proc(b)
local i,c;
    i := b[1,1];
    c := subsop(1=NULL, i+1=NULL, b); # a bit tricky...
    subsop(i=max(c)+1, c);
end proc:

Note the double nulling in the assignment to c.  While I haven't measured it, it should be slightly more efficient than the equivalent

  c := subsop(i=NULL, b[2..-1]);

The above is less efficient because b[2..-1] requires Maple to construct that intermediate list. In the above procedure that construction is avoided. Note that unlike subs, the operation of subsop on sequential substitutions is simultaneous.  With subs one would group the substitutions in a list or set to make the operation simultaneous.

I see my implementation was flawed.  Because the list is specified to have unique elements, and b[1,1]+1=b[1,2], you do not need to call MakeUnique. Instead just NULL (delete) the element at either index:

replace2 := proc(b)
local i,c;
    i := b[1,1];
    c := subsop(1=NULL, i+1=NULL, b); # a bit tricky...
    subsop(i=max(c)+1, c);
end proc:

Note the double nulling in the assignment to c.  While I haven't measured it, it should be slightly more efficient than the equivalent

  c := subsop(i=NULL, b[2..-1]);

The above is less efficient because b[2..-1] requires Maple to construct that intermediate list. In the above procedure that construction is avoided. Note that unlike subs, the operation of subsop on sequential substitutions is simultaneous.  With subs one would group the substitutions in a list or set to make the operation simultaneous.

First 120 121 122 123 124 125 126 Last Page 122 of 195