All Questions
590
questions
0
votes
1
answer
33
views
How are reference to objects handled in javascript when returning object and modifying them in their original functions
I am trying to create a function that returns an object and a function that reset this object to its initial state. Something like:
const create = () => ({
a: "something"
});
const setup = ...
-3
votes
1
answer
67
views
Can someone explain to me why after this function is called a becomes 2 instead of 3 or 4?
#include <iostream>
using namespace std;
void f(int &x, int &y)
{
x = 1;
x = x + y;
}
int main()
{
int a = 3;
f(a, a);
cout<<a;
return 0;
}
I found this ...
0
votes
1
answer
126
views
A C# Project library with app.config as dll reference to a azure function ,keys not accessible
A C# Project library with app.config file to access keys in project , When i add this project as dll reference to a azure function the keys used in dll are not able to access in metadata of dll and ...
0
votes
1
answer
125
views
Google sheet - using a value from a function as a reference to another cell
In google sheet i have created a formula =CONCATENATE("=";MID((FORMULATEXT(A2));2;6);"P3").
This formula takes a refernce value from cell A2 (reference to a cell E2 in sheet 2) ...
1
vote
1
answer
158
views
How to get reference to the function or variable with the same name in Kotlin?
The problem is when I try to get the reference to testVar variable in Kotlin, ambiguity occurs if I have a function with the same name as the variable. Is there a solution for this?
class ...
0
votes
0
answers
194
views
Trying to use an IF statement in a Word table field to reference another column in the table
I have a three column table in a Word document. The second column has numeric values in it. The third column has text based on the value from the 2nd column. I want to use an IF statement in a ...
0
votes
2
answers
87
views
Swap values of two IORefs
I need this functionality:
x <- newIORef "x"
y <- newIORef "y"
swapIORefs x y
readIORef x -- Outputs "y"
readIORef y -- Outputs "x"
My best attempt is:
...
0
votes
3
answers
53
views
how to reference arguments with parameters in a function?
class Score(
val score:Int
){
fun PersonalScore(){
println(score)
}
}
fun comPare(a: Int, b: Int, c: Int): Int{
var max = a
if(max < b) max = b
if(max < c) max = ...
0
votes
0
answers
40
views
Indirect function usage
I am trying to use the indirect function to refer to a cell in another workbook:
A1 = 'C:\Users\thekv\OneDrive\Documents\accessmydocs\[KVR 4.0.xlsm]SheetOne'!$e$32
B1 = indirect(a1)
I get #REF!
Is ...
7
votes
1
answer
83
views
How can I reference an existing method in Raku?
As explained in the docs, you can reference an existing function by prepending the & sigil:
&say # reference to the `say` function
&infix:<+> # reference to the infix `+` ...
1
vote
1
answer
137
views
Member function that can return multiple references? (C++)
I have a member function that needs to return multiple references of char member variables.
class Foo {
public:
Foo() {// ... constructor }
std::string& func();
private:
char ch1 ...
0
votes
0
answers
45
views
Range based for loop in function as reference throws error (C++) [duplicate]
I just learned range based for loops in c++ and i'm trying to create a function that initializes a vector to all 0's; i did the following:
#include <vector>
// #include <algorithm>
// #...
0
votes
1
answer
83
views
How to pre-order a binary tree in a function without moving its root node?
I'm pretty new to Rust and after reading some chapters of Official Rust Book I started to coding some data structure stuff. I chose to create a simple binary tree and perform a simple pre-order twice. ...
0
votes
0
answers
36
views
How do I compare two functions if identical? [duplicate]
Having a function getting a function as parameter:
mutating func updateAccessCaches(by areInIncreasingOrder: (NumberedFile, NumberedFile) -> Bool = sortByOldIDPrio) { ... }
How do I compare like
...
1
vote
1
answer
38
views
Array turns back to its original form after being modified inside a function
I was trying to do problem no. 189 in LeetCode but I encountered a problem. The code is as follows:
public class Solution {
public void rotate(int[] nums, int k) {
k %= nums.length;
...