acer

32632 Reputation

29 Badges

20 years, 47 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Doug, do you mean the ability to insert such a Button programmatically?

In general, there is no functionality at present to insert any kind of Component programmatically, for any purpose, AFAIK. There would be a great deal of usefulness to such functionality, and I believe that it's been discussed here before.

But you should be able to insert a Button Component "by hand" (using the mouse pointer and palette) and then edit the "Action when Clicked" to issue read "foo.maplet". You likely already realize this. Redirecting results returned by the Maplet would be more work, of course.

What happens on Windows if you File->Open a foo.maplet file? On Linux, where there is no MapletViewer, it simpply inserts the file's contents.  On Windows, can you Open or Launch from the File menu?  The File->Open manager does allow filtering by .maplet filename extension.

If there were a way to get a context-sentive menu action to run a Maplet (and behave nicely when returning NULL) when right-clicking on the "empty region" (where the cursor lies), then one could write code to automatically add reading file foo.maplet to the context-menus. I haven't really tried this. I've had difficulty getting a context-menu action to %CANCEL and insert nothing (not even NULL) after launching say a Worksheet/Help.

acer

Doug, do you mean the ability to insert such a Button programmatically?

In general, there is no functionality at present to insert any kind of Component programmatically, for any purpose, AFAIK. There would be a great deal of usefulness to such functionality, and I believe that it's been discussed here before.

But you should be able to insert a Button Component "by hand" (using the mouse pointer and palette) and then edit the "Action when Clicked" to issue read "foo.maplet". You likely already realize this. Redirecting results returned by the Maplet would be more work, of course.

What happens on Windows if you File->Open a foo.maplet file? On Linux, where there is no MapletViewer, it simpply inserts the file's contents.  On Windows, can you Open or Launch from the File menu?  The File->Open manager does allow filtering by .maplet filename extension.

If there were a way to get a context-sentive menu action to run a Maplet (and behave nicely when returning NULL) when right-clicking on the "empty region" (where the cursor lies), then one could write code to automatically add reading file foo.maplet to the context-menus. I haven't really tried this. I've had difficulty getting a context-menu action to %CANCEL and insert nothing (not even NULL) after launching say a Worksheet/Help.

acer

I doubt that you'd want "all" possible computations done modulo 26. There's a lot more to "all" than you might at first imagine.

Maybe you mean interactive arithmetic, or something like that. You should be able to extend this simplistic example code below to cover other arithmetic operators (as described in the ?mod help-page).

> modenv := module() export `+`,`-`,use_p;
>    option package;
>    local p;
>    use_p := proc(x::posint) p:=x; end proc;
>    `+` := proc(a,b) (a+b) mod p; end proc;
>    `-` := proc(a) :-`-`(a) mod p; end proc;
> end module:

> with(modenv):
> use_p(26):

> 7+24;
                                       5
 
> -24;
                                       2
 
> 3-24;
                                       5

There may well be some tricky syntax corners, possibly where the global operators like :-`+` would still be wanted.

acer

I doubt that you'd want "all" possible computations done modulo 26. There's a lot more to "all" than you might at first imagine.

Maybe you mean interactive arithmetic, or something like that. You should be able to extend this simplistic example code below to cover other arithmetic operators (as described in the ?mod help-page).

> modenv := module() export `+`,`-`,use_p;
>    option package;
>    local p;
>    use_p := proc(x::posint) p:=x; end proc;
>    `+` := proc(a,b) (a+b) mod p; end proc;
>    `-` := proc(a) :-`-`(a) mod p; end proc;
> end module:

> with(modenv):
> use_p(26):

> 7+24;
                                       5
 
> -24;
                                       2
 
> 3-24;
                                       5

There may well be some tricky syntax corners, possibly where the global operators like :-`+` would still be wanted.

acer

One calls CurveFitting:-Spline in order to get a continuous piecewise object. The continuous nature of the resulting piecewise object is not (currently) retained knowledge, and so the burden lies on the user to pass that on (as an option to int, say).

But what if CurveFitting:-Spline were to place 'continuous' as an attribute on the returned piecewise object. If that were so, then int or discont or evalf/Int might detect it and benefit.

That could take the burden off of the user to pass along the knowledge. It would be cheaper than having discont try and discover continuity, even if it did so by cleverly examining the conditions for overlap/touching and checking matched evaluated values.

acer

One calls CurveFitting:-Spline in order to get a continuous piecewise object. The continuous nature of the resulting piecewise object is not (currently) retained knowledge, and so the burden lies on the user to pass that on (as an option to int, say).

But what if CurveFitting:-Spline were to place 'continuous' as an attribute on the returned piecewise object. If that were so, then int or discont or evalf/Int might detect it and benefit.

That could take the burden off of the user to pass along the knowledge. It would be cheaper than having discont try and discover continuity, even if it did so by cleverly examining the conditions for overlap/touching and checking matched evaluated values.

acer

He might even mean that he pressed (entered) the <Return> or <Enter> key in the block that defined the proc. Right, that would be the moment when a quote-mismatch error message would get displayed.

acer

He might even mean that he pressed (entered) the <Return> or <Enter> key in the block that defined the proc. Right, that would be the moment when a quote-mismatch error message would get displayed.

acer

The leaf of the acer palmatum (irohamomiji) could inspire a refreshing change for a new logo for Maple.

The leaf of the acer palmatum (irohamomiji) could inspire a refreshing change for a new logo for Maple.

This comes up repeatedly. There have been earlier threads addressing it, here and here say.

I am not completely satisfied with Doug's suggestion above, where MyCos(50) would return the global cos(50) since that result would get interpreted in terms of radians if subsequently evalf'd.

It might be useful if someone with sufficient expertise could roll together a package that did as much as can be currently accomplished (filling in for all trig and inverse trig where possible, giving desirable output in both 1D and 2D even when returning unevaluated, etc, etc). Basically, a citable "final word" with current mechanisms. Such a package could be based on the best techniques already suggested in the related subthreads.

Accompanying such a package might be notes explaining that the package is for "interactive" use and is not a modal switch for all of Maple; trig calls returned from other Library routines would still be in terms of radians. Any other currently unresolvable issues could be noted.

Of course, Doug's comments about learning about and using radians -- as a recommended course of action -- might still apply.

acer

I advise not using Units[Natural]. Too many symbols are taken to be units, so that environment has practically no single-character symbols left for general use.

In your example, you probably intended `t` to be a free variable, while `deg` stood for Unit(degree). But under Units[Natural], `t` means tonne.

> with(Units[Natural]):

> t+kg;
                                   1001 [kg]

And that's why the exported `sin` routine choked, because it thought it was getting tonne*degree and not `t`*degree.

In the following solutions, _Z1 means "any integer".

> solve(sin(x*Pi/180)=0,AllSolutions);
                                   180 _Z1~

> restart:
> with(Units[Standard]):
> solve(sin(x*Unit(deg))=0,AllSolutions);
                                   180 _Z1~

> restart:
> with(Units[Natural]):
> solve(sin(tt*deg)=0,AllSolutions);
                                   180 _Z1~

acer

I advise not using Units[Natural]. Too many symbols are taken to be units, so that environment has practically no single-character symbols left for general use.

In your example, you probably intended `t` to be a free variable, while `deg` stood for Unit(degree). But under Units[Natural], `t` means tonne.

> with(Units[Natural]):

> t+kg;
                                   1001 [kg]

And that's why the exported `sin` routine choked, because it thought it was getting tonne*degree and not `t`*degree.

In the following solutions, _Z1 means "any integer".

> solve(sin(x*Pi/180)=0,AllSolutions);
                                   180 _Z1~

> restart:
> with(Units[Standard]):
> solve(sin(x*Unit(deg))=0,AllSolutions);
                                   180 _Z1~

> restart:
> with(Units[Natural]):
> solve(sin(tt*deg)=0,AllSolutions);
                                   180 _Z1~

acer

"Changing" a list to a set is a very different sort of operation. It is a (generally non-reversible) change in not only data-structure but in the data itself (ie. uniquification and re-ordering).

Changing an rtable from one form to another (Vector[row] to Vector[column], or Matrix to/from Array, or other more exotic changes) can be considered as quite different. It can preserve the underlying data (stored in a contiguous rectangular array of memory) and merely alter the named structure which controls how elements are accessed. In what sense do the associated types then match "static" in the sense cited?

acer

You appear to have misunderstood my meaning.

I meant that 'Matrix' did not appear to fully fit how you described a static type. The gist was not that `.` behaves differently, but that something of type 'Matrix' could be changed to be something of type 'Array'.

acer

First 483 484 485 486 487 488 489 Last Page 485 of 597