gimple_call_num_args(stmt) on my statement gives 2 but get_name(gimple_call_arg(stmt,1)) is null. Any ideas on how to get the arguments?
Related
Attempting to write more queries in F# through LinqPad I ran into an interesting thing with the where clause.
let dc = new TypedDataContext()
let q = query {
for o in dc.OrderItem do
where (o.Description.Contains("spam"))
select o
}
q |> Dump
If I remove the parenthesis around o.Description.Contains("spam") I get the often seen error message below.
Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized (using external F# compiler)
When I see this error I normally realize that I'm not giving enough information in order for the compiler to understand that I'm attempting to chain off of the result of a prior method call or property get accessor invocation but in this case it is unclear to me. Additionally I'd be curious if there is a more idiomatic way of satisfying the conditions of the compiler without having to reach around the expression to add both open and closing parenthesis.
You'd see the same result if you did something like this:
let f x = 1
f o.Description.Contains("spam")
As the message implies, if you're using the result of a method call (Contains in this case) as an argument to a function, then the method call needs to be parenthesized. Even though where is a query operator rather than a true function, the same result applies.
I am new to Jmeter and trying to do a while loop operation with a condition. So please someone provide solution for the below query.
Query: I am trying to do DELETE request for 50 times using the id as reference. So I kept the condition as "${startId}<=${endId}" in the while loop. But the while loop is executing infinitely. Is there any simple mechanism to iterate the loop for 50 times by increment the startId till it reaches endId.
While Controller accepts function or variable. So you need to either:
provide a variable which has value of "true" and becomes "false" somewhere else
provide a function which returns "false" to exit from While loop.
With your condition it won't evaluate your expression hence it will never become "false". The solution is to wrap your statement into i.e. __javaScript function as:
${__javaScript(${startId}<=${endId},)}
For more information on JMeter functions see How to Use JMeter Functions post series.
You may take help of loop controller and pre-processor.
snaps :
I am having a little problem here. In the code below is a function that has two arguments when I attempt to execute the functions i obtained this error
Undefined function or method for input
arguments of type 'double' (X,CX) as shown in (1).
the function is coded as below
[CX,sse]= (vgg_kmiter(X, CX)) ....(1)
can someone point me out where is the problem with this code?
note that the x is the input points in a columns which is integer and the CX is the center of clustering which is also integer.
Thank you
[CX,sse]= (vgg_kmiter(X, CX)) ....(1)
Is not a valid line of code.
[CX,sse]= (vgg_kmiter(X, CX));
is fine, though the outer parentheses aren't needed.
[CX,sse]= (vgg_kmiter(X, CX)) %....(1)
is fine as well - everything after the % sign is considered a comment
I am getting a rather strange behaviour when invoking oracle instr function, or probably I'm blind enough not to see my stupid mistake.
Actually I written a procedure to split a string. For example if we have string
a,e,i,o,u
then my split method will look like
string_split('a,e,i,o,u',',',5);
where first parameter is the string to split while second one is the separator and third one is the number of element I know is there after splitting.
Now, of number of things , one thing my procedure do is invoke
start_index := instr(temp_string_to_split,',',1,(total_element-i));
But the moment it is invoked I get a
ORA-06512 ,numeric or value error
But if I invoke
start_index := instr(temp_string_to_split,1,(total_element-i));
the procedure runs,though not in a desirable manner. Note that in second invocation separator parameter is missing, and directly number is passed as the second parameter, which I guess should have cause big time exception. But surprisingly it goes and run fine.
Can somebody explain this anomaly...or help me see if I'm missing something.
Thanks,
Mawia
I'm assuming that in your call to instr, temp_string_to_split is the string that was passed to string_split, and (total_element-i) is meant to be an iterator over the number of splits to make. (As an aside, it seems odd that you have ',' hardcoded in this call, when you appear to be passing it as a parameter to string_split.
I tried emulating this with the following SQL, which worked fine:
SELECT LEVEL,instr('a,e,i,o,u',',',1,LEVEL)
from dual connect by level < 5;
Do you know the exact values of temp_string_to_split, total_element, and i on the call to instr that caused the error?
Thanks a lot all for responding.
Actually as I told earlier, I was calling
start_index := instr(temp_string_to_split,',',1,(total_element-i));
in a loop. Now as a final value of the loop
(total_element-i)
was getting negative. And this was the root of malady.
One thing, I'm still puzzled though is as it was a run time generated condition, that is to say everything before the final invocation was legal. Then why I dont see on console the result of few of DBMS_OUTPUT.PUT_LINE statement which I had put into to trace the execution.
Thanks,
Mawia
Forgive me if the answer is obvious as it has been a long time since I have programmed vbscript.
Are there any avantages to using Call when calling a function in vbscript?
For example:
SomeFunction param1, param2
vs
Call SomeFunction (param1, param2)
The difference as per MSDN -
To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma. The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.
The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do exactly the same thing.
Call MyProc(firstarg, secondarg)
MyProc firstarg, secondarg
Notice that the parentheses are omitted in the call when the Call statement isn't used.
No, there is not.
Call is usually used for subroutines and not functions, but either way there is no differences. However when it comes to functions you can retrieve a value return from the function, where as a subroutine can not. Example
result = SomeFunction("param1")
Function SomeFunction(someArg)
SomeFunction = someArg & "Hey There"
End Function
this would return "param1 Hey There" to the "result" value
result = SomeSub("param1")
Sub SomeSub(someArg)
SomeSub = someArg & "Hey There"
End Sub
but in this case "result" won't have any value, because subroutines can't do this.
It really just depends on how much you like parenthesis. Coming from a c-family background, it looks incredibly odd to me to not have them.