I need to pull email size for each email in a sendmail log, then total them up with the total size and total number of emails

The size is simple to find after size= i can find the size and put it to a file but removing everything but the numbers and then summing it with the total numbers all in one file is just not coming to me.

right now i am using this;

 grep 'size=' /var/log/maillog-2019* | awk ' { print $  8 }' > output.txt  

Show total price of current product on product page before “Add To Cart” button, why not?

I’m having a hard discussion about adding total price per product in product page before adding to cart or not.

The situation:

Our user normally add more than 1 product to cart and our products have a cheap price, but the user never buys just 1. For example, if he is buying a roof tile, he will add 500 tiles. And considering it I thinking the total price could be a benefit helping users to know the individual total (subtotal for each product) before add to cart reducing the shopping cart abandonment. And the experience could improve because this new feature will reduce the number of page changes and we will be very transparent with the user without bad surprises.

As this feature is no common on other e-commerce is being very difficult to approve an A/B test. Adding the total price for each product on the product page looks a good idea? Why not?

I already read this topic but they are talking something more advanced and my user is not adding a shirt or simple items to the cart. I just want to calculate: Product Price X Quantity and show the total price.

See an example of how I expect to do it.

enter image description here enter image description here

Would removing the “total cover” part of a Paladin’s Divine Sense unbalance the feature?

Inspired by this question: What good is the paladin's Divine Sense?

I am running Lost Mines of Phandelver to introduce a couple of people to D&D (just me and my two players; I use DMPCs to pad out the party), and one of my players is a Paladin. During their time in Thundertree, he used Divine Sense a few times to try to detect the zombies throughout the town (there’s a sign that says “Beware! Zombies” or something, so this was a completely in-character thing to do).

Since, as the linked question mentions, it’s a very niche ability in D&D 5e, I wasn’t that familiar with it; I remembered that it detects undead and fiends (forgot celestials at the time, but it’s irrelevant to this case) within 60 feet, but forgot about the total cover thing, so we proceeded without the total cover part of the ability. It was very useful for sniffing out those zombies hiding in the buildings.

Only later (because of a question on here, I think – this was a while ago), I realised that total cover was part of how it worked, and informed my player that, what happened happened, but going forward we’d have to bear total cover in mind. His response was basically “ok, you’re the DM, but doesn’t that kinda make this ability useless?”; my only response was about detecting invisible fiends or undead, which he accepted gracefully, but I doubt we’ll be seeing much more use out of it…

They’re now in Wave Echo Cave (our sessions are quite infrequent), but have not encountered anything undead yet, and will eventually progress onto Out of the Abyss, which has many fiends, and in light of the question I link to at the top, I am starting to wonder whether I should go back on myself and allow my player’s Paladin to use Divine Sense like how he used it in Thundertree. I think it will be more fun if he can actually use his ability outside of its otherwise rare niche uses.

This question is about the impacts on balance. What issues would arise from me ruling to ignore the total cover rule of Divine Sense? Would the ability become overpowered or otherwise unbalanced compared to other classes?

Divide $n$ gifts among three people so as to minimize the difference in the total cost of gifts between the most lucky and the most unlucky people

Divide $ n$ gifts of different values among three people so as to minimize the difference in the total cost of the gifts for the most lucky and the most unlucky persons.

The total value of $ n$ gifts is $ W$ . The most fair division will be to give all of them gifts of the total value $ W/3$ .

Suppose $ W_1, W_2, W_3$ are the total values of the gifts of the first, second and third person.

We want to minimize: $ max(W_1, W_2, W_3) – min(W_1, W_2, W_3)$ .

Using the knapsack problem. Assign to the first knapsack the “weight” $ W/3$ and the same for the second knapsack $ W/3$ . Use double knapsack algorithm and get the for each knapsack the gifts that maximizes the total value but obeys the $ W_{i \in {1,2}} \le W/3$ property. Then the remaining gifts give to the third person.

The question is if such kind of algorithm is correct? If so why? If no can you provide your own solution to the problem?

Does the total cover provided by being swallowed work both ways? [duplicate]

This question already has an answer here:

  • Is it possible for a swallowed caster to cast Fireball outside of a Giant Toad? 3 answers

Say a character ends up being swallowed by a monster, for the sake of an example say the monster is a Kraken.

The rules for being swallowed by a Kraken include this sentence:

While swallowed, the creature is Blinded and Restrained, it has total cover against attacks and other Effects outside the kraken, and it takes 42 (12d6) acid damage at the start of each of the kraken’s turns.

So I take that to mean if one swallowed character’s allies outside of the Kraken drops a spell on it like Fireball or Prismatic Spray, then they won’t be affected.

Does the same apply in reverse? If the swallowed creature casts Cone of Cold while inside of the Kraken, are the creatures outside of the Kraken also able to be hit by the spell or not?

Sumando el total de la misma columna DataGridView – CellEndEdit

Trabajo con Visual Studio 2019, Windows Forms

Tengo un DataGridView en el cual voy poniendo las cantidades por denominación de la moneda al momento que voy ingresando las cantidades voy multiplicando el valor * cantidad ese resultado va en la columna SubTotal pero a la vez también voy sumando esa columna subtotal.

El problema es que cuando llego a la última fila ingreso la cantidad pero ya no me hace las operaciones que mencione al presionar enter ya no hay mas filas y no puede salir del evento CellEndEdit la única manera es presionando la tecla TAB pero eso ya lo trabajaría en otro evento del DGV como el KeyDow

Este es el código que ocupo.

private void DgvRecuento_CellEndEdit(object sender, DataGridViewCellEventArgs e)         {             int index = dgvRecuento.CurrentRow.Index;             if (index < dgvRecuento.Rows.Count - 1)             {                 decimal valor = Convert.ToDecimal(dgvRecuento.Rows[index].Cells["colValor"].Value);                 decimal cantidad = Convert.ToDecimal(dgvRecuento.Rows[index].Cells["colCantidad"].Value);                 var resultado = valor * cantidad;                 dgvRecuento.Rows[index].Cells["colSubTotal"].Value = resultado;                 decimal recuento =                     dgvRecuento.Rows.Cast<DataGridViewRow>().Sum(x => Convert.ToDecimal(x.Cells["colSubTotal"].Value));                 lblTotalRecuento.Text = $  "{recuento:N2}";                 lblRecuento.Text = $  "{recuento:N2}";                 decimal descuadre = _efectivoCaja - recuento;                 lblDescuadre.Text = $  "{descuadre:N2}";             }         } 

¿De que manera lo puedo solucionar?


How can you achieve a significantly higher total passive Perception than the sum of your Perception bonus + 10?

In the comments for another question, I was asked to pose a question on how to achieve a passive Perception of 28, while having a Perception modifier significantly lower than 18, which is impossible to achieve.

So, here’s the question:
How do you achieve a passive Perception of 28, with a bonus to active Perception of less than 10?

Mysql; Trigger Consultar total de registros por habitacion

Buenas Noches necesito ayuda ya que necesito realizar un trigger el cual me valide la cantidad de registros por habitacion de la tabla paciente y actualize el estado del campo estado en la tabla Habitacion a ocupado en caso de que la cantidad de personas registradas en esa habitacion sea de 3 o X personas.

CREATE TABLE Paciente ( ID_Paciente BIGINT PRIMARY KEY NOT NULL, Nombre_Paciente VARCHAR(25)NOT NULL, Apellido_Paciente VARCHAR(25)NOT NULL, Fecha_Nacimiento DATE NOT NULL, Descripcion_Enfermedad VARCHAR(150)NOT NULL, Numero_Habitacion VARCHAR(8) NOT NULL, Estado  varchar(15) );  create table Habitacion ( Numero_Habitacion VARCHAR(8) PRIMARY KEY , Piso bigint NOT NULL, Tipo_Habitacion CHAR(3) NOT NULL, Estado VARCHAR(15) NOT NULL );