17,333 questions
1
vote
2
answers
9k
views
MS Excel: How do I make cell references variable?
I probably didn't word that title correctly, so let me explain what I'm trying to do.
I need to find cycles in a series of data. So let’s say I have all of my data in column A of an Excel ...
3
votes
1
answer
142
views
Conditional operator with a throwing branch in Visual C++ 2026
My program changed its behavior after updating Visual Studio to the latest version (2026).
Simplifying it, I got the following minimal example, which contains a ternary operator with a throw in ...
11
votes
3
answers
3k
views
Why were references added to C++? (from the history viewpoint)
I've read many discussions on the difference between references and pointers and when to use which. They all seem to get their conclusions from analysis of the behaviors of the two.
But I'd still ...
1
vote
1
answer
1k
views
Can a Java object tell when a reference to it goes out of scope?
I'm fantasizing of a tool to detect resource leaks. I have a good idea what the tool should look like and what the requirements are, but I lack one piece of the puzzle to make it work: an event ...
36
votes
5
answers
53k
views
download windows API reference (MSDN) for offline use
I would like to have a windows API reference document available offline. MSDN is fine, but I also need this kind of information when I don't have access to internet.
pdf, chm, help (for emacs) would ...
6
votes
2
answers
9k
views
React- createRef() Api - this.child.current is null
In order to allow my parent component (JsonFetcher) to access values from my child component (Display), I tried using createRef() API that just came of this patch 16.3
Following the "Adding a Ref to ...
1
vote
1
answer
2k
views
How to adjust the order of author names in Latex references (Journal of Finance style)
I try to replicate the Journal of Finance reference style. In order to do that, the names in the references should be ordered and written with full names as:
For two authors: LastName1, FirstName1 ...
51
votes
4
answers
14k
views
Does it make sense to combine optional with reference_wrapper?
It occurred to me that in C++ it is possible to use the type std::optional<std::reference_wrapper<T>>. An object of this type is essentially a reference to an object of type T or a null ...
1
vote
2
answers
9k
views
how to access refs in methods in vuejs
I want to access template ref in functions inside method objects. Currently, it throws undefined when accessing the refs.
My Code Below:
<template>
<ul ref="lvl1_target" style="width: ...
3361
votes
44
answers
2.2m
views
How do I pass a variable by reference?
I wrote this class for testing:
class PassByReference:
def __init__(self):
self.variable = 'Original'
self.change(self.variable)
print(self.variable)
def change(self, ...
2
votes
4
answers
7k
views
How to get multiple mutable references to elements in a Vec?
I have a large nested data structure and would like to pluck out a few parts to pass around for processing. Ultimately I want to send sections to multiple threads to update but I'd like to get my feet ...
5
votes
3
answers
3k
views
Calling code in a string without exec/eval, Python
I have this code that executes when a player attempts to eat something:
def eat(target='object'):
global current_room
global locations
global inventory
if target in inventory:
...
10
votes
3
answers
714
views
Assigning char to int reference and const int reference in C++
I noticed that assigning a char to a const int& compiles, but assigning it to a int& gives a compilation error.
char c;
int& x = c; // This fails to compile
const int& y = c; // ...
6
votes
5
answers
10k
views
Difference between reference and const reference as a function parameter
Here is a simple snippet of C++ code:
A foo(){
A a; // Create a local A object
return a;
}
void bar(const A & a_r){
}
bar(foo());
Why does the argument of function bar have to be a const ...
1044
votes
28
answers
461k
views
What's the difference between the 'ref' and 'out' keywords?
I'm creating a function where I need to pass an object so that it can be modified by the function. What is the difference between:
public void myFunction(ref MyClass someClass)
and
public void ...
0
votes
2
answers
13k
views
Visual Studio change Path for a reference
I'm a complete newbie when it comes to C# and Visual Studio. I have a reference with a path to a dll. It is pointing to an absolute directory and it works fine on my computer. However, when I send ...
1
vote
2
answers
1k
views
Is it possible to reference .NET Framework 4.8 libraries in a .NET 8 project?
I'm working with an older C# solution built on .NET Framework 4.8, which contains several libraries. Now, I'm developing a new solution targeting .NET 8 that needs to reuse some of those existing ...
3
votes
1
answer
214
views
Use decltype(auto) return type to sometimes return references
I have the following code to normalize std::filesystem::path to always use forward slashes as separators:
static decltype(auto) fix_path_separator(const std::filesystem::path& path) {
if ...
43
votes
14
answers
152k
views
How to disable Excel's automatic cell reference change after copy/paste?
I've got a massive Excel 2003 spreadsheet I'm working on. There are a lot of very large formulas with a lot of cell references. Here's a simple example.
='Sheet'!AC69+'Sheet'!AC52+'Sheet'!AC53)*$D$3+'...
7
votes
5
answers
18k
views
Could not Load Type from Microsoft.Extensions.Logging.Abstractions
I have a solution that works on some computers and not others. The exception is this:
Could not load type 'Microsoft.Extensions.Logging.Abstractions.Internal.NullScope' from assembly 'Microsoft....
1
vote
1
answer
109
views
Use a reference to $a to make $a a reference to $b
I have an array $arr = ['a', ['b',['c','d','e']]];.
So $arr[1][1][0] is 'c'.
I have these indexes listed in n array: $idx = [1,1,0];
(this may sound tricky, but comes from the fact that I got them ...
0
votes
1
answer
76
views
How to assign a new object to a reference?
Why can't I do it like this in Go?
func do(m1 map[int]string) {
var m map[int]string = make(map[int]string)
*m1 = &m;
}
I have m1 map, which means I can now it's reference? How to assign ...
1
vote
1
answer
128
views
Avoiding double references in Rust
I have the following utility method to get raw bytes of an object (to send via network, etc.):
pub fn to_bytes<T>(data: &T) -> &[u8] {
unsafe { slice::from_raw_parts((data as *...
0
votes
2
answers
1k
views
How to change data of reference passed Array in Closure
I have an Eventbus that takes a filter name as its first parameter and a Closure as second parameter. Like this:
$this->EventBus->subscribe('FilterTestEvent', function(){/*Do Something*/});
It'...
6
votes
1
answer
9k
views
The type or namespace name 'AutoMapper' could not be found
Hi ive got an issue very similar to this question:Namespace not recognized (even though it is there) but their solution doesn't work for me as my project is already set up in the correct framework. So ...
1
vote
1
answer
90
views
Simplifying getting a specific type from an enum
I have a set of classes linked into an enum:
#[derive(Default)]
pub struct A {
}
#[derive(Default)]
pub struct B {
}
#[derive(Default)]
pub struct C {
}
enum Classes {
A(A),
B(B),
C(C),
...
5
votes
1
answer
183
views
Segmentation fault when trying to assign a global variable to a static reference variable
The following program gives segmentation fault.
#include <iostream>
using namespace std;
class A {
public:
static int& a;
};
int a = 42;
int& A::a = a;
int main() {
a = 100;
...
0
votes
1
answer
83
views
How to reference a second Pandas dataframe to the first one without creating any copy of the first one?
I have a large pandas dataframe df of something like a million rows and 100 columns, and I have to create a second dataframe df_n, same size as the first one. Several rows and columns of df_n will be ...
0
votes
2
answers
3k
views
VBA - where are "available references" stored?
In Excel (or other MS Office apps), when you go to the VBA IDE, the Tools, References list shows you currently selected assemblies as well as a list of others you can add by checkmarking them. You can ...
32
votes
10
answers
58k
views
Could not load file or assembly 'System.Buffers, Version=4.0.2.0...'
I'm getting the following exception when trying to call GetDatabase method of the MongoClient class after adding a new configuration using VS config. manager:
Could not load file or assembly 'System....
0
votes
0
answers
119
views
Making sense of const rvalue reference [duplicate]
I'm trying to understand the rvalue references in C++. Here's what I think they represent.
Say we have an object, O. This object exists on the stack and has the name O. This makes this object a lvalue....
-1
votes
1
answer
110
views
Not able to add pointer to a vector in C++
I am trying to implement a grid system to detect collision between tanks in a game.
My goal is to have around 40 cells which all have a vector with tank pointers. The tank should be in the right grid ...
628
votes
13
answers
592k
views
Is there a difference between "==" and "is"?
My Google-fu has failed me.
In Python, are the following two tests for equality equivalent?
n = 5
# Test one.
if n == 5:
print 'Yay!'
# Test two.
if n is 5:
print 'Yay!'
Does this hold true ...
1
vote
2
answers
116
views
Creating virtual object in constructor initialization
I want to create a variable of type Foo. The class Foo consists of a variable called Bar bar_ which is filled directly in the constructor initialization. The thing is, class Bar has a reference to the ...
0
votes
0
answers
62
views
The mutable reference I return from a function in Rust seems to violate the borrowing rules — how is this possible? [duplicate]
I have a mutable variable and a mutable reference to it. When I pass this reference to a function and return it back from there, it seems to violate Rust’s borrowing rules. What’s the reason for this?
...
2
votes
1
answer
169
views
c++20 tuple compare with reference
We upgrade our codebase from c++17 to c++20 lately, and some code does not work as before. I take the following simplified sample code as show case here.
None of the overloaded compare operators is ...
1
vote
1
answer
3k
views
Set path of dlls referenced by another library
I have a C# project, a class library, which is a module for another project, and it's output path is in a subfolder within the main-projects output path (i.e. outputpath = C:\WHATEVER\MainProject\...
5
votes
2
answers
315
views
Can an rvalue of a specific class type be automatically cast to an lvalue of itself?
In C++, a function with signature void f(A& a) (non-template) only binds to a lvalue.
Is it possible for an rvalue to automatically cast itself to an lvalue?
This is what I tried:
#include <...
12
votes
1
answer
297
views
C++ temporary objects and constant reference
I am going through "C++ Primer", and it is mentioned that for the following code:
double dval = 3.14;
const int &ri = dval; //Bind a const int to a plain double object.
The ...
2
votes
5
answers
22k
views
How do I reference controls with a variable in visual basic 2010?
I have 12 checkboxes (32 total, but for now just worrying about the first 12) that are named checkbox1, checkbox 2...checkbox 12. I want a for loop to go through them and see if they are checked. If ...
201
votes
2
answers
119k
views
Cannot move out of borrowed content / cannot move out of behind a shared reference
I don't understand the error cannot move out of borrowed content. I have received it many times and I have always solved it, but I've never understood why.
For example:
for line in self.xslg_file....
0
votes
2
answers
95
views
How can the italicized text be referenced in other cells?
I asked a question about italicizing specific parts of a cell (Making variable strings of text italics in Excel VBA).
I run the macro in column N to get what I want italicized, but when I reference ...
1
vote
2
answers
2k
views
How to correctly declare static refs in Composition API using Typescript?
I am using the Composition API (with <script setup lang='ts'>) to create a ref, used in my template:
const searchRef = ref(null)
onMounted(() => { searchRef.value.focus() })
It does work and ...
11
votes
3
answers
12k
views
Does an std::optional parameter create a copy?
I have a function that takes an std::optional:
void foo(const std::optional<T>& opt);
But copying T is expensive.
Does this create a copy of T?
If so, how can I not create a copy?
28
votes
13
answers
39k
views
Why would all of my references have yellow exclamation points on them in my .NET class library?
I've been developing a class library for quite sometime and all of the sudden, sometime last week, I opened my project and all of my references have yellow exclamation points on them now (System.dll, ...
28
votes
1
answer
2k
views
Why is `&self` allowed in the parameters of `&mut self` methods, but not `&mut self`?
Rust method calls are desugared to fully-qualified-syntax and function parameters are evaluated left to right. Why then does s.by_mut(s.by_ref(())) compile while other
expressions don't?
struct S;
...
22
votes
7
answers
35k
views
using ref with class C#
I want to give a certain linked list to a class I am making. I want the class to write into that list (eg by .addLast()).
Should I use the ref keyword for that?
I am somewhat puzzled on where to use ...
0
votes
1
answer
1k
views
How to issue multiple prompts to a user, depending on how many times they wish to be prompted C++
I am creating a program in C++ that allows a user to input the number of times he or she wants to be prompted for three separate inputs, ie.
how many would you like: 2
enter here: 123.45/N 32.45/W ...
4
votes
1
answer
2k
views
Syntax for accessing nested array elements in PHP double quotes string [duplicate]
I'm attempting to access a nested array element within a double quotes string, like this:
"$variable[first_index][second_index]";
This is throwing an Array to string conversion notice and halting my ...
2
votes
2
answers
2k
views
How to get a field reference in java?
i am trying to get a compile time safe field reference in java, done not with reflection and Strings, but directly referencing the field. Something like
MyClass::myField
I have tried the usual ...