Tag: var

56 votes
14 answers
1.3K views
How do I pass environment variables to Docker containers?

I'm new to Docker, and it's unclear how to access an external database from a container. Is the best

avatar
Louetta
0 1 0 9
asked 07 September, 2021
47 votes
8 answers
1.3K views
MySQL: Large VARCHAR vs. TEXT?

I've got a messages table in MySQL which records messages between users. Apart from the typical ids and m

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
51 votes
5 answers
2.4K views
How do I delete an exported environment variable?

Before installing gnuplot, I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src. During

avatar
Bryant
0 1 0 9
asked 07 September, 2021
50 votes
2 answers
739 views
In MATLAB, are variables REALLY double-precision by default?

This question arose out of something strange that I noticed after investigating this question further... I al

avatar
Dusty
0 1 0 9
asked 07 September, 2021
56 votes
9 answers
1.9K views
Using i and j as variables in MATLAB

i and j are very popular variable names (see e.g., this question and this one). For example, in loops: for i=1

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
56 votes
6 answers
3.1K views
How to get the type of a variable in MATLAB

Does MATLAB have a function/operator that indicates the type of a variable (similar to the typeof operator in

avatar
Boyd
0 1 0 9
asked 07 September, 2021
68 votes
9 answers
459 views
How can I index a MATLAB array returned by a function without first assigning it to a local variable?

For example, if I want to read the middle value from magic(5), I can do so like this: M = magic(5); value = M

avatar
Rudy
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.5K views
How to check if a variable is set in Bash?

How do I know if a variable is set in Bash? For example, how do I check if the user gave the first parameter

avatar
Basil
0 1 0 9
asked 07 September, 2021
46 votes
14 answers
858 views
How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application

When I publish my ASP.NET Core web application to my local file system, it always takes the production-config

avatar
Rufus
0 1 0 9
asked 07 September, 2021
71 votes
9 answers
2K views
Static vs class functions/variables in Swift classes?

The following code compiles in Swift 1.2: class myClass { static func myMethod1() { } class func

avatar
Stacia
0 1 0 9
asked 07 September, 2021
51 votes
7 answers
1.8K views
Read environment variables in Node.js

Is there a way to read environment variables in Node.js code? Like for example Python's os.environ[&apos

avatar
Joseph
0 1 0 9
asked 07 September, 2021
52 votes
15 answers
3.1K views
How to access environment variable values

I set an environment variable that I want to access in my Python application. How do I get its value?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
55 votes
23 answers
870 views
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
65 votes
21 answers
459 views
Using global variables in a function

How can I create or use a global variable in a function? If I create a global variable in one function, how c

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
64 votes
11 answers
981 views
Why don't Java's +=, -=, *=, /= compound assignment operators require casting?

Until today, I thought that for example: i += j; Was just a shortcut for: i = i + j; But if we try this:

avatar
Jeff
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1K views
How can I determine if a variable is 'undefined' or 'null'?

How do I determine if variable is undefined or null? My code is as follows: var EmpName = $("div#esd-names d

avatar
Hilario
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
1K views
What's the difference between using "let" and "var"?

ECMAScript 6 introduced the let statement. I've heard that it's described as a local variable, but I

avatar
Basil
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
1.9K views
58 votes
29 answers
571 views
"Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_na

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
1.8K views
How to get the client IP address in PHP

How can I get the client IP address using PHP? I want to keep record of the user who logged into my website t

avatar
User demo
0 1 0 9
asked 07 September, 2021