Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
1 answer
34 views

R Reference Class Add New Variable by Name

Consider the following R code : MyClass <- setRefClass("MyClass", fields = list( ), methods = list( initialize = function(x){ #give new attribute x ...
温泽海's user avatar
  • 344
0 votes
1 answer
31 views

How Python know that it has to give a new address for a variable?

So I found out Python always passed by reference and append always store reference to the appended variables, so I was curious about how append as the following code don't give 10 10s: ls = [] for i ...
Johnny C.'s user avatar
0 votes
1 answer
33 views

Is there a way concatenate a cell value into a page reference function to reference pages with the name of that cell value?

Essentially I am creating a budget that utilizes 2 sheets and want to be able to create copies without manually having to manually update each page name reference with every new set. I have pages ...
Ally's user avatar
  • 3
2 votes
2 answers
66 views

Powershell store variable in a hashtable and resolve the value later on

Let me start by saying I'm fairly certain I'm not using the correct terms, so please correct me where needed. Here's the situation, I'm a ham radio operator and I have multiple radios that I program ...
Wired's user avatar
  • 21
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 ...
Сергей Андриенко's user avatar
4 votes
5 answers
264 views

Why does "setf" not work when using "let"?

The behavior of setf when combined with let is confusing to me. Here, setf isn't changing the second value of my list. (defun to-temp-field (lst) (let ((old-value (nth 2 lst)) (new-value '...
Antonio Solana's user avatar
0 votes
1 answer
104 views

How to count references in java correctly?

I have difficulties understanding how to correctly count a reference variables. Example (adopted from some book for java learning): class Car { } class Example { public static void main(String[] ...
ImNotARobot's user avatar
0 votes
0 answers
31 views

php script with "&" in reference variable [duplicate]

I have a script php code <?php class A { public $x; } $a = new A(); $a->x = 10; $b = &$a; $b = new A(); $b->x = 20; echo $a->x; When try to understand code I think the result ...
Tran Van Hieu's user avatar
0 votes
0 answers
56 views

How to return a variable by reference in PHP?

This is my code: function &query_test(....) { $ret = array(....); return ($ret); } Why do I get a strict warning on PHPStorm saying "Only variables can be returned by reference" I ...
John Wythe's user avatar
1 vote
0 answers
35 views

Are PHP zvals mutable?

I've been reading about memory management in PHP and learned that variables in PHP copy the reference to zvals as long as you don't do a write operation (copy on write paradigm). https://www....
tweekz's user avatar
  • 338
0 votes
2 answers
89 views

Reference Variables In C++ [duplicate]

I need assistance in understanding why reference variables are used in C++. The reference variables points to other variables since they are an alias of other variable We are able to create int x = 10;...
Piyush Shrivastava's user avatar
1 vote
1 answer
87 views

golang updating slice value is not reflected in container object

package main import ( "fmt" ) func main() { root := map[string]interface{} { "disney": "world", } fmt.Printf("main begin %v\n", ...
tuls's user avatar
  • 13
0 votes
2 answers
48 views

How can you pass a variable to an other function in Python and set value to it? [duplicate]

I would like to pass a variable to an other function and in that function change the value of it. Here is an example of the problem: class TestClass: _g_a: int _g_b: int def __init__(self)...
Wathfea's user avatar
  • 93
-7 votes
2 answers
65 views

Why am I getting an output of always 1 in the below code

I was writting a program to assign the Value of N to M in the declaration statement.If i gave value of N in declaration i get the same value in output.But if i read from user ,i am getting 1 always #...
Bhagat Singh's user avatar
0 votes
0 answers
31 views

any way to update parent variable when updating its alias?

How to update the parent variable when updating its alias? This is what I'm doing right now. parent = 3 alias = parent alias = 4 print(parent) ===== the result is 3. but the expected is 4.
David H. J.'s user avatar

15 30 50 per page
1
2 3 4 5
27