pr.probability – Quantiles of Q values ​​of unknown MDP

Consider a CDM with $ n $ States $ k actions and reduction factor $ gamma in (0,1) $. We are uncertain of its reward function $ R in mathbb {R} ^ {n times k} $ and transition function $ T in mathbb {R} ^ {n times k times n} $. More precisely,

begin {align}
R_ {s, a} & sim text {Beta} ( alpha_ {s, a}, beta_ {s, a}) \
T_ {s, a} & sim text {Dirichlet} ( delta_ {s, a})
end {align}

or $ alpha, beta in (0, infty) ^ {n times k} $ and $ delta in (0, infty) ^ {n times k times n} $. Q function $ Q in mathbb {R} ^ {n times k} $ of our CDM is defined to be the solution to the equation
begin {align}
Q_ {s, a} & = R_ {s, a} + gamma sum_ {s} T_ {s, a, s} max_ {a} Q_ {s & # 39; 39 ;, a & # 39;
end {align}

which can be formulated as a linear program. So the Q function is distributed as
begin {align}
Q_ {s, a} & sim text {D} ( alpha, beta, delta) _ {s, a}
end {align}

or $ mathrm {D} $ is an unknown distribution. My question is the following: What do we know about $ text {D} $? I am particularly interested in the quantile function $ f: (0,1) rightarrow mathbb {R} $
begin {align}
f (p) = inf {x in mathbb {R}: p leq Pr (Q_ {s, a} leq x) }
end {align}

because this gives a higher Bayesian confidence related to the Q function of our CDM. For the sake of such limits in the context of multi-armed bandit problems, see Bayesian upper confidence limits for bandit problems by Kaufmann et al.

If the quantiles of this distribution can not be obtained in closed form, what is the fastest way to approach them, beyond the sampling of several CDMs? $ R $sand $ T $s) of our belief distribution, to solve them and to observe the empirical distribution of $ Q_ {s, a} $?

r – Finding cell values ​​in a matrix using values ​​from another data image

I have a matrix with all cell values ​​ranging from -1: 1 and another database that identifies the row / column cells for each cell I need to find.

I want to add columns to the data frame containing the values ​​of the cells identified in the matrix. Example of what I have and what I want below:

HAVE A MATRIX:

      1   2   3   4   5   6   7   8   9  10

 1    0   0   0   1   0   1   1   0   0   0
 2    0   0  -1  -1   1   1  -1  -1   0   0
 3    0   0  -1   0   0  -1   0  -1   0   0
 4   -1   1   0   0   1   1   0  -1   1  -1
 5   -1   1   0  -1  -1   0   0   0   0   1
 6    1  -1   1   1   0   0  -1  -1   0   1
 7    0  -1   1   0   1   1   0   1  -1   0
 8    0   0  -1  -1  -1   0   1  -1   0   1
 9   -1   1   0   1   1  -1   0   1  -1  -1
10   -1   1  -1  -1  -1  -1   1   0   1  -1

A DATAFRAME:

     i   j   k

 1   3   4   2
 2   4   8  10
 3  10   7   5
 4   2   6   8
 5   9  10   7
 6   2  10   4
 7   7   8  10
 8   6  10   8
 9   2   9   5
10   9   7   1

WANT DATAFRAM:

     i    j    k    j,i    k,i    k,j

 1   3    4    2      0     -1     -1
 2   4    8   10     -1     -1      0 
 3  10    7    5      0      1      0
 4   2    6    8     -1      0      0
 5   9   10    7      1     -1      0   
 6   2   10    4      1      1     -1
 7   7    8   10      1      1      0
 8   6   10    8     -1      0      1
 9   2    9    5      1      1      0
10   9    7    1     -1      0      1

plsql – Oracle Apex Apex_application.G_fNN Processing Does Not Retrieve All Values

I am very new to oracle apex and constantly fail in creating tables for inserting data into my chart. My scenario is the following.

I have two tables
1. tasks (job_id, job_name)
2. Efforts (Eff_id, Task_id, Hours_spent, Notes).

I want to create a tabular form to insert data into the Efforts table with the tasks I have in the task table. I have created the tabular form with the query below.

SELECT APEX_ITEM.CHECKBOX(1,TASK_ID) "TASK_ID",
       TASK_NAME,
       APEX_ITEM.TEXT(2,'')"HOURS_SPENT",
       APEX_ITEM.TEXT(3,'')"NOTES"
FROM TASKS;

but when I create the "after Submit" process to read the values ​​in this report and try to put some effort into my table with the following code, something odd happens. When I select the checkbox for lines 1,2 and 3, only line 1 is inserted in the table of efforts, but for the rest, only the values ​​of the task ID are inserted, not the whole line . I missed "hours_spent and notes". in my table of efforts for lines 2 and 3 .. here is my block plsql

BEGIN
FOR i in APEX_APPLICATION.G_F01.COUNT LOOP
INSERT INTO EFFORTS(EFF_ID,TASK_ID,HOURS_SPENT,NOTES)
VALUES (SEQ_EFFORTS.NEXTVAL,APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F03(i))
END LOOP;
commit;
END;

Can someone help me! If there is another way to do my requirement, then I am more than happy to do it.

mysql – I need to remove duplicate SQL values ​​Left Join

It is not possible to display in the desired format (without a lot of extra work and without assuming that there are still as many locations as there are job categories).

However, using GROUP_CONCAT will allow you to return a line by user name containing all the information you want, regardless of the number of categories and locations.

SELECT
users.id,
users.username,
GROUP_CONCAT(job.category) AS job_categories,
GROUP_CONCAT(locations.location) AS locations
FROM users
INNER JOIN job ON users.username = job.username
INNER JOIN locations ON job.username = locations.username
GROUP BY users.id

He will return results like:

5   Don   Fashion/Design/Beauty,Eng,Arts/Audio/Video Technology        Mr,Colombo,gm

t sql – Get max, min, and average values ​​in each 1-day range on the SQL server

I want to select max, min, average value in each 1 day range.

My table looks like:

+-------+---------------------+
| Value |      TimeStamp      |
+-------+---------------------+
| 31.20 | 2019-04-20 20:02:51 |
| 31.00 | 2019-04-20 20:17:33 |
| 31.00 | 2019-04-21 20:32:15 |
| 30.70 | 2019-04-21 20:46:58 |
| 30.50 | 2019-04-21 21:01:40 |
| 30.50 | 2019-04-24 21:16:22 |
| 30.20 | 2019-04-24 21:31:04 |
| 30.20 | 2019-04-26 21:45:47 |
| 30.00 | 2019-04-26 22:00:29 |
| 29.70 | 2019-04-26 22:15:11 |
+-------+---------------------+

I want to select max, min, average value in each 1-day range of 2019-04-20 at 2019-04-25.

I want my output (for the mean value) to be like this:

+-------+---------------------+
| Value |      TimeStamp      |
+-------+---------------------+
| 31.10 | 2019-04-20 00:00:00 |
| 30.73 | 2019-04-21 00:00:00 |
| 0     | 2019-04-22 00:00:00 |
| 0     | 2019-04-23 00:00:00 |
| 30.35 | 2019-04-24 00:00:00 |
| 0     | 2019-04-25 00:00:00 |
+-------+---------------------+

And I used the query below:

SELECT AVG(Value) AS Value,
       DATEADD(day, DATEDIFF(day, 0, timestamp), 0) AS TimeStamp 
FROM MyTable
GROUP BY DATEADD(day, DATEDIFF(day, 0, timestamp), 0)

But what I got like this:

+-------+---------------------+
| Value |      TimeStamp      |
+-------+---------------------+
| 31.10 | 2019-04-20 00:00:00 |
| 30.73 | 2019-04-21 00:00:00 |
| 30.35 | 2019-04-24 00:00:00 |
+-------+---------------------+

Missing lines on TimeStamp: 2019-04-22 , 2019-04-23 and 2019-04-25

How can I solve this?

theme development – Custom Nav Walker Viewing values ​​in the submenu

I'm trying to display submenu links in a Custom Tailwindcss / View component that I've added in Nav Walker.

Menu problems

header.php

    

inc / Clean_Walker_Nav.php

    class Clean_Walker_Nav extends Walker_Nav_Menu {
    /**
     * Filter used to remove built in WordPress-generated classes
     * @param  mixed $var The array item to verify
     * @return boolean      Whether or not the item matches the filter
     */
    function filter_builtin_classes( $var ) {
        return ( FALSE === strpos( $var, 'item' ) ) ? $var : '';
    }
    function start_lvl( &$output, $depth = 0, $args = array() ) {
        $indent = str_repeat("t", $depth);
        $output .= "
"; $output .= ""; $output .= ""; $output .= "$indent"; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= "
"; $output .= "n$indent
    n"; $output .= "
"; $output .= "
"; $output .= "
"; } function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth ) ? str_repeat( "t", $depth ) : ''; $class_names = $value = ''; $unfiltered_classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes = array_filter( $unfiltered_classes, array( $this, 'filter_builtin_classes' ) ); if ( preg_grep("/^current/", $unfiltered_classes) ) { $classes() = 'active'; } $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args ); $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; $output .= $indent . ''; $atts = array(); $atts('title') = ! empty( $item->attr_title ) ? $item->attr_title : ''; $atts('target') = ! empty( $item->target ) ? $item->target : ''; $atts('rel') = ! empty( $item->xfn ) ? $item->xfn : ''; $atts('href') = ! empty( $item->url ) ? $item->url : ''; $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); $attributes = ''; foreach ( $atts as $attr => $value ) { if ( ! empty( $value ) ) { $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = $args->before; $item_output .= ''; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= ''; $item_output .= $args->after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } }

Any help is very appreciated.

Thank you.

8 – The #states property in the field causes multiple values ​​not to work in the form with paragraphs

Hello, I have a problem with the form. How to solve this problem?

I have created a custom entity and some sets in a batch. I use reference fields, one of them comes from paragraphs with multiple values. I needed a conditional field and I created two fields: a boolean, a check box and a date field, I modified them via the hook_form_alter and made conditional, see pic, and I can not add more paragraph field

function edu_bookings_form_alter (&$form, FormStateInterface $form_state, $form_id) {

if ($ form_id == & # 39; bookings_lesson_add_form & # 39;) {

//FOR FIELDS CONDITIONS USING #STATE 
//Drupal::messenger()->addMessage('MY TEXT');
// README: IF I COMMENT THIS CODE MULTIPLE PARAGRAPHS WORKING FINE
$form('field_suggest_your_time') = (
  '#type' => 'checkbox',
  '#title' => t('Check to Suggest your time'),
);
$form('field_time_suggestion')('#states') = (

    'invisible' => (
      ':input(name="field_suggest_your_time")' => ('unchecked' => TRUE),
    ),
    );

};
}

Conditional fields work

multiple value field error

i've applied some fixes that i found on drupal.org it had no effects

SQL Server – INSERT the values ​​of .csv into the database

We have a sybase database running an application used by our users, which contains information about the client.

The situation is that the addresses of about 1000 customers are obsolete. We have received a .csv file with updated address information and we are being asked to update the database addresses.

I've filtered the csv file to compare the two address columns and show only the ones that are not identical. I therefore have a .csv file containing only the clients that need their address to be updated.

So, imagine that the customer information resides on a table. We also have unique customer IDs, as well as other personal information found on the customer's table.

I am not an expert in SQL, so my query syntax for SQL is probably very different, but does anyone have any suggestions on how I could write a query for that?

Something like,

INPUT FOR EACH [client_id in the .csv A column] [address_info in the .csv B column] TO clientAddress.table

That's how I imagine it would work in my head anyway. I've tried searching, but I can not find anyone in a situation similar to mine.

macos – How can I automatically fill a formula in Numbers while maintaining some referenced values?

So I have a chart in Numbers that contains a formula that refers to some values ​​in the chart, as well as some values ​​in another chart. I want to automatically fill out this formula, while keeping the references of the previous graph.
Numbers
I want A2 to change for each line, A3, A4, etc. But I want the values ​​in Table 2 to remain referenced to B2.

I'm using the iOS version, but I can use the macOS version if necessary.

What industrial alternatives exist to "define" in an API affecting values

I create a library in PHP. I prefer to avoid making properties a part of the public API.

class Something 
{
    private $value = "";

    // getter
    public function value(): string
    {
        return $this->value;
    }

    // setter - traditional (most well-known??) solution
    public function setValue(string $value)
    {
        // do some sanity checks against submitted value
        $this->value = $value;
    }
}

Curious to know if a term other than "set", which could also be a group of things, was used to make the API totally strange.