c ++ operator overload doesn't bring me back well

The problem is that your subtraction operator is conceptually wrong.

If you subtract two numbers:

C = A – B

The result is not one of the original numbers, that is, C It is not even A neither Bis "a new numberMsgstr "" "When you work with other types (such as matrices), the same thing happens.

Because of this, you cannot return a reference The matrix in the subtraction must be a new matrix:

// Instancia, no referencia (&), const porque no modifica el objeto original ni el proveído
Matriz Matriz::operator-(const Matriz& m)  const
    Matriz resultado(m.n_filas, m.n_columnas);

    for (int i = 0; i < resultado.n_filas; i++) {

        for (int j = 0; j < resultado.n_columnas; j++) {

            resultado.matriz(i)(j) = this->matriz(i)(j) - m.matriz(i)(j);
            cout << "resultado("<

Usually these operations are written as free operators, not as member operators:

Matriz operator-(const Matriz &a, const Matriz &b)
    Matriz resultado( … );

    // … operaciones

    return resultado;

Your code generated undefined behavior because you returned a reference to an object that no longer exists.

How do you bring the deputy department head back with the worker who has served the longest?

Scenario / problem
I have a spreadsheet that stores my ID when they start or leave a department. This can be seen in SQL Fiddle: http://www.sqlfiddle.com/#!9/d0c982/1/0

The following code creates the table and inserts the test data

CREATE TABLE `Worker_Department` (
  `Worker_ID` Integer NOT NULL ,
  `Department_ID` Integer NOT NULL,
  `Position` Text NOT NULL,
`Start_Date` datetime NOT NULL,
`Leave_Date` datetime

  INSERT INTO `Worker_Department`(`Worker_ID`,`Department_ID`,`Position`,`Start_Date`)

  (30,200,'Administrator','1980-11-11', '2014-02-02'),
  (40,200,'Receptionist','1975-11-11', '2014-02-02');

  INSERT INTO `Worker_Department`(`Worker_ID`,`Department_ID`,`Position`,`Start_Date`)


Code (SQL):

I have to write a query that identifies the longest-serving employee currently in a department (no end date). However, those with the "leader" position are not allowed to be the longest serving person. From the results of this query, I then have to determine the head of the department in which the longest-serving employee is currently working.

Expected result
Viewing the test data provided:

  • The 40th employee cannot be the longest employed since he no longer works for the company.
  • Workers 10 and 20 cannot be the longest-serving employee since both hold the leadership position (however, this entitles them to be the department head based on who the longest-employed employee is).
  • Worker 30 is the longest employed because there is a greater difference between the current date and the oldest start date compared to worker 50.
  • Worker 30 is currently working in Department 100. That means that Worker 10 is the department head of the department with the longest employed worker at the moment

The query output would be something like
| Worker_ID
| —————
| 10

If this table is linked to another table as a foreign key, the selection can be changed so that details about this conductor (name, telephone, address) are included.

Ongoing progress
The following query shows the employees currently employed (employees without a vacation date), the department in which they work and their role in this department.

SELECT Worker_ID, Department_ID, Position FROM Worker_Department
   WHERE position != 'Leader' AND leave_date is null

Code (SQL):

The following query returns the difference between the current date and the minimum start date of the worker. However, this includes those who do not have a zero end date (not current).

SELECT Worker_ID, DATEDIFF(Now(), Min(Start_Date)) as NowSubMin FROM Worker_Department
WHERE position != 'Leader'

Code (SQL):

Finally, both queries were used to create the following query, which is to return current employees along with the date difference between the current date and their first start date

SELECT Worker_ID, DATEDIFF(Now(), Min(Start_Date)) as NowSubMin FROM Worker_Department
WHERE position != 'Leader'

HAVING Worker_ID IN (SELECT Worker_ID FROM Worker_Department
   WHERE position != 'Leader' AND leave_date is null)

Code (SQL):


Organic Bring Real Visitor & # 39; s 5000 Targeted Web Traffic for $ 2

Organic Bring Real Visitor & # 39; s 5000 Targeted Web Traffic

5000 web traffic 5 days

About this gig

FREE TRIAL – more details in the FAQ below!

Your website is displayed on thousands of constantly different domains suitable for your target group.

Traffic starts within 4-5 hours
The delivery is made after you have received all traffic. Usually in about 4 days (may vary from case to case), but we will continue to send bonus traffic for 5 days.

Main features:

  • Receive over 6,000 visitors
  • Real visitors with unique IPs. No bots, hits from China, proxies or data centers.
  • The traffic is direct and 100% Adsense SAFE
  • CPA, memberships, landing pages, blogs, etc. are welcome!
  • Trackable on Analytics (UTM tags are gladly accepted)
  • SEO friendly
  • Custom tracking provided
  • Comprehensive customer care

You may get sales or opt-ins, but these CAN NOT guaranteed, as well as specific bounce rate time and ranking. We cannot control visitors' actions.

, (tagsToTranslate) targeted (t) web (t) traffic

Integration – Can I bring this integral into a form that contains known functions?

In the context of quantum field theory, I face the following $ 1 $Integral over Feynman parameters:

$$ I (a, b) = int_0 ^ infty d alpha frac {1} {F G} arctan frac {F} {G} tag {1} $$


$$ F ( alpha, a, b): = sqrt { alpha (1+ alpha) (ab) ^ 2- alpha a ^ 2 + (1+ alpha) b ^ 2} tag {2 } $$

$$ G ( alpha, a, b): = sqrt { alpha left (a-b- alpha (a-b) ^ 2 right)} tag {3} $$

Is there a way to express this integral using polylogarithms or elliptic functions? Usually my (rather primitive) way to achieve this goal is to insert the indefinite integral in Mathematica, to pray that it can solve it, and to set the appropriate limits. But this time Mathematica can't. So I want a more robust way to do that.

Why do these Senate Democrats want to bring evidence to court? Isn't that inappropriate?

Why is it inappropriate? They recapitulate the evidence they have and ask for new evidence that has only emerged to prove their arguments. The GOP is in a completely deliberate ignorance mode. You are not impartial at all. 19 of the trump cards "employees" were accused or imprisoned; He lied or made false statements over 16,000 times, and yet the fools and other ignoramuses support him without question. When acquitted, he is essentially a king / monarch who can act without any control or consideration. We are back to the 16th century!