search for: sub2

Displaying 20 results from an estimated 86 matches for "sub2".

Did you mean: sub
2006 Aug 08
9
Handling userland char ** pointers
...smaller pieces to see what was going on at each step. Here''s the "C" and "D" code: --- pt.c --- static int sz = sizeof(char *); main() { char *s = "abcdefghijk"; char **p = &s; printf ("Size of pointer = %d\n", sz); sub1(s); sub2(p); exit(0); } sub1 (char *arg) { if (sz == 4) printf ("First 32 bit pointer = %x\n", arg); else printf ("First 64 bit pointer = %llx\n", arg); puts (arg); return; } sub2 (char **arg) { if (sz == 4) printf ("Second 32 bit pointer = %x\n&...
2012 Nov 10
2
[LLVMdev] Saving a reference to a Basic Block?
...xecutes a switch statement based on that ID to branch to the Base Block to return to for that integer ID. (I attached a text file with the input file, output file, and generated LLVM code, if you want to see all the details). But to explain it in psudeo code: The BASIC code is: gosub sub1 gosub sub2 sub1: sub2: return (Note the "subroutine" has multiple entry points, or put another way, the subroutines can share common code or return statements) Which translates to this llvm psuedo code: basicblock1: ext_runtime_function_push(101): br sub1 <-- 101 could be anything, the c...
2008 Oct 07
3
vectorized sub, gsub, grep, etc.
R pattern-matching and replacement functions are vectorized: they can operate on vectors of targets. However, they can only use one pattern and replacement. Here is code to apply a different pattern and replacement for every target. My question: can it be done better? sub2 <- function(pattern, replacement, x) { len <- length(x) if (length(pattern) == 1) pattern <- rep(pattern, len) if (length(replacement) == 1) replacement <- rep(replacement, len) FUN <- function(i, ...) { sub(pattern[i], replacement[i], x[i],...
2013 Nov 16
16
[PATCH] BTRFS-PROG: recursively subvolume snapshot and delete
Hi All, the following patches implement the recursively snapshotting and deleting of a subvolume. To snapshot recursively you must pass the -R switch: # btrfs subvolume create sub1 Create subvolume ''./sub1'' # btrfs subvolume create sub1/sub2 Create subvolume ''sub1/sub2'' # btrfs subvolume snapshot -R sub1 sub1-snap Create a snapshot of ''sub1'' in ''./sub1-snap'' Create a snapshot of ''sub1/sub2'' in ''./sub1-snap/sub2'' To recursively delete subvolumes,...
2006 Nov 01
1
How to rsync only specified subdirectories in the source folder?
Hi all, For example,if there is ten subdirectories named sub1~sub10(each including subdirectories and files too),and file1~file10,how can I rsync only sub2 and sub 3 to the target? /---- MyFolder |---------- sub1 |---------- sub2 |---------- sub3 |---------- sub4 |---------- sub5 |---------- sub6 |---------- sub7 |---------- sub8 |---------- sub9 |---------- sub10 |---------- file1 |---------- file2...
2003 Nov 05
0
Re: [S] LME - fixed effects model and missing values
...ch subject was measured *up to* four times, with missing measurements, so that the data look like this: > MAT<- structure(c(23, 24, 6, 19, 16, 20, 13, 11, NA, 8, NA, 21, 19, 15, 11, NA, 10, 12, 16, 30, 13, 16, NA, NA, NA, NA, 28, 6), .Dim = c(7, 4), .Dimnames = list(c("SUB1", "SUB2", "SUB3", "SUB4", "SUB5", "SUB6", "SUB7"), c("BDI0", "BDI3", "BDI6", "BDI12"))) > MAT BDI0 BDI3 BDI6 BDI12 SUB1 23 11 11 16 SUB2 24 NA NA NA SUB3 6 8 10 NA SUB4 19...
2013 Feb 22
1
[Bug 9670] New: missing substructure within partial-dir causes files to be lost or overwritten
...nc 3.0.9 protocol version 30 in Linux (openSuSE-12.2). The setup: local machine: danae, remote machine: devsys # cleanup rm -rf srcdir ssh korn at devsys "rm -rf /jbod1/tmp/priv-temp-dir /jbod1/tmp/priv-part-dir /jbod1/tmp/destdir" # create source structure mkdir -p srcdir/sub1 srcdir/sub2 echo "file1" > srcdir/sub1/file1 echo "readme1" > srcdir/sub1/README echo "file2" > srcdir/sub2/file2 echo "readme2" > srcdir/sub2/README # rsync ssh korn at devsys "mkdir -p /jbod1/tmp/priv-temp-dir" rsync --partial --delay-updates...
2005 Jun 14
0
c(recursive=TRUE)
Hi R users, I am currently using c(...,recursive=TRUE) to handle list-structured objects. This allows to represent something like: > l1 = list(level1=1,level2=list(sub1=1,sub2=2)) as: > (l1names = names(c(l1,recursive=TRUE))) [1] "level1" "level2.sub1" "level2.sub2" Then, one can use: > (l1names = sapply(l1names,FUN=function(element) strsplit(element,"\\."))) $level1 [1] "level1" $level2.sub1 [1] "level2...
2012 Dec 10
1
Problem/Bug when syncing subdirectory structures with delay-updates and partial-dir
...3.0.9 protocol version 30 in Linux (openSuSE-12.2). The setup: local machine: danae, remote machine: devsys # cleanup rm -rf srcdir ssh korn at devsys "rm -rf /jbod1/tmp/priv-temp-dir /jbod1/tmp/priv-part-dir /jbod1/tmp/destdir" # create source structure mkdir -p srcdir/sub1 srcdir/sub2 echo "file1" > srcdir/sub1/file1 echo "readme1" > srcdir/sub1/README echo "file2" > srcdir/sub2/file2 echo "readme2" > srcdir/sub2/README # rsync ssh korn at devsys "mkdir -p /jbod1/tmp/priv-temp-dir" rsync --partial --delay-updates...
2017 May 16
2
[RFC] Canonicalization of unsigned subtraction with saturation
...dBits or something, but we don't really do much to optimize selects involving zero. -Eli > On Tue, May 16, 2017 at 5:30 AM, Koval, Julia <julia.koval at intel.com > <mailto:julia.koval at intel.com>> wrote: > > (1.16) > %cmp = icmp ugt i16 %x, %y > %sub2 = sub i16 %y, %x > %res = select i1 %cmp, i16 0, i16 %sub2 > > or > > (2.16) > %cmp = icmp ugt i16 %x, %y > %sel = select i1 %cmp, i16 %x, i16 %y > %sub = sub i16 %sel, %x > > Which of these versions is canonical? I think first version is &g...
2017 May 16
2
[RFC] Canonicalization of unsigned subtraction with saturation
...m = *--p; *p =(m >= max ? m-max : 0); } } (2.16) void goo(unsigned short *p, unsigned short max, int n) { int i; unsigned short m; for (i = 0; i < n; i++) { m = *--p; unsigned short umax = m > max ? m : max; *p =umax - max; } } (1.16) %cmp = icmp ugt i16 %x, %y %sub2 = sub i16 %y, %x %res = select i1 %cmp, i16 0, i16 %sub2 or (2.16) %cmp = icmp ugt i16 %x, %y %sel = select i1 %cmp, i16 %x, i16 %y %sub = sub i16 %sel, %x Which of these versions is canonical? I think first version is better, because it can be converted to unsigned saturation instruction(i.e....
2006 Mar 23
1
comparative density estimates
...h.yorku.ca/SCS/Gallery/milestone/Test/kde-bug/mileyears32.gif http://euclid.psych.yorku.ca/SCS/Gallery/milestone/Test/kde-bug/mileyears33.gif The densities in the first are roughly equivalent to the R code d1 <- density(sub1, from=1500, to=1990, bw="sj", adjust=1) d2 <- density(sub2, from=1500, to=1990, bw="sj", adjust=1) the second to d1 <- density(sub1, from=1500, to=1990, bw="sj", adjust=2.5) d2 <- density(sub2, from=1500, to=1990, bw="sj", adjust=0.75) The second graph seems to me to undersmooth the more extensive data from Europe and...
2011 Apr 13
0
[LLVMdev] built-in longjmp and setjmp
...0 when compiled with clang. If it is supposed to return 23, it seems to me that saving and clobbering registers is not enough to guarantee correctness of the compiled program. #include <stdio.h> #include <stdlib.h> #include <setjmp.h> jmp_buf buf; void __attribute__((noinline)) sub2 (void) { longjmp (buf, 1); } int main (int argc, char** argv) { int n = atoi(argv[1]), r; if ((r = setjmp (buf))) { printf("n = %d\n", n); return 0; } n += 13; sub2 (); return n; } On Tue, Apr 12, 2011 at 5:51 PM, John McCall <rjmccall at apple...
2011 Aug 04
2
How to extract sublist from a list?
Hi everyone, Suppose I have a list named "lst", see below: > lst $sub1 ... $sub1$x ... $sub1$y .... $sub2 ... $sub2$x ... $sub2$y ? $sub3 ... ... ... Now, I want to extract the sub-sublist $y from every sublist(sub1, sub2...) and then storage them to a new list. I know how to extract them by subscript or list name one by one, but I wonder if there exist some tricks to finish this job more automatical...
2011 Apr 04
2
[Bug 8057] New: -x negates --force
...is being replaced by a non-directory. 2.6.9 and 3.0.7 on all platforms I've tested exhibit the same behavior. Mac, linux, OpenBSD. The following commands produce the error: rm -rf src dest mkdir src src/sub1 src/sub1/sub1a src/sub2 src/sub2/sub2a rsync -ax src/ dest/ rm -Rf src/sub2 ln -s sub1 src/sub2 rsync --force -a...
2011 Apr 13
4
[LLVMdev] built-in longjmp and setjmp
On Apr 12, 2011, at 3:15 PM, Jim Grosbach wrote: > If you want an automated method, then using the source code re-writer interfaces in clang is probably a reasonable starting place. Just modifying the source code manually is probably easier, though, to be honest. > > As a moderate caveat to all of this, there are some bits of code out there that use these builtins that are very tightly
2008 Jul 09
2
sorting a data frame by rownames
...mple code below: ########################### #build a dataframe set.seed(12345) a<-sample(1:50, 15) b<-15:1 c<-rep(1:3, 5) ex.dat<-data.frame(a,b,c) #pull it apart; in my case, each chunk is going through a loop and being spit out in a list sub3<-subset(ex.dat, c=="3") sub2<-subset(ex.dat, c=="2") sub1<-subset(ex.dat, c=="1") #put it back together; in my case, pull out the parts of the list generated by the loop that hold the data newdat<-rbind(sub3, sub2, sub1) #rebuild it such that it can be re-organized into it's original order...
2011 Apr 27
2
[LLVMdev] built-in longjmp and setjmp
...setjmp6.arm.ll -emit-llvm -O3 -S -ccc-host-triple > arm-unknown-darwin -ccc-clang-archs arm > $ llc setjmp6.arm.ll -o setjmp6.arm.s > > > #include <stdio.h> > #include <stdlib.h> > void *buf[20]; > > int gi2 = 0; > > > void __attribute__ ((noinline)) sub2 (void) > { > __builtin_longjmp (buf, 1); > > } > > int > main (int argc, char **argv) > { > int n = atoi (argv[1]); > int r = __builtin_setjmp (buf); > ++gi2; > > if (r) > { > printf ("setjmp %d\n", n + gi2); > retu...
2010 Feb 03
3
How to flatten a tree (based on list) to a certain depth?
...mes). I want to flatten it to be a list of frames. However, if I unlist(root), it will flatten the frames as well. Is there a simply way to flatten the tree to certain depth? aframe1=data.frame(x=1:3,y=1:3) aframe2=data.frame(u=7:9,v=11:13) aframe3=data.frame(p=3:5,q=6:8) main1=list(sub1=aframe1, sub2=aframe2) main2=list(sub3=aframe3) root=list(main1=main1, main2=main2) str(root) unlist(root)
2013 May 15
2
animating plots over time with a slider
I have a population of subjects each with a variable which has been captured at a baseline date. Then for many subjects (but not all) an intervention has occurred and the variable has changed at one or more time points after the baseline date. So my dataset consists of a subject ID (x), which may appear several times or just once, a measure (y), and a date of observation (z). I would like to be