Building a Set

I recently discovered a minor variation on the technique of building a set using a table. The purpose for using a table rather than inserting new items directly into a set is that, in a loop, the latter technique is O(n2) rather than O(n).  The way I would normally do this is to assign a counter and an empty table, and then, in a loop, compute the new element, increment the counter, and insert the element into the table at the counter index.  For example,

Will's picture

Mandelbrot Set Music Video

It's not often that a funny music video is made about Fractals. Here is something very special:

Filename generator

Ever wondered how you can create filenames by cycle.

Well, I did, because I needed it. And I came up with something that works and because once i forgot it, I decided this time to put it here. At least, I won't forget again :) If you have a better way to do it, please, say so.

The idea:

>A:=`/home/Data/file_`; B:=`.txt`;

>for i from 1 to 3 do C:=cat(A,i,B); writedata(`C`,[i],integer);od;

Tim Vrablik's picture

Maple Mentor Award Winner for June

Hard to believe it's that time already...we are pleased to announce that the winner of the monthly Maple Mentors Award for June is Mario Lemelin (aka lemelin) .  Mario will receive a prize of his choice to thank him for his involvement with the MaplePrimes community.

Congratulations...and keep on posting!

 

8337_MSim Logo.jpgWe are happy to announce the latest product to the Maple line of software.  MapleSim is a high-performance multi-domain modeling and simulation tool which will revolutionize how you bring products to market.

We are going to show a roundabout but rather effective method of solving some rather complicated (definite) integrals in closed-form via a rather unusual method: a special factorization of linear ODEs.  The example we will use is a 2 week old question that has yet to get an answer.

First, the problem: compute the integral

alec's picture

Lexical Table

In the recent discussion about patching, a question about patching a function f including local variables of a module or another function was discussed. For example, let it be defined as

A:=proc() global f,t; local x,y,z;
f:=()->x+y();
y:=()->z;
t:=()->x+z;
x,z:=0,1;
NULL end:
A();

Now,

op(f);
                            () -> x + y()
f();
                                  1

How to change it so that it would return 2 instead of 1, without reassigning it?

alec's picture

Maple Wiki

Everybody is invited to Maple Wiki .

It is hosted on Maple Advisor, a Maple community site independent of Maplesoft and/or Mapleprimes.

The site has started just a couple of days ago and doesn't have much of a content yet.

acer's picture

int() and float input

This is one sort of Maple inconsistency that interests me. Why should the first example behave like evalf(Int(...)) and call `evalf/int` while the second example does not?

acer's picture

timelimit

I was looking at the timelimit command in Maple, and wonder about whether it might be improved .

The help-page ?timelimit says that it suspends its checks while within builtin functions. It says that, inside builtins, the time limit is "ignored".

But Maple has a lot of builtins. And significant portions of the work may go on within them. Does this make the timelimit() function not useful, from a practical point of view?

What if timelimit were to make checks whenever garbage collection (gc) ocurred? That's a safe point, no? And gc can happen within some builtins? Or what if time checks were made at the same frequency that interrupt requests were checked? Those can happen within some builtins, at safe points.

Those were my thoughts, until I tried it. The command anames(builtin) shows that rtable() is a builtin. But I have found that timelimit will function within at least some rtable() calls.

Syndicate content
}