Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 322 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@maplefan123 To put some lines of text at the top of the file, use an fprintf command such as below immediately before the while:

fprintf(
    fp,
    "This is\n5 lines\nof text\nfor the top\nof the file.\n\n"
);

@Preben Alsholm The expressions can be greatly simplified with two further assumptions: 0 < d1, d5 < L.

@Carl Love I tested Answer 1, the value method, and it works. I didn't test Answer 2 because Answer 1 is much easier to implement anyway: After the dsolve command, just do value(%).

@vv Your formula treats (6, -3) as the focus of the parabola, not as its vertex.

@vv In my opinion, using HFloat to wrap the target being searched for is by far the best of the given Answers, but the OP seems to be ignoring your Answer. The other Answers--converting to rationals or using software floats--incur a substantial performance penalty.

@Ali Guzel In brief, you should do this:

numboccur(x2[1], HFloat(0.))

This is because Sample returns an array of hardware floats. Hardware floats are not exact matches to their software-float counterparts. That's what you're missing.

@Preben Alsholm You are passing arguments to numboccur in the wrong order; the first argument should be the container, and the second argument the item being counted.

I'd like to elaborate on what Mac Dude said is his P.S. The fact that a help page says that a command is intended for arguments of a certain type can't be used to infer that it won't also work for some arguments not of that type. I think that your type command returning false can be taken as definitive proof that the object is not type series.

The special parameter _rest can be used to "pass along" optional arguments without a procedure knowing what those arguments are or even whether they're present at all. I find this very useful for any procedure whose output is a plot.

waterfall:= proc(
    data::list(numeric),
    {colors::And(list({name, function, string}), 2 &under nops):= 
        ["green", "red"]
    }
)
uses P= plots, PT= plottools;
local d:= [0, data[]], c:= colors[(sign~(d[..-2] -~ d[2..]) +~ 3)/~2];
    d:= `[]`~([$0..nops(data)], d);
    P:-display(PT:-rectangle~(d[..-2], d[2..], ':-color'=~ c), _rest)
end proc
:
data := [6, 4, 4, 4, 7, 9, 12, 16, 25, 100, 105, 95, 90, 55, 45, 30]:
waterfall(data, colors= [purple, yellow], axes= boxed);

First, let's make sure that I've correctly guessed the package structure. You have a package that you didn't give a name to. I'll call it P. Are and both exports of P? Is a module with a ModuleApply procedure?

Can you write in such a way that it doesn't use any of P's module locals?

Is there a close relationship between a graph's crossing number and the least complicated surface (such as a torus) on which the graph can be embedded?

If you'd like, I could mark your account as a "spammer", which would delete (but not totally purge) everything related to your account (including this thread) and block the account's ability to make any future posts (thus, it'd be nearly impossible for a hacker to hijack the account and post in your name). I am by no means suggesting that you are a spammer! I only mention the possibility because it's something that I have the power to do. It'd only take about 20 seconds on my part, and you wouldn't need to do anything. So, if you'd like for me to do that, let me know.

@Christian Wolinski 

Your T is reminiscent to me of constructing a *sub*basis (rather than a basis) for a topology S.

[The next few definitions may already be familiar to you. If so, I include them for the benefit of other readers.] Let X be a set, and let S be a subset of the powerset of X containing at least the empty set and X itself. (For convenience, we define an intersection with zero operands to be X, which conforms with the usual rule that an associative operator applied to zero operands equals the identity for that operator.)

1. Definition of topology: Suppose that S contains (as elements) 1.1) all pairwise intersections of its elements and 1.2) all unions (not necessarily pairwise) of its subsets. Then S is called a topology on X and the elements of S are called the open sets. Note that 1.1 implies that S contains all intersections of its finite subsets.

2. Definition of basis (base is also commonly used) of a topology: Let S be a topology on X. Let B be a subset of S such every element of S (i.e., every open set of X) is a union of a subset of B. Then B is called a basis for S.

3. Definition of subbasis (or subbase) of a topology: Let S be a topology on X and let C be a subset of S such that every element of S is a union (not necessarily of a finite number of opetands) of intersections of finite subsets of C. Then C is called a subbasis for S.

Quick examples (that should be familiar to almost all readers): Let R be the real numbers. Let's declare a subset A of R to be open if for all x in A there is a d > 0 such that the open interval (x-d, x+d) is a subset of A. Then the set of all such A is a topology on R (indeed it's the standard topology). The set of all open intervals is a basis for that topology. The set of all open intervals that are unbounded at one end is a subbasis for that topology. (These things require some proof, which is essy, the subbasis part being trivial once the topology and basis are verified).

A place where this analogy between topology and your S and T breaks down is that the elements of a topological subbasis are not necessarily pairwise disjoint. However, it may be worthwhile to restrict your attention to cases where the union of S (in other words, X) is finite. 

@ehorta As far as I know, there is no mechanism for completely deleting an account. Whatever you did yesterday was sufficient to delete the personal info that you just mentioned. All that remains is the name "ehorta", the date that you joined, and (I guess) a password (not that I can see that part).

The only data associated to your account that I can see is the Question above. It looks like you've never posted anything else. Since you haven't acquired any reputation points, you don't even appear in the Users list.

Are you implying (and it may well be true, I don't know) that given S there is a unique satisfying those conditions?

First 113 114 115 116 117 118 119 Last Page 115 of 708