search for: str2

Displaying 20 results from an estimated 146 matches for "str2".

Did you mean: str
2011 Aug 10
2
using if then statements in a dataframe
...t; statements. For each row I need either a value or a blank/NA. Below is the series of if else statements I have been trying without success to integrate into a function such as "apply". if (t1.secondstrongest<-13000) {NA} else if (noise>-13000) {NA} else if ((abs(value.str1-value.str2))==120) {NA} else if ((abs(value.str1-value.str2))==180) {NA} else if ((abs(value.str1-value.str2))==240) {NA} else if (value.str1 ==300&&value.str2 ==0) {value.str1_adj+ bearingdiff} else if (value.str1 ==0&&value.str2 ==360) {value.str1_adj+360 - bearingdiff} else if (value.str2&l...
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr, I think I found a working matcher: match ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(isInteger()), has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("compare"))), hasArgument(0, declRefExpr().bind("str2")), callee(memberExpr(has(declRefExpr().bind("str1"))))))))).bind("case1") This one bind to both str1 and str2 in str1.compare(str2). I have included a code segment below. I have attached a screenshot of this matcher working from clang-query. HOWEVER - when I try to use th...
2016 Nov 28
2
Looking for help with an ast matcher
...and it: > > ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType( > isInteger()), > has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName(" > compare"))), > hasArgument(0, > declRefExpr().bind("str2")), > callee(memberExpr(has( > declRefExpr().bind("str1"))))))))).bind("case1") > > And this is the AST part that we care about > |-IfStmt 0x7fba9625f5e8 <line:8:5, line:10:5> > | |-<<<NULL>>...
2009 Oct 02
1
[LLVMdev] alias analysis and functions
...i32 (...)*) ??????????????????????????????????????????????????????????????????????????????? NoAlias: i32 (...)* %pf, i32 (...)* bitcast (i32 ()* @pointed_to_function1 to i32 (...)*) NoAlias: i32 (...)* bitcast (i32 ()* @pointed_to_function0 to i32 (...)*), i8* getelementptr ([20 x i8]* @.str2, i32 0, i64 0) NoAlias: i32 (...)* bitcast (i32 ()* @pointed_to_function1 to i32 (...)*), i8* getelementptr ([20 x i8]* @.str2, i32 0, i64 0) NoAlias: i32 (...)* %pf, i8* getelementptr ([20 x i8]* @.str2, i32 0, i64 0) NoAlias: i32 (...)* bitcast (i32 ()* @pointed_to_function0 to i32...
2016 Nov 27
2
Looking for help with an ast matcher
...want to match? > > Piotr > > 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org > >: > >> Hi, >> >> Hope this is the right channel for this question. I am trying to make an >> ast matcher for clang-tidy to find str1.compare(str2), where both str1 and >> str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png . >> But I am having a hard time finding a way to bind an id to the str1 part of >> the expression. >> >> Can anyone help me out with an idea? >> >> Best regar...
2008 Jan 06
0
[LLVMdev] Another memory fun
but why this code don't work: ; ModuleID = 'sample.lz' @.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*> [#uses=1] @.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*> [#uses=1] @.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*> [#uses=1] @.str8 = internal global [8 x i8] c"mother \00" ; <[8 x i8]*> [#uses=1] declare i32 @puts...
2011 Feb 18
0
[LLVMdev] Adding "S" suffixed ARM/Thumb2 instructions
On Feb 17, 2011, at 10:35 PM, Вадим Марковцев wrote: > Hello everyone, > > I've added the "S" suffixed versions of ARM and Thumb2 instructions to tablegen. Those are, for example, "movs" or "muls". > Of course, some instructions have already had their twins, such as add/adds, and I leaved them untouched. Adding separate "s" instructions is
2008 Jan 06
4
[LLVMdev] Another memory fun
Yes, I agree with you -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080106/efb1c465/attachment.html>
2011 Feb 18
2
[LLVMdev] Adding "S" suffixed ARM/Thumb2 instructions
Hello everyone, I've added the "S" suffixed versions of ARM and Thumb2 instructions to tablegen. Those are, for example, "movs" or "muls". Of course, some instructions have already had their twins, such as add/adds, and I leaved them untouched. Besides, I propose the codegen optimization based on them, which removes the redundant comparison in patterns like orr
2008 Jan 06
4
[LLVMdev] Another memory fun
Hey again) Now I have next code: ; ModuleID = 'sample.lz' @.str1 = internal global [8 x i8] c" world!\00" ; <[8 x i8]*> [#uses=1] @.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x i8]*> [#uses=1] @.str7 = internal global [21 x i8] c"welcome to out hall!\00" ; <[21 x i8]*> [#uses=1] declare i32 @puts(i8*) declare i8* @strcat(i8*, i8*) declare void @llvm.memcpy.i32(i8*, i8*, i...
2006 Nov 12
4
[LLVMdev] need help understanding getelementptr assembler instruction
I am trying to understand the hello word assember example. This is my version: %str1 = internal constant [13 x sbyte] c"Hello World\0a\00" declare int %printf(sbyte*, ...) implementation ; Functions: int %main() { %str2 = getelementptr [13 x sbyte]* %str1, long 0, long 0 call int(sbyte*, ...) *%printf(sbyte* %str2) ret int 0 } Why is getelementptr being given two "long 0" indices? Thanks for any help. -Ram
2009 Sep 27
5
[LLVMdev] A basicblock iterator bug in llvm
...lock ("I" is pointing to the second instruction) in test.ll: bb: ; preds = %bb1 %1 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([42 x i8]* @.str1, i32 0, i32 0)) nounwind ; <i32> [#uses=0] %2 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([40 x i8]* @.str2, i32 0, i32 0)) nounwind ; <i32> [#uses=0] %3 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([40 x i8]* @.str3, i32 0, i32 0)) nounwind ; <i32> [#uses=0] %4 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([42 x i8]* @.str, i32 0, i32 0)) nounwind ; <i32&...
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
...problem involves a data set 'u', with dimension (i x j), I need to assign values to 'u1', 'u2', ..., 'ui' via defineVar(install(...)). I tried the following: double feval(double x, double *u, int d, double v, SEXP f, SEXP rho) { int i; char *str1="u", str2[1001], *str3; defineVar(install("x"), mkans(x), rho); defineVar(install("y"), mkans(v), rho); for(i=0;i<d;i++) { sprintf(str2,"%d",i+1); str3 = (char *)malloc((strlen(str1)+strlen(str2)+1)*sizeof(char)); strcpy(str3,str1); strcat(str3,str2);...
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
...problem involves a data set 'u', with dimension (i x j), I need to assign values to 'u1', 'u2', ..., 'ui' via defineVar(install(...)). I tried the following: double feval(double x, double *u, int d, double v, SEXP f, SEXP rho) { int i; char *str1="u", str2[1001], *str3; defineVar(install("x"), mkans(x), rho); defineVar(install("y"), mkans(v), rho); for(i=0;i<d;i++) { sprintf(str2,"%d",i+1); str3 = (char *)malloc((strlen(str1)+strlen(str2)+1)*sizeof(char)); strcpy(str3,str1); strcat(str3,str2);...
2003 Feb 20
2
is.numeric
Hi, I have a vector, which contains both strings and numbers, e.g. > foo <- c("str1",1234,"str2",0.9876) I want to know if a distinct element of the vector is a string or a number and took "is.numeric", but > is.numeric(foo[2]) [1] FALSE because R treats the numbers in a mixed vectors as strings: > foo [1] "str1" "1234" "str2" &quo...
2012 Feb 02
1
gsub syntax help
I have some elements in a vector with extraneous information (e.g. file name and sample IDs) that I'd like to strip from every element. For example, I would like "SPI1.S1.str1.P3.sample.tif" "SPI1.S1.STR2.P1.sample.tif" to read "SPI1.S1.str1.P3" "SPI1.S1.STR2.P1". Will someone help me with the syntax in gsub? It needs to be something like gsub("garbage", "everything except garbage" , dataframe,), I think, but it's the "everything except garbage...
2011 Mar 10
1
about textConnection
...e in a string with special format. I used read.csv and textConnection function. But i am confuse about textConnection by follow code. case A: It is OK£¡ str0 <- '{"abc",{"def","X,1&Y,2&Z,3"}}' str1 <- strsplit(str0,'"')[[1]][6] str2 <- gsub("&","\n", str1) con <- textConnection( str2 ) read.csv(con,header=F) close(con) case B: It is NOK! con <- textConnection( gsub("&","\n",(strsplit('{"abc",{"def","X,1&Y,2&Z,3"}}'...
2016 Nov 26
2
Looking for help with an ast matcher
Hi, Hope this is the right channel for this question. I am trying to make an ast matcher for clang-tidy to find str1.compare(str2), where both str1 and str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png . But I am having a hard time finding a way to bind an id to the str1 part of the expression. Can anyone help me out with an idea? Best regards, Mads Ravn -------------- next part -------------- An HTML...
2007 Jul 23
1
CHAR(STRING_ELT( - OK but CHAR(asChar(STRING_ELT( - not, why?
...int i = 0; i < LENGTH(x); i++ ) Rprintf(\"%s\\n\", CHAR(asChar(STRING_ELT(x, i)))); return R_NilValue; " setCMethod(c("p1","p2"), list(sig,sig), list(code1,code2)) #---------------------------------------------------------- p1(c("str1", "str2")) # str1 # str2 # NULL p2(c("str1", "str2")) # NA # NA # NULL -- Dr. Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +441223494466
2009 Jul 31
1
help in using gsub and ?
Hi all, I would like to strip the R prompt from a series of code lines and copy the resulting text into a R script. For example, consider the following : ##### str1<-" > library(MASS) > data(Cars93) > attach(Cars93) > imosaic(data.frame(AirBags,Cylinders,Origin))" str2<-gsub('>','',str1) ###### This gives, as expected .? > str2 [1] "\n library(MASS)\n data(Cars93)\n attach(Cars93)\n imosaic(data.frame(AirBags,Cylinders,Origin))" How can I now activate the newline character, "\n", so that I get the following print-out...