Questions tagged [reference]
A reference is a value that enables a program to indirectly access a particular datum, such as a variable or a record, in the computer's memory or in some other storage device.
reference
17,277
questions
0
votes
1
answer
15
views
Modify the values in a (global) list of dictionary without reference
I'm new to python - being an educator trying to write to python script to score student's performance downloaded from an online polling platform. I've solved most problems until something like this: I'...
0
votes
0
answers
60
views
Confusion regarding addresses and references in C++. What are the data types of addresses and references respectively? [duplicate]
I understood that the & operator is context dependent,
int var = 5;
int* ptr = &var;
In the above code, &var returns the address of var, then gives it to the pointer.
On the other hand
...
0
votes
0
answers
9
views
Visual Studio Code - code reference break if I use path.join to specify imports (nodejs) [duplicate]
I am trying a more centralized way of specifying the import paths in nodejs, by using core path module.
Problem is that when changing from code A to code B specified below, Visual Studio Code stops ...
0
votes
1
answer
34
views
The type or namespace name 'iOSBackgroundService' could not be found
Error Message : The type or namespace name 'iOSBackgroundService' could not be found
I have created new class named iOSBackgroundService in Platform -> iOS. But I cannot inject it in the maui ...
-2
votes
0
answers
20
views
How to fix errors that suddenly appeared without any changes occurring? [closed]
I am writing a web application in vsc, using .net and react. Everything works well, but suddenly while I was looking through files I got few errors:
The type or namespace name 'DbSet<>' could ...
1
vote
1
answer
123
views
Is it possible to initialize a struct reference with an array?
Is it possible to do something like this?:
struct S {
int length;
char data[100];
};
class C {
uint8_t buffer[10];
S& s = buffer[0];
};
If I use pointer it compiles, but working with ...
5
votes
2
answers
146
views
Python object creation behavior
Coming from Java, I have trouble understanding how objects are allocated in Python.
Consider this Python script:
x = ("a", "b")
y = ("a", "b")
print(x is y) # ...
0
votes
2
answers
97
views
Why this constant struct can be modified in this way?
Recently I encounter the following code, it is an excerpt from tutorial of open-source package AMReX text
Array4<Real> const& a = fab1.array();
Dim3 lo = lbound(a);
Dim3 hi = ubound(...
0
votes
0
answers
74
views
JavaFX: setting list for comboBox does not work
I am working in a JavaFX project. There I have fxml included in other fxml files. Now I need to send data from the outer controller to the inner controller. I've tried it, but the combobox looses its ...
-3
votes
0
answers
106
views
Are pointer variables sometimes faster to initialize than reference variables?
Let's say just for acquiring the MEMORY-ADDRESS and VALUE of some variable. If the variable is "nested" in pointers like so:
int val = 10;
int *ptr1 = &val;
int *ptr2 = ptr1;
int *ptr3 =...
0
votes
1
answer
27
views
How to tweak font size and position of reference in quarto revealjs slide
This is my example code:
---
title: "test"
format:
revealjs:
footer: Institute of | Tarjae
---
<!-- Style and format of footer -->
<style>
.reveal .footer {
display: ...
0
votes
0
answers
34
views
Cannot find package 'aws-sdk' imported from /var/task/index.mjs
i am getting this error
even after having the correct configuration
using nodejs 18
{
"errorType": "ReferenceError",
"errorMessage": "require is not defined ...
0
votes
0
answers
13
views
Error to find references in Visual Studio 2019
I noticed that every time I open a cloned project in a new environment (with Visual Studio 2019), the project cannot find the references it uses.
I know that I can add the references again to solve ...
0
votes
1
answer
81
views
How can I pass a reference to a closure in Rust?
I am using wry to spawn a few web views. Each view has a on_page_load_handler. Inside the handler I need to access the web view to e.g. navigate to another website. Sadly I fail to pass the web view ...
3
votes
1
answer
101
views
Why does `Option::map` work with immutable data, but not with mutable data
Why does the immutable version in the following example work, but the mutable version does not compile with error error: lifetime may not live long enough?
trait Car {
fn honk(&self);
}
...