shell script – How to shorten a list of variable names in bash?

In a shell script, I have a list of variables that I ordered in the form $ a, $ b, $ c, and so on. I would like to print these variables without having to list all the variables. My current code is:

a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7

for x in $ a $ b $ c $ d $ e $ f $ g
make
echo "$ x"
completed

Can I shorten $ a $ b $ c $ d $ e $ f $ g into an item referring to $ a to $ g?

automation – Incremental variable in ansible azur

Do you have any ideas on how to increment variables every time I play in my game book so I can reuse it for multiple projects? For example, I want my resource group name to be called "rg1". The next time I play my reading book after the existence of "rg1", I wish the newly created resource group to call "rg2".

for example.

first piece:

rg = rg1

second piece:

rg = rg2

Thank you!

Nginx Proxy Header Variable Does Not Work

I'm trying to setup a load balancer with nginx.

The problem I encounter for some reason, the $ host variable does not work for me when I try to use proxy_set_header

When I tried to go on http://proxy.domain.com, give me a 404 error, when I check the logs, give me this.

server: proxy.domain.com, request: "GET / HTTP / 1.0", upstream: "http://1.2.3.4:80/", host: "proxy.domain.com"

IP 1.2.3.4 is the actual IP address of ss.domain.com, but that's fine, but why give me this
http://1.2.3.4:80/ instead of my domain name, because of this, give me the error 404 and do not look for the good vhost.

I have configured my proxy settings like this:

upstream s3 {
ss.domain.com server weight = 2;
vv.domain.com server;
}
server {
listen to 80;
listening [::]: 80;
server_name proxy.domain.com;
root /var/www/proxy.domain.com/html;

location / {
proxy_pass http: // s3;
proxy_set_header Host $ host;
proxy_set_header X-Real-IP $ remote_addr;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $ host;
proxy_set_header X-Forwarded-Server $ host;
proxy_set_header X-Forwarded-Port $ server_port;
proxy_set_header X-Forwarded-Proto $ scheme;
}
}   

javascript – Notice: Undefined variable: from_time1 in C: xampp htdocs cronometro02 response.php online 6 00:00:00 Aviso: Indefinite variable: from_time1

query ("SELECT * FROM timer");
while ($ row = mysqli_fetch_array ($ res)) {
$ duration = $ row["duration"];
}
$ _SESSION["duration"] = $ duration;
$ _SESSION["start_time"] = date ("Y-m-d H: i: s");

$ end_time = $ end_time = date (Y-m-d, strtotime (+ $ + $ 39.["duration"]. Minutes, strtotime ($ _SESSION["start_time"])));
$ _SESSION["end_time"] = $ end_time;


$ from_time1 = date (Y-m-d H: i: s & # 39;);
$ to_time1 = $ _SESSION["end_time"];

$ timefirst = strtotime ($ from_time1);
$ timesecond = strtotime ($ to_time1);

$ differenceinseconds = $ timesecond = $ timefirst;

echo gmdate ("H: i: s", $ differenceinseconds);
?>

obg: a comment on the bench of music fans !!

google sheets – Using NumberRangeFilterBuilder for a cursor controlled variable entry?

I was looking for a slider control in the sheets in which I could play with a variable input by moving the slider to the left or to the right. In the following example:

A1 = value | B1 = VAR | C1 = A1 * B1

I want cell B1 to be occupied by a number given by a cursor moving between 100 and 1000, in increments of 100. The cursor itself is preferably in another cell. I know this is possible thanks to the documentation on NumberRangeFilterBuilder

Can you give me an example of the script and call it with a specified range? It seems that I can not find any other documentation on the implementation, nor that I can make it work.

unreal 4 – How can a variable have two values ​​at the same time?

Just to clarify, I do not want to know how to make a variable display 2 values ​​at the same time.

I want to know how it goes in my project.

In the Blueprint, I have a timer that generates every 5 seconds 2 warriors at different locations. This is to distinguish them. One is from the blue team and the other from the red team:

enter the description of the image here

The team of everyone that I can define correctly, the problem arises with the entire variable.

The value of the blue warrior variable must be 5. The value of the red warrior variable must be 1.

I have a text rendering that displays the time and value of the variable that I quoted:

enter the description of the image here

In Event BeginPlay, I have a loop that displays the value of this integer variable that I quoted:

enter the description of the image here

Picture of the game:

enter the description of the image here

Picture of the game:

enter the description of the image here

How can a place show that the variable is 0 and in the other indicate that it is 1/5?

Equation Resolution – Is it possible to use FindRoot with a two variable function?

Thank you for your contribution to Mathematica Stack Exchange!

  • Please make sure to respond to the question. Provide details and share your research!

But to avoid

  • Ask for help, clarification, or answer other answers.
  • Make statements based on the opinion; save them with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, read our tips for writing good answers.

laravel – How do I know if a variable contains a date?

Hello, I'm building tables dynamically. So, to know the type of data that I will save in the x field. I have to discriminate the data.

Example I have this.

if (is_int ($ x))
{
// is whole
}

if (is_bool ($ x))
{
// is a boleano
}

if (is_float ($ x))
{
// this is a floating number
}

It's a bit doubtful.

if (is_string ($ x))
{
// is a string
}

The problem is with the dates.

I have the following date format.

2019-21-06 00:00:00

I use Carbon and Laravel. Not sure there is a direct way to prove the date. And, in this way, you could tell me the method or function with which I can validate the format of this date.

I think of something like this.

if (preg_match (- ( d {4}) - ( d {2}) - ( d {2}) ( d {2}): ( d {2}): ( d {2}) $ #, $ x)) {
// is a date
}

c ++ – If a class A holds a class B as a member variable, what are the advantages and disadvantages of A who holds the object B with respect to a pointer to the object B?

What are the advantages of A using the stack to allocate an object B to the use of the heap via pointers. Consider

class B {
public:
B () {
}
void fun () {
}
};

Class A {
public:
A B() {
}

void fun () {
b.fun ();
}
private:
B b;
};

Where the object b is used by A. against

Class A {
public:
A (): b (new B ()) {
}
void fun () {
b-> fun ();
}

~ A () {
delete b;
}
private:
B * b;
}

int main () {
A;
amusing();
}

What are the advantages of the first over the last, since class B is exclusively used in class A. In the first case, the object B is allocated in the stack, while in the latter case, the Object B is allocated in the heap. When to use the old against the last.

Consider B, as a class that reads UDP protocols from a socket. Class A therefore repeatedly calls the read function of B to read the protocol. Everything about B is known at the time of compilation.

Defining a variable from the Do-Try block [Swift]

I need to define a variable such that I can access it from the do-try block. I use the do-try to leave early if there are any errors.
That's what I'm using right now, but I'm not sure it's the best practice or if there's another better way to do it.

leave rulesXml: XMLElement
make {
rulesXml = try XMLElement (xmlString: rules.string)
} catch let error {
self.showWarning (message: "Unable to create XML from LRML instructions, please validate the instructions and try again.  nError:  (error)", title: "Error: LRML file merging")
returns zero
}

Of course, I could use keep trying? but then I can not access the error message.