Simon Johansen

213 Reputation

5 Badges

16 years, 99 days

MaplePrimes Activity


These are answers submitted by Simon Johansen

It happends that i too had this problem once!

In my opinion the easiest way to save a lib is by un-protecting maples lib folder. It's not the safest, and i agree, but if you save it at another space then you cannot load with the "with(package)" anymore. When thats said, then it's common sence not to make packages with same name as maples packages...

Anyhow, heres is my approach:

    with(LibraryTools):
    WriteMode(cat(kernelopts(mapledir), kernelopts(dirsep), "lib"), "WRITABLE"):
    savelib(x);
    WriteMode(cat(kernelopts(mapledir), kernelopts(dirsep), "lib"), "READONLY"):
 

You can now load it like a normal package!

/Simon Johansen

 

 

looks like a "v:=" was left out in the equation.

well.. just saw my post and realized that there was missing something.

Here is the real proc's:

ToDeg := proc (x) if type(x, symbol) = true then return 1 else return 180/Pi end if end proc;

sin := proc (x) :-sin(x*ToRad(x)) end proc;

sin(30)

                1/2

At first it looked like it was the proc that was the problem, but the it could just as well be the type of input!

So i tried fallowing:
ToRad := proc (x) if type(x, symbol) = true then return 1 else return Pi/180 end if end proc;

sin := proc (x) :-sin(x*ToRad(x)) end proc;

Since sin is protected, it is not possible to make an if procedure. So by making the "ToRad" it work.

> sin(x)

          sin(x)

> sin(30)

          1/2

BTW - the reason why i did not go with Alec's answer was that it did not work with arcsin :-(

Thx for everything :)

To acer,

Well - i asked what factors that could make the proc execute in another way. And the first 2-3 answers was about why i could not make the proc was using, and i can use it. It works just fine, and not for me, on serval computers.

With that i mean, that you could effect the way the proc execute by setting the % in front of it.

Besiedes, do not take it the wrong way. Gues what i ment came out the wrong way.

To Alec,

It was just what i wanted! It works just like a charm! THANK YOU :)

Thank you for your reply(s), but the only answer i could use was mainly the one with the "%".

And it shows up that ":-sin" is not the same as "sin". I would say that ":-sin" is the root function, just like when you reach for a package.

LinearAlgebra:-DotProduct(`<,>`(1, 2, 3), `<,>`(4, 5, 6))

It get the function from LinearAlgebra in that case.

/Simon

BTW - i am still interested in newer anwers :)

Sory - bad connection, and pressed the submit button 2 times!

Looks like i can make a file outside maples folder, but it would be fine if i can open it with the "with" command..

Anyhow, do you know a way to unlock the protection from maples private folders?

as the headline says, how about printing a label..

The benefits from this is:

 - It's aligned to the left

 - it's black

Can anyone help me make such a thing?

/Simon Johansen

Green - sure better then all text getting blue :D

Ty for your posibility - ill use that!

Still open for other suggestions :)

 

/Simon Johansen

looks like c/p from word is a bad thing when posting on this forum - look at the bottom please :)

/Simon

wow! it actualy looks good! You sir, have won the internet!

 

Btw, is there a good guide or anything that you can recomend me to read to get an further knowlage about the functions and so :)

I know the basic syntax and some smart commands like % and labels... is there alot more to know?

/Simon Johansen

He he, there is more then one road to happyness ^^ I will keep on seraching :D

By the way, arent there a way to watch the source files of the help untillities? I mean, to me it looks like demonstration tools..

I'm intrested in this too, since i am thinking of making a maplet, that handles those formulars.. Is there a simple way, like pythagoras or soemthing like that?

Page 1 of 1