Questions tagged [static]

Static is a term used in some programming languages to define a function or data storage area (field) that is not bound to any specific object instance. In the majority of cases this tag, if used, should be used in conjunction with a specific programming language tag.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

NextJs Page first page dynamic second not

See Build output ├ ○ /models 1.07 kB 128 kB <-- [Static] Why? ├ λ /models/page/[page] 1.07 kB 128 kB <-- [Dynamic] other pages with ...
0xLucius's user avatar
0 votes
0 answers
10 views

Is there a way to add video as assets in Django project? And calling it's path in view file? I'm trying to add it static files but it not working

I want to add some videos about 200 short video to my project django to proccess them with moviepy package When I call my view with request URL ...and this view contain script to process these video ...
mahmoud fathy's user avatar
0 votes
2 answers
35 views

without constructor, is there a way to get child class name in JavaScript?

I have a class A and a child class B . now i want to print child class name from a static method of parent class. but both of them doesn't use constructor or new keyword. Class A { static run() { ...
Sifat Playz's user avatar
-1 votes
1 answer
70 views

C++ non-static function variables behaves like static variables [closed]

I am trying to understand the differences between C++'s static and non-static variables by printing out their memory location during code execution. Below is my code: #include <iostream> void ...
code.c.c's user avatar
4 votes
2 answers
100 views

Static variable in a loop vs variable and a loop in a block

In C we can use blocks to restrict the scope of a variable, so is { int var = /* initialization */; while(...) { // some stuff with var } } equivalent to while(...) { static ...
zonn's user avatar
  • 257
0 votes
0 answers
43 views

Use this keyword in static method of class

export default class SpecialtyAPI { public static async getSpecialtyList(request: Request, response: Response): Promise<TResponseData> { public static async getSpecialtyData(request: ...
user21696941's user avatar
1 vote
0 answers
38 views

Java Classes - Why is one of these valid and one is not? [duplicate]

I'm kind of confused about how java classes work. How come when I do this, it gives me an error that says: "Non-static variable cannot be referenced from static context": public class Test { ...
user22996223's user avatar
0 votes
1 answer
75 views

Static files not loading in pythonanywhere [closed]

I am going to run my project on the pythonanywhere site and I did all the work, but the static files are not loaded. I'm developing a website with Django. My static files are located in the ...
Elyas Shavikloo's user avatar
0 votes
1 answer
17 views

How do i download archive with static assets to my server and replace all "https://vuu.io" links with my own using wordpress?

WHITE-LABEL STATIC ASSETS All links to static content in fax report are hardcoded to Vuu.io, but you may replace them with your own URL. In this case you'll need to download archive with static assets ...
taptap's user avatar
  • 9
-4 votes
0 answers
34 views

Why does it not allow for three public static in C# to run? [closed]

I have the main public static void Main and then within that a public static string () to ask for Fuel types and a public static bool that verifies that it's correct, as soon as I add the next public, ...
shin.student's user avatar
-1 votes
0 answers
17 views

How do I make 2 scripts trade information back and forth? [duplicate]

I have a ReloadRequest asking PlayerInventory for bullets. If there's enough it sends a clipSize back, if not, it sends what it has back. Script A private void ReloadRequest() { ...
James Thies's user avatar
0 votes
2 answers
32 views

List of all static-ralated tags and elements, and how to get all static from a beautifulsoup

I working on a beautifulsoup finding of all elements that are related to static. What is the list of all static-related tags and elements? Is there any other way apart from finding by multiple ...
Dimon Agon's user avatar
0 votes
0 answers
11 views

React app subdir deploy static files issue

I need to deploy React app behind httpd proxy and I'm having issues with static files. The app must be deployed at https://example.com/app1. When I visit the homepage of the app the HTML contains this ...
user568021's user avatar
  • 1,426
-1 votes
0 answers
17 views

Why Dynamic DNS not working coreectly on 4G router? [closed]

I have many DVR cameras on different places with different ADSL and 4G subscription. Until the last week I was paying for static IP addresses, but canceled static IP subscription and bought DDNS ...
Volkan Bülbül's user avatar
0 votes
0 answers
26 views

How do i iterate and print out the next Line from my Text.txt to my output console in NetBeans?

Im trying to read out my text note from a text File, but it seems it fails to iterate towards the next line of code due to a NoSuchElementException. How do i fix this? I do apologize in advance, due ...
Ryu Christian's user avatar
-2 votes
2 answers
41 views

Recursive static enum and singleton definitions

TL;DR: Don't do what I did. Run and read the code comments in the minimum reproducer below. I have an enum that takes an instance of a class which itself is a singleton that takes a value from the ...
Ryan Moser's user avatar
0 votes
1 answer
62 views

Are function calls that are used to initialize `thread_local` variables guaranteed to be thread-safe?

Consider the following implementation of rand_double(), in which there is a thread_local function variable seed that is initialized using std::random_device{}() in each thread: auto rand_double(double ...
Christopher Miller's user avatar
0 votes
1 answer
23 views

Detect if the user is resizing a textbox

I have some code that allows a textarea to be moved around: // Note that this code is paraphrased. It may not work exactly. function createSelection(e) { if (dragging == false) { newSelection = ...
isaiah day's user avatar
0 votes
1 answer
45 views

Store an object in a static Box and then retrieve as mutable?

This is a PyO3 situation. So the Python calls a long-running task. Using ZeroMQ messaging (inter-process messaging*) it is possible for the user to order the task to be suspended. At that point I want ...
mike rodent's user avatar
  • 14.4k
0 votes
1 answer
52 views

Adjust lambda syntax to match required signature

I found this question, but the answer seems does not fulfill my requirements. The answer suggests to use static functions, instead I need to access the class members. My (not-working) ideal code would ...
Mark's user avatar
  • 4,448
0 votes
0 answers
58 views

Static Inner Class Issue

I'm facing a problem with Static Inner Classes So, my program is class Outer { static class Inner { static void test() { System.out.println("This is Inner Method"); ...
Anonymous_1354's user avatar
0 votes
0 answers
39 views

Compiling in GCC but not in Clang: "initializer element is not a compile-time constant"

I'm having this error (in the title) when I use the compiler clang-15 (15.0.7). Below is a minimum reproducible code: #include <stdio.h> #include <stdint.h> #define BUF_SIZE 255 #...
rammmmm_'s user avatar
0 votes
1 answer
45 views

How does memory allocation work for static generic classes in C# when the type is determined at runtime?

The keyword static has the following theses: Memory for static members is allocated once for the entire application. Static class fields and methods are stored in memory as soon as the assembly is ...
Christopher Fontaine's user avatar
0 votes
0 answers
21 views

Expo Swift Pods Statis Libraries Issue

I was building expo app for IOS and I was getting that error because I had used firebase in my project. ERROR: [!] The following Swift pods cannot yet be integrated as static libraries: The Swift pod ...
Ali Yousafzai's user avatar
1 vote
2 answers
112 views

Is returning a static string from a function in C a bad practice?

I'm working on a C program where I've implemented a function to generate ANSI color codes for printing colored text. const char* getAnsiColorCode(int colorId) { static char colorCode[15]; ...
kallazz's user avatar
  • 43
0 votes
0 answers
57 views

How to let a thread remember which number it is in C pthread forever until destroyed?

I have to create multiple threads and use them for multiple times. I need to let each thread remember that it is the i-th thread (not the system thread id). Thus there need to be a static place in the ...
Kagura Hitoha's user avatar
0 votes
0 answers
53 views

CMake: How to compile a static library in a project that only compiles a shared library?

This repo contains the source code to build a library called librockchip_mpp that is necessary to access the video processing unit of Rockchip SoCs. The library is a dependency of this FFmpeg fork ...
Marc Altmann's user avatar
2 votes
2 answers
63 views

How to close a static variable of AutoClosable type?

I’m the author of a Java library that provides Java access to a C++ library our company sells. The instances of one of the classes “own” C++ objects in the following sense: The class has a few private ...
Bolpat's user avatar
  • 1,448
0 votes
0 answers
17 views

Sveltekit static website blog show data filtered on client current date

Disclaimer: I'm a non-web engineer trying to setup a personal blog with sveltekit. What I want: a static blog (hosted on github pages for now). I want to write blogposts ahead of time and have them ...
Dimebag's user avatar
  • 833
0 votes
0 answers
4 views

Form objects not visibles using a delegate

I need to perform several actions in sync with the arrival of data, on the serial port. Then I simply need to display a message indicating that these characters have arrived correctly. The message ...
Attilio's user avatar
0 votes
0 answers
20 views

How to set the focus of custom tab to remain static in Excel addin api using js

enter image description here Hi, I have created an excel addin project using custom tab ribbon that loads at very last tab but the focus shifts to Home tab each time I perform any operation using that ...
ArshadAnsari's user avatar
-3 votes
0 answers
68 views

Why are Static variables not allowed in constexpr function? [duplicate]

As we know constexpr function are functions that can be evaluated either at compiletime or at runtime, which depends on various factors(like whether the arguments passed are constexpr or whether the ...
Akshay J R's user avatar
0 votes
0 answers
22 views

In Django, how to remove language prefix conditionnally after internationalization ? Media file src problem

In a django project, after a query I'm sending image srcs to a JS file that will then create popovers dynamically on my home page using these image srcs and some text data. ex : popover_photo.src = '...
Antz's user avatar
  • 1
1 vote
0 answers
27 views

Rust: static objects or something like Java Spring Component

I am building an application using Rust + Iced. I have various services for creating and manipulating my data. As of now I have one struct that contains all of the services and I pass it around as ...
stove's user avatar
  • 566
-1 votes
0 answers
36 views

How to display static google map on android MapView?

there I've been having a problem with static map URL with Google Map SDK. Static URL https://maps.googleapis.com/maps/api/staticmap?size=400x275&key=MY_API_KEY&maptype=roadmap&scale=2&...
Urvish Stack's user avatar
-1 votes
0 answers
31 views

add custom plugin for adminer in laravel

i want to write a custom plugin for adminer in laravel , my custom_plugin must add a field like "modify_field" in adminer , adminer have static field named "modify_field" for all ...
milad habibi's user avatar
2 votes
2 answers
76 views

Why doesn't the size of the binary file increase with the size of the static data?

When I compile the following C code with gcc -O0, #include <stdlib.h> #include <stdio.h> char bytes[1000*1000*1000]; int main(void) { for (int i = 0; i < 1000*1000; i++) ...
richardIII's user avatar
1 vote
0 answers
29 views

How can I use either enums or final Objects inside Java annotations to make better validations?

Annotations in Java like Size or JsonProperty require me to use constants, I have lots of fields in DTOs to validate and I also need to go back to the validated fields later to check some infos so I ...
Enzo Lopes's user avatar
0 votes
0 answers
18 views

Creating a jagged array out of arrays in a static class in C# gives NullReferenceException [duplicate]

I've created a static class for palettes and have many static palettes. I want to create a jagged array out of them so they are easier to access. This doesn't work, if I use it from another class with ...
Linus's user avatar
  • 1
0 votes
0 answers
8 views

I am trying to host my Django project in heroku, but i am getting an error when i am collecting static files with python manage.py collectstatic

I am trying to host my Django project in heroku, but i am getting an error when i am collecting static files with python manage.py collectstatic. I have looked for this file 'plugins/flot/jquery.flot....
Isaac NSB Kargbo's user avatar
0 votes
0 answers
10 views

error (400) when putting whitenoise in django cpanel whit debug in false

I get a 400 error on the entire page when I put this in the settings.py: STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" If I have the debug set to true ...
Fausto Fernandez's user avatar
0 votes
1 answer
45 views

How to mock Java static block

I have a following Java class in a 3rd party library: public final class SomeFactory { public static native someMethod1() public static native someMethod2() private SomeFactory() { } ...
Pitel's user avatar
  • 5,216
0 votes
1 answer
90 views

C++ how to get the first and the last element in an std::vector by its base memory address

To me, a vector layout looks something like this: struct MyViewOnHowVectorLooksLike { public: int* _first, * _last, * _end; }; Known Parameters: Address of the std::vector<Type> object size ...
Jerry's user avatar
  • 11
0 votes
0 answers
35 views

Unable to load static files with express.js

I've been trying to get CSS files and JS files to work alongside my HTML files with express.js but I am unable to get it to work with the express.static() method but it doesn't work and returns a &...
SpeedyChipmunk's user avatar
0 votes
0 answers
45 views

Multithreading: more efficient to have static variables with a static Lock or non-static variables and then compare the results between all threads?

I have a list of files, let's say of size 1000. Each thread is going to do some work on 100 files, so we would have a total of 10 threads. The result of this work, for each thread, is an int and a ...
Elegancia's user avatar
0 votes
0 answers
43 views

How to initialize a protected class variable in C++; LNK2001 [duplicate]

I'm trying to teach myself C++, but the error messages are less than helpful in my debugger. The short version is that I have declared a Bank_Account class with a next_account_number class variable. ...
Red Whale's user avatar
1 vote
2 answers
134 views

"Incomplete type is not allowed" with static inline member of own class

struct Foo { inline static Foo F1; }; This causes compilation error on various online compilers of C++11, C++17, C++20 due to ‘Foo Foo::F1’ has incomplete type. In Visual Studio with C++17 it ...
H.v.M.'s user avatar
  • 1,454
0 votes
0 answers
62 views

Access Denied when trying to access sub pages on static website hosted on S3

I am trying to create a static website using Hugo. I built my hugo site and uploaded the public folder to Amazon S3. After setting the CORS policy, changing the filepath for the css and js files in ...
jrida523's user avatar
-2 votes
1 answer
71 views

Use object guarded by Mutex

I want to implement a lazy static reqwest::ClientBuilder. NB this is for a utilities module, so I have a feeling it'd be difficult to avoid using a static in this case. I want to construct it once, ...
mike rodent's user avatar
  • 14.4k
-1 votes
1 answer
122 views

How to initialize static members of a class? [duplicate]

I have written this code. It is giving no compile time errors but a runtime error. Can you please tell me what is wrong with this code? It is giving this runtime error -> strap info: vpid 1: ...
Praveen O'Connell's user avatar

1
2 3 4 5
329