## Pass two concatenated variables in a Json object of a POST Curl in PHP

I'm sending this request on the json POST of Curl with PHP.

Here is post json:

``````"Payment" => (
"Type" => "Vendor",
"Amount" => 100,
"CreditCard" => (
"CardNumber" =>  "\$card",
"ExpirationDate" =>   "\$dataexp"

)
``````

The default value for receipt on the ExpirationDate API is: 20/2021 XX / XXXX.

In "ExperationDate" => "", I want to concatenate the two variables (\$ mes and \$ year) with the / (slash). \$ my + / + \$ year or more on a single variable.
When I submit the ExpirationDate content, it must contain 12/2021 XX / XXXX.

They come from other script variables: \$ Mes and \$ year.

Returns this template by sending ExperationData to the publication API.

I have tried something like:

``````"ExperationDate" => "'.\$mes.'/'.\$ano.'"

"ExperationDate" => "\$mes/\$ano.'"

"ExperationDate" => "\$mes./.\$ano.'"
``````

None of the 3 possibilities gave it to me. \$ Mes and \$ year are not concatenated with /. So, the default value, for example 10/2021, was not passed correctly in the POST object in json ExperationDate => ""

I have error in ExperationDate in api, the error is exactly at the point of two more variables / concatenated in ExperationDate.

Could someone help me to do this motive that I have shown?
Would it be possible to pass two variables and concatenated in a json object of the post?

cordially
thank you so much

## powershell – shell script assigning psql values ​​to variables

I'm trying to assign a query output value to the variable in the sh script file. As I run Git bash command line, an attribution error is returned.

``````mycount = \$(psql -X -A -h \${PGHOST} -p \${PGPORT} -U \${PGUSER} -d\${PGDATABASE} -c "SELECT max(date_posted) FROM posts;" )
echo "max date is :" \$mycount
``````

Here is my exit screen:

I do not know how to solve this problem. Please, help someone on this subject.

## problem with constant variables

The variable x is supposed to be constant, but the program calculates for each variable x 100 numbers of x. I want all my x variables to have the same definition, but the program constantly changes the definition of each variable x.

https://1drv.ms/u/s!AqOJ6xqR2PKjglEgVfbcNx8XyKX5?e=SdAOHZ

## memory – the operation takes a very long time, all the variables are erased

I'm trying to simplify a very big expression and to accomplish that, I use the following lines of code:

``````Parallelize(SimpExpression = Simplify(Expression);)
Compress(SimpExpression)
``````

the `Compress(SimpExpression)` The line is just there to generate an output that I can save later. After running for several hours ($$sim12$$) I receive the following output:

``````Simplify: Time spent on a transformation exceeded 300.` seconds, and the transformation was aborted. Increasing the value of TimeConstraint option may improve the result of simplification.

Simplify: Time spent on a transformation exceeded 300.` seconds, and the transformation was aborted. Increasing the value of TimeConstraint option may improve the result of simplification.

Simplify: Time spent on a transformation exceeded 300.` seconds, and the transformation was aborted. Increasing the value of TimeConstraint option may improve the result of simplification.

General: Further output of Simplify::time will be suppressed during this calculation.
``````

In addition, all the variables have been erased. Any ideas on what is happening or how can I solve this problem?

I am not sure that this is relevant, but I am using an evaluation version of Mathematica. Also, I can provide `Expression` if someone wants to reproduce that.

## optimization – A decision variable that is only an upper limit on other decision variables makes a whole program more difficult to solve?

I have several decision variables $$max_s in mathbb {N}, s in mathcal {S}$$ which are only upper bounds on other decision variables: $$x_ {i, s} leq max_s forall s in mathcal {S}, forall i in mathcal {I}.$$

I'm using this strategy simply to make it easier to get the upper bounds of the output, which makes the explanation of the model easier, as these are very important to the context of the problem, but I could also obtain the maximum values ​​of the solution. $$max_i x_ {i, s}$$. I think it's maybe the solver (using the branch and bound algorithm by default) does something like that too, but I'm not sure.

Do these variables of the upper limit $$max_s, s in mathcal {S}$$ make the problem more difficult to solve than simply getting the maximum value of the solution?

## apache – HTTPD redirection does not work with environment variables

We want to redirect users from an old domain to a new domain defined in an environment variable:

``````SetEnvIfExpr true SERVER_HOST_NAME=mynewdomain.com
``````

The following works in Apache 2.4 to redirect to a host name defined in an environment variable:

``````Redirect permanent https://%{env:SERVER_HOST_NAME}/
``````

This does not mean, however:

``````Redirect permanent / https://%{env:SERVER_HOST_NAME}/
``````

The second option is preferable because it keeps the path, so if the request is:

``````GET https://myOLDdomain.com/somepath
``````

The first option will always redirect the user to:

``````    GET https://mynewdomain.com/
``````

instead of:

``````    GET https://mynewdomain.com/somepath
``````

Currently, the 2nd option redirects (literally) the user to:

``````    GET https://%{env:SERVER_HOST_NAME}/somepath
``````

Is this a problem that Apache does not solve? `%{env:SERVER_HOST_NAME}`?

## calculation and analysis – Implementation of Simpson's rule with two variables

For one of my lab projects, I have to integrate a given function (in this example, `f1`, using Simpson's ruls. When only one variable `x` exists, I could find a code that calculates the integration:

``````f1(x_) := 3 + Cos(x + 3)
LEFT1(f_, a_, b_, n_) :=
Module({h, i},
h = (b - a)/n;
N(h Sum(f1(a + i h), {i, 1, n - 1, 2})))
RIGHT1(f_, a_, b_, n_) :=
Module({h, i},
h = (b - a)/n;
N(h Sum(f(a + i h), {i, 2, n - 2, 2})))
TRAP1(f_, a_, b_, n_) := 4 LEFT1(f, a, b, n) + 2 RIGHT1(f, a, b, n)
MID1(f_, a_, b_, n_) :=
Module({h, i},
h = (b - a)/n;
N(h (f(a) + f(b))))
SIMP1(f_, a_, b_, n_) := (MID1(f, a, b, n) + TRAP1(f, a, b, n))/3.0

SIMP1(f1, -1, 10, 10)
``````

`32.5062`

Instead of using `f1(x_) := 3 + Cos(x + 3)`, I would like to use `f1(x_) = 3 + Cos(x + 3 b)` and calculate the integration for the value of `b` ranging from 1 to 50. I do not know how I should start addressing this problem.

## networking – Ansible, retrieve the IP address for a given network interface via variables

I am currently facing a problem with my ansible role, actually my role installed on a NRPE server installed on Linux.

In some cases, these servers have multiple network adapters and must associate the NRPE server with a particular network adapter (dedicated to the monitoring network).

My goal is to recover the IP address of a named network card (which is a variable because it can act from another network card) and set this IP address on the # Server_address option of my nrpe.cfg file.

After some research, trial and error, ansible_fact seems to be the way to gather this information. I think I will have to register a variable to use with my jinja2 model.

My main problem is how to recover the IP address of the named network card (enp0s8).

Thanks for your advices.

Regards,

Nikos

## How to enter random values ​​(constraints) of all the variables in the case of the formulation of a linear programming problem?

suppose,
Min 2x + 3y
Subject to, x = 2, x = 5, x = 7
y = 5, y = 9
is a linear program. Where x holds the values ​​2 or 5 or 7 and there are the values ​​5 or 9. So, what is the correct wording for the problem above?

## Java uses the variables of a method called in another class

I make a game and I want to load all my assets first, then start the game.
How it works is that I have a class that has 2 methods `loadTextures()` and `loadSounds()` I want to call them the 2 methods in the main `Game` method and then use the variables in these methods in a different class `Player` it's mainly for sounds, because when I photograph, the sound is not played, it must be loaded first.