[Rcpp-devel] Bug: replace_last()

2016-05-16 Thread 津田真樹
I find a bug in String::replace_last(). I can reproduce the bug with the following code. (I also showed output of replace_first and replace_all for comparison.) = // [[Rcpp::export]] void rcpp_string(){ String s("abcdabcd"); Rcout << "replace_first()\n"; Rcout << s.r

[Rcpp-devel] Compiler [-Wunused-variable] warnings.

2016-05-16 Thread Robi Ragan
On compilation I am getting lots of warnings that I would love to resolve. There are 30 or so but they all more or less look like the first three ill paste here: > ==> R CMD INSTALL --preclean --no-multiarch --with-keep.source voteR > > * installing to library > ‘/Library/Frameworks/R.framewo

[Rcpp-devel] Bug report : String::replace_first(), String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : replace_first() and replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : replace_first() and replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread 津田真樹
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread 津田真樹
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report : String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDABC

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first and String::replace_last

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AA

[Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Masaki Tsuda
Hello, all This is my first post to this mailing list. I might have found bugs with String::replace_first() and String::replace_last(). The bugs can be reproduced by following code. (R version 3.2.3 Rcpp 0.12.4) --- // [[Rcpp::export]] void rcpp_string(){ String s("AABCDAB

[Rcpp-devel] [ANN] Rcpp 0.12.4

2016-05-16 Thread Dirk Eddelbuettel
Rcpp 0.12.5 arrived on CRAN yesterday, and I wrote the usual short blog post which it is at http://dirk.eddelbuettel.com/blog/ http://dirk.eddelbuettel.com/blog/2016/05/14#rcpp_0.12.5 and included as text (without links) below. This release once again continues on the 'every two mon

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
Hi, I have confirmed the bug and fix. Please send a PR. We will really appreciate this. Best wishes, KK On Sun, May 8, 2016 at 9:14 AM, 津田真樹 wrote: > I find a bug in String::replace_last(). > > I can reproduce the bug with the following code. > (I also showed output of replace_first and repla

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Kevin Ushey
Thanks -- it looks to me like there is something more fundamentally wrong with the 'replace_first' and 'replace_last' methods; ie, I don't think we want to be using 'find_first_of' and 'find_last_of' functions. Ie, when writing string.replace_first("foo", "bar"); I imagine we want to replace

Re: [Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Joris Meys
Dear Masaki, There is no need to send the same message 16 times to this list. It won't get it answered faster. If anything, it'll likely lessen the chance of receiving an answer. Please use this list with a bit consideration of those who aren't necessarily able to answer your question but still fo

[Rcpp-devel] List outage

2016-05-16 Thread Dirk Eddelbuettel
All, My apologies -- I didn't put 2+2 together to realize R-Forge mailing lists were down which I should have realized via at least three different lists that are somewhat active. Of these, rcpp-devel is clearly the largest and most active. I am sorry for any frustrations that caused anyone try

Re: [Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread Dirk Eddelbuettel
On 16 May 2016 at 21:07, Joris Meys wrote: | There is no need to send the same message 16 times to this list. It won't get The list was down for several days, possibly a week. Hence the bulk delivery showing the different dates at which the mail was sent. Dirk -- http://dirk.eddelbuettel.com

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
Yes, Kevin, I think we need something like size_t index = std::distance(buffer.begin(), std::search(buffer.begin(), buffer.end(), s.begin(), s.end())); KK On Mon, May 16, 2016 at 2:04 PM, Kevin Ushey wrote: > Thanks -- it looks to me like there is something more fundamentally > wrong with the

Re: [Rcpp-devel] Bug report: String::replace_first() and String::replace_last()

2016-05-16 Thread teuder
I'm sorry for embarrassing you all, I would explain the whole story below. As Dirk mentioned the mailing list had a problem at least from May 8 to today. So, my post was not delivered to members including me. I thought my post was rejected at first, but after several times trial I had doubt the

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread teuder
Hi, Kevin and Qiang. After I sent my first post, I realized the problem as you pointed out. The problem can be resolved by replacing replace_first() and replace_last() to find() and rfind(). --- inline String& replace_first(const char* s, const char* news) { RCPP_STRING_DEBUG

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Qiang Kou
Hi, Masaki, Please try the latest version on github. It should fix this bug. KK On Mon, May 16, 2016 at 9:42 PM, wrote: > Hi, Kevin and Qiang. > > After I sent my first post, I realized the problem as you pointed out. > > The problem can be resolved by replacing replace_first() and > replace_l

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Masaki Tsuda
Hi, Quang I confirmed that the bug was fixed. Thank you for coping with the problem. // [[Rcpp::export]] void rcpp_string(){ String s("AABCDABCDA"); Rcout << "replace_all()\n"; Rcout << s.replace_all("AB", "ab").get_cstring() << "\n"; Rcout << "\n"; s="AABCDABCDA"; Rcout <