Re: [Fwd: Re: [Rcom-l] Building R(D)Com Web Application experiences]

2008-11-21 Thread Thomas Baier

Wayne,

[EMAIL PROTECTED] schrieb:
THanks for the help in retrieving a server under shared use. 

In the VB code example: 


RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")

Is this retrieving a server for shared use or is it doing something different?


It is for shared use, but indeed without tracking uses. So using 
GetServerShared() or GetServerExclusive() is the recommended way. Could 
you please point out, which of the Examples uses .Item() to retrieve a 
server, so I can fix this for the next release.


As has already been pointed out by Julien, special care has to be taken 
into account when using these components from a webserver account. I've 
not yet done this myself, but I have heard that in this case permissions 
for all COM objects have to be set accordingly.


Regards,
Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


RE: [Fwd: Re: [Rcom-l] Building R(D)Com Web Application experiences]

2008-11-21 Thread Wayne.W.Jones

Hi Thomas, 


THanks for the help in retrieving a server under shared use. 

In the VB code example: 

RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")

Is this retrieving a server for shared use or is it doing something different?

Regards, 

Wayne



http://rcom.univie.ac.at/server/doc/RServerManager.html


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Thomas
Baier
Sent: 20 November 2008 22:21
To: rcom-l
Subject: [Fwd: Re: [Rcom-l] Building R(D)Com Web Application
experiences]


Hi Wayne,

[EMAIL PROTECTED] schrieb:
> Hi Thomas & fellow R(D)Com users, 
> 
> Thanks for the excellent suggestion of using RserverManager. This would seem 
> to be exactly what I need!
> I have managed to get an example in VBA working (See VBA code at bottom of 
> email). 
> 
> However, when I try to run a corresponding example using .NET with C# I run 
> into difficulty. 
> I can add a IStatConnector-objects to RserverManager with no problems but I 
> can't seem to retrieve it back again!
> In VBA the  RServerManager has a method called "Item" which I can pass in a 
> string to retrieve my IStatConnector session!
> The methods, classes, constructors for the  .NET example are quite different. 
> 
> Here is the C# code I used to set up an R session and store the 
> IStatConnector called "RLink" into the RServermanager. 
> Does anyone know how to get it back? i.e. can anyone translate the VBCode
> 
> Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")
> 
> to C#?

The following piece of code retrieves a server called "R" for shared use
and produces a plot:

RServerManager.ServerPool lServerManager =
  new RServerManager.ServerPool();
 RServerManager.ServerItem lItem =
  lServerManager.GetServerShared("R");
 lItem.Server.EvaluateNoReturn("plot(sin(1:100))");

I hope this helps,

Thomas



___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


RE: [Rcom-l] Building R(D)Com Web Application experiences

2008-11-21 Thread Julien Vanwinsberghe
Dear Wayne,

I don't know if you have encountered this problem yet, but when you install
RDCOM on a web server, you can have some security restrictions related to
the webuser account permission to create RDCOM instances.

There is a little explanation of how to handle this, and some C# code of the
principal classes used in the RNetWeb project, from the Leiden University
Medical Center website, at this link:
http://www.msbi.nl/dnn/Default.aspx?tabid=159

I hope that it can help in your works,

Regards,

Julien Vanwinsberghe


-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de
[EMAIL PROTECTED]
Envoyé : jeudi 20 novembre 2008 11:21
À : rcom-l@mailman.csd.univie.ac.at
Objet : RE: [Rcom-l] Building R(D)Com Web Application experiences


Hi Thomas & fellow R(D)Com users, 

Thanks for the excellent suggestion of using RserverManager. This would seem
to be exactly what I need!
I have managed to get an example in VBA working (See VBA code at bottom of
email). 

However, when I try to run a corresponding example using .NET with C# I run
into difficulty. 
I can add a IStatConnector-objects to RserverManager with no problems but I
can't seem to retrieve it back again!
In VBA the  RServerManager has a method called "Item" which I can pass in a
string to retrieve my IStatConnector session!
The methods, classes, constructors for the  .NET example are quite
different. 

Here is the C# code I used to set up an R session and store the
IStatConnector called "RLink" into the RServermanager. 
Does anyone know how to get it back? i.e. can anyone translate the VBCode

Call
RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")

to C#?


Regards

Wayne


'-C# .NET example --
using StatConnectorCommonLib;
using STATCONNECTORSRVLib;
using RServerManager; 

 protected void Button1_Click(object sender, EventArgs e)
{
int n = 150; 
StatConnector RLink = new StatConnector();
RLink.Init("R");
RLink.SetSymbol("n", n);
Label1.Text = "here i go!"; 

ServerPool mservermanager = new ServerPool();
mservermanager.Add(RLink, "MyR");
}

 protected void Button2_Click(object sender, EventArgs e)
{
Need a method to get "MyR" back!!!
}


'- End C# Code -

'-VBA code example working correctly--
Sub RunRSession()
Call StartRSession
Call GetRSession
End Sub
'--

'
Sub StartRSession()
Dim RLink As StatConnector
Dim mean As Double
Dim n As Long
Dim mservermanager As RServerManager.ServerPool

n = 150
Set RLink = New StatConnector
RLink.Init ("R")
RLink.SetSymbol "n", n
RLink.EvaluateNoReturn ("x <- 1:" & n)

Set mservermanager = New RServerManager.ServerPool

mservermanager.Add RLink, "MyR" 
'Add Rlink StatConnector Session to RServermanager amd call it MyR.
End Sub
'

'
Sub GetRSession()
' Recall StatConnector R session from RServerManager
Call
RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")
End Sub

 End VBA Code ----------------------



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Thomas
Baier
Sent: 19 November 2008 09:55
To: R (D)COM and RExcel server related issues
Subject: Re: [Rcom-l] Building R(D)Com Web Application experiences


Dear Wayne,

[EMAIL PROTECTED] schrieb:
> One method of doing this is to define a static StatConnector class in C# 
> see for example:_ __<http://www.daniweb.com/forums/thread49952.html>_
> but I certainly don't think this would be a recommended approach!
> Alternatively I could store the instance of the StatConnectorClass to a 
> server side "Application Object" or "Session object"
> see for example:_ <http://www.csharphelp.com/archives/archive207.html>_ 
> (I have yet to test this approach).
> 
> Can anyone perhaps suggest another better approach?

I have not tried to use this in the context of a ASP.NET application, 
but I would suggest to have a look at RServerManager.

Using RServerManager, you can store IStatConnector-objects with a 
specific name in an object repository (RServerManager) and later 
retrieve the same objects by querying the object with its name.

Basic documentation and an adminstrative console is included in the 
R/Scilab (D)COM server setup.

Regards,
Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


___
Rcom-l ma

[Fwd: Re: [Rcom-l] Building R(D)Com Web Application experiences]

2008-11-20 Thread Thomas Baier

Hi Wayne,

[EMAIL PROTECTED] schrieb:
Hi Thomas & fellow R(D)Com users, 


Thanks for the excellent suggestion of using RserverManager. This would seem to 
be exactly what I need!
I have managed to get an example in VBA working (See VBA code at bottom of email). 

However, when I try to run a corresponding example using .NET with C# I run into difficulty. 
I can add a IStatConnector-objects to RserverManager with no problems but I can't seem to retrieve it back again!

In VBA the  RServerManager has a method called "Item" which I can pass in a 
string to retrieve my IStatConnector session!
The methods, classes, constructors for the  .NET example are quite different. 

Here is the C# code I used to set up an R session and store the IStatConnector called "RLink" into the RServermanager. 
Does anyone know how to get it back? i.e. can anyone translate the VBCode


Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")

to C#?


The following piece of code retrieves a server called "R" for shared use
and produces a plot:

RServerManager.ServerPool lServerManager =
  new RServerManager.ServerPool();
RServerManager.ServerItem lItem =
  lServerManager.GetServerShared("R");
lItem.Server.EvaluateNoReturn("plot(sin(1:100))");

I hope this helps,

Thomas



___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


RE: [Rcom-l] Building R(D)Com Web Application experiences

2008-11-20 Thread Wayne.W.Jones

Hi Thomas & fellow R(D)Com users, 

Thanks for the excellent suggestion of using RserverManager. This would seem to 
be exactly what I need!
I have managed to get an example in VBA working (See VBA code at bottom of 
email). 

However, when I try to run a corresponding example using .NET with C# I run 
into difficulty. 
I can add a IStatConnector-objects to RserverManager with no problems but I 
can't seem to retrieve it back again!
In VBA the  RServerManager has a method called "Item" which I can pass in a 
string to retrieve my IStatConnector session!
The methods, classes, constructors for the  .NET example are quite different. 

Here is the C# code I used to set up an R session and store the IStatConnector 
called "RLink" into the RServermanager. 
Does anyone know how to get it back? i.e. can anyone translate the VBCode

Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")

to C#?


Regards

Wayne


'-C# .NET example --
using StatConnectorCommonLib;
using STATCONNECTORSRVLib;
using RServerManager; 

 protected void Button1_Click(object sender, EventArgs e)
{
int n = 150; 
StatConnector RLink = new StatConnector();
RLink.Init("R");
RLink.SetSymbol("n", n);
Label1.Text = "here i go!"; 

ServerPool mservermanager = new ServerPool();
mservermanager.Add(RLink, "MyR");
}

 protected void Button2_Click(object sender, EventArgs e)
{
Need a method to get "MyR" back!!!
}


'- End C# Code -

'-VBA code example working correctly--
Sub RunRSession()
Call StartRSession
Call GetRSession
End Sub
'--

'
Sub StartRSession()
Dim RLink As StatConnector
Dim mean As Double
Dim n As Long
Dim mservermanager As RServerManager.ServerPool

n = 150
Set RLink = New StatConnector
RLink.Init ("R")
RLink.SetSymbol "n", n
RLink.EvaluateNoReturn ("x <- 1:" & n)

Set mservermanager = New RServerManager.ServerPool

mservermanager.Add RLink, "MyR" 
'Add Rlink StatConnector Session to RServermanager amd call it MyR.
End Sub
'

'
Sub GetRSession()
' Recall StatConnector R session from RServerManager
Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)")
End Sub

 End VBA Code --------------



-----Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Thomas
Baier
Sent: 19 November 2008 09:55
To: R (D)COM and RExcel server related issues
Subject: Re: [Rcom-l] Building R(D)Com Web Application experiences


Dear Wayne,

[EMAIL PROTECTED] schrieb:
> One method of doing this is to define a static StatConnector class in C# 
> see for example:_ __<http://www.daniweb.com/forums/thread49952.html>_
> but I certainly don't think this would be a recommended approach!
> Alternatively I could store the instance of the StatConnectorClass to a 
> server side "Application Object" or "Session object"
> see for example:_ <http://www.csharphelp.com/archives/archive207.html>_ 
> (I have yet to test this approach).
> 
> Can anyone perhaps suggest another better approach?

I have not tried to use this in the context of a ASP.NET application, 
but I would suggest to have a look at RServerManager.

Using RServerManager, you can store IStatConnector-objects with a 
specific name in an object repository (RServerManager) and later 
retrieve the same objects by querying the object with its name.

Basic documentation and an adminstrative console is included in the 
R/Scilab (D)COM server setup.

Regards,
Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


Re: [Rcom-l] Building R(D)Com Web Application experiences

2008-11-19 Thread Thomas Baier

Dear Wayne,

[EMAIL PROTECTED] schrieb:
One method of doing this is to define a static StatConnector class in C# 
see for example:_ ___

but I certainly don't think this would be a recommended approach!
Alternatively I could store the instance of the StatConnectorClass to a 
server side "Application Object" or "Session object"
see for example:_ _ 
(I have yet to test this approach).


Can anyone perhaps suggest another better approach?


I have not tried to use this in the context of a ASP.NET application, 
but I would suggest to have a look at RServerManager.


Using RServerManager, you can store IStatConnector-objects with a 
specific name in an object repository (RServerManager) and later 
retrieve the same objects by querying the object with its name.


Basic documentation and an adminstrative console is included in the 
R/Scilab (D)COM server setup.


Regards,
Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at