Skip to main content
4 votes
0 answers
68 views

Scope of underspecified declarations

C23 §6.2.1(7) contains some new wording related to underspecified declarations (highlighted in bold below): Structure, union, and enumeration tags have scope that begins just after the appearance of ...
user51462's user avatar
  • 1,900
0 votes
1 answer
66 views

Why is scoped service injected in MainLayout.razor reinstanced? on every page

I wanted to create a data store that was accessible between different pages on the site. On every page I want the same code to run. Rather than putting it on every page I figured it would be best to ...
Patrick Johnston's user avatar
0 votes
1 answer
57 views

How to get inaccessible object when I can't declare it as public

Probably repeat question because it's so simple, but I can't find an answer to my problem. I'm new to c# and coding in general, and am still a little confused on objects and classes. I want to access ...
MintJungle's user avatar
2 votes
1 answer
76 views

gcc bug? name-hiding vs. specialization for class template with same name in derived class, but only when base class is also template

Is the error message shown below a gcc 13.1.0 bug? This code compiles fine under clang 18.0.2 and MSVC 19.41. This code even compiles OK on gcc if you change s0 into a non-template class. There is ...
Louis Semprini's user avatar
-1 votes
1 answer
66 views

Variable set in if/else blocks says "not found in this scope" when printed afterward

fn gronsfeld_cipher(data: &str, keys: &[i32], space: char, decode: bool) -> String { let alphabet = String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); let data = data....
BigD's user avatar
  • 23
-3 votes
3 answers
83 views

Why can't a derived class in Python reference inherited attributes in its definition? [duplicate]

I have this snippet: class A(object): def foo(): pass class B(A): bar = foo() As written, this file will fail to run with the error NameError: name 'foo' is not defined. However, ...
DrownedSuccess's user avatar
1 vote
2 answers
85 views

Why can I sometimes assign to a variable in one function and print it in another?

I don't understand why this code works as it works. Maybe I don't understand what functions and namespaces in Python really are? Example 1: def f1(): a = 1 f2() def f2(): print(a) a = 0 ...
Adam's user avatar
  • 19
0 votes
0 answers
69 views

Java lambda not able to access inner scope?

Consider this class: import java.util.concurrent.Callable; public class c { static interface a<T> extends Callable<T> { static <T> a<T> of(Callable<T> ...
nsayer's user avatar
  • 17k
2 votes
1 answer
61 views

How to have a code block for a case statement for a switch that assigns a value?

As you know, Java 14 introduced Switch Expressions, switch statements that return a value. (See JEP 361.) But it doesn't seem to work with case statements that have code blocks. I'm not sure if I don'...
Paul C's user avatar
  • 8,407
1 vote
1 answer
66 views

Redefining the special form after the usage of that special form in one func definition has no effects to that definition in Scheme

I am reading SICP section 3.5.1 where it gives the implementation of primitive procedures provided in MIT/GNU Scheme. I tried to load these implementations without considering the order since they are ...
An5Drama's user avatar
  • 485
1 vote
1 answer
57 views

PostgreSQL Dynamic Query Execution with Table-Valued Variables

I am working with code inside of a PostgreSQL pgsql function. I have a merge statement that has multiple elements that are only known at runtime and are supplied to the function as parameters, which ...
MRodriguez's user avatar
3 votes
2 answers
118 views

Two occurrences of a variable declared with 'my' but in two different packages in the same file

I haven't coded anything in Perl for a long time. Now I have started again and came across an interesting situation when coding two packages within a single '.pm' file. Until now I thought that if I ...
autio's user avatar
  • 33
1 vote
2 answers
94 views

does nodejs's eval() would change the behavior of var keyword?

all these code snippets run in nodejs. below are demo1.js, ps: run these code in nodejs rather than browser js engine // demo1.js var1 = 'var1'; // in nodejs or Chrome-V8 js engine, this line would ...
Lucas's user avatar
  • 25
3 votes
0 answers
80 views

how to access phone location in Android app using Kotlin

My app runs on a private network in a remote location, so I'm really only interested in GPS coordinate, not WiFi assisted, but using the google play services integrated function is ok too. The rest of ...
user6157571's user avatar
3 votes
1 answer
80 views

Behavior of %>% when piping values to functions containing pipes

The below examples demonstrate that passing an object to deparse() and substitute() produces different output depending on whether the object is passed to the function with %>% and whether the ...
socialscientist's user avatar

15 30 50 per page
1
2 3 4 5
1177