MrMarc

3163 Reputation

18 Badges

17 years, 136 days

MaplePrimes Activity


These are replies submitted by MrMarc

@DuncanA   ok thank you for that explanation.

Could you please explain to be how I can make the above
code work in parallel ie can you provide me with a modification
of the above code 5) so it can work in parallel so I can see the speed improvment
of calling google finance in parallel instead of sequentially...

If it is not to much to ask for could you also provide some modified code for 4)
so I can see the impovement in speed by calling X2+X3 in parallel compared to
calling X1. Since X2+X3 is called in parralel it should be much faster than X1.....

@DuncanA   ok thank you for that explanation.

Could you please explain to be how I can make the above
code work in parallel ie can you provide me with a modification
of the above code 5) so it can work in parallel so I can see the speed improvment
of calling google finance in parallel instead of sequentially...

If it is not to much to ask for could you also provide some modified code for 4)
so I can see the impovement in speed by calling X2+X3 in parallel compared to
calling X1. Since X2+X3 is called in parralel it should be much faster than X1.....

@DuncanA   Well If find it a difficult to understand that if you run the below

code you get no html output ie empty "" but if you call X() you get loads of html output...



restart:
with(Sockets):


X1 := proc () local str, sid, b; global str1;
str := "";
sid := Open("google.com", 80);
Write(sid, cat("GET /finance/historical?q=INDEXSP:.INX&histperiod=daily HTTP/1.0 \n\n"));
b := Read(sid);
while b <> false do str := cat(str, b); b := Read(sid) end do;
Close(sid);
str
end proc:

Create(X(), str1): 
Create(X(), str2):

str1;
str2;

@DuncanA   Well If find it a difficult to understand that if you run the below

code you get no html output ie empty "" but if you call X() you get loads of html output...



restart:
with(Sockets):


X1 := proc () local str, sid, b; global str1;
str := "";
sid := Open("google.com", 80);
Write(sid, cat("GET /finance/historical?q=INDEXSP:.INX&histperiod=daily HTTP/1.0 \n\n"));
b := Read(sid);
while b <> false do str := cat(str, b); b := Read(sid) end do;
Close(sid);
str
end proc:

Create(X(), str1): 
Create(X(), str2):

str1;
str2;

very nice replies indeed :-)

@Samir does your solution work with webmail solutions like hotmail ?
Do I need to have a locally installed SMTP server if I use hotmail ?
It should work to simply call hotmail over the internet and tell
it to send an email ??

very nice replies indeed :-)

@Samir does your solution work with webmail solutions like hotmail ?
Do I need to have a locally installed SMTP server if I use hotmail ?
It should work to simply call hotmail over the internet and tell
it to send an email ??

Percentage_Return.mw

For example, I have in the attached maple file written a procedure that
downloads data from yahoo finance and calculates the percentage return
for the last 30 days for approx 26 stock indicies. The code is working but it is extremly slow.

I have two options as I see it:

i) try to run downloading from yahoo finance simulationsly by using for example thread.
I have now idea how this should be specified. Any suggestions?

ii) try to download from google finance. Again I have no idea how this should be specified.
Any suggestions ?


The goal is to do the download and return calculation fast !

"Some other responses produce "7" instead of "07" for the output month."

That was exactly the problem that I came across when I tried to find a solution.
The problem was to difficult to solve so I simply gave up :-(

"Some other responses produce "7" instead of "07" for the output month."

That was exactly the problem that I came across when I tried to find a solution.
The problem was to difficult to solve so I simply gave up :-(

Thank you for pointing that out to me. I had missed that.
However, it does not change the fact though. I mean I
can not really see the point of having it that way.

Why would anyone want to put a comment on the first line.
It would be much better to be able to assign a caption to the code
edit region as with buttons for example.

Also the attach command for matrix data is needed ie attach(codeeditregion1, A)
where A is a matrix with data.

Thank you for pointing that out to me. I had missed that.
However, it does not change the fact though. I mean I
can not really see the point of having it that way.

Why would anyone want to put a comment on the first line.
It would be much better to be able to assign a caption to the code
edit region as with buttons for example.

Also the attach command for matrix data is needed ie attach(codeeditregion1, A)
where A is a matrix with data.

well it is more in general. Either you write stuff in word and only use maple
for some simulation charts etc However, with the recent development where
you can combine text, equations, tables and code directly in the maple worksheet
it would make sense to do all work in maple but then you have the problem
which this post is about, how to print or save a pdf copy of your work.

As of now the pdf looks like shit and I am not exaggerating (my laptop has a widescreen).
I have hundreds of maple worksheets that contains text, tables, code, equations etc Sometime
I want to show a colleague some of my work but then I have to re-edit everything
in word (because maples pdf printer is so crappy) which is a BIG pain....

I ask myself the question if it is even worth the time and effort as an end-user to try to learn
this parallel programming stuff. I have a distinct feeling that this type of
computations will soon be done behind the scene automatically. Right or wrong?

true! diversification can do more harm then good if you dont have a
frequent reblancing strategy. The problem is however that Maple currently
does not have the technology to solve large scale portfolio optimization problems.
Maple is good when it comes to creating "cute" applications but I cant see how
Maple would be able to solve a optimization for a universe of let say 5000 securities
in an efficient manner. Hopefully someone can prove we wrong in the near future..

This premature evaluation thing is a bit of a headacke actually
and is a very frequent source problems for a lot of users (based
upon the mapleprimes post on the subject) I dont thing it is
realistic to assume that the user is interested in the error
messages related to "premature evaluation"

It would be much better if the source code was change so such an
problems would not happen. I came a cross the same thing (I assume)
quite resently when I tried to make a 3dplot based upon a procedure
with two inputs vol and prob. The most optimal way would be to simply call:

plot3d(X(vol, prob), vol=1..120, prob=0..1)

but that does not work. Instead you have to do:

dd := [seq([seq([vol, prob, X(vol, prob)], vol = 1 .. 120)], prob = 0 .. 1)];
surfdata(dd, axes = boxed);

or you might be lucky with (I have not tried if it works)

plot3d(X('vol', 'prob'), vol=1..120, prob=0..1)

or something like that but it is still a headache having to be bothered with this
"premature evaluation" thing. It is a nice example where notation is more
important than intention ie the aim and purpose of

plot3d(X(vol, prob), vol=1..120, prob=0..1)

is so clear and simple but it all of a sudden require you to be an high level
programmer in maple to solve the problem. As I said I think the source
code should be changed to remove such behaviour. I would assume it would
require very litle effort to eliminate such a behaviour...

First 16 17 18 19 20 21 22 Last Page 18 of 33