Clare So

170 Reputation

8 Badges

17 years, 259 days
Waterloo, Ontario, Canada

I was a software developer in Math and Research groups in 2007-2012.  I reviewed most of the contributions from Maplesoft's academic research labs.  In addition, I was one of the maintainers of the math library in Maple.  My involvement in Maple started in my undergraduate career when I worked at one of Maplesoft's affiliated academic research labs.

I hold BSc and MSc degrees in Computer Science from The University of Western Ontario, London, Canada.

My public LinkedIn profile: http://ca.linkedin.com/in/claremso

MaplePrimes Activity


These are answers submitted by Clare So

If you've used other debuggers (such as gdb) before, you will pick up Maple's debugger fairly quickly.

Setting up a breakpoint is done by "stopat". The list of breakpoints is printed.

> stopat(solve);
                                  [solve]

Maple's debugger should wait for your instructions when one of the breakpoints is reached. Note that DBG> prompt in the TTY interface indicates that the debugger is running. In GUI interface, the debugger runs in a new window that contains common commands.

> solve(x^2=sin(x),x);
solve:
   1*  if nargs = 0 then
         ...
       else
         ...
       end if;

DBG>

Some useful commands are "next", "step", "arg" and "cont". If you would like to examine a local variable, enter the name of the variable in the prompt. "unstopat" removes breakpoint.

Please see ?debugger and ?Interactive Maple Debugger for more information on the Maple debugger.

For examining Maple's reasoning, "infolevel" and "printlevel" are extremely useful as well.  Thanks Doug for explaining.

Hope this helps.

Lists and vectors can be sorted by "sort":

> l:=[6,2,7,2,8,3,1,10];
                       l := [6, 2, 7, 2, 8, 3, 1, 10]

> sort(l);
                          [1, 2, 2, 3, 6, 7, 8, 10]

Is the following what you are looking for?  The procedure f1's argument p is also a procedure.

> f1 := proc(p, x) return p(x): end proc:         
> f1(sin,Pi);                            
                                       0

> f1(cos,Pi);
                                      -1

> 

This is close to what you are looking for:

convert(7,base,2);

If you would like the digits in "non-reverse" order, try calling ListTools[Reverse] to the result of convert.

It is possible to use compiled code in Linux and Macs, too.  Different platforms have different naming conventions for binaries (.dll for Windows).  To have platform-independent call to define_external, you can obtain the names of the binaries using ExternalCalling[ExternalLibraryName].

You may want to have a look at XMLTools package.  XMLTools[ParseFile] and XMLTools[ParseString] reads XML into Maple's internal XML datastructure.  From there you can traverse the XML tree and extract info from it using other XMLTools' procedure.

I hope this info gets you started.

1 2 Page 2 of 2