search for: is_true

Displaying 16 results from an estimated 16 matches for "is_true".

Did you mean: js_true
2020 Feb 21
0
function(x) !is.na(x) & x "is_true(.)" etc. was: [R] How to index..
...1, so >> isTRUE(c(TRUE,FALSE,NA)) > [1] FALSE >> isTRUE(c(TRUE,TRUE, TRUE)) # I thought I thaw a puddycat... ;-) > [1] FALSE >> Vectorize(isTRUE)(c(TRUE,FALSE,NA)) > [1] TRUE FALSE FALSE > (The latter would be silly as an implementation of is_true, of course.) > -pd yes... We've had (hidden) functions in the Matrix package for these, which can still be accelerated (quite a bit for most arguments), in Matrix/R/Auxiliaries.R (see the R-forge development version : https://r-forge.r-project.org/scm/viewvc.php/pkg/Matrix/R/Auxiliari...
2020 Feb 19
2
How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.
Dear all, Could you please help me how to get the output as I described in the following example? x<-c(543, 543, 543, 543, 551 , 551 ,1128 ,1197, 1197) diff<-x-lag(x) diff [1] NA 0 0 0 8 0 577 69 0 How to index the occasions in x repeatedly if the diff<15? if diff>=15, it will give a new index. I want the output be like y. y<-c(1,1,1,1,1,1,2,3,3) Thank you so
2020 Feb 19
2
How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.
Dear all, Could you please help me how to get the output as I described in the following example? x<-c(543, 543, 543, 543, 551 , 551 ,1128 ,1197, 1197) diff<-x-lag(x) diff [1] NA 0 0 0 8 0 577 69 0 How to index the occasions in x repeatedly if the diff<15? if diff>=15, it will give a new index. I want the output be like y. y<-c(1,1,1,1,1,1,2,3,3) Thank you so
2014 Dec 17
3
[PATCH 0/3] Allow environment variables to have boolean values.
https://bugzilla.redhat.com/show_bug.cgi?id=1175196 Currently if you write something like LIBGUESTFS_DEBUG=0 or LIBGUESTFS_DEBUG=true then it doesn't do what you probably expect. This patch series fixes that. Rich.
2018 Oct 01
7
[PATCH v2 API PROPOSAL 0/5] inspection Add network interfaces to inspection data.
The proposed API is the same as v1, but this includes an implementation (for /etc/sysconfig/network-scripts/ifcfg-*) and modifications to virt-inspector. This compiles and works. If you look in patch 5 you can see proposed output as virt-inspector XML for a guest (although this guest has not been booted, so a real guest would hopefully have a hwaddr="MAC" attribute too). Rich.
2009 Sep 11
1
[PATCH] guestfish: Enable grouping in string lists
...131 +++++++++++++++++++++++++++++++++++++++++++++-------- guestfish.pod | 6 ++- src/generator.ml | 3 +- 3 files changed, 118 insertions(+), 22 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index a4069d6..86c0dfa 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1082,30 +1082,121 @@ is_true (const char *str) strcasecmp (str, "no") != 0; } -/* XXX We could improve list parsing. */ char ** parse_string_list (const char *str) { - char **argv; - const char *p, *pend; - int argc, i; - - argc = 1; - for (i = 0; str[i]; ++i) - if (str[i] == ' ') argc++; -...
2009 Sep 11
1
[FOR REVIEW ONLY] guestfish: Enable grouping in string lists
...ote. --- fish/fish.c | 129 +++++++++++++++++++++++++++++++++++++++++++++-------- src/generator.ml | 3 +- 2 files changed, 111 insertions(+), 21 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index a4069d6..62ec3a3 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1082,30 +1082,119 @@ is_true (const char *str) strcasecmp (str, "no") != 0; } -/* XXX We could improve list parsing. */ char ** parse_string_list (const char *str) { - char **argv; - const char *p, *pend; - int argc, i; - - argc = 1; - for (i = 0; str[i]; ++i) - if (str[i] == ' ') argc++; -...
2015 Dec 02
3
[PATCH 0/3] [FOR COMMENTS ONLY] Rework inspection.
This is something I've been working on: Reworking inspection so it's not a big mess of ad hoc C code, but instead uses a well-defined domain-specific language to describe how we inspect guests. The best introduction to this is the manual page, which I include below (it's also included in patch 2/3). Rich. ---------------------------------------------------------------------- NAME
2016 Feb 23
4
[PATCH v3 0/4] [FOR COMMENTS ONLY] Rework inspection.
Previously posted: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html Inspection now really succeeds on a small number of simple guests. To test it out: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" Rich.
2015 Dec 05
6
[PATCH 0/6 v2] [FOR COMMENTS ONLY] Rework inspection.
This is a more working version. Inspection (partially) succeeds on a real guest this time :-) You can test it out on a real guest (in this case, a CentOS disk image located at /tmp/centos-6.img) by doing: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" which will print lots of debugging, and at the end the
2016 Jan 21
8
[PATCH v3 0/6] [FOR COMMENTS ONLY] Rework inspection.
For background on this change, see: https://rwmj.wordpress.com/2015/12/06/inspection-now-with-added-prolog/ v2 was previously posted here: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html To test this patch series on a real guest, you can do: $ ./run guestfish -v -x -a /var/tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky for development (too easy to miss new ones) so I spent some time last week and today working on removing them. The first patch gets us down to almost no warnings with the original -Wall setting. That was by far the hardest part. Once I'd done that, I enabled nearly all of gcc's warnings via gnulib's warnings and manywarnings modules
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally useful to any binding which uses camel case by requirement or convention. --- generator/generator_haskell.ml | 4 ++-- generator/generator_java.ml | 10 +++++----- generator/generator_main.ml | 2 +- generator/generator_structs.ml | 12 +++++------- generator/generator_structs.mli | 8 ++++---- 5
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...;|xargs \ perl -pi -e 's/\bstrcasecmp( ?\(.*?\)) != 0/STRCASENEQ$1/g' --- fish/fish.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index 9a89f55..cac4e4a 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1107,11 +1107,11 @@ int is_true (const char *str) { return - strcasecmp (str, "0") != 0 && - strcasecmp (str, "f") != 0 && - strcasecmp (str, "false") != 0 && - strcasecmp (str, "n") != 0 && - strcasecmp (str, "no") != 0; + STR...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...ame i i - | FileOut name -> - pr " %s = strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n" - name i i - | StringList name -> - pr " %s = parse_string_list (argv[%d]);\n" name i - | Bool name -> - pr " %s = is_true (argv[%d]) ? 1 : 0;\n" name i - | Int name -> - pr " %s = atoi (argv[%d]);\n" name i + fun i -> + function + | String name -> pr " %s = argv[%d];\n" name i + | OptString name -> + pr " %s = strcmp (a...