Finite element method – FEM simulation: Networking any two objects in an "air" network

Based on this excellent answer to my previous question: FEM: Electric field between two arbitrarily defined forms

I wanted to try other shapes:

Needs("NDSolve`FEM`");
(*Define Boundaries*)
air = Rectangle({-5, -5}, {5, 5});
object1 = Rectangle({-2.5, 2.5}, {2.5, 2});
object2 = Rectangle({-2.5, -2.5}, {2.5, -2});
reg12 = RegionUnion(object1, object2);
reg = RegionDifference(air, reg12)

mesh = ToElementMesh(reg, {{-5, 5}, {-5, 5}}, 
  MeshRefinementFunction -> 
   Function({vertices, area}, 
    area > 0.001 (0.1 + 10 Norm(Mean(vertices)))))
mesh("Wireframe")

But all I get is this:

M.

When I use that Diskeverything works correctly as object 1:

Enter the image description here

So I asked myself: why doesn't it work with other shapes?

amazon ec2 – best method for calculating latency

I have designed a Linux shell script that does the following:

  1. Send some files from my laptop to an Ubuntu 18.04 server based EC2 instance.
  2. Some analysis is performed on these received files on the EC2 instance and a graph is recorded on this EC2 instance.
  3. The resulting diagram is sent back to my laptop.

I want to find latency. Is linux time Command good for that? I can use it iperf Utility in this scenario? Please advise.

Finite element method – FEM: Electric field between two arbitrarily defined shapes

I was wondering how to do this:
I want to calculate the electrostatic field between two shapes using the FEM method.

(*Define Boundaries*)
air = Rectangle({-3, -3}, {3, 3});
object1 = Disk();
object2 = Rectangle({2, 0}, {2.5, 2});
Show(Graphics({Blue, air}), Graphics({Magenta, object1}),Graphics({Green, object2}))

Enter the image description here

Calculation of the electric field at every point {x, y} in 2D space:

Enter the image description here
$ r_i $ is the vector of the point charge; $ r $ is the vector to the point in 2D (or also 3D) space at which the electric field is to be calculated.

I make a Mathematica function out of it (at the moment I am omitting the constant term):

eField(x_, y_) := q Sum(({x, y} - pts((i)))/Norm({x, y} - pts((i)))^3, {i, n})

Where pts((i)) are the boundary points of the loaded object and x and y are coordinates of the "air" object.

How I would proceed:

  1. I calculate the electrostatic field of object 1 -> $ E_1 $

  2. I calculate the electrostatic field of object 1 -> $ E_2 $

  3. I use overlay to get the resulting electric field: $ E_ {Total} = E_1 + E_2 $

I would be very happy if someone could show me how Mathematica works with finite elements (FEM).

SQL Server – method of finding the top record with WHERE conditions in child tables

configuration

I recently worked on an optimization for an SQL query that returns the last prescription product used by a patient. The original query handled this over 3 nested ones CTEand performed really badly after migrating to a new server. Instead of trying to get the original version to work with either server optimization or index changes, we changed the query using ROW_NUMBER() Partitions. This took the query execution time from approximately 10 minutes to approximately 6 seconds for approximately 215,000 lines in the final output.

question

I am looking for a better way than how I rewritten it as it almost seems like a hack to me. I just want to see if this works well due to the size of our dataset or if it really is a good solution. I would think we'd rather use some kind of solution that uses a few different ones JOINs who find this type of information instead of using it ROW_NUMBER() and a CTE.

Additional details

For this question, I will leave out certain details in our database that are less desirable (composite primary key, with VarChar(1) instead of one BIT, etc …) so that the root of the question can be better addressed.

We have 4 tables in scope:

  • Patient – We will only return the identity column from this table
  • OrderHeader – contains information about the package, e.g. B. the address to which it should be sent. And the parent record is too OrderDetail. This table is tied to Patient about a PatientID Pillar.
  • OrderDetail – creates a relationship between OrderHeader and Product to indicate which products were in their actual packaging at the time of shipment
  • Product – contains the list of products

We need a query that returns the top for each patient OrderDetail Record for the top OrderHeader record where the Product Record bound to the OrderDetail recording Product.IsRx = 1.

Unfortunately, we cannot just get it MAX Value for OrderDetail.ID Where Product.IsRx = 1 since then OrderDetail.ID must not be part of MAX Value for OrderHeader.ID. We cannot rely on it either MAX Value for OrderHeader.ID as it is not guaranteed to have a record in OrderDetail It is also not guaranteed that a record will contain one there Product.IsRx = 1

I solved this problem with the following query:

WITH CTE
(
    PatientID,
    OrderHeaderID,
    OrderDetaillID,
    ProductNDCCode,
    ProductNDCDescription,
    RowNumber
)
AS
(
    SELECT P.ID AS 'PatientID',
    H.ID AS 'OrderHeaderID',
    D.ID AS 'OrderDetaillID',
    P.NDCCode AS 'ProductNDCCode',
    P.NDCDescription AS 'ProductNDCDescription',
    ROW_NUMBER() 
    OVER
    (
    PARTITION BY P.ID
    ORDER BY 
        P.ID ASC, --This part in the ORDER BY may not be needed, I apologize if it is unnecessary
        SH.OrderHdrID DESC, 
        SD.OrderDtlID DESC
    ) AS 'RowNumber'
    FROM Patient P
        INNER JOIN OrderHeader H
            ON P.ID = H.PatientID
        INNER JOIN OrderDetail D
            ON H.ID = D.OrderHeaderID
        INNER JOIN Product PR
            ON PR.ID = D.ProductID
    WHERE PR.IsRx = 1
)
SELECT PatientID,
OrderHeaderID,
OrderDetaillID,
ProductNDCCode,
ProductNDCDescription
FROM CTE
WHERE RowNumber = 1

Any guidance or expertise that I could gain would be very helpful.

Which method is better?

Which structure is better?

I have my own CMS in which I want to track page hits.
I now have 2 options.

1. I create a "MEDIUM TEXT" column in the same table in which the page data is stored.
and I add IP / UserAgent to this column every time the page loads.
The middle text column is limited to 16 MB, and my PHP memory limit is over 30 MB, so there is no more space available.
Most shared hosts have about that much. Even if the site is moved, this is not a problem.
SEMrush

The problem is,
Each time I load the page in the front end, I need to pull this 16MB of data out, add my new string, and update the table record.
Can be a problem if traffic is heavy and server resources are overused.
CONCAT doesn't seem to work with MediumText and LongText on my shared server, not sure why …

2. I add a new table and save IP / UserAgent in it
Loading the front end page is faster, only quick insertion is required.
In the backend, when I'm going to check statistics,
then a very large table must be read again and again.
Assuming there are 100 pages, the page hit data of all 100 pages is stored in this table itself.
It can get very big.

So running a query would mean reading this huge table again and again.
If I want to count the total number of hits in a week, then the month, then on individual days …
With this type of counting query, no limit can be set …
Sure, there will be indexes, etc., but I'm still worried about size.

However, if it's only in a middle column of text, in the page table itself,
Then I pull out a maximum of 16MB of data for a given page and use PHP to do the rest of the processing.
This is cheaper in the backend and probably also faster.

Which would you suggest?

magento2 – The free method is not shown for custom discounts

I developed a module for custom discounts on the M2 checkout page. It works fine, but if the total is 0, I cannot place an order. All methods show "This payment method is not available". The free payment option is also not displayed. I don't get a free method in the response to the payment information endpoint. Please help me, I want to display the free method when the total is 0. The free method is shown for Magento vouchers, but only for my custom discount module it is not shown. Please help me to solve this problem.

Thanks greetings,
Mousam

[GUIDE] Simple method of marketing webcam affiliate programs

I provided a link at the end of the thread for the software and resources I needed

requirement
– Have an affiliate account for an adult cam site (also known as a webcam model site).
– video editing program

steps

1. Register a domain. *** Example ***: mysexycams.com <- Name your website something catchy. I don't own this domain, just as an example.

2. Forward your partner and mask him …

(GUIDE) Simple method of marketing webcam affiliate programs

magento2.3 – Repository getList method and CollectionProcessor

I am working in Magento 2.3 and have problems with the implementation of the getList () method, especially with the collectionProcessor.

I read devdocs (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/searching-with-repositories.html) but found little code base to follow the documentation.

Please explain collectionProcessor and how it should be implemented in the getList () method for a custom model. Code examples a bonus.