Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
9k views

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 ...

1
2 3 4 5
347