differential equations – What is the definition of Curl in Mathematica?

I have a usual mathematical training in vector and tensor calculus. I was trying to use the Mathematica Differential Operators, namely div, Grad and Loop. To my knowledge, the Mathematica definitions for div and Grad coincides with those usually used in tensor calculus, that is to say

begin {align *}
text {grad} mathbf {T} & = frac { partial mathbf {T}} { partial x_i} otimes mathbf {e} _i, \
text {div} mathbf {T} & = frac { partial mathbf {T}} { partial x_i} cdot mathbf {e} _i \
tag {1}
end {align *}

for any tensor $ mathbf {T} $ of rank $ n ge1 $. $ otimes $ and $ cdot $ are the usual generalized external and internal products, also defined in Mathematica by Outside and Internal. The usual definition I know about calculating the tensor for the Loop is as follows
begin {align *}
text {curl} mathbf {T} & = mathbf {e} _i times frac { partial mathbf {T}} { partial x_i}.
tag {2}
end {align *}

However, it appeared that Mathematica's curematic definition was totally different. For example, it returns the Loop second-order tensor as a scalar, whereas according to $ (2) $ it should be a second-order tensor.

I could not find a precise definition of Mathematica for Loop in the documents. I wonder what that definition is. What is the motivation for this? and how it can be related to the definition given in $ (2) $?

bitcoind – RPC calls to LND using curl?

I have a Bitcoind server and LND running. I can make RPC calls to bitcoind using curl, like this:

curl http: // XXX: YYY @ localhost: 8332 -H type of content: text / plain; & # 39; --data-binary & # 39; {"jsonrpc": "1.0", "id": "curltext", "method": "getblockchaininfo", "params":[]} & # 39;

However, I do not find how to make RPC calls to LND using curl.

My lnd.conf contains a [Bitcoind] section like this:

[Bitcoind]



bitcoind.rpchost = 127.0.0.1: 8332
bitcoind.rpcuser = XXX
bitcoind.rpcpass = YYY
bitcoind.zmqpubrawblock = 127.0.0.1: 28332
bitcoind.zmqpubrawtx = 127.0.0.1: 28333

However, what is problematic is to discover or configure how to connect to LND itself with RPC.

Can not find clear documentation on this. I understood that apparently I needed to use port 10009, but it did not work:

curl http: // XXX: YYY @ localhost: 10009 -H type of content: text / plain; & # 39; --data-binary & # 39; {"jsonrpc": "1.0", "id": "curltext", "method": "getinfo", "params":[]} & # 39;

(the result is empty, no error, nothing)

I guessed that maybe I needed to set a separate RPC user name and password for LND, but I can not know how or where, that is, what are the parameters in lnd.conf?

In addition, should I add a configuration line to make sure the LND daemon listens for RPC calls?

In addition, should I add a configuration line to ensure that the LND daemon supports RPC calls from specific IP addresses? (localhost in this case, or adding external IPs later)

php – Retrying Curl X of Time Before Successful Return (Script / Functions)

I am under no illusion that this is the best way, if not the best way to do it. It's just a work solution. Advice, opinions, suggestions, insults, death threats, let's listen to him.

<? php

require_once & # 39; ../ include / include.php & # 39 ;;
include FUNCTIONS.DS. & # 39; functions.php & # 39 ;;
$ getPage = CurlPage ($ URL);
$ getPage1httpCode = $ getPage['httpCode'];

if ($ getPage1httpCode! = 200)
{
sleeping (rand (5, 10));
echo & # 39;

Attempt # 2

& # 39 ;; $ getPage2 = CurlPage ($ URL); $ getPage1httpCode2 = $ getPage2['httpCode']; if ($ getPage1httpCode2! = 200) { sleeping (rand (5, 10)); echo & # 39;

Attempt # 3

& # 39 ;; $ getPage3 = CurlPage ($ URL); $ getPage1httpCode3 = $ getPage3['httpCode']; if ($ getPage1httpCode3! = 200) { sleeping (rand (5, 10)); echo & # 39;

Attempt # 4

& # 39 ;; $ getPage4 = CurlPage ($ URL); $ getPage1httpCode4 = $ getPage4['httpCode']; if ($ getPage1httpCode4! = 200) { sleeping (rand (5, 10)); echo & # 39;

Attempt # 5

& # 39 ;; $ getPage5 = CurlPage ($ URL); $ getPage1httpCode5 = $ getPage5['httpCode']; if ($ getPage1httpCode5! = 200) { sleeping (rand (5, 10)); echo & # 39;

Failed.

& # 39 ;; var_dump (& # 39; Fatal error & # 39;) die(); } } } } } if ($ getPage == 200 || $ getPage1httpCode == 200 || $ getPage1httpCode2 == 200 || $ getPage1httpCode3 == 200 || $ getPage1httpCode4 == 200 || $ getPage1httpCode5 == 200) { if ($ getPage == 200) {$ HTML = $ getPage['Data']; echo & # 39;

httpCode2 Success: 200

& # 39 ;; } elseif ($ getPage1httpCode2 == 200) {$ HTML = $ getPage1httpCode2['Data']; echo & # 39;

httpCode4 Success: 200

& # 39 ;; } elseif ($ getPage1httpCode4 == 200) {$ HTML = $ getPage1httpCode4['Data']; echo & # 39;

httpCode6 Success: 200

& # 39 ;; } else {var_dump (& Fatal error & # 39;); die(); } if (isHTML ($ HTML)) { $ saveHTMLfileName = ROOT_DIR.DS. & # 39; .DS.date (& mr-d-Y_hia). & # 39 ;. html & # 39 ;; if (! file_exists ($ saveHTMLfileName)) {file_put_contents ($ saveHTMLfileName, $ HTML); } } TruncateCookieFile (); $ conn = NULL;

Related features // include FUNCTIONS.DS. & # 39; functions.php & # 39 ;;

CurlPage function ($ URL)
{
$ Cookie = ROOT_DIR. DS. & # 39; & # 39 ;. _misc DS. & # 39; & # 39 ;; cookie.txt
if (! file_exists ($ Cookie))
{
$ OpenCookieFile = fopen ($ Cookie, "w");
fclose ($ OpenCookieFile);
}

$ Host = & # 39; example.com & # 39 ;;
$ acceptLanguage = in-US & # 39 ;;
$ Curl = curl_init ();
curl_setopt ($ Curl, CURLOPT_URL, $ URL);
curl_setopt ($ Curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt ($ Curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ Curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ Curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ Curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt ($ Curl, CURLOPT_ENCODING, 1);
curl_setopt ($ Curl, CURLOPT_COOKIESESSION, 1);
curl_setopt ($ Curl, CURLOPT_COOKIEJAR, $ Cookie);
curl_setopt ($ Curl, CURLOPT_COOKIEFILE, $ Cookie);
curl_setopt ($ Curl, CURLOPT_HTTPHEADER, array (
& # 39; Accept: text / html, application / xhtml + xml, application / xml; q = 0.9, image / webp, image / apng, * / *; q = 0.8 #
& # 39; Accept-Language: & # 39 ;. $ acceptLanguage. & # 39; q = 0.9 #
& # 39; Cache-Control: max-age = 0 & # 39;
"Connection: keep alive",
& # 39; User Agent: Mozilla / 5.0 (X11; Ubuntu; Linux i686; vr: 28.0) Gecko / 20100101 Firefox / 28.0;
& # 39; Host: & # 39; . $ Host
));
$ Content = curl_exec ($ Curl);
$ httpCode = curl_getinfo ($ Curl, CURLINFO_HTTP_CODE);
curl_close ($ curl);
if ($ httpCode == 200)
{
return array (
& # 39; httpCode & # 39; => $ httpCode,
& # 39; Data & # 39; => $ Content
)
}
elseif ($ httpCode! = 200)
{
return array (
& # 39; httpCode & # 39; => 0,
& # 39; Data & # 39; => 0
)
}
}



TruncateCookieFile () function {
$ Cookie = ROOT_DIR. DS. & # 39; & # 39 ;. _misc DS. & # 39; & # 39 ;; cookie.txt
$ openCookieFile = @fopen ($ Cookie, "r +");

if ($ openCookieFile! == false)
{
ftruncate ($ openCookieFile, 0);
fclose ($ openCookieFile);
}
}



isHTML function ($ str) {return preg_match ("/  /[a-z]*> / i ", $ str)! = 0;

I am particularly confused by my HTTP Code 200 validator from loop-from-hell. I know that I can add a validator to the returned HTML code, matching the size of the content to the file size. Of course, add a more detailed and detailed error logging system. But these are just new features, unrelated to the question.

I want to know how bad my code is and how it can be improved.

security certificate – Which HTTP request and response headers the `curl –cert` and` curl –cacert` read and write?

From https://curl.haxx.se/docs/httpscripting.html

In the HTTPS world, you use certificates to validate that you are the
one that you claim to be, in addition to normal passwords. Curl mounts
client-side certificates. All certificates are locked with a pass
sentence you need to enter before the certificate can be used by
loop. The passphrase can be specified on the command line or else
entered interactively when curl queries. Use a certificate with
curl on an HTTPS server like:

curl --cert mycert.pem https://secure.example.com

curl also tries to verify that the server is what it claims to be, by
checking the server certificate against a locally stored certificate authority certificate
package. If the verification fails, Curl will refuse the
link. You must then use –insecure (-k) in case you want to say
curl to ignore that the server can not be verified. More on the server
Certificate verification and certificate sets can be read in the
Document SSLCERTS, available online here:
https://curl.haxx.se/docs/sslcerts.html

Sometimes you can end up with your own CA certification store and then you can
Tell Curl to use it to check the server certificate:

    curl --cacert ca-bundle.pem https://example.com/

What do request and response HTTP headers do? curl --cert and curl --cacert read and write?

Thank you.

javascript – Problem with cURL in Windows 10

In the end, I learn to make an API and when I go to make a request with cURL from Windows 10 PowerShell, I get the following:

PS C:  Users  josem  OneDrive  Desktop  hr_app> curl -i -X ​​"DELETE"

"http: // localhost: 3000 / api / employees / 1000"
Invoke-WebRequest: No position parameter accepting the argument was found
& # 39; http: // localhost: 3000 / api / employees / 1000 & # 39 ;.
Online: 1 Character: 1
+ curl -i -X ​​"DELETE" "http: // localhost: 3000 / api / employees / 1000"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~~~~~~~~~~
+ CategoryInfo: InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId: PositionalParameterNotFound, Microsoft.PowerShell.Commands.InvokeWebRequestCommand

and the truth is that i do not give any solution, i hope for your help and thank you very much.

8 – How to use Drupal on Arch Linux if php- {cli, curl, mbstring, mcrypt} is missing in the Arch repository?

How to run Drupal on Arch Linux if php- {cli, curl, mbstring, mcrypt} are missing in Arch repositories?

The only package I've found on the Arch repositories that says that AFAIR is needed for Drupal is php-gd, the rest above are not.

What should I do if I still want to use Drupal on Arch?

curl – A strange problem regarding the size limit in the http header

Background: I maintain some kind of web service server, but with a particular implementation: all the data sent by the web service is in the http header. This means that there is only one http header in the response (no body part). The web service runs as a Windows service.
The consumer is my PHP code that invokes the web service via the CURL library.
All this is in production for 3 years and works well.
I've recently had to create a development environment.

1 – I have the web service on Windows 7 Pro, as a Windows service.

2 – I have my PHP client in another Windows 7 Pro (WAMP + CURL).

3 – my PHP code invades the web service and displays the raw response.

4 – in this context, the problem occurs: if the response contains more than 1215 characters, I have an empty answer (but no error message).


5 – I have installed my PHP code (exactly the same) on a new Ubuntu Linux: I have the same problem.


6 – I installed my PHP code (exactly the same) on a new linux centos: I did not have the problem.


7 – I have read a lot about the internet about the size limitation on the http header, and I think that today is not the reason for the problem.

8 – I have examined all size limitation settings on Apache, PHP, Curl but I have not found anything relevant.

If someone has information. All tracks are welcome.
Thank you

PHP Curl returns SSL The issuer of Peer's certificate is not recognized

I am a client trying to connect to my provider's server.

I visited dozens of sites trying to figure out what I was doing wrong …

$ url = "https://someurl.com";
$ curl = curl_init ();
curl_setopt_array ($ curl, array (
CURLOPT_URL => $ url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_VERBOSE => TRUE,
CURLOPT_TIMEOUT => 30,
CURLOPT_CAINFO => "./cert.crt",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $ xml,
CURLOPT_HTTPHEADER => array (
"Cache-Control: no-cache",
"Content type: application / xml"
)
));

the answer:

* NSS initialization with certpath: sql: / etc / pki / nssdb
* CAfile: ./cert.crt
// server information
* Error NSS -8179 (SEC_ERROR_UNKNOWN_ISSUER)
* The issuer of Peer's certificate is not recognized.
* Closing the connection 0
The issuer of Peer's certificate is not recognized.

When I do:

openssl s_client -connect server: 443 -CAfile /path/to/cert/cert.crt

it works and I receive among other lines of answer:

                    Check the return code: 0 (ok)

I tried to change:

            CURLOPT_CAINFO => "./cert.crt" on its full path (same as the openssl test)

I have updated php in PHP 7.0.13

I have installed NSS (version 3.36.0)

From what I understand this error occurs because the server responded with a cert, and php compared to the cert I told him, and thought it was bad.
But the openssl test worked well …

Will it be a crime if I can post data to a website using CURL?

I found a website that is not secure and I tried to post a form on this site using the CURL query in PHP and it worked successfully.

However, this is a simple site with contact form and no special or secure data. Anyone can fill out this form. I just did this with curl with a loop of 100.

Is it a crime?

curl – Show result json concrete

I'm trying to display a single value with the following command:

curl -X GET -H "Content type: application / json" -d "{state": "on"} & # 39; http: // $ {HUE} / api / $ {API} / lights / 1

But the result shows me all the JSON answer.
I can not show the result that I'm trying to recover only (& # 39; {"state": "on"})?

{"state": {"on": true, "bri": 90, "alert": "select", "mode": "homeautomation", "accessible": true}, "swupdate": {"state": "noupdates", "lastinstall": "2019-01-04T22: 37: 21"}, "type": "Dimmable light", "name": "Bombeta menjador 1", "modelid": "LWB010", "name" manufacturer ":" Philips "," product name ":" White lamp "," Capacities ": {" this ...

How can I display the result I'm trying to filter? He should be true/false

thank you!