16,482 questions
0
votes
1
answer
52
views
Problem with injecting value to the static variable
With the entered code here, I am trying to build a project on springboot. I am using AES encryption in my project. I am keeping the password(key) of AES in the application properties. The variable ...
1
vote
1
answer
96
views
django-vite static assets being served but not loading on an Nginx deployment
I'm deploying a simple Django project on a local Ubuntu server VM running Docker (3 containers, Postgres, nginx and Django). The project uses a lot of HTMX and DaisyUI. On my dev environment they ...
5
votes
1
answer
182
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;
...
-3
votes
1
answer
105
views
POJO class retains old values during multiple test execution
I am having pojo class with Lombok @data annotation. pojo classes are static in calling classes. So When I execute multiple selenium tests say test 1 and test 2, during test 2 execution, pojo fields ...
0
votes
0
answers
24
views
Django static files not loading for one app when DEBUG=False [duplicate]
I'm working on a Django project with multiple apps (Home, student, login, etc.).
When I set DEBUG = False in settings.py, the static files (CSS and JS) from my Home app load fine, but the static files ...
2
votes
1
answer
41
views
Why is static SQL in Linux DB2 stored procedure rejected?
I've seen plenty of examples of static SQL in sample Linux DB2 stored procedures. But if I code static SQL in my Linux DB2 stored procedure, as follows:
SET v_MsgText = 'DROP LOC CHECK failed.';
...
2
votes
2
answers
112
views
Lambda static vs mutable variable
I have encountered a lambda with static variable in the following answer https://stackoverflow.com/a/79631994/2894535 :
EXPECT_CALL(my_mock, foo(_))
.WillRepeatedly(InvokeWithoutArgs([](){
...
2
votes
3
answers
244
views
How to declare static constexpr variable in C++?
I have a Foo class that includes an array and a static constexpr variable. As a general convention, I want to write public and private variables respectively. But, compiler error occurs 's_array_size' ...
0
votes
1
answer
387
views
What is a good solution to avoid "unreferenced function with internal linkage has been removed" warnings?
I implement some functions in header files (template functions, for instance), but then some of these functions go unused in some translations units:
main.cpp
#include "include.h"
int main()...
1
vote
1
answer
49
views
AspectJ staticInitialization changes the method context on the code in the clinit when doing @Around
This question is a follow up to the question here
AspectJ @around a static initializer
I accepted that answer because it did apply the aspect to the code, but i hadn't actually run it yet to see there ...
0
votes
0
answers
58
views
Can Array be declared with size as function argument, array[variable_size] in C Language (constraint - malloc should not be used) [duplicate]
I need to know if I can have variable as size of array in a loop and in a function.
NOTE: I cannot use malloc.
Using array sizes as shown below, Is it valid? Will it cause any runtime issues / crash / ...
0
votes
0
answers
57
views
boost::system::error_code::message() crashed, for it call __cxxabiv1::__cxa_pure_virtual() actually
boost:Version 1.68.0.
os:Linux IVI 5.4.134 #1 SMP PREEMPT Tue Mar 18 01:00:37 CST 2025 aarch64 GNU/Linux.
compiler:gcc7.3.
when I called boost::system::error_code.message() like LOG("open error: %...
0
votes
0
answers
53
views
Why is the getBrowserStoreParams111 Function Initialized Twice in the Same Process and Thread?
common.h
static int getBrowserStoreParams111(int type);
common.cc
int Common::getBrowserStoreParams111(int type) {
static int store_param = [type] {
int result = type;
std::cout <<...
0
votes
1
answer
60
views
I keep getting this issue Invalid block tag on line 5: 'static', expected 'endblock'. Did you forget to register or load this tag?
<!-- about.html -->
1 {% extends 'book/base.html' %}
2
3 {% block title %} About {% endblock %}
4 {% block extra_head %}
5 <link rel="stylesheet" href="{% static '...
1
vote
4
answers
210
views
Why do I need to make a static class to make instances of that class?
When I'm trying to make instances of my class I get errors unless I add the static keyword. I'm wondering why this is, doesn't this go against the whole concept of being static.
Here is my code that ...
1
vote
0
answers
32
views
Using static reference in struct with non-static lifetime [duplicate]
In the following example:
fn send(_data: &'static mut [u8]) {
unimplemented!();
}
struct Device {
buffer: &'static mut [u8],
}
impl Device {
fn new(buffer: &'static mut [u8]) ...
0
votes
1
answer
98
views
Are arrays treated as static data structures by gcc compiler or as dynamic? [duplicate]
I thought arrays were considered static data structures.
Then we executed this:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[5] = {10,20,30,40,50};
a[5] = 100;
a[6] = ...
0
votes
1
answer
43
views
Django admin: strange view
Couldnt understand what wrong with my admin part. It looks like that:
I understood that this effect may depend on 'static' resources..
HTML preview shows:
<head>
<title>Log in | Django ...
-3
votes
2
answers
104
views
How to improve the initialization of a Settings window?
I have a class like this:
public static class Settings
{
private static SettingsWindow _settingsWindow = null;
public static void Init(SettingsWindow settingsWindow)
{
...
0
votes
2
answers
64
views
Kotlin static property initialization
I'm searching for the (idiomatic) Kotlin equivalent to javas:
private static Book currentBook;
public static Book get() {
if(currentBook == null) {
currentBook = new Book();
}
...
4
votes
1
answer
234
views
C++17 inline static member instantiation timing: Lazy instantiation or before main()?
I’m defining an inline static data member in a C++17 class (inline static SharedData gSharedData;).
I have two questions:
1)It seems gSharedData instantiated before main() starts like (non-inline ...
0
votes
2
answers
151
views
Excel/VBA: Create a static time stamp the first time a cell is updated
I am trying to figure out a way in VBA to give a timestamp when a cell is updated, but I want that timestamp to be static and only update one time, the first time.
Columns A-I are a checklist and the ...
-1
votes
3
answers
161
views
How can I make the factory class static in factory design pattern?
I was reading an e-book explaining design patterns, and after explaining the factory design pattern, it suggests some improvements. One of them was to make the factory static.
Make the factory (or a ...
-4
votes
1
answer
101
views
Need for encapsulating main() [closed]
Since main() is made static so that JVM can access it without creating an object of the class in which it is defined, then what is the need for writing it in a class?
2
votes
2
answers
125
views
Accessing a static property in a generic interface [duplicate]
I created a generic interface that has a static property, and yet the classes that implement that interface do not seem to have access to the property or expose it to other code.
For example, the code ...