[Rd] mb_m buffer not cleared if parseEval fails

2012-03-01 Thread Pratibha Rana

Hi,

I am using RInside for one of the applications that I'm using. The error 
that occured is as follows.


When I use  R.parseEval(xyz) if the parse fails then the mb_m is not 
cleared and hence all subsequent

calls to R.parseEval fail.

example:

when R.parseEval(stringConcatfactoryrandom) is executed the R instance 
looks like this

 (gdb) p R
$7 = (RInside ) @0x7fff13d42d10: {mb_m = {buffer = 
stringConcatfactoryrandom}, global_env = incomplete type, verbose_m 
= false, static instance_ = 0x7fff13d42d10}


since there's no function called stringConcatfactoryrandom in my R code, 
the above call fails. The I use the same R instance to call


R.parseEval(exists)and I  get this

(gdb) p R
$8 = (RInside ) @0x7fff13d42d10: {mb_m = {buffer = 
stringConcatfactoryrandomexists}, global_env = incomplete type, 
verbose_m = false, static instance_ = 0x7fff13d42d10}


I think the buffer should be cleared after each call to parseEval


Thanks
Pratibha

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] mb_m buffer not cleared if parseEval fails

2012-03-01 Thread Dirk Eddelbuettel

Hi Pratibha,

May I suggest to move this over to the rcpp-devel list (where you need to be
subscribed to post)?   I am setting an appropriate Reply-To: now, we should
then also remove the CC for r-devel.

On 1 March 2012 at 11:05, Pratibha Rana wrote:
| Hi,
| 
| I am using RInside for one of the applications that I'm using. The error 
| that occured is as follows.
| 
| When I use  R.parseEval(xyz) if the parse fails then the mb_m is not 
| cleared and hence all subsequent
| calls to R.parseEval fail.
| 
| example:
| 
| when R.parseEval(stringConcatfactoryrandom) is executed the R instance 
| looks like this
|   (gdb) p R
| $7 = (RInside ) @0x7fff13d42d10: {mb_m = {buffer = 
| stringConcatfactoryrandom}, global_env = incomplete type, verbose_m 
| = false, static instance_ = 0x7fff13d42d10}
| 
| since there's no function called stringConcatfactoryrandom in my R code, 
| the above call fails. The I use the same R instance to call
| 
We could do with a try/catch logic here.  You can either (easiest) wrap your
actual expression in a try() [ or tryCatch() ] and then submit the new
compound expression.

Or we tackle this at the C++ and add a try/catch layer in the member function
RInside::parseEval() --- which never had one as I started with the code from
littler which, being C, never had this type of exception handling.

I do not have to implement this, or try it, but if you get a chance I'd love
to hear how it goes.

| R.parseEval(exists)and I  get this
| 
| (gdb) p R
| $8 = (RInside ) @0x7fff13d42d10: {mb_m = {buffer = 
| stringConcatfactoryrandomexists}, global_env = incomplete type, 
| verbose_m = false, static instance_ = 0x7fff13d42d10}
| 
| I think the buffer should be cleared after each call to parseEval

Other approaches may work too. What you suggest would just ignore the error
and carry on.  That may work too, but there is something about this I don't
quite like...


Cheers, Dirk

 
| Thanks
| Pratibha
| 
| __
| R-devel@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read. -- Groucho Marx

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Julia

2012-03-01 Thread Douglas Bates
My purpose in mentioning the Julia language (julialang.org) here is
not to start a flame war.  I find it to be a very interesting
development and others who read this list may want to read about it
too.

It is still very much early days for this language - about the same
stage as R was in 1995 or 1996 when only a few people knew about it -
but Julia holds much potential.  There is a thread about R and
statistical programming on groups.google.com/group/julia-dev.  As
always happens, there is a certain amount of grumbling of the R IS
S SLW flavor but there is also some good discussion regarding
features of R (well, S actually) that are central to the language.
(Disclaimer: I am one of the participants discussing the importance of
data frames and formulas in R.)

If you want to know why Julia has attracted a lot of interest very
recently (like in the last 10 days), as a language it uses multiple
dispatch (like S4 methods) with methods being compiled on the fly
using the LLVM (http://llvm.org) infrastructure.  In some ways it
achieves the Holy Grail of languages like R, Matlab, NumPy, ... in
that it combines the speed of compiled languages with the flexibility
of the high-level interpreted language.

One of the developers, Jeff Bezanson, gave a seminar about the design
of the language at Stanford yesterday, and the video is archived at
http://www.stanford.edu/class/ee380/.  You don't see John Chambers on
camera but I am reasonably certain that a couple of the questions and
comments came from him.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Julia

2012-03-01 Thread Jeffrey Ryan
Doug,

Agreed on the interesting point - looks like it has some real promise.
 I think the spike in interest could be attributable to Mike
Loukides's tweet on Feb 20. (editor at O'Reilly)

https://twitter.com/#!/mikeloukides/status/171773229407551488

That is exactly the moment I stumbled upon it.

Jeff

On Thu, Mar 1, 2012 at 11:06 AM, Douglas Bates ba...@stat.wisc.edu wrote:
 My purpose in mentioning the Julia language (julialang.org) here is
 not to start a flame war.  I find it to be a very interesting
 development and others who read this list may want to read about it
 too.

 It is still very much early days for this language - about the same
 stage as R was in 1995 or 1996 when only a few people knew about it -
 but Julia holds much potential.  There is a thread about R and
 statistical programming on groups.google.com/group/julia-dev.  As
 always happens, there is a certain amount of grumbling of the R IS
 S SLW flavor but there is also some good discussion regarding
 features of R (well, S actually) that are central to the language.
 (Disclaimer: I am one of the participants discussing the importance of
 data frames and formulas in R.)

 If you want to know why Julia has attracted a lot of interest very
 recently (like in the last 10 days), as a language it uses multiple
 dispatch (like S4 methods) with methods being compiled on the fly
 using the LLVM (http://llvm.org) infrastructure.  In some ways it
 achieves the Holy Grail of languages like R, Matlab, NumPy, ... in
 that it combines the speed of compiled languages with the flexibility
 of the high-level interpreted language.

 One of the developers, Jeff Bezanson, gave a seminar about the design
 of the language at Stanford yesterday, and the video is archived at
 http://www.stanford.edu/class/ee380/.  You don't see John Chambers on
 camera but I am reasonably certain that a couple of the questions and
 comments came from him.

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Jeffrey Ryan
jeffrey.r...@lemnica.com

www.lemnica.com
www.esotericR.com

R/Finance 2012: Applied Finance with R
www.RinFinance.com

See you in Chicago

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Julia

2012-03-01 Thread Douglas Bates
On Thu, Mar 1, 2012 at 11:20 AM, Jeffrey Ryan jeffrey.r...@lemnica.com wrote:
 Doug,

 Agreed on the interesting point - looks like it has some real promise.
  I think the spike in interest could be attributable to Mike
 Loukides's tweet on Feb 20. (editor at O'Reilly)

 https://twitter.com/#!/mikeloukides/status/171773229407551488

 That is exactly the moment I stumbled upon it.

I think Jeff Bezanson attributes the interest to a blog posting by
Viral Shah, another member of the development team, that hit Reddit.
He said that, with Viral now in India, it all happened overnight for
those in North America and he awoke the next day to find a firestorm
of interest.  I ran across Julia in the Release Notes of LLVM and
mentioned it to Dirk Eddelbuettel who posted about it on Google+ in
January.  (Dirk, being much younger than I, knows about these
new-fangled social media things and I don't.)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] missing value break my if clause and crash my program

2012-03-01 Thread Uwe Ligges



On 29.02.2012 13:36, zisheng xing wrote:

I have a program which is designed to read through a dbf file and carry out 
certain amount of further calculation if one condition obtained from the newly 
read line. The condition to determine if the calculation can be done is a 
if-clasue (i.e. if(m0). Unfortunately, when m is missing, the program crashed. 
Just wonder who can help me out.


1. Please ask questions on R-help after reading its posting guide. 
R-devel is for development purposes.


2. Your code results in an ERROR rather than a crash.

3. Check if m exists before you compare it to some value.

Uwe Ligges







Thanks
[[alternative HTML version deleted]]




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] improved error message when existing implicit S4 generic is not imported?

2012-03-01 Thread Hervé Pagès

Hi,

On 02/27/2012 12:22 AM, Prof Brian Ripley wrote:
...

(Re another message: stats4 *is* methodsGenerics for base packages.)


Why isn't it called base4 if it's for base packages?

Thanks,
H.

--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Julia

2012-03-01 Thread Kjetil Halvorsen
Can somebody postb a link to the video? I cant find it, searching
Julia on youtube stanford channel gives nothing.

Kjetil

On Thu, Mar 1, 2012 at 11:37 AM, Douglas Bates ba...@stat.wisc.edu wrote:
 On Thu, Mar 1, 2012 at 11:20 AM, Jeffrey Ryan jeffrey.r...@lemnica.com 
 wrote:
 Doug,

 Agreed on the interesting point - looks like it has some real promise.
  I think the spike in interest could be attributable to Mike
 Loukides's tweet on Feb 20. (editor at O'Reilly)

 https://twitter.com/#!/mikeloukides/status/171773229407551488

 That is exactly the moment I stumbled upon it.

 I think Jeff Bezanson attributes the interest to a blog posting by
 Viral Shah, another member of the development team, that hit Reddit.
 He said that, with Viral now in India, it all happened overnight for
 those in North America and he awoke the next day to find a firestorm
 of interest.  I ran across Julia in the Release Notes of LLVM and
 mentioned it to Dirk Eddelbuettel who posted about it on Google+ in
 January.  (Dirk, being much younger than I, knows about these
 new-fangled social media things and I don't.)

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Julia

2012-03-01 Thread Ted Harding
http://julialang.org/blog

Then click on Stanford Talk Video.
Then click on available here.

Ted.

On 01-Mar-2012 Kjetil Halvorsen wrote:
 Can somebody postb a link to the video? I cant find it, searching
 Julia on youtube stanford channel gives nothing.
 
 Kjetil
 
 On Thu, Mar 1, 2012 at 11:37 AM, Douglas Bates ba...@stat.wisc.edu wrote:
 On Thu, Mar 1, 2012 at 11:20 AM, Jeffrey Ryan jeffrey.r...@lemnica.com
 wrote:
 Doug,

 Agreed on the interesting point - looks like it has some real promise.
 Â_I think the spike in interest could be attributable to Mike
 Loukides's tweet on Feb 20. (editor at O'Reilly)

 https://twitter.com/#!/mikeloukides/status/171773229407551488

 That is exactly the moment I stumbled upon it.

 I think Jeff Bezanson attributes the interest to a blog posting by
 Viral Shah, another member of the development team, that hit Reddit.
 He said that, with Viral now in India, it all happened overnight for
 those in North America and he awoke the next day to find a firestorm
 of interest. Â_I ran across Julia in the Release Notes of LLVM and
 mentioned it to Dirk Eddelbuettel who posted about it on Google+ in
 January. Â_(Dirk, being much younger than I, knows about these
 new-fangled social media things and I don't.)

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Mar-2012  Time: 20:47:42
This message was sent by XFMail

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel