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,279
questions
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
...
3
votes
1
answer
59
views
What is the rationale for the expression class{}.refmem to be an lvalue expression
I came to know that S{}.rval is an lvalue expression. I want to know the rationale behind considering it an lvalue expression.
Why are access to non-static member of reference type lvalue, even when ...
-1
votes
0
answers
37
views
Lifetime of Temporary Passed to Multiple Functions by Const Reference in the Same Lexical Expression [duplicate]
According to the answers to this question, a temporary created in an expression lasts for the entire expression. This seems to imply that we can pass a temporary into and return it from functions by ...
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
63
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
40
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 ...
1
vote
1
answer
124
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
158
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
39
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
46
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
84
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);
}
...
0
votes
0
answers
17
views
Suprema BioMini with C# - where should UFLicense.dat be put?
I'm developing a C# application using the BioMini SDK for fingerprint scanning. When running my application, I encountered the following error:
Exception thrown: 'System.DllNotFoundException' in ...
0
votes
0
answers
78
views
"Unable to Create App State Field 'saveforlater' with Document Reference Data Type in Flutter Flow"
Story
In my Flutter Flow project, I'm working on implementing an app with functionality similar to a shopping cart. I have successfully implemented the "Add to Cart" feature, but I am ...
0
votes
1
answer
78
views
Public static class and methods not found in NuGet package
I'm running into an odd issue where I've developed a NuGet package. Because of the architecture of the legacy software I'm trying to write new functionality for, this is in .NET Framework 4.6.1 (I ...
0
votes
0
answers
57
views
Why doesn't std::array<T,N>::operator[] return an rvalue reference for rvalue object? [duplicate]
std::array<T,N>::operator[] always returns an lvalue reference (const if needed), but what can possibly be the use of a line of code like this, which is valid C++?
std::array<int,1>{1}[0] =...
1
vote
1
answer
50
views
A question on Rust trait/struct lifetime bounds coercion
I have recently stumbled upon a lifetime coercion issue that I am unable to resolve. The minimal reproducible example which I think stems from the same problem is the following:
const MACGUFFIN: i32 = ...
0
votes
0
answers
45
views
creating a cell reference with a fixed column name and the line # from a value in a different cell
I have a workbook with data from multiple years in separate worksheets. On my summary worksheet I am using the following formula, plus multiple similar formulas, to analyze data: =AVERAGE('2024:2014'!...
6
votes
1
answer
95
views
Returning const reference from lambda stored as std::function segfaults [duplicate]
Here is the code:
#include <vector>
#include <functional>
class TestClass {
public:
const std::vector<int> &getStuff() const {
return callback();
}
protected:
...
1
vote
2
answers
72
views
Powershell: How to copy, duplicate, or clone an object? [duplicate]
I'm banging my head against the wall. I have an issue where I'm dealing with objects created using the AWS Powershell Tools, specifically objects of type Amazon.Route53.Model.ResourceRecordSet and ...
0
votes
1
answer
100
views
Why does dereferencing a String (not &String) work in Rust?
In the following code, in calculate_length function we are sending String not &String, yet dereferencing works. I expected to get error something:
type String cannot be dereferenced
But the code ...
0
votes
0
answers
48
views
Why is it ok to return a reference to a function's default argument? [duplicate]
#include <iostream>
//class for testing**
class T
{
public:
void print() { std::cout << "hello\n"; }
~T() { std::cout << "~T\n";}
};
//function for ...
1
vote
1
answer
53
views
Data validation reference provides value and not associated list values - VBA Reference Errors
It seems I'm running into a relative reference problem with the INDIRECT formula in the data validation section of my code.
I am trying to create a macro that will automatically update and format ...
-1
votes
1
answer
65
views
What effect does the placement of the reference symbol (ampersand) have in a simple loop?
I just started learning rust and I am confused about how the ampersand placement affects the program in the following examples. I understand that '&' indicates a reference to a variable, but I'm ...
0
votes
0
answers
12
views
formula that will return the Company Account number for the invoice number
In the screen shot provided the company account numbers are in column B, the invoice numbers are in Column D. I need a formula that will return the Company identifier when the Invoice number is ...