proof techniques – Combination of TWO Monte Carlo algorithms to obtain a Las Vegas algorithm that solves the same problem

I have encountered a problem that I have no idea how to solve it.

Consider two Monte Carlo algorithms, called A and B, which both solve the same problem.
A is biased and correct t, while B is biased and correct z.
Show that you can combine A and B to get a Las Vegas algorithm to solve the same problem.

Also, how could I find the best value for R, which is the probability that the Las Vegas algorithm will find the right answer? For this second part, how could I find this fictitious value of R without concrete example or dataset, this question seems completely outside the left field.

Thank you for your time :]

postgresql – How can I select the total number of affected rows and obtain the result of the rows in the form of an aggregated table?

I know i can use count(x) OVER (), but I get total as a column in each row, where I guess I want to return a row with the total and the affected affected rows aggregated:

({
  total: 100,
  rows: (...)
})

DO NOT:

({ total: 100, ... }, { total: 100, ... }, { total: 100, ... }, { total: 100, ... })

I tried to play with json_agg, array_agg, grouping etc.

Sheet G How to obtain an average duration?

I have a duration series which is also the result of a formula in a column formatted in duration

Duration :
80:08:00
53:05:00
50:20:00
86:21:00
59:56:00
44:27:00
#VALUE!
35:44:00
39:29:00
133:45:00
35:07:00
32:20:00
.../...

I would like to get the MIN, MAX and AVERAGE values. For the average I tried this formula

=ARRAYFORMULA(AVERAGE(TIMEVALUE(E2:E305)))

I have this error:

#VALUE! ERROR TIMEVALUE parameter '' cannot be parsed to date/time

How to exclude the cell with no value inside?

How to obtain insurance after the extension of the trip due to the cancellation of a flight, when the existing insurance refuses to extend?

My wife is in New Zealand and her flight has been canceled. Now her insurance company won't extend her coverage because she can't get a flight until next week.

What can she do?

Scan the QR code to obtain a private key

How can I scan the QR code to get the private key of a "watch only" blockchain wallet address?

wysiwyg – Any drupal 8 module available to obtain the name of the user profile with @tag in the text field

I want to get the username in the formatted text field when I type @username and with an anchor tag on the profile, help me, I'm very new to this type of functionality, if not none idea or possibility of doing it.

proof techniques – Prove that if we take all the edges of the directed graph which are on the shortest path from 1 to N, we will obtain a DAG

We are given a weighted graph directed with possibly a few cycles with $ N $ knots and $ M $ edges. Let's look at all the shortest paths since $ 1 $ at $ N $ in this graph find the shortest single source paths from $ 1 $ in the normal graph and the shortest single source path of $ N $ in the reverse graph we can check for each edge whether it belongs to a shortest path or not.

If we take all the edges that belong to a shortest path and build a separate graph, we will get a directed acyclic graph. How to prove that this graph will never cycle? I haven't written a lot of evidence on graphics before, so I've fixed the problem, but I'm not sure why it will still hold.

magento2 – Magento Upgrade 2.2.10 to 2.3.3 Obtain the violation of the php bin / magento setup integrity constraint: upgrade

I went from magento 2.2.10 to magento 2.3.3

after running

php bin/magento setup:upgrade

I have this error

SQLSTATE (23000): Violation of integrity constraint: 1452 Unable to add or update a child row: a foreign key constraint fails (db_amit. # Sql-14b6_7ed, CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTTID_ID entity ) REFERENCES_CENT_ID: ALTER TABLE catalog_product_entity_decimal UPDATE eav_attribute REFERENCES (attribute_id) ON CASCADE DELETE COLUMN decimal value (20, 6) NULL COMMENT "value", ADD CONSTRAINT CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id), ADD CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id ) ON DELETE CASCADE, ADD CONSTRAINT CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE CASCADE

jsonapi – JSON API: how to correctly filter the taxonomy terms to obtain all the nodes corresponding to the term or to the parent term?

I have a vocabulary (channel) on two levels. An item node can be added to the first or second level (via field_channel). The hierarchy looks like:

  • channel-1
    • subchannel-1.1
    • subchannel-1.2
    • subchannel-1.3
  • channel-2 (i.e. (node ​​/ 1, node / 2))
    • subchannel-2.1 (i.e. (node ​​/ 4, node / 5))
    • subchannel-2.2 (i.e. (node ​​/ 6))

I want to filter all the nodes belonging to a level 1 term (those which were directly assigned to the term and those which were assigned to one of its child terms).

In other words, the filtering of all nodes for a given channel (i.e. channel-2) must contain the nodes assigned directly to that channel and all of the nodes assigned to a sub- channel whose parent channels are this channel. In the example all nodes from 1 to 6.

The json api request looks like:

{{base_url}}/node/article?
include=field_channel,field_channel.parent&
fields(node--article)=title,field_channel&
fields(taxonomy_term--channel)=name,parent&
filter(or-group)(group)(conjunction)=OR&
filter(channel)(condition)(path)=field_channel.name&
filter(channel)(condition)(value)=channel-2&
filter(channel)(condition)(memberOf)=or-group&
filter(channel-parent)(condition)(path)=field_channel.parent.name&
filter(channel-parent)(condition)(value)=channel-2&
filter(channel-parent)(condition)(memberOf)=or-group    

I don't see the error, but it only contains the nodes corresponding to the parent-channel condition. If I remove this condition, the ones that match the channel condition are there. What's wrong with demand.

I also tried the short form:

{{base_url}}/node/article?
fields(node--article)=title,field_channel&
include=field_channel,field_channel.parent&
fields(taxonomy_term--channel)=name,parent&
filter(or-group)(group)(conjunction)=OR&
filter(field_channel.name)(value)=channel-2&
filter(field_channel.name)(memberOf)=or-group&
filter(field_channel.parent.name)(value)=channel-2&
filter(field_channel.parent.name)(memberOf)=or-group

Which gives me an error in the where clause (the group empty at the start):

OERE (() and (taxonomy_term_field_data.name LIKE: db_condition_placeholder_0 ESCAPE & # 39; \ & # 39;)

BTW: The example could be easily constructed using the drupal thunder distribution.

php – How to obtain the identifier of the last field registered in MYSQL?

The problem I have is that this part of my code has recently started to fail

public static function CrearConexion()

{

// this is how my code is currently

$mysql_config = array(
  'host' => 'localhost',
  'db' => 'produccion',
  'user' => 'admin',
  'pass' => '1up'
);

// it was like that before

    //$mysql_config = array(
    //  'host' => '127.0.0.1', 
    //  'db' => 'produccion', 
    //  'user' => 'root', 
    //  'pass' => '');


    $conexion = mysqli_connect(
      $mysql_config('host'), 
      $mysql_config('user'), 
      $mysql_config('pass')) 
    or die("Sin conexion");

    mysqli_select_db($conexion, $mysql_config('db'));

    return $conexion;
}

And the problem is that currently all of the empty data is returned inside the object

mysqli {
  +affected_rows: null
  +client_info: null
  +client_version: null
  +connect_errno: null
  +connect_error: null
  +errno: null
  +error: null
  +error_list: null
  +field_count: null
  +host_info: null
  +info: null
  +insert_id: null
  +server_info: null
  +server_version: null
  +stat: null
  +sqlstate: null
  +protocol_version: null
  +thread_id: null
  +warning_count: null
}

And the one I need is the one from inserte_id but since it's null, a 0 comes back and I can't do anything else after that. I don't know if it is because of the php version or something similar, it is a code from 2 years ago but so far it doesn’t matter posed this problem