Displaying 20 results from an estimated 2000 matches similar to: "serialization of external pointers"
2011 May 31
1
assignInNamespace and new bindings
Hello,
assignInNamespace refuses to assign an object to a name that is not
already used in the namespace.
Something like this would make it possible:
--- src/library/utils/R/objects.R (revision 56024)
+++ src/library/utils/R/objects.R (working copy)
@@ -252,8 +252,9 @@
stop("environment specified is not a package")
ns <- asNamespace(substring(nm, 9L))
2013 Nov 16
2
serialization for external pointers
Hello,
Are there any recipe to handle serialization / deserialization of
external pointers.
I'm thinking about something similar in spirit to the way we handle
finalization of external pointers.
Currently, if we create an external pointer, save the session, quit R,
then load the session, we get a null pointer.
One way I'm thinking of is to have an environment in the
2007 Aug 03
2
How to properly finalize external pointers?
Dear R .Call() insiders,
Can someone enlighten me how to properly finalize external pointers in C code (R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the finalizer set in R_RegisterCFinalizer?
I succeeded registering a finalizer that works when an R object containing an external pointer is garbage collected. However, I have some difficulties figuring out how to do that in an
2012 Mar 22
1
Serializing many small objects efficiently
Hi,
sorry if this question is trivial or unclear, this is my first venture into
mixed C/R programming (I am reasonably experienced in each separately).
I am trying to write a serialization function for a format called
typedbytes, which is used as an interchange format in Hadoop circles. Since
I would need to serialize according to the internal R format many small R
objects I looked at the c
2020 Jan 29
2
Model object, when generated in a function, saves entire environment when saved
Reviving an old thread. I haven't noticed this be a problem for a while
when saving RDS's which is great. However, I noticed the problem again when
saving `qs` files (https://github.com/traversc/qs) which is an RDS
replacement with a fast serialization / compression system.
I'd like to get an idea of what change was made within R to address this
issue for `saveRDS`. My thought is that
2011 Jun 04
2
Interfacing a C++ class
Hello
Apologies for cross-posting, the discussion should (if) go to R-devel, but I also want to reach the rcpp-devel people.
My C++ class FOO is a module available through Rcpp, and it works fine and is -- so far -- bug free. With trying to further develop my R package, I thought it was a good idea to interface my C++ workhorse FOO with an S4 class Foo. After some long and not always insightful
2024 Jan 12
2
Choices to remove `srcref` (and its buddies) when serializing objects
Dear R devs,
I was digging into a package issue today when I realized R serialize function not always generate the same results on equivalent objects when users choose to run differently. For example, the following code
serialize(with(new.env(), { function(){} }), NULL, TRUE)
generates different results when I copy-paste into console vs when I use ctrl+shift+enter to source the file in RStudio.
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
On 1/16/24 20:16, Dipterix Wang wrote:
> Could you recommend any packages/functions that compute hash such that
> the source references and sexpinfo_struct are ignored? Basically a
> version of `serialize` that convert R objects to raw without storing
> the ancillary source reference and sexpinfo.
> I think most people would think of `digest` but that package uses
>
2024 Jan 16
2
Choices to remove `srcref` (and its buddies) when serializing objects
Could you recommend any packages/functions that compute hash such that the source references and sexpinfo_struct are ignored? Basically a version of `serialize` that convert R objects to raw without storing the ancillary source reference and sexpinfo.
I think most people would think of `digest` but that package uses `serialize` (see discussion
2017 Aug 23
1
How to benchmark speed of load/readRDS correctly
Hi there
Thanks for your answers. I didn't expect that this would be so complex. Honestly, I don't understand everything you wrote since I'm not an IT specialist. But I read something that reading *.rds files is faster than loading *.Rdata and I wanted to proof that for my system and R version. But thanks anyway for your time.
Cheers Raphael
> -----Urspr?ngliche Nachricht-----
2018 Nov 07
2
error unserializing ascii format (v2 or v3)
I ran into an interesting error unserializing a file created with
ascii=TRUE:
R 3.5.1 (Windows or Linux):
> unserialize(serialize(list(raw=as.raw(c(39,41))), NULL, version=2,
ascii=TRUE))
Error in unserialize(serialize(list(raw = as.raw(c(39, 41))), NULL,
version = 2, :
ReadItem: unknown type 29, perhaps written by later version of R
The same error happens when the
2019 Jan 22
1
About xapian serialization on float/double variables
Dear Members of Xapian Project,
Sorry for troubling you this time. It can be witnessed that xapian will store Document values with serialization approach when given value types meet float/double.
Such an approach is deployed on sort_key related fields as well, where the xapian requires KeyMaker::operator() must return an serialized float/dobule variable. Then heap sort comes and ranks
2012 Jan 09
1
serializing recordedplot object
I use recordPlot() to save plots to disk that I render later to a
variety of formats. This works fine for base R plots and ggplot2
plots, and also used to work for lattice plots. However somewhere in
version 2.14 things stopped working for lattice plots. Here is an
example:
library(lattice);
histogram(rnorm(100));
x <- recordPlot();
saveRDS(x, "myplot.rds");
y <-
2011 Dec 06
1
unserialize and eager execution
Hi,
While debugging a network server I'm developing I noticed something unusual
- call to unserialize() resulted in
an error about loading a namespace.
I was a bit taken back by this - why should unserializing an object cause a
namespace lookup?
Are there any other side-effects of unserialize() that I should be cautious
about? I've been
digging through the R_Unserialize() call, I
2007 Apr 18
1
YAML serialization
Hi,
something wrong with ActiveRecord or YAML? They don''t put Strings
into Quotes when it serializes. This gave me trouble when I
serialized a String with a double colon (eg. ''key: value''). After AR
unserialized the Value it became a Hash since a String ''key: value''
becomes attribute[:key] => value... :(
Sincerely
Florian
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
> I think one could implement hashing on the fly without any
> serialization, similarly to how identical works, but I am not aware of
> any existing implementation
We have one in vctrs but it's not exported:
https://github.com/r-lib/vctrs/blob/main/src/hash.c
The main use is vectorised hashing:
```
# Non-vectorised
vctrs:::obj_hash(1:10)
#> [1] 1e 77 ce 48
# Vectorised
2011 Sep 28
1
serialize/unserialize vector improvement
Hi folks,
I've attached a patch to the svn trunk that improves the performance
of the serialize/unserialize interface for vector types. The current
implementation: a) invokes the R_XDREncode operation for each element
of the vector type, and b) uses a switch statement to determine the
stream type for each element of the vector type. I've added
R_XDREncodeVector/R_XDRDecodeVector functions
2012 Aug 24
3
ActiveRecord storing arrays and hashes
Hi,
When trying to store a Array or Hash to a string field, ActiveRecord
automatically
serializes them to yaml. If that''s so why is there a special option
called serialize?
--
Azhagu Selvan
http://tamizhgeek.in
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Oct 21
6
detecting width overflow in serialized column with mysql
So I''ve got an ActiveRecord model pointing to a MySQL db, with an
auto-serialized column ("serialize :columnName").
Thing is, MySQL, depending on how it''s configured (like, by default),
has a bad habit of just truncating your data if it''s too wide for the
column, with no error raised. Yeah, I can probably reconfigure MySQL
and/or my AR connection to it. But
2020 Oct 29
2
Something is wrong with the unserialize function
Hi all,
I am not able to export an ALTREP object when `gctorture` is on in the
worker. The package simplemmap can be used to reproduce the problem. See
the example below
```
## Create a temporary file
filePath <- tempfile()
con <- file(filePath, "wrb")
writeBin(rep(0.0,10),con)
close(con)
library(simplemmap)
library(parallel)
cl <- makeCluster(1)
x <- mmap(filePath,