Displaying 20 results from an estimated 1000 matches similar to: "help in using gsub and ?"
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
2011 Aug 10
2
using if then statements in a dataframe
I used this service several months ago and was very pleased with the response.
I have a dataframe with several thousand lines and to each line I need to apply a series of "if else" 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
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
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr,
Thanks. Yeah, it seemed a little weird, but it was what got me closest. I
found out that the matcher I supplied here was working for clang-query
3.8.1. I'm working on a clang-tidy module for 4.0.0 - it's not working
there.
Could you elaborate on the "onImplicitObjectArgument"? There is no document
on it on the clang page. So I wouldn't know how it works or what it
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*)
2016 Nov 27
2
Looking for help with an ast matcher
Adding cfe-dev, because it is related to clang, not LLVM.
2016-11-27 22:34 GMT+01:00 Piotr Padlewski <piotr.padlewski at gmail.com>:
> Hi Mads,
> Can you provide the code that you run clang-query on, or at least AST for
> the fragment you want to match?
>
> Piotr
>
> 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org
> >:
>
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
--------------
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]
2008 Jan 06
0
[LLVMdev] Another memory fun
It's invalid for the same reason that
char *foobar = strcat("foo", "bar");
is invalid in C. Please make sure you understand what you're asking LLVM
to do before going any further down this path. A good approach is to
write out the correct code in C and then use llvm-gcc (or the demo page
at http://llvm.org/demo ) to see what it looks like in LLVM assembly.
Nick
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
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"
2007 Jul 23
1
CHAR(STRING_ELT( - OK but CHAR(asChar(STRING_ELT( - not, why?
Any idea why CHAR(asChar(STRING_ELT( produces NA whereas
CHAR(STRING_ELT( gets a pointer to a string? It's generally expected
that STRING_ELT should already be a character, but why the coercion does
not work? Here is a simple example (consistent over R2.5.1-R2.6 rev
42284, I didn't check earlier versions, but it used to be different in
2.4):
install.packages("inline")
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
Dear all,
[system and version information below]
I am trying to modify a C function for finding the root of an
expression. The function is to be called from R as .Call with input
parameters:
f: expression for which we will find the root
guesses: interval for the solution
stol: tolerance
rho: environment
The original functions I use are:
SEXP mkans(double x) {
SEXP ans;
PROTECT(ans =
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
Dear all,
[system and version information below]
I am trying to modify a C function for finding the root of an
expression. The function is to be called from R as .Call with input
parameters:
f: expression for which we will find the root
guesses: interval for the solution
stol: tolerance
rho: environment
The original functions I use are:
SEXP mkans(double x) {
SEXP ans;
PROTECT(ans =
2006 Nov 13
2
[LLVMdev] need help understanding getelementptr assembler instruction
Hi,
I must say I also was in need of this document but never knew it
existed. It seems to be linked from the faq page only. I only read
that the first day I came to LLVM. Maybe linking it from the
GetElementPtr instruction in LangRef.html would make sense.
cheers
Eric
On Nov 12, 2006, at 8:47 PM, Reid Spencer wrote:
> Ram,
>
> Please read and understand the GetElementPtr FAQ
2009 Sep 27
5
[LLVMdev] A basicblock iterator bug in llvm
Dear developers:
When I am doing basicblock pass, I meet a bug: there is an
iterator "I" in a basicblock, and it is not pointing to the first
instruction in this basicblock. However, "I--;" will fail by an
assertion.
The basic block ("I" is pointing to the second instruction) in test.ll:
bb: ; preds = %bb1
%1 = call i32 (i8*, ...)* @printf(i8* noalias
2006 Nov 13
0
[LLVMdev] need help understanding getelementptr assembler instruction
Ram:
Let me explain and hopefully Reid or Chris will correct if I have it
wrong. The first 0 is the index into a possible array of sbyte[13]
arrays that this pointer points to. I expect GetElementPtr works this
way is to keep down the proliferation of arrays of arrays in the type
table. So you are pointing at the zeroth, and in this case only, array
of sbyte[13]. The next 0 actually
2011 Mar 10
1
about textConnection
I need read a table 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 <-
2008 Jan 06
4
[LLVMdev] Another memory fun
hm.... I think, that is valid in c
but next code too doesn't works right:
; 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]
2006 Nov 12
0
[LLVMdev] need help understanding getelementptr assembler instruction
Ram,
Please read and understand the GetElementPtr FAQ available here:
http://llvm.org/docs/GetElementPtr.html
That will help you understand how it works. We wrote that document
specifically because this question comes up all the time.
Reid.
On Sun, 2006-11-12 at 11:13 -0800, Ram Bhamidipaty wrote:
> I am trying to understand the hello word assember example. This is
> my version:
>