Displaying 20 results from an estimated 200 matches similar to: "A question about the API mkchar()"
2023 Jan 31
1
Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '<ff>' if an environment variable contains \xFF
Can we use the "bytes" encoding for such environment variables invalid
in the current locale? The following patch preserves CE_NATIVE for
strings valid in the current UTF-8 or multibyte locale (or
non-multibyte strings) but sets CE_BYTES for those that are invalid:
Index: src/main/sysutils.c
===================================================================
--- src/main/sysutils.c
2023 Jan 30
2
Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '<ff>' if an environment variable contains \xFF
/Hello.
SUMMARY:
$ BOOM=$'\xFF' LC_ALL=en_US.UTF-8 Rscript --vanilla -e "Sys.getenv()"
Error in substring(x, m + 1L) : invalid multibyte string at '<ff>'
$ BOOM=$'\xFF' LC_ALL=en_US.UTF-8 Rscript --vanilla -e "Sys.getenv('BOOM')"
[1] "\xff"
BACKGROUND:
I launch R through an Son of Grid Engine (SGE) scheduler, where the R
2017 Jun 11
1
translateChar in NewName in bind.c
I see another thing in function 'NewName' in bind.c. In
else if (*CHAR(tag)) ,
'ans' is basically copied from 'tag'. Could the whole thing there be just the following?
ans = tag;
It seems to me that it can also replace
ans = R_BlankString;
in 'else'; so,
else if (*CHAR(tag))
and
else
can be merged to be just
else .
--------------------------------------------
2023 Jan 31
1
Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '<ff>' if an environment variable contains \xFF
On 1/31/23 09:48, Ivan Krylov wrote:
> Can we use the "bytes" encoding for such environment variables invalid
> in the current locale? The following patch preserves CE_NATIVE for
> strings valid in the current UTF-8 or multibyte locale (or
> non-multibyte strings) but sets CE_BYTES for those that are invalid:
>
> Index: src/main/sysutils.c
>
2009 Jan 27
2
Package (PR#13475)
Full_Name: Partho Bhowmick
Version: 2.8.1
OS: Windows XP
Submission from: (NULL) (199.43.48.131)
While trying to install package sn (I have tried multiple mirrors),
I get the following message
trying URL 'http://www.revolution-computing.com/cran/bin/windows/contrib/2.8/sn_0.4-10.zip'
Content type 'application/zip' length 320643 bytes (313 Kb)
opened URL
downloaded 313 Kb
2003 May 14
2
Is there a simple method of changing text into 'Proper Ca se'
Yes and no. Given your response it appears that "Proper Case" is not a term
that everyone uses. In Excel there is a function "Proper" which in essence
changes "this line into something like this" into "This Line Into Something
Like This."
My look at casefold seesm to be that is is a wrapper of two functions to
change text into either Lower or Upper case.So
2009 Feb 01
2
Using arrays to generate parameters
My external node classifier returns some arrays in the list of
parameters. Example output (names have been changed to protect the
innocent):
$ ./node_classifier a.b.com
--- %YAML:1.0
"classes": ["class1", "class2", "class3"]
"parameters":
"hostname": "a"
"name": "a"
"domain":
2016 May 12
3
Suggestion: mkString(NULL) should be NA
I would like to propose that Rf_mkString(NULL) and Rf_mkChar(NULL)
return NA rather than segfault.
Case: the mkString() and mkChar() functions are convenient to wrap
strings returned by e.g. external C libraries into an R vector.
However sometimes a library returns NULL instead of a string when the
result is unavailable. In some C libraries this can happen
unexpectedly or is even undocumented.
A
2023 Jan 31
2
Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '<ff>' if an environment variable contains \xFF
>>>>> Tomas Kalibera
>>>>> on Tue, 31 Jan 2023 10:53:21 +0100 writes:
> On 1/31/23 09:48, Ivan Krylov wrote:
>> Can we use the "bytes" encoding for such environment variables invalid
>> in the current locale? The following patch preserves CE_NATIVE for
>> strings valid in the current UTF-8 or multibyte locale (or
2016 May 05
4
R process killed when allocating too large matrix (Mac OS X)
Hi Simon,
thanks for your quick reply.
1) ... so you can reproduce this?
2) Do you know a way how this can be 'foreseen'? We allocate larger
matrices in the copula package depending on the user's input
dimension. It would be good to tell her/him "Your dimension is quite
large. Be aware of killers in your neighborhood"... before the killer
attacks.
Thanks & cheers,
2016 May 04
1
R process killed when allocating too large matrix (Mac OS X)
> Can you elaborate on "leads to R being killed"? You should tell to the killer not to do it again :).
Hi Simon!
Sure, but who do you tell it if you don't know the killer?
This is all the killer left me with, the 'crime scene' if you like :-)
> m <- matrix(0, 90000, 100000)
Killed: 9
My colleague Wayne Oldford also tried it on his Mac machine and
apparently the
2014 Jan 21
1
Using unicode from C interface of R
Hi ,
I am using C interface of R . If a unicode string is read , in what format
I could pass it back to R ?
I was trying to use the following
tpStr = ( char *)val;
SET_STRING_ELT(innerList , 0, mkChar(tpStr));
It does not work .
If I pass it back from as RAW format to R , what package is there to read
it ? I mean package for interpreting RAW data .
Thanks,
Sandip
[[alternative HTML
2016 May 05
1
R process killed when allocating too large matrix (Mac OS X)
Hi,
Interesting "feature" in 10.11.4. I wonder if the process is killed
before or after malloc() returns. If before, it seems very blunt:
"You're asking too much and I don't like it so I kill you now".
If after it doesn't look much better: "You're asking a lot and I
don't like it but I give it to you anyway. I'll kill you quickly
later".
Why
2019 May 19
4
most robust way to call R API functions from a secondary thread
Hi,
As the subject suggests, I am looking for the most robust way to call an (arbitrary) function from the R API from another but the main POSIX thread in a package's code.
I know that, "[c]alling any of the R API from threaded code is ?for experts only? and strongly discouraged. Many functions in the R API modify internal R data structures and might corrupt these data structures if
2004 Jun 08
5
fast mkChar
Hi,
To speed up reading of large (few million lines) CSV files I am writing
custom read functions (in C). By timing various approaches I figured out
that one of the bottlenecks in reading character fields is the mkChar()
function which on each call incurs a lot of garbage-collection-related
overhead.
I wonder if there is a "vectorized" version of mkChar, say mkChar2(char
**, int
2016 Jan 27
2
rstan warning messages
Confirmed that gcc-gfortran is installed
Package gcc-gfortran-4.4.7-16.el6.x86_64 already installed and latest version
What could I check next?
I do not have the following installed and will get that done and tested again.
libcurl-devel
libidn-devel
Thanks,
Larry
-----Original Message-----
From: Tom Callaway [mailto:tcallawa at redhat.com]
Sent: Wednesday, January 27, 2016
2010 Mar 03
1
(PR#14226) -- Re: libgfortran misplaced in Mac OS X R install (PR#14226)
I am the guy who compiles the OpenMx binaries. We would be delighted
to place our package on CRAN, once the project is stable enough so
that we are comfortable releasing it to the larger public. Let's try
to track down where I made a mistake. Our Makevars.in file contains
the line:
PKG_LIBS=$(FLIBS) $(BLAS_LIBS) $(LAPACK_LIBS)
In addition, on the build machine I noticed that a copy of
2019 May 20
1
most robust way to call R API functions from a secondary thread
Stepan,
Andreas gave a lot more thought into what you question in your reply. His question was how you can avoid what you where proposing and have proper threading under safe conditions. Having dealt with this before, I think Andreas' write up is pretty much the most complete analysis I have seen. I'd wait for Luke to chime in as the ultimate authority if he gets to it.
The
2010 Jan 03
1
Re: How to achieve Japanese localization on Mac OSX?
Marvin_Arnold wrote:
>
> Charles Davis wrote:
> > James McKenzie wrote:
> >
> > > vitamin wrote:
> > >
> > > > James McKenzie wrote:
> > > >
> > > >
> > > > > I do think this is doable, but the appropriate variables have to be set before running Wine, just like you do in Linux (or any other UNIX for that
2004 Jun 14
5
mkChar can be interrupted
Hi,
As was discussed earlier in another thread and as documented in R-exts
.Call() should not be interruptible by Ctrl-C. However the following
code, which spends most of its time inside mkChar, turned out to be
interruptible on RH-7.3 R-1.8.1 gcc-2.96:
#include <Rinternals.h>
#include <R.h>
SEXP foo0(const SEXP nSexp) {
int i, n;
SEXP resSexp;
if (!isInteger(nSexp))