magento2 – La validation de la demande a échoué pour l'action "Apriljune Testimonial Controller Index Add Interceptor

Voici le contrôleur qui est responsable de l'ajout des données de formulaire du frontend à plusieurs tables de base de données.

namespace ApriljuneTestimonialControllerIndex;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppResponseInterface;
use ApriljuneTestimonialModelTestimonial;
use ApriljuneTestimonialModelAuthor;
use ApriljuneTestimonialModelSocial;
use ApriljuneTestimonialModelContent;
use ApriljuneTestimonialModelResourceModelTestimonial as TestimonialResource;
use ApriljuneTestimonialModelResourceModelAuthor as AuthorResource;
use ApriljuneTestimonialModelResourceModelSocial as SocialResource;
use ApriljuneTestimonialModelResourceModelContent as ContentResource;
use MagentoFrameworkControllerResultFactory; 

class Add extends Action
 {
/**
 * @var Testimonial
 */
private $testimonial;

/**
 * @var Social
 */
private $social;

/**
 * @var Content
 */
private $content;

/**
 * @var Author
 */
private $author;

/**
 * @var TestimonialResource
*/
private $testimonialResource;

/**
 * @var SocialResource
*/
private $socialResource;

/**
 * @var ContentResource
*/
private $contentResource;

/**
 * @var AuthorResource
*/
private $authorResource;

/**
 * Add constructor.
 * @param Context $context
 * @param Testimonial $testimonial
 * @param Social $social
 * @param Author $author
 * @param Content $content
 * @param TestimonialResource $testimonialResource
 * @param SocialResource $socialResource
 * @param ContentResource $contentResource
 * @param AuthorResource $authorResource
 */

public function __construct(

    Context $context,
    Testimonial $testimonial,
    Social $social,
    Author $author,
    Content $content,
    TestimonialResource $testimonialResource,
    SocialResource $socialResource,
    AuthorResource $authorResource,
    ContentResource $contentResource
)
{
    parent::__construct($context);
    $this->testimonial = $testimonial;
    $this->social      = $social;
    $this->content     = $content;
    $this->author      = $author;

    $this->testimonialResource = $testimonialResource;
    $this->socialResource      = $socialResource;
    $this->contentResource     = $contentResource;
    $this->authorResource      = $authorResource;
}

/**
 * Execute action based on request and return result
 *
 * Note: Request will be added as operation argument in future
 *
 * @return MagentoFrameworkControllerResultInterface|ResponseInterface
 * @throws MagentoFrameworkExceptionNotFoundException
 */

public function execute()
{

    /* Get the post data */
    $data = (array) $this->getRequest()->getPost();

    if (!empty($data)) {

        /* Set the data in the model */
        $testimonialModel = $this->testimonial;
        $authorModel = $this->author;
        $contentModel = $this->content;
        $socialModel = $this->social;

        $date             = date('Y-m-d h:i:sa'); 

        // Set Parent Table Testimonial Data
        $testimonialModel->setData('status', 0 );
        $testimonialModel->setData('created_at', $date);
        $testimonialModel->setData('modified_at', $date);

        //Save Testimonial Table Data
        $this->testimonialResource->save($testimonialModel);

        //Get the last added Testimonial
        $lastTestimonialId = $testimonialModel->getId();

        //Set Testimonial Author Data
        $authorModel->setData('testimonial_id', $lastTestimonialId);
        $authorModel->setData('author_name', $data('author_name'));
        $authorModel->setData('author_email', $data('author_email'));
        $authorModel->setData('author_company', $data('author_company'));
        $authorModel->setData('author_job_title', $data('author_job_title'));
        $authorModel->setData('author_city', $data('author_city'));
        $authorModel->setData('author_image', '123456789');

        //Set Testimonial Social Data
        $socialModel->setData('testimonial_id', $lastTestimonialId);
        $socialModel->setData('facebook_url', $data('facebook_url'));
        $socialModel->setData('linkedin_url', $data('linkedin_url'));
        $socialModel->setData('twitter_url', $data('twitter_url'));
        $socialModel->setData('youtu_url', $data('youtu_url'));

        //Set Testimonial Content Data
        $contentModel->setData('testimonial_id', $lastTestimonialId);
        $contentModel->setData('testimonial_title', $data('testimonial_title'));
        $contentModel->setData('testimonial_description', $data('testimonial_description'));
        $contentModel->setData('testimonial_rating_number', $data('testimonial_rating_number'));

        //Save Testimonial Author Data
        $this->authorResource->save($authorModel);

        //Save Social Informaiton
        $this->socialResource->save($socialModel);

        //Save Testimonial Content Informaiton
        $this->contentResource->save($contentModel);

        $this->messageManager->addSuccessMessage("Testimonial saved successfully!");

        /* Redirect back to Testimonial page */
        $redirect = $this->resultRedirectFactory->create(ResultFactory::TYPE_REDIRECT);
        $redirect->setPath('/testimonial/index/add');
        return $redirect;
    }

    $this->_view->loadLayout();
    $this->_view->renderLayout();
}
}

tout fonctionnait bien sauf si j'ai effectué la compilation magento / bin di: après cela ne fonctionne pas correctement.

J'ai une autre section pour l'administrateur qui nécessitait d'exécuter magento / bin di: compile, donc avant que cette section fonctionne correctement, car je l'ai compilée, commencez à me donner l'erreur:

(2020-05-21 11:36:09) main.DEBUG: Request validation failed for action "ApriljuneTestimonialControllerIndexAddInterceptor" () ()

What is the Best Way to Index Backlinks fast?

Hello Everyone,

We just created 200 backlinks for our website i wnat to know the best to index back link safely . We already tried blogge… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1809035&goto=newpost

error (Undefined index) and (Cannot modify header information – headers already)

Error:

Notice: Undefined index: link_type in /home/golchind/public_html/wp-content/themes/golchindl/functions.php on line 40

Notice: Trying to get property of non-object in /home/golchind/public_html/wp-content/themes/golchindl/functions.php on line 58

Warning: Cannot modify header information – headers already sent by (output started at /home/golchind/public_html/wp-content/themes/golchindl/functions.php:40) in /home/golchind/public_html/wp-admin/admin-header.php on line 9

help :

line 40

$type = $_POST(‘link_type’);

line 58

update_post_meta($post->ID,”_oscar_data”,json_encode(array(“episodes”=>$episodes,”links”=>$links,”type”=>$type),
JSON_UNESCAPED_UNICODE));

function oscar_meta_box_js(){
    wp_enqueue_style( 'oscar_box_style',get_bloginfo('template_url')."/css/admin_meta_box.css");
    wp_enqueue_script( 'oscar_box', get_bloginfo('template_url'). '/js/meta_boxes.js', array('jquery'),'1.0',true);
}
add_action( 'admin_enqueue_scripts', 'oscar_meta_box_js');


function oscar_meta_save(){
    global $post,$meta_args,$meta_dls;
    $type = $_POST('link_type');
    $episodes = array();
    $links = array();
    if($type == "serial"){
        for($i=0;$i<count($_POST('ep_name'));$i++){
            $episodes() = array("name"=>$_POST('ep_name')($i),"quality"=>$_POST('ep_quality')($i),"medium_size"=>$_POST('ep_med')($i));
        }
        for($i=0;$i<count($_POST('link'));$i++){
            $links() = array("name"=>$_POST('name')($i),"link"=>$_POST('link')($i),"subtitle"=>$_POST('subtitle')($i),"screenshot"=>$_POST('screenshot')($i),"episode"=>$_POST('episode')($i));
        }
    } else if($type == "movie") {
        for($i=0;$i<count($_POST('movie_title'));$i++){
            $episodes() = array("name"=>$_POST('movie_title')($i));
        }
        for($i=0;$i<count($_POST('mlink'));$i++){
            $links() = array("name"=>$_POST('mname')($i),"link"=>$_POST('mlink')($i),"subtitle"=>$_POST('msubtitle')($i),"screenshot"=>$_POST('mscreenshot')($i),"episode"=>$_POST('mtitle')($i));
        }
    }
    update_post_meta($post->ID,"_oscar_data",json_encode(array("episodes"=>$episodes,"links"=>$links,"type"=>$type), JSON_UNESCAPED_UNICODE));
}







function oscar_download(){
    global $post;
    ?>
<script>
var $ = jQuery;
$(function(){
    var data = '<?=get_post_meta($post->ID,"_oscar_data",true);?>';
    if(data != ""){
        data = JSON.parse(data);
        var type = data('type');
        data('episodes').forEach(function(e){
            if(type == "serial")
                add_ep(e('name'),e('quality'),e('medium_size'))
            else
                add_title(e('name'));
        });
        data('links').forEach(function(e){
            if(type == "serial")
                add_link(e('name'),e('link'),e('subtitle'),e('screenshot'),e('episode'))
            else
                add_mlink(e('name'),e('link'),e('subtitle'),e('screenshot'),e('episode'))
        });
        if(data('type')){
          $("#link_type").val(data('type'));
    }
    }
    normalize_links()
    normalize_mlinks()
});
</script>
<?php if ('series' == get_post_type()) { ?>
<div id="serial" class="content">
    <div class="side_inp_keeper">
        <input id="title_serial" type="text" placeholder="عنوان فصل">
        <input id="quality_serial" type="text" placeholder="کیفیت">
        <input id="med_serial" type="text" placeholder="میانگین حجم هم قسمت">
        <button id="add_ep" class="button">افزودن</button>
    </div>
    <div id="episodes">

    </div>
    <hr>
    <div class="links" style="display:none;">
            <div class="side_inp_keeper">
                <select id="ep"></select>
                <input type="text" id="name" placeholder="عنوان لینک">
                <input type="text" id="link" placeholder="لینک دانلود">
                <input type="text" id="subtitle" placeholder="زیر نویس">
                <input type="text" id="screenshot" placeholder="نمونه کیفیت">
                <button id="add_link" class="button">افزودن</button>
            </div>
            <div id="links">

            </div>
        </div>
</div>
<?php } else if ('movies' == get_post_type()) { ?>
<div id="movie" class="content">
    <div class="side_inp_keeper">
        <input type="text" name="movie_title" id="movie_title" placeholder="عنوان (مثال : زبان اصلی)"><button id="add_link_title" class="button">افزودن</button>
    </div>
    <div id="titles">

    </div>
    <hr>
    <div class="mlinks">
        <div class="side_inp_keeper">
                    <select id="titl"></select>
                    <input type="text" id="mname" placeholder="عنوان لینک">
                    <input type="text" id="mlink" placeholder="لینک دانلود">
                    <input type="text" id="msubtitle" placeholder="زیر نویس">
                    <input type="text" id="mscreenshot" placeholder="نمونه کیفیت">
                    <button id="add_mlink" class="button">افزودن</button>
        </div>
        <div id="mlinks">

        </div>
    </div>
</div>
<?php } ?>
<input type="hidden" name="link_type" id="link_type" value="serial">
    <?php
}



function oscar_meta_boxes() {
    add_meta_box( 'oscar_download',"باکس دانلود", 'oscar_download', array('movies', 'series'), 'normal', 'high' );
}
add_action("save_post","oscar_meta_save");
add_action( 'add_meta_boxes', 'oscar_meta_boxes' );

bitcoin core – How do I connect to the Electrs index?

Goal:

My goal is to be able to have my own local blockchain indexed so I can perform searches based on public keys.

Blockchain:

wget https://bitcoincore.org/bin/bitcoin-core-0.19.1/bitcoin-0.19.1-x86_64-linux-gnu.tar.gz

I have a full node fully sync’ed

enter image description here

It seems electrs has not fully indexed the blockchain

enter image description here

Electrs was configued based on instructions here:

https://github.com/romanz/electrs/blob/master/doc/usage.md

What’s next?

Unsure what to do next? Do I need to create a C# app to connect to the Electrs index using JSON? Do I need to use C# to connect to the rocksdb, which is the database used by electrs to index the blockchain? If any of these is the next step, can someone please provide me with basic start code? As in, how to connect my C# app to the index, pass it a parameter, in this case a public key, and retrieve a value back?

Range Optimizer in Mysql: What is an index dive during query optimization?

Following the post by Jorgen Loland on range optimization, I arrived at the concept of "index diving" which is done when planning MySQL query (aka in Mysql Optimizer).

Citing his point,

Since there is a method of accessing ranges in MySQL, the number of rows in a range has been estimated by plunging the index to find the start and end of the range and use them to count the number of lines between them. This the technique is precise and therefore constitutes a good basis for achieving the best possible execution plan (QEP) for the query.

I tested the same and they were accurate in my tests too.
I have a few questions,

  1. What exactly does this mean, "to find the start and end of the range"? Does that mean
    get the start page and end page for the range in tree B.
  2. If my first question is yes, then how precise this technique will be, that is,
    What about the pages.
    in the middle of the range.

php – if isset does not work for an undefined index, how to correct

this is my code although i am not sure what i am missing to remove the error:

Week 8, Exercise 4

require_once ("conn.php");
if (isset ($ _ POST (& # 39; quantity & # 39;)))) {
$ quantityinstock = $ _POST (& # 39; quantity & # 39;);
}

$ quantityinstock = $ dbConn-> escape_string ($ _ POST (& # 39; quantity & # 39;));
$ sql = "select name, quantity in stock, product price where quantity in stock = & # 39; $ quantity in stock &";
$ results = $ dbConn-> query ($ sql)
or die (& # 39; Problem with request: & # 39 ;. $ dbConn-> error);

?>

Last name
The quantity on deposit
Price

Fall 2020
Technologies for web applications 300582
Page 3 of 5
fetch_assoc ()) {?>

To close(); ?>

postgresql – postgres includes the column listed in the sort key and therefore fails to use the index

This is a query that occurs quite frequently:

SELECT DISTINCT id, published_year, first_author FROM publication ORDER BY published_year DESC NULLS LAST LIMIT 10;

There is an index that could be used for this:

CREATE INDEX publication_published_year_idcombineddesc2_btree ON public.publication USING btree (published_year DESC NULLS LAST, id)

However, it is not used and the request therefore lasts 30 to 40 seconds:

EXPLAIN ANALYZE SELECT DISTINCT id, published_year, first_author FROM publication ORDER BY published_year DESC NULLS LAST LIMIT 10;
                                                              QUERY PLAN                                                                  
----------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=3527756.39..3527756.49 rows=10 width=23) (actual time=33860.282..33860.292 rows=10 loops=1)
   ->  Unique  (cost=3527756.39..3623290.85 rows=9553446 width=23) (actual time=33860.280..33860.288 rows=10 loops=1)
         ->  Sort  (cost=3527756.39..3551640.01 rows=9553446 width=23) (actual time=33860.278..33860.281 rows=10 loops=1)
               Sort Key: published_year DESC NULLS LAST, id, first_author
               Sort Method: external merge  Disk: 310440kB
               ->  Seq Scan on publication  (cost=0.00..2224226.46 rows=9553446 width=23) (actual time=0.036..20842.499 rows=9553526 loops=1)
 Planning time: 1.157 ms
 Execution time: 33945.457 ms

Now if I delete the first_author or DISTINCT, the request runs well and quickly:

EXPLAIN ANALYZE SELECT DISTINCT id, published_year FROM publication ORDER BY published_year DESC NULLS LAST LIMIT 80;
                                                                                      QUERY PLAN                                                                                          
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.43..4.57 rows=80 width=10) (actual time=0.055..0.250 rows=80 loops=1)
   ->  Unique  (cost=0.43..493764.18 rows=9553446 width=10) (actual time=0.053..0.236 rows=80 loops=1)
         ->  Index Only Scan using publication_published_year_idcombineddesc2_btree on publication  (cost=0.43..445996.95 rows=9553446 width=10) (actual time=0.051..0.204 rows=80 loops=1)
               Heap Fetches: 1
 Planning time: 1.487 ms
 Execution time: 0.300 ms

EXPLAIN ANALYZE SELECT id, published_year, first_author FROM publication ORDER BY published_year DESC NULLS LAST LIMIT 10;
                                                                                 QUERY PLAN                                                                                     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.43..9.63 rows=10 width=23) (actual time=0.062..0.190 rows=10 loops=1)
   ->  Index Scan using publication_published_year_idcombineddesc2_btree on publication  (cost=0.43..8787896.00 rows=9553446 width=23) (actual time=0.061..0.186 rows=10 loops=1)
 Planning time: 1.380 ms
 Execution time: 0.223 ms

So my question is this: is there a way to force the query planner to use an index in the first case?

Index Order Help SQLite – Database administrators stack Exchange

I have a very large sqlite table (70 million rows) on a low end machine that I am trying to index properly.

My columns are timestamp, machineid, ioid and value.

There are probably around 200 ioids (on each machine), a handful of machineids, and the timestamp is one sample per second for each ioid.

My requests are as such:

select * from AnalogInput where SampleInfo_source_timestamp>=0 and SampleInfo_source_timestamp<=1587481620000000000 and ioId in (1,9,10,11,5,6,7,8,12,13,14,15,179,203,2,3,27,28,29,31,32,33,34,35,36,37,30,38,42,48,41,49,53,59,52,60,64,70,63,79,89,82,134,144,137,71,74,75,78,16,479,490,20,26,19,90,94,100,93,101,105,111,104,133,112,115,116,122,181,182,233,177,171,504,505,173,172,174,175,211,212,217,213,214,215,216,176,234,235,236,237,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,219,220,221,222,223,237,238,239,240,241,225,226,227,230,231,232,228,229,506,507) and machineid=1111 group by ioId;

I am currently using an index of: CREATE INDEX "index1 $ AnalogInput" ON "AnalogInput" ("machineId", "ioId", "SampleInfo_source_timestamp")

Is it the most efficient command?

Does the product of two elements belong to a subgroup of index 2

Let $ H leq G $ to be a subgroup of $ G $ which is a finite group, is it true that for each $ a, b in G setminus H $, $ a cdot B in H $ when $ [G: H] = $ 2?

mysql – Update of the column having an index causing a blocking

Update XyzTable set state = & # 39; second & # 39; where pgmNumber = & # 39; prog123 & # 39; and state = & # 39; first & # 39;

The state & pgmNumber columns have an individual index.

A deadlock occurs even if the above request is executed simultaneously with different pgmNumber.

What would be the best way to solve the problem