search for: lenout

Displaying 6 results from an estimated 6 matches for "lenout".

2016 Nov 15
2
ifelse() woes ... can we agree on a ifelse2() ?
...at's worth...) that x = rnorm(100) y = ifelse2(x > 0, 1L, 2L) should continue to work. Also, If we combine a stricter contract that the output will always be of length with the suggestion of a specified output class the pseudo code could be ifelse2 = function(test, yes, no, outclass) { lenout = length(test) out = as( rep(yes, length.out = lenout), outclass) out[!test] = as(rep(no, length.out = lenout)[!test], outclass) #handle NA stuff out } NAs could be tricky if outclass were allowed to be completely general, but doable, I think? Another approach if we ARE fast-passing while...
2016 Nov 22
0
ifelse() woes ... can we agree on a ifelse2() ?
...as logical < integer < double < complex and your pseudo code below would not work so easily I think. > the pseudo code could be (I'm changing assignment '=' to '<-' ... [please!] ) > ifelse2 <- function(test, yes, no, outclass) { > lenout <- length(test) > out <- as( rep(yes, length.out <- lenout), outclass) > out[!test] <- as(rep(no, length.out = lenout)[!test], outclass) > # handle NA stuff > out > } > NAs could be tricky if outclass were allowed to be completely gen...
2016 Nov 26
3
ifelse() woes ... can we agree on a ifelse2() ?
...lt; complex > > and your pseudo code below would not work so easily I think. > >? ???> the pseudo code could be > > (I'm changing assignment '=' to? '<-' ...? [please!] ) > >? ???> ifelse2 <- function(test, yes, no, outclass) { >? ???>???lenout? <- length(test) >? ???>???out <- as( rep(yes, length.out <- lenout), outclass) >? ???>???out[!test] <- as(rep(no, length.out = lenout)[!test], outclass) >? ???>???# handle NA stuff >? ???>???out >? ???> } > > >? ???> NAs could be tricky if outc...
2016 Aug 15
2
ifelse() woes ... can we agree on a ifelse2() ?
On Fri, Aug 12, 2016 at 11:31 AM, Hadley Wickham <h.wickham at gmail.com> wrote: >> >> One possibility would also be to consider a "numbers-only" or >> >> rather "same type"-only {e.g., would also work for characters} >> >> version. >> >> > I don't know what you mean by these. >> >> In the
2016 Nov 28
0
ifelse() woes ... can we agree on a ifelse2() ?
...k so easily I think. >> >> ? ???> the pseudo code could be >> >> (I'm changing assignment '=' to? '<-' ...? [please!] ) >> >> ? ???> ifelse2 <- function(test, yes, no, outclass) { >> ? ???>???lenout? <- length(test) >> ? ???>???out <- as( rep(yes, length.out <- lenout), outclass) >> ? ???>???out[!test] <- as(rep(no, length.out = lenout)[!test], outclass) >> ? ???>???# handle NA stuff >> ? ???>???out >> ? ???> } &g...
2008 Sep 30
1
Problem compiling tinc-1.0.8 on gcc-2.95
....st.active) send_meta(c, buffer, length); } } @@ -170,7 +170,7 @@ while(lenin > 0) { /* Decrypt */ - if(c->status.decryptin && !decrypted) { + if(c->status.st.decryptin && !decrypted) { result = EVP_DecryptUpdate(c->inctx, (unsigned char *)inbuf, &lenout, (unsigned char *)c->buffer + oldlen, lenin); if(!result || lenout != lenin) { logger(LOG_ERR, _("Error while decrypting metadata from %s (%s): %s"), diff -ubr tinc-1.0.8/src/net.c tinc-1.0.8.my/src/net.c --- tinc-1.0.8/src/net.c Wed Feb 14 11:20:27 2007 +++ tinc-1.0.8.my/src/...