Re: [Rd] Bug: C-level and _set_rl_word_breaks

2013-01-31 Thread Duncan Murdoch

On 13-01-30 9:48 PM, Laurent Gautier wrote:

Hi,

I filed a bug report in the tracker (id #15169) a short while ago,
along with a patch, but I came back to it to see that there is
relatively little movement or participation on the tracker so I
thought I'd pitch it here (patch attached).

The function `set_rl_word_breaks` in src/unix/sys-std.c relies on
statically-allocated strings local to the function, making other C
code using the readline library, such as a program embedding
R and using readline as well, at risk of creating a segfault when
trying to free `rl_basic_word_break_characters` or
`rl_completer_word_break_characters` when changing them.

The issue was noticed when embedding R in Python (rpy2); I had an
ugly hack for a long time (less work than champion the inclusion
of a patch in R) but the iPython developers pushed what could be
demanded from the rpy2 with their "R magic" extension and
so I wrote a patch (and they have made a brittle workaround in
the meantime).

The fix would be of interest to anyone embedding R in C and using
readline (e.g., language interface developers if the language either
has a console using readline - and chances are that it does - or
an interface to readline).

The patch attached is against today's R-dev and will likely apply to
current R-2.15 branch. With the patch applied, R is building and is
passing `make check`. It could be slightly expanded by handling
cases where the calloc() or realloc() faills, although not an absolute
priority (if allocating 200 bytes fails, the system might have
bigger worries than keeping R from crashing).


I suspect the reason your bug hasn't been dealt with in the 2 weeks 
since you posted it is that you don't show any code that illustrates the 
problem it causes.  It is much easier to run some code and see that code 
that should be valid is causing a crash, than it is to develop code to 
illustrate it.  Easily illustrated bugs get solved before hard ones.


Your post here gives a lot more detail, but still no code.  This isn't 
an area I'd work on (it seems to be a Unix-only bug), but you might 
attract someone else to look at it if you include a minimal 
self-contained trigger for it.


Duncan Murdoch

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


Re: [Rd] Bug: C-level and _set_rl_word_breaks

2013-01-31 Thread Laurent Gautier

On 2013-01-31 21:09, Duncan Murdoch wrote:

On 13-01-30 9:48 PM, Laurent Gautier wrote:

Hi,

I filed a bug report in the tracker (id #15169) a short while ago,
along with a patch, but I came back to it to see that there is
relatively little movement or participation on the tracker so I
thought I'd pitch it here (patch attached).

The function `set_rl_word_breaks` in src/unix/sys-std.c relies on
statically-allocated strings local to the function, making other C
code using the readline library, such as a program embedding
R and using readline as well, at risk of creating a segfault when
trying to free `rl_basic_word_break_characters` or
`rl_completer_word_break_characters` when changing them.

The issue was noticed when embedding R in Python (rpy2); I had an
ugly hack for a long time (less work than champion the inclusion
of a patch in R) but the iPython developers pushed what could be
demanded from the rpy2 with their "R magic" extension and
so I wrote a patch (and they have made a brittle workaround in
the meantime).

The fix would be of interest to anyone embedding R in C and using
readline (e.g., language interface developers if the language either
has a console using readline - and chances are that it does - or
an interface to readline).

The patch attached is against today's R-dev and will likely apply to
current R-2.15 branch. With the patch applied, R is building and is
passing `make check`. It could be slightly expanded by handling
cases where the calloc() or realloc() faills, although not an absolute
priority (if allocating 200 bytes fails, the system might have
bigger worries than keeping R from crashing).


I suspect the reason your bug hasn't been dealt with in the 2 weeks 
since you posted it is that you don't show any code that illustrates 
the problem it causes.  It is much easier to run some code and see 
that code that should be valid is causing a crash, than it is to 
develop code to illustrate it.


Fair enough. Now I realize that this might be a part of R codebase that 
is hardly touched; while the problem makes sense to me after spending 
time on it, a demonstrating what it causes in a minimal example might be 
best).



Easily illustrated bugs get solved before hard ones.


I guess I had a free pass since I provide a solution to the bug.



Your post here gives a lot more detail, but still no code.  This isn't 
an area I'd work on (it seems to be a Unix-only bug), but you might 
attract someone else to look at it if you include a minimal 
self-contained trigger for it.


I'll work on that.

Thanks,

L.


Duncan Murdoch


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


[Rd] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Michael Friendly
CRAN task views are useful, but they seem difficult to write and 
maintain because the XML format is rather

limited (no sectioning) and the  must be maintained manually.
They are also difficult to read because the generated html and .css used 
are extremely basic, giving an

overly dense page.

Are there any markdown-like tools for writing a CTV?  Is it possible to 
apply a custom .css to a CTV?


-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

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


Re: [Rd] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Yihui Xie
See this page by Barry Rowlingson:
https://stat.ethz.ch/pipermail/r-devel/2012-February/063338.html

Given that CRAN maintainers do not even use JavaScript, I bet CSS does
not matter either; plain text is plain good.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Jan 31, 2013 at 8:50 AM, Michael Friendly  wrote:
> CRAN task views are useful, but they seem difficult to write and maintain
> because the XML format is rather
> limited (no sectioning) and the  must be maintained manually.
> They are also difficult to read because the generated html and .css used are
> extremely basic, giving an
> overly dense page.
>
> Are there any markdown-like tools for writing a CTV?  Is it possible to
> apply a custom .css to a CTV?
>
> -Michael
>
> --
> Michael Friendly Email: friendly AT yorku DOT ca
> Professor, Psychology Dept. & Chair, Quantitative Methods
> York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
> 4700 Keele StreetWeb:   http://www.datavis.ca
> Toronto, ONT  M3J 1P3 CANADA

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


Re: [Rd] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 4:28 PM, Yihui Xie  wrote:
> See this page by Barry Rowlingson:
> https://stat.ethz.ch/pipermail/r-devel/2012-February/063338.html

 Sadly that page is just the lipstick on a pig. Underneath, its still a pig.

> Given that CRAN maintainers do not even use JavaScript, I bet CSS does
> not matter either; plain text is plain good.

 I think we all know that the whole of www.r-project.org could do with
a revamp and that large chunks of the CRAN infrastructure would
benefit from a redesign. But at the moment, it all kinda works, its
just a bit annoying in places, and we put up with it because the
effort to make it more functional or shiny (no, not package:shiny) is
a bit too much.

 Sometimes putting lipstick on the pig is enough...

Barry

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


Re: [Rd] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Achim Zeileis

Michael:

CRAN task views are useful, but they seem difficult to write and 
maintain because the XML format is rather limited (no sectioning)


What type of sectioning would you like to have? In the HTML part, you can 
use the usual structuring tools like , , etc. It's not



and the  must be maintained manually.


Yes, but I recently started adding tools to help checking this. Hopefully 
I'll also get round to add some more convenience features for this.


They are also difficult to read because the generated html and .css used 
are extremely basic, giving an overly dense page.


Is it possible to apply a custom .css to a CTV?


In principle yes. When generating the HTML pages, you can supply the 
desired .css file. It defaults to the CRAN_web.css file also used for the 
rest of the web area on CRAN.


So when you generate your own web pages on your own server, you can plug 
in any .css you like. But as a CRAN user/viewer, I don't think you can 
modify the already existing .html pages.



Are there any markdown-like tools for writing a CTV?


No. When I wrote "ctv" XML seemed to be the natural format to go with. 
If I were to write it again today, I might use something different. But so 
far XML worked well enough for me.


Best,
Z



-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

__
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] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Achim Zeileis

On Thu, 31 Jan 2013, Yihui Xie wrote:


See this page by Barry Rowlingson:
https://stat.ethz.ch/pipermail/r-devel/2012-February/063338.html

Given that CRAN maintainers do not even use JavaScript, I bet CSS does
not matter either;


You lose - see help("ctv2html", package = "ctv"). Have I won anything? ;-)

Best,
Z


plain text is plain good.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Jan 31, 2013 at 8:50 AM, Michael Friendly  wrote:

CRAN task views are useful, but they seem difficult to write and maintain
because the XML format is rather
limited (no sectioning) and the  must be maintained manually.
They are also difficult to read because the generated html and .css used are
extremely basic, giving an
overly dense page.

Are there any markdown-like tools for writing a CTV?  Is it possible to
apply a custom .css to a CTV?

-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA


__
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] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Michael Friendly

On 1/31/2013 12:01 PM, Achim Zeileis wrote:

Michael:

CRAN task views are useful, but they seem difficult to write and 
maintain because the XML format is rather limited (no sectioning)


What type of sectioning would you like to have? In the HTML part, you 
can use the usual structuring tools like , , etc. It's not
OK. I think you mean the  ...  section, where I failed to 
read the vignette sufficiently closely, which talks about

using HTML.



and the  must be maintained manually.


Yes, but I recently started adding tools to help checking this. 
Hopefully I'll also get round to add some more convenience features 
for this.
Something simple might be a tool to scan the  ...  section 
for  ...  mentions and just print
a new  section to the console.  This would avoid having to 
remember what you added recently

and manually add to the 

-Michael


--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

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