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

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
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
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 ...
Oersted's user avatar
  • 1,706
-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 ...
user985091's user avatar
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'...
Chris H's user avatar
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 ...
Anjonimus's user avatar
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 ...
Linton's user avatar
  • 7
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 ...
Galaxylokka's user avatar
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 ...
Maple's user avatar
  • 251
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) # ...
Mohammad Javad's user avatar
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(...
Xeh Deng's user avatar
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 ...
PalBeron's user avatar
-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 =...
ZenPyro's user avatar
  • 95
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: ...
TarJae's user avatar
  • 78.1k
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 ...
software's user avatar
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 ...
Thiago Moura's user avatar
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 ...
user3563584's user avatar
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); } ...
puaaaal's user avatar
  • 330
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 ...
khawulele Makopi's user avatar
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 ...
KUNAL KUMAR's user avatar
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 ...
Steven's user avatar
  • 300
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] =...
Enlico's user avatar
  • 26.7k
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 = ...
Christoff van Zyl's user avatar
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'!...
Howard Leibovitch's user avatar
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: ...
ligazetom's user avatar
  • 145
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 ...
Matthew McDonald's user avatar
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 ...
luffy's user avatar
  • 117
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 ...
Kappy's user avatar
  • 27
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 ...
user23370984's user avatar
-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 ...
Nack's user avatar
  • 1
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 ...
Nikki Gordon's user avatar

15 30 50 per page
1
2 3 4 5
576