All Questions
80
questions
1
vote
1
answer
140
views
Need more understanding of PHP Float CONSTANTS
So, I just came across these PHP float Constants: PHP_FLOAT_DIG and PHP_FLOAT_EPSILON, and I don't understand both constants (even after studying the official documentation https://www.php.net/manual/...
0
votes
1
answer
112
views
How to add link/href to html from global constants file
I have a global constants file where I added a links node to it but I'm not sure how to translate that node from the constants file into the html file or possibly ts file of the html file.
constants ...
2
votes
0
answers
78
views
Do PHP class constants introduce the same global scope problems as normal PHP constants?
I understand the scope problems in PHP that arise from use of constants (as well as the global keyword with normal variables) in functions and classes. I understand Singletons and that I don't have (...
0
votes
1
answer
166
views
Are there any tricks I can use to initialize global constants with a separate function call?
I have a lot of global settings defining the behavior of my program. I found it convenient to declare these settings as extern constants in a separate namespace like this:
// settings.hpp
namespace ...
-2
votes
1
answer
75
views
Global Constants in Python3 [closed]
I have some code which was written in Python2.7 and I need to convert it to Python3. My problem is that I used this
https://code.activestate.com/recipes/65207-constants-in-python/
to create a ...
1
vote
1
answer
82
views
C++, Where To Put Free Variables?
I'm writing a small ini file parser (0), I use some regular expressions that I have put into a std::map<std::string, std::regex>, it's a const one because it contains all I need to retrieve the ...
0
votes
0
answers
70
views
Dart - global constants design - Class constructor Constants._()
I'm using a Dart package and need to extend or otherwise change some of the state in a singleton class called Constants, i.e. a class with a private constructor. It appears I have to change the ...
0
votes
1
answer
663
views
Global constant in Angular depending on build configuration
I am currently trying to migrate an AngularJS 1.6 application, completely build in components, to Angular 12. So far everything works, but I am having one big problem cause of our project structure:
...
2
votes
1
answer
659
views
Accessing global constants using globalThis/window [duplicate]
I just played around with global declerations using var, const, and without any, and noiticed that while var and without can be accessed using globalThis, const cant.
aaa = "aaa";
var bbb = &...
0
votes
0
answers
61
views
Is it good to use globals() in Python?
My code includes a constants.py module that needs to initialize two capitalized constant variables with two functions, and may I wonder if it is good to:
(1) initialize the variables as None and then
(...
-2
votes
1
answer
45
views
datatypes that act as global need no header files. How to find #define for OS and Linux version. Is there any header file that get included by default
If I make a C program or C++ program so on Linux datatypes need no header files to be included (at least true for int, char, and void). so I believe they are common in different Operating Systems ...
-1
votes
2
answers
922
views
Python : define a constant used by several functions [duplicate]
In Python, I was wondering something about defining a variable in a module which can be used by all functions in that module.
I know that if I define a variable outside function, I can access that ...
1
vote
2
answers
55
views
global const var declared once, is it possible?
I've an header file with all const values I need within the DLL I'm making, such as:
// myHelpers.hpp
const int kMaxNumVoices = 16;
const int kMaxBeats = 32;
....
and so on. Once I include the .hpp ...
1
vote
0
answers
118
views
How can I access all the constants in the form of an array which are defined in my Ruby program?
I can access all the local variables with variable name "local_variables".
I can access all the global variables with variable name "global_variables".
But how can I access all the ...
0
votes
0
answers
159
views
Declaring const variable in function or file?
So I'm integrating some old drivers and implementation for LCDs.
They have images declared as static const uint8_t image[]. Sometimes declared within the file globally, sometimes declared within the ...