Linux – When sending email, check for any live mail protocol errors

I need help with the command to put on my vps. I want to read the email log to check for errors so I can report it to Hotmail. I quickly googled and tried to find the live mail log to look for errors when sending the email.

I use Centos 8 OS and the name of the software I use to send the email is exim.

Do you know what command to use to check for live mail logs to determine if there was an error sending the email or not?

Thanks a lot.

Rust – A function for batch back propagation of weight errors in a dense neural network layer

I am switching my neural network library to ArrayFire to improve performance.

One of the functions I lose when moving from ndarray is ndarray_einsum_beta. So I have to write my own function to do what I once used.

This function must be as quick as possible.

This is the function:

fn arrayfire_weight_errors(errors:arrayfire::Array,activations:arrayfire::Array) -> arrayfire::Array {
    let rows:u64 = errors.dims().get()(0);

    let er_width:u64 = errors.dims().get()(1);
    let act_width:u64 = activations.dims().get()(1);
    let dims = arrayfire::Dim4::new(&(act_width,er_width,rows,1));

    let temp:arrayfire::Array = arrayfire::Array::::new_empty(dims);

    for i in 0..rows {
        let holder = arrayfire::matmul(
            &arrayfire::row(&activations,i),
            &arrayfire::row(&errors,i),
            arrayfire::MatProp::TRANS,
            arrayfire::MatProp::NONE
        );
        arrayfire::set_slice(&temp,&holder,i);
    }
    return temp
}

How could I improve it to make it better? (and hopefully faster)

(Sorry for the use arrayfire:: Everywhere this is a test project that uses some other linear algebra libraries.

ndarray approach:

fn ndarray_einsum(errors:ndarray::Array2,activations:ndarray::Array2) -> ndarray::ArrayD {
    return ndarray_einsum_beta::einsum("ai,aj->aji", &(&errors, &activations)).unwrap();
}

Recompile kernel: No errors, but it doesn't work

I am a beginner and at the moment I am just trying to repack the original boot image. I found that the boot partition is on "/ dev / block / mmcblk0p7", so I dragged it along adb pull /dev/block/mmcblk0p7 original_boot.img
Then I extracted the original boot with tools from https://forum.xda-developers.com/showthread.php?t=2319018 and then recompiled it. But then my image doesn't boot. Flashing with TWRP caused a boot loop. Where am I wrong?

SPFX – How are TypeScript errors suppressed in the terminal so that the app can be compiled?

I managed to both suppress the errors in the IDE and build the project using ts-lint:disable as the first line in the file, specifying the exact rule (s) to be deactivated, something like

/* ts-lint:disable:no-any max-line-length */
import Something from 'something';

export default class Foo {
    // etc
}

filter – add_filter (allow_block_types) -> add core / paragraph errors Gutenberg editor

I have a strange problem with the "core / paragraph" block:
An already working "allowed_filter type" (see code below) with core and user-defined blocks starts to annoy the Gutenberg editor as soon as I click the & # 39; core / paragraph & # 39; in the $ allow_blocks array.

My problem :
The block appender at the bottom of the editor disappears, so I can no longer add a new block.

However, the paragraph block itself works perfectly.

I also have a custom container block that works well.
But in the same way, the block appender contained in it disappears as soon as I have inserted "core / paragraph" in its allowed blocks.

Could anyone know where that could come from?
(I'm building a topic from scratch, maybe I should call this core / paragraph somewhere else first, but didn't have to do this with the other cores / blocks.)

Thanks for reading, hope you can help!

Here is the code:

For the add_filter:

add_filter( "allowed_block_types", "filter_allowed_block_types", 10, 2 );
function filter_allowed_block_types( $allowed_blocks, $post ) {

   if( $post->post_type == "my_post_type" ) {
      $allowed_blocks = array(
         "core/heading",
         "core/image",
         "core/gallery",
         "core/video",

         "core/paragraph",

         'my-custom-container'
      );
   }
return $allowed_blocks;
}

For my custom container: (didn't add the attributes stuff, worked)

edit( { attributes, setAttributes } ) {

   let allowedBlocks = (
      'core/heading',
      'core/paragraph',
      'core/image',
      'core/gallery',
      'core-embed/instagram',

      'core/video',
      'core-embed/youtube',
      'core-embed/vimeo'
   );

   return((
      
)); }, save( { attributes } ) { return (
); }

Docker – What can cause Nginx to "peer connect" when the upstream is free of errors?

With an AWS Beanstalk deployment (single server), the Nginx server communicates with the NodeJS / Express server on the same host occasionally complains about broken connections to the upstream.

2020/03/23 10:52:43 (error) 11443#0: *70 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.31.46.70, server: , request: "GET /health-check HTTP/1.1", upstream: "http://172.17.0.3:33080/health-check", host: "172.31.39.242"
2020/03/23 10:52:48 (error) 11444#0: *580 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.31.21.226, server: , request: "POST /api/app/importNutriwebData HTTP/1.1", upstream: "http://172.17.0.3:33080/api/app/importNutriwebData", host: "******"
2020/03/23 10:52:50 (error) 11443#0: *526 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.31.21.226, server: , request: "GET /health-check HTTP/1.1", upstream: "http://172.17.0.3:33080/health-check", host: "172.31.39.242"

This happens for no apparent reason, including the /health-check URL that is very simple response.send("OK");. It seems to be happening for random URLs.

Upstream 172.17.0.3 is on the same computer that is running Nginx. All downstream connections come from CloudFront.

The same setup has worked well in the past 3-4 years, but these errors have been increasing for 2-3 days. I can't think of anything that could have changed except could be 10% more requests or something. There can be approximately 50 long-lived EventStream connections, but never more than 100 simultaneous connections. I'm pretty sure the NodeJS server is fine.

I also tried upgrading Amazon Linux, restarting servers, and rebuilding the entire EBS deployment – nothing has changed.

I can run endlessly curl Upstream URL loop (http://172.17.0.3:33080/health-check) or even the public URL of CloudFront => Nginx and cannot reproduce the problem, even though thousands of requests (tests) have been tried for minutes.

The server has approximately 1.5 GB RAM free, CPU is around 80% Neutral.

Open file handles seem low to me:

$ for pid in $(pidof nginx) ; do sudo ls /proc/$pid/fd | wc -w ; done
130
169
11

$ for pid in $(pidof node) ; do sudo ls /proc/$pid/fd | wc -w ; done
146

Could it be that Nginx runs out of resources? Is it a timing problem? What can I do to further debug this?

Any help much appreciated.

Javascript – Shopping cart items show errors after adding a description field to content

I tried to find out why there is an error in my shopping cart, but apparently you cannot find it. The problem started when I added the content of the description field and a small change to my Js file.

Here is the link to the project on github http://elvin247.github.io

Here is my Js code:

// JavaScript document
const client = contentful.createClient ({
// This is the space ID. The content of a space is like a project folder
Space: "r742wojtl7kg",
// This is the access token for this area. You usually get both the ID and the token in the Contentful web application
Access token:
A8PNnqkBaRJN4TvjyNxDR0C0erFG9LgntCJ_0hL68jM
});

// variables
const cartBtn = document.querySelector (". cart-btn");
const closeCartBtn = document.querySelector (". close-cart");
const clearCartBtn = document.querySelector (". clear-cart");
const cartDOM = document.querySelector (". cart");
const cartOverlay = document.querySelector (". cart-overlay");
const cartItems = document.querySelector (". cart-items");
const cartTotal = document.querySelector (". cart-total");
const cartContent = document.querySelector (". cart-content");
const productsDOM = document.querySelector (". products-center");
let cart = ();
let buttonDOM = ();
// syntactic sugar of the writing constructor function

// Products
Class products {
async getProducts () {
// always returns a promise so we can add .then
// We can use wait until the promise is fulfilled and return the result
To attempt {
// let result = wait for fetch ("products.json");
// leave data = wait for result.json ();
let contentful = wait for client.getEntries ({
content_type: "reejuviProducts"
});
console.log (contentful.items);

  let products = contentful.items;
  products = products.map(item => {
     const { title, price, description } = item.fields;
    const { id } = item.sys;
    const image = item.fields.image.fields.file.url;
   return { title, price, description, image };
  });

  return products;
} catch (error) {
  console.log(error);
}

}}
}}

// ui
Class UI {
displayProducts (products) {
let result = "";
products.forEach (product => {
Result + =

product

$ {product.title}

$ {product.description}

& # 8358; $ {product.price}


;;
});
productsDOM.innerHTML = result;
}}
getBagButtons () {
let button = (… document.querySelectorAll (". bag-btn"));
buttonDOM = buttons;
button.forEach (button => {
let id = button.dataset.id;
let inCart = cart.find (item => item.id === id);

  if (inCart) {
    button.innerText = "In Cart";
    button.disabled = true;
  }
  button.addEventListener("click", event => {
    // disable button
    event.target.innerText = "In Cart";
    event.target.disabled = true;
    // add to cart
    let cartItem = { ...Storage.getProduct(id), amount: 1 };
    cart = (...cart, cartItem);
    Storage.saveCart(cart);
    // add to DOM
    this.setCartValues(cart);
    this.addCartItem(cartItem);

// this.showCart ();
});
});
}}
setCartValues ​​(shopping cart) {
let tempTotal = 0;
let itemsTotal = 0;
cart.map (item => {
tempTotal + = item.price * item.amount;
itemsTotal + = item.amount;
});
cartTotal.innerText = parseFloat (tempTotal.toFixed (2));
cartItems.innerText = itemsTotal;
}}

addCartItem (item) {
const div = document.createElement ("div");
div.classList.add ("shopping cart");
div.innerHTML = `

$ {item.title}
₦ $ {item.price}
remove

      
`;
cartContent.appendChild(div);

}}
showCart () {
cartOverlay.classList.add ("transparentBcg");
cartDOM.classList.add ("showCart");
}}
setupAPP () {
cart = Storage.getCart ();
this.setCartValues ​​(cart);
this.populateCart (shopping cart);
cartBtn.addEventListener ("click", this.showCart);
closeCartBtn.addEventListener ("click", this.hideCart);
}}
populateCart (shopping cart) {
cart.forEach (item => this.addCartItem (item));
}}
hideCart () {
cartOverlay.classList.remove ("transparentBcg");
cartDOM.classList.remove ("showCart");
}}
cartLogic () {
clearCartBtn.addEventListener ("click", () => {
this.clearCart ();
});
cartContent.addEventListener ("click", event => {
if (event.target.classList.contains ("remove-item")) {
let removeItem = event.target;
let id = removeItem.dataset.id;
cartContent.removeChild (removeItem.parentElement.parentElement);
// remove item
this.removeItem (id);
} else if (event.target.classList.contains ("fa-chevron-up")) {
let addAmount = event.target;
let id = addAmount.dataset.id;
let tempItem = cart.find (item => item.id === id);
tempItem.amount = tempItem.amount + 1;
Storage.saveCart (shopping cart);
this.setCartValues ​​(cart);
addAmount.nextElementSibling.innerText = tempItem.amount;
} else if (event.target.classList.contains ("fa-chevron-down")) {
let lowerAmount = event.target;
let id = lowerAmount.dataset.id;
let tempItem = cart.find (item => item.id === id);
tempItem.amount = tempItem.amount – 1;
if (tempItem.amount> 0) {
Storage.saveCart (shopping cart);
this.setCartValues ​​(cart);
lowerAmount.previousElementSibling.innerText = tempItem.amount;
} else {
cartContent.removeChild (lowerAmount.parentElement.parentElement);
this.removeItem (id);
}}
}}
});
}}
clearCart () {
// console.log (this);
let cartItems = cart.map (item => item.id);
cartItems.forEach (id => this.removeItem (id));
while (cartContent.children.length> 0) {
cartContent.removeChild (cartContent.children (0));
}}
this.hideCart ();
}}
removeItem (id) {
cart = cart.filter (item => item.id! == id);
this.setCartValues ​​(cart);
Storage.saveCart (shopping cart);
let button = this.getSingleButton (id);
button.disabled = false;
button.innerHTML = add to cart;;
}}
getSingleButton (id) {
return buttonDOM.find (button => button.dataset.id === id);
}}
}}

Class memory {
static saveProducts (products) {
localStorage.setItem ("Products", JSON.stringify (Products));
}}
static getProduct (id) {
let products = JSON.parse (localStorage.getItem ("products"));
return products.find (product => product.id === id);
}}
static saveCart (shopping cart) {
localStorage.setItem ("cart", JSON.stringify (cart));
}}
static getCart () {
return localStorage.getItem ("cart")
? JSON.parse (localStorage.getItem ("cart"))
: ();
}}
}}

document.addEventListener ("DOMContentLoaded", () => {
const ui = new user interface ();
const products = new products ();
ui.setupAPP ();

// get all products
Products
.getProducts ()
.then (products => {
ui.displayProducts (products);
Storage.saveProducts (products);
})
.then (() => {
ui.getBagButtons ();
ui.cartLogic ();
});
});

c – Show queue errors (CIRCULAR TAIL)

I'm having trouble viewing the queue. It consists of a string of the type "string". If you execute "Paste", it will work correctly, as will the pop function that I have already tried (for reasons of space I cannot paste it here). Then when you view the elements, it only shows me the first letter of the string. I don't know if it's because I'm not sending the entire string well or if I sent the string to the function. Thank you very much

#define max 100
char elem=0,belem=-1,c=0; 
struct ccircular{
char a;
};

void push(struct ccircular *aux,char x(),int num)
{
if(c==num)
{
    printf("COLA LLENAn"); return;
}
belem++; 
belem=belem%num;
if(c!=num)
    c++;
(aux+belem)->a=*x  ; 
}

void muestracola(struct ccircular *aux,char x(),int num)
{   

if(c==0)
{
printf("La cola esta Vacian"); return; 
}
char i=elem,j=0;
if(elem>belem)
for(i=elem; ia;
    printf("(%s)",x); j++;

}
else
    for(i=elem; i<=belem; i++)
    {
    *x=(aux+i)->a;
    printf("(%s)",x); j++;
    }
    if(j!=c)
        {
            for(i=0; ia;
                printf("(%s)",x);
            }
        }
    printf("n");
}

here the main