global Questions
2
Solved
The FastAPI application I started working on, uses several services, which I want to initialize only once, when the application starts and then use the methods of this object in different places.
I...
Homologate asked 23/5, 2021 at 20:16
5
Solved
#include <algorithm>
using namespace std;
int count = 0, cache[50];
int f(int n)
{
if(n == 2) count++;
if(n == 0 || n==1) return n;
else if (cache[n] !=- 1) return cache[n];
else cache...
7
Solved
I'm looking for a way to force JSON.stringify to always print BigInts without complaining.
I know it's non-standard, I know there's a package for that in pure JavaScript; but it doesn't fit my need...
Premer asked 5/12, 2020 at 0:0
1
Solved
The official way of working with expo-cli is to install it globally, see https://docs.expo.io/get-started/installation/#installing-expo-cli:
Installing Expo CLI
# Install command line tools
npm in...
4
Solved
Is there a use for flagging a variable as static, when it lies in the global scope of a .cpp file, not in a function?
Can you use the static keyword for functions as well? If yes, what is their us...
Descant asked 18/1, 2011 at 14:29
2
Solved
Using Razor Pages ASP.Net Core, I have some functions that I'd like to use on every page. I guess this used to be done with App_Code, but that no longer seems to work in Core. How can I accomplish ...
Columbus asked 10/2, 2020 at 21:29
3
Solved
I'd like to set seeds in R only locally (inside functions), but it seems that R sets seeds not only locally, but also globally. Here's a simple example of what I'm trying (not) to do.
myfunction &...
5
Solved
In C language, I want to access a global static variable outside the scope of the file. Let me know the best possible way to do it.
One of the methods is to assign an extern global variable the val...
Fao asked 29/12, 2009 at 6:9
11
Solved
I want to check in a script if a certain other module is already loaded.
if (ModuleName) {
// extend this module
}
But if ModuleName doesn't exist, that throws.
If I knew what the Global Objec...
Anitaanitra asked 18/7, 2010 at 20:44
4
Solved
How can I assign a function argument to a global variable with the exact same name?
Note:
I can't do self.myVariable = myVariable because my function is not inside of a class.
When write the foll...
14
Solved
I want to set up Git to globally ignore certain files.
I have added a .gitignore file to my home directory (/Users/me/) and I have added the following line to it:
*.tmproj
But it is not ignorin...
10
Solved
I have a node.js app that attaches some config information to the global object:
global.myConfig = {
a: 1,
b: 2
}
The TypeScript compiler doesn't like this because the Global type has no objec...
Beatrizbeattie asked 29/1, 2016 at 0:17
5
Solved
How to get the global (company) group id in Liferay without accessing ThemeDisplay?
P.S.: with ThemeDisplay it is simple: themeDisplay.getCompanyGroupId().
3
I see that it is possible to embed React components with MDX:
https://v2.docusaurus.io/docs/markdown-features/#embedding-react-components-with-mdx
However, this method works for a specific page. H...
Priedieu asked 26/5, 2020 at 12:33
10
Solved
I'm bit confused about how the global variables work. I have a large project, with around 50 files, and I need to define global variables for all those files.
What I did was define them in my proj...
3
Solved
I would like to store my NodeJS config in the global scope.
I tried to follow this => Extending TypeScript Global object in node.js and other solution on stackoverflow,
I made a file called glob...
Estren asked 21/7, 2019 at 10:44
6
Solved
I have two pages - "page 1" and "page 2". On page 1 there's an text-box with a value of e.g. 100 and a button at the end.
By pressing the button I want javascript to save the value of the textbox ...
Myxomatosis asked 4/1, 2015 at 12:49
16
I'm trying to pass a variable into an include file. My host changed PHP version and now whatever solution I try doesn't work.
I think I've tried every option I could find. I'm sure it's the simple...
Katheryn asked 10/8, 2012 at 15:50
8
Solved
I'm writing a silly program in python for a friend that prints "We are the knights who say 'Ni'!". then sleeps for 3 seconds, and then prints "Ni!" twenty times at random intervals using the random...
Pekan asked 6/8, 2010 at 5:48
8
Solved
I just want to use a $variable at several places: not only views and controllers, but also in the routes.php and other configuration files.
I don't want things like: use the Config class to load c...
Renettarenew asked 9/6, 2013 at 19:36
10
Solved
What is the reason of having globals() function in Python? It only returns dictionary of global variables, which are already global, so they can be used anywhere... I'm asking only out of curiosity...
Bayard asked 2/10, 2012 at 15:39
4
Solved
Why can I not change global variables from inside a function, using exec()? It works fine when the assignment statement is outside of exec(). Here is an example of my problem:
>>> myvar = 'test'
...
5
Solved
I have the following three files in my code (with most of the code removed. This is just to isolate the issue).
global.h:
//global.h
#ifndef GLOBAL_H
#define GLOBAL_H
extern const int ARRAYSIZEX;...
2
Solved
I'd like to use the Logger library in my app. I only want to instantiate it once so that I have consistent formatting across my app. Also I would like to avoid instantiating PrettyPrinter() several...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.