search for: repr

Displaying 20 results from an estimated 57 matches for "repr".

Did you mean: repo
2019 Jun 05
2
The way of implementing structs of Rust bindings
Hi, I'm now implementing generators of Rust, and I faced a problem. In order for the wrapper to 'understand' the struct passed from C API, it is required to incorporate the definition of the struct in C into Rust code. I have two approaches. 1. Create raw struct(#[repr(C)]), which has the equivalent memory mapping to C struct and access through this struct in Rust 2. Use bindgen to create ffi struct from guestfs.h Each of them has advantages and disadvantages. # 1st approach This is highly dependent on the implementation of API because it is subject to the memo...
2019 Jun 05
1
Re: The way of implementing structs of Rust bindings
...er to 'understand' the struct passed from C API, it > > is required to incorporate the definition of the struct in C into Rust > > code. > > > > I have two approaches. > > I don't know a lot about Rust bindings, but ... > > > 1. Create raw struct(#[repr(C)]), which has the equivalent memory mapping > > to C struct and access through this struct in Rust > > ... this is what I did in nbdkit (although it is not generated, but > written by hand in this case): > > > https://github.com/libguestfs/nbdkit/blob...
2019 Aug 16
0
[nbdkit PATCH 2/2] rust: Add support for dynamic .thread_model
...st plugins will have already thought about thread models, they can convert their existing model into the new .thread_model field (and thus, I don't feel too bad making Parallel the default, even if it is not always the safest). And something I learned the hard way: enum ThreadModel _must_ be #[repr(C)], otherwise Rust will compile a return type of this enum into a 1-byte return, even though C expects sign-extension into a 4-byte return; the garbage left in the other three bytes (at least on x86 architecture) would generally render .thread_model broken otherwise. Signed-off-by: Eric Blake &lt...
2019 Aug 16
1
Re: [nbdkit PATCH 2/2] rust: Add support for dynamic .thread_model
...hought about thread > models, they can convert their existing model into the new > .thread_model field (and thus, I don't feel too bad making Parallel > the default, even if it is not always the safest). > > And something I learned the hard way: enum ThreadModel _must_ be > #[repr(C)], otherwise Rust will compile a return type of this enum > into a 1-byte return, even though C expects sign-extension into a > 4-byte return; the garbage left in the other three bytes (at least on > x86 architecture) would generally render .thread_model broken > otherwise. > >...
2019 Aug 16
7
[nbdkit PATCH 0/2] rust: Implement some missing v2 callbacks
Similar to what I just did for OCaml (this IS an API break, requiring recompilation of any existing Rust plugin), and done because I want to add fast_zero support to both languages as part of my upcoming fast zero series. Figuring out how to get extents working was hard enough that I punted that, still. Eric Blake (2): rust: Implement can_cache rust: Add support for dynamic .thread_model
2019 Jun 05
0
Re: The way of implementing structs of Rust bindings
...em. > > In order for the wrapper to 'understand' the struct passed from C API, it > is required to incorporate the definition of the struct in C into Rust > code. > > I have two approaches. I don't know a lot about Rust bindings, but ... > 1. Create raw struct(#[repr(C)]), which has the equivalent memory mapping > to C struct and access through this struct in Rust ... this is what I did in nbdkit (although it is not generated, but written by hand in this case): https://github.com/libguestfs/nbdkit/blob/a5d94ab65110136680598677610868...
2002 Nov 26
1
script-shell sftp
...47;/lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20021126/2e7b17c0/attachment.vcf -------------- next part -------------- Post-scriptum La Poste Ce message est confidentiel. Sous r?serve de tout accord conclu par ?crit entre vous et La Poste, son contenu ne repr?sente en aucun cas un engagement de la part de La Poste. Toute publication, utilisation ou diffusion, m?me partielle, doit ?tre autoris?e pr?alablement. Si vous n'?tes pas destinataire de ce message, merci d'en avertir imm?diatement l'exp?diteur.
2017 Jun 20
2
Unable to get transaction opinfo for transaction ID gluster version 3.6
...enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals. Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Conform?ment aux dispositions relatives ? la repr?sentation de l'asbl dans ses statuts, seul l'administrateur d?l?gu?, le directeur g?n?ral ou son mandataire expr?s est habilit? ? souscrire des engagements au nom de Smals. Si ce message ne vous est pas destin?, nous vous prions de nous le signaler imm?diatement et de d?truire le messag...
2007 Aug 05
5
accent
Salut alex, est-ce qu''il est possible d''avoir la liste de tous les accents qu''il est possible de représenter avec wxruby2, comme "é" par exemple. merci Sebastien _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2015 Apr 23
3
Usar una matriz sparse desde python a R
...o la que sea) y tengo prisa. Me pregunto si es posible pasar más o menos directamente de python a R (nada de pasar a texto el objeto, porque eso me lleva al mismo punto de llenar la sparse en R). He probado rPython (gracias Carlos Gil por esta librería!) pero suelta este error raise TypeError(repr(o) + " is not JSON serializable") TypeError: <138493x26744 sparse matrix of type '<type 'numpy.int64'>' with 19761138 stored elements in LInked List format> is not JSON serializable ¿Hay alguna otra posibilidad? Gracias! -- Pedro Concejero BI & Big Dat...
2017 Jul 14
3
Next steps for optimization remarks?
...ticularly easy to read. I guess > this can be mitigated with some filtering approach, I and Simon > discussed it offline. Can you please elaborate? > > 2) Yes, indeed `opt-viewer` takes forever for large testcases to > process. I think that it could lead to exploring a better > representation than YAML which is, indeed, a little slow to parse. To > be honest, I'm torn about this. > YAML is definitely really convenient as we already use it somewhere in > tree, and it has an easy textual repr. OTOH, it doesn't seem to scale > that nicely. Agreed. We now hav...
2020 Sep 01
3
Re: [nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...m still not sure this is the best interface. Applying this on top of the original patch lets me use 'string option' instead of 'string' as the second member of the export record. https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s%3Ac-ocaml-datatype-repr didn't directly answer my question, but my understanding is that since 'string option' is the same as: type 'a t = a' option = | None (* Is_block is false, value is Val_int(0) *) | Some of 'a (* Is_block is true, value is block with tag 0 *) then checking...
2017 Jun 19
8
Next steps for optimization remarks?
Hello all, In https://www.youtube.com/watch?v=qq0q1hfzidg, Adam Nemet (cc'ed) describes optimization remarks and some future plans for the project. I had a few follow-up questions: 1. As an example of future work to be done, the talk mentions expanding the set of optimization passes that emit remarks. However, the Clang User Manual mentions that "optimization remarks do not
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...quot; pub %s: u64,\n" n + | n, FInt64 -> pr " pub %s: i64,\n" n + | n, FUUID -> pr " pub %s: UUID,\n" n + | n, FOptPercent -> pr " pub %s: Option<f32>,\n" n ) cols; pr "}\n"; pr "#[repr(C)]\n"; @@ -214,8 +284,8 @@ impl UUID { ) cols; pr "}\n"; pr "\n"; - pr "impl %s {\n" name; - pr " fn new(raw: *const Raw%s) -> %s {\n" name name; + pr "impl convert::From<*const Raw%s> for %s {\n&quot...
2017 Jul 14
2
Next steps for optimization remarks?
...cedural optimizations which in turn generates more > remarks. > 2) As pointed out earlier, DI is not always reliable. > >> >> >> 2) Yes, indeed `opt-viewer` takes forever for large testcases to >> process. I think that it could lead to exploring a better >> representation than YAML which is, indeed, a little slow to parse. To >> be honest, I'm torn about this. >> YAML is definitely really convenient as we already use it somewhere in >> tree, and it has an easy textual repr. OTOH, it doesn't seem to scale >> that nicely. >...
2018 Feb 19
0
[RFC PATCH v3 0/3] Enable virtio_net to act as a backup for a passthru device
...out here? I.e. what's the user space app that expects the netdev to be linked? This is just out of curiosity, the linking of netdevs to devices is a bit of a PITA in the switchdev eswitch mode world, with libvirt expecting only certain devices to be there.. Right now we're not linking VF reprs, which breaks naming. I wanted to revisit that. > > FWIW two solutions that immediately come to mind is to export "backup" > > as phys_port_name of the backup virtio link and/or assign a name to the > > master like you are doing already. I think team uses team%d...
2010 Mar 31
1
Hyphen search with parse_query()
...a basic python script to get to grips with it. When I do this:: qp = xapian.QueryParser() stemmer = xapian.Stem("english") qp.set_stemmer(stemmer) qp.set_database(database) qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME) print "Query string is:", repr(query_string) query = qp.parse_query(query_string) print "Parsed query is: %s" % str(query) I get the following output:: Query string is: 'peter-bengtsson' Parsed query is: Xapian::Query((ssh:(pos=1) PHRASE 2 bengtsson:(pos=2))) 22 results found. This is wrong as...
2010 Feb 25
2
getaddrinfo problem
...getreply(self=<smtplib.SMTP instance>) 349 if line == '': 350 self.close() 351 raise SMTPServerDisconnected("Connection unexpectedly closed") 352 if self.debuglevel > 0: print>>stderr, 'reply:', repr(line) 353 resp.append(line[4:].strip()) global SMTPServerDisconnected = <class smtplib.SMTPServerDisconnected> SMTPServerDisconnected: Connection unexpectedly closed args = ('Connection unexpectedly closed',) Notice that line: code undefined, msg = 'getaddrin...
2019 Jun 27
0
[PATCH 4/9] Rust bindings: Add generator of structs
...ytes) -> pr " %s: u64,\n" n + | n, FInt64 -> pr " %s: i64,\n" n + | n, FUUID -> pr " %s: UUID,\n" n + | n, FOptPercent -> pr " %s: Option<f32>,\n" n + ) cols; + pr "}\n"; + pr "#[repr(C)]\n"; + pr "struct Raw%s {\n" name; + List.iter ( + function + | n, FChar -> pr " %s: c_char,\n" n + | n, FString -> pr " %s: *const c_char,\n" n + | n, FBuffer -> + pr " %s_len: usize,\n&quot...
2020 Sep 01
0
Re: [nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...sure > this is the best interface. Applying this on top of the original > patch lets me use 'string option' instead of 'string' as the second > member of the export record. https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s%3Ac-ocaml-datatype-repr > didn't directly answer my question, but my understanding is that > since 'string option' is the same as: > > type 'a t = a' option = > | None (* Is_block is false, value is Val_int(0) *) > | Some of 'a (* Is_block is true, value is block wi...