Joe Riel

9660 Reputation

23 Badges

20 years, 1 days

MaplePrimes Activity


These are replies submitted by Joe Riel

There is, so for as I can tell, no consensus on the use of the terms "parameter" and "argument" in this context. Some documentation use the terms interchangeably. When I think about it, I generally use "argument" to mean "actual parameter", however, when clarity matters I'll use the two-word phrases.
A matrix is specialization of an array, which is a specialization of a table. The matrix data structure has been superceded by the Matrix data structure (which is a specialization of the Array data structure, which supercedes array). Tables (tables) have not been superceded. They allow you to use almost anything as an index. Unlike Arrays (and Matrices) they grow as elements are added to them. You can use the indices and entries procedures to extract all the indices or elements of a table.
It's not clear what you are asking for. A procedure that returns a table? Or do you want to display a sequence of function calls in a table? Or just as a tabular listing? I'm thinking the latter is what you want. In that case, you could use printf or one of its cousins (see ?printf). For example,
for x to 10 do
  printf("%3d %10.00f\n", x, f(x))
od:
Look under the flags section in the description of printf for the explanation of the optional field flag (the number after the %).
The double colon, `::', is the type declaration operator. It is used to declare the type of a formal parameter, a procedure output, or a variable. For example, in the procedure
squareroot := proc(x::integer) :: float;
local tmp::float;
    tmp := evalf(x);
    sqrt(tmp)
end proc
The formal parameter x is declared to be an integer, the return value of the procedure is declared to be a float, as is the local variable tmp. Maple doesn't require one to type its variables, however, doing so can help eliminate simple errors (the example doesn't illustrate that). Note that the Maple doesn't check the type of the return value unless kernelopts(assertleve) is set to 2 or greater. The [usually] binary `:-' operator is for member selection from a module. The left parameter is the module name, the right parameter a module export. See ?module,export for a description of its use.
I agree that a brute-force recursive solution is overkill, but I enjoyed writing the program more than I'd enjoy solving the puzzle. The idea of limiting the recursion depth is clever. The PDF was generated with noweb (the site is down right now); a literate programming tool. Norm Ramsey wrote noweb; it is simpler than Knuth's Web tools and can be used with almost any language. I've written some enhancements to the noweb.sty file used to typeset the generated LaTeX and have also created a maple specific awk filter for automatically indexing the file. If you're interested in any of this, contact me. I'll write a description in a blog at some point.
I tried the same with firefox (1.0.4) on linux; it doesn't mention anything about a compressed folder. Clicking on view in xpdf opened the pdf.
Let a player have abilities x1, x2, ... xn. Use the monte carlo simulation to estimate the 9n partial derivatives of S (total score) with respect to xk for each of the 9 positions in the lineup. Now, for each player, compute their scoring ability at each position (just plug abilities into the linear sum). You now have a 9x9 matrix of scoring ability for each player by position in lineup. Testing each permutation, 9!=360K, can be done quick enough; it's not clear to me whether dynamic programming can be used here.
You can enable/disable some of the sidebar info (if that is what you were referring to) by changing the settings in the "block configuration" section of your "my account".
I suspect it will be rendered badly in the sidebars (the tags appear). Besides the poor rendering in the sidebars, the tags use up limited title length. Considering that, so far as I can tell, no one has intentionally used font effects in their titles, it would seem more useful to allow < and > characters in the title. Another nasty bug is that an unterminated tag in a response is not localized to that response, it effects responses lower in the page and both sidebars. To see this, I will enter an unterminated <em> tag here: Moderator Edit: In order to restore the site, I have placed the closing <em> tag in this comment. Originator Poster: Thanks, moderator. I apologize for leaving the open tag---probably wasn't a smart idea though it effectively demonstrated the issue. If it isn't practical to localize the effect, is there a way to reject, with an appropriate warning, posts that contain such open tags?
I entered that as "here's an example of lowercase converted to uppercase". In the sidebars it shows up as lowercase, but in the main viewing area, the subject line is in Subject Case.
Thanks for the suggestion. By using Maple10's optional parameter syntax, you can simplify the procedure somewhat. Also, it's a good idea to add "copyright" to the option field so that it behaves like a normal copyrighted procedure (only displayes skeleton when printed unless interface(verboseproc) is 2 or greater). Here's my minor alteration:
MakeIntervalType := proc(N::symbol, R::range
                         ,LoEnd::{identical(open),identical(closed)} := closed
                         ,HiEnd::{identical(open),identical(closed)} := closed
                        )
local Hi, Lo, t, Test, Test1, Test2;
description "Creates a user-defined Maple type for an interval - finite or infinite, open or closed";
options `Copyright (c) Douglas B. Meade, Univ. of South Carolina, August 2005`;
    Lo,Hi := op(R);
    Test1 := `if`(LoEnd=':-closed', t >= Lo, t > Lo);
    Test2 := `if`(HiEnd=':-closed', t <= Hi, t < Hi);
    Test := unapply( Test1 and Test2, t );
    TypeTools:-AddType(N, Test)
end proc:

I agree, having the <code> tag act as verbatim would be the best. Also, do we really need to allow html tags in the titles (subject line)? I originally typed <code> in the subject line, but it was not visible when previewed. When entered as <code> it is not properly rendered in the summary text in the side bars. And why are some subject lines rendered in "Subject Case", i.e., initial letters that were input as lower case get capitalized? This doesn't always happen, possibly it depends on whether I am replying to a comment or not.

You should probably consider adding slugging percentage to the mix; three hits to score a run seems like a lot. It is unfortunate (or not) that the usual baseball statistics (on-base percentage, batting average, slugging percentage) do not suffice. However, if you also keep track of walks and sacrifices you can then make a simple monte-carlo simulator that might be a reasonable approximation. That is, evaluate a uniform random variable to determine whether each batter (depending on statistics) walks, hits (for so many bases), sacrifices or wastes an out. Then keep track of total bases and outs. When bases greater than 4, increment the runs, etc...
Something like `∂□`, for instance (not that I'd use that particular combo). I can create it using maple input, but not using 2D input with Ctrl-space completion. I cannot tell whether that is a limitation of the 2D mode, or just my incompetence in dealing with it.
Something like `∂□`, for instance (not that I'd use that particular combo). I can create it using maple input, but not using 2D input with Ctrl-space completion. I cannot tell whether that is a limitation of the 2D mode, or just my incompetence in dealing with it.
First 191 192 193 194 195 Page 193 of 195