Plot with three functions ana three parameters

i think my code doesn t have any problem but the program shows me this error and i comfused!/* Plot::argr: Plot called with 1 argument; 2 arguments are expected.*/

 a = 1; l = 2;     w1[x_, c_, theta1_] := x^c + theta1;     f[x_] := ( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a];     mesi = Integrate[x*f[x], {x, 0, Infinity}];     mesi1 = Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0, Infinity}];     fw1[x_, c_, theta1_] := ((x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]))/(Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0, Infinity}]);     DH1[x_, c_,theta1_] := ((Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0,Infinity}])/((Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0, Infinity}]) +theta1))*(((x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/ Gamma[a]))/(Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0, Infinity}])) + (theta1/ (Integrate[(x^c + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]), {x, 0, Infinity}]) + theta1)*(( l^a*x^(a - 1)*Exp[-l*x])/Gamma[a]);  Manipulate[Plot[DH1[x, c, theta1]], {x, 0, 100}, , {c, 0, 10}, {theta1, 0, 10}]  /*my plot doesnt run ? i want to run this function with mean mesi */ 

Response time optimization – Getting record count based on Input Parameters

I’m trying to optimize the process of calculating count of records, based on variable input parameters. The whole proces spans several queries, functions and stored procedures.

1/ Basically, front-end sends a request to the DB (it calls a Stored procedure) with an input parameter (DataTable). This DataTable (input parameter collection) contains 1 to X records. Each record corresponds to one specific rule.

2/ SP receives the collection of rules (as a custom typed table) and iterates through them one by one. Each rule apart from other meta-data contains a name of a specific function that should be used in evaluating the said rule.

For every rule, the SP prepares a dynamic query wherein it calls the mentioned function with 3 input parameters.

a/ Custom type Memory Optimized Table (Hashed index) b/ collection of lookup values (usually INTs) that the SELECT query uses to filtr data. Ie. "Get me all records, that have fkKey in (x1, x2, x3)" c/ BIT determining if this is the first rule in the whole process.

Each function has an IF statement, that determines based on the c/ parameter if it should return "all" records that fullfill the input criteria (b/). Or if it should fullfill the criteria on top of joining the result of previous rule that is contained in the custom table (a/)

3/ Once the function is run, it’s result is INSERTed into a table variable called @tmpResult. @result is then compared to tmpResult and records that are not in the tmpResult are DELETEd from result.

  • @result is a table variable (custom memory optimized table type), that holds intermediate result during the whole SP execution. It is fully filled up on the first rule, every consequent rule only removes records from it.

4/ The cycle repeats for every rule until all of the rules are done. At the end, count is called on the records in @result and returned as a result of SP.

Few things to take into account:

  • There are dozens of different types of rules. And the list of rules only grows bigger over time. That’s why dynamic query is used.
  • The most effective way to temporarily store records between individual rule execution so far proved to be custom Memory-Optimized table type. We tried a lot of things, but this one seems to be the fastest.
  • The number of records that are usually returned for 1 single rule is roughly somewhere between 100 000 and 3 000 000. That’s why a bucket_size of 5 000 000 for the HASHed temporary tables is used. And even though we tried nonclustered index, it was slower than that HASH.
  • The input collection of rules can vary strongly. There can be anything from 1 rule up to dozens of rules used at once.
  • Most every rules can be defined with at minimum 2 lookup values .. at most with dozens or in a few cases even hundred values. For a better understanding of rules, here are some examples:

Rule1Color, {1, 5, 7, 12} Rule2Size, {100, 200, 300} Rule3Material, {22, 23, 24}

Basically every rule is specified by it’s Designation, which corresponds to a specific Function. And by it’s collection of Lookup values. The possible lookup values differ based on the designation.

What we have done to optimize the process so far:

  • Where big number of records need to be temporarily stored, we use Memory-Optimized variable tables (also tried with temp ones, but it was basically same when using Memory-Optimized variants).
  • We strongly reduced and optimized the source tables the SELECT statements are run against.

Currently, the overal load is somewhat balanced 50/50 between I/O costs pertaining to SELECT statements and manipulation with records between temporary tables. Which is frankly not so good .. ideally the only bottleneck should be the I/O operations, but so far we were not able to come up with a better solution since the whole process has a lot of variability.

I will be happy for any idea you can throw my way. Of course feel free to ask questions if I failed to explain some part of the process adequately.

Thank you

How to pass parameters in wordpress shortcode?

Everything is working fine and it’s displaying the comments of the current page with this shortcode [wpdiscuz_comments] using the code below.

function my_wpdiscuz_shortcode() { $  html = ""; if (file_exists(ABSPATH . "wp-content/plugins/wpdiscuz/themes/default/comment-form.php")) { ob_start(); include_once ABSPATH . "wp-content/plugins/wpdiscuz/themes/default/comment-form.php"; $  html = ob_get_clean(); } return $  html; } add_shortcode("wpdiscuz_comments", "my_wpdiscuz_shortcode"); 

I’m trying to pass id parameter using the shortcode below. But it’s not working.

[wpdiscuz_comments post_id="22"] 

Where "post_id" parameter fetching the comments of only post id 22. So I can fetch the comments of a specific post.

Can anyone please help me with this or let me know how can I pass the parameters with shortcode using the above code? Thanks!

Will URL parameters affect SEO of blog posts

I have written some simple js/php that adds WordPress taxonomies and categories of posts to the urls of blog posts so that we can search in google analytics which posts with matching taxonomies are performing better.

Before I put this live though I would like to know how and if this will effect ranking of those posts. I have tried online but so far i am struggling to find an answer.

example of the URL pre and post URL params

  • https://example.com/collaboration/how-to-activate-teams-together-mode/
  • https://example.com/collaboration/how-to-activate-teams-together-mode/?cat=Team%20Collaboration&brands=Microsoft&region=EMEAAmericasAPAC

Added information thanks to Stephen : The parameters are always consistent. I am doing a pushState refresh to add the url parameters so the page refreshes with the parameters. The posts will always have the parameters. The canonical tag is the original url.

OOP: Instantiate plugin, passing parameters and accessing super class properties from sub class object

I would like to know the "best" – OOP-way – and WP-compatible – format for instantiating an object, while passing arguments ( which are defined as properties in the parent class ) – which are then cleanly and correctly available to all sub classes, which extend the parent.

I would like to know how to make $ this->slug ( the parent prop ) available cleanly within the sub class, without having to pass the arguments to this class constructor.

The example code concept below works, but something smells wrong:

<?php  // plugin.php  namespace Q\Plugin;  // If this file is called directly, Bulk! if ( ! defined( 'ABSPATH' ) ) {     return; }  // autoloader ## require_once __DIR__ . '/autoload.php';  // Define Class ## class Plugin {      // class properties ##     protected $  slug     = false;      // construct ##     public function __construct( Array $  args = [] ) {          // set class props, if defined - check using null coalescing operator ##         $  this->slug     = $  args['slug'] ?? false ;      }      // public init callback ##     public function init() {          // setup CPT ##         $  cpt = new \Q\Plugin\CPT([             'slug'      => $  this->slug,         ]);         $  cpt->init();      }  }  // instantiate the plugin class and make the returned object available as a (optional) global variable  ## global $  q_plugin; $  q_plugin = new Plugin([     'slug'      => 'q_cpt', // cpt slug -- singular ## ]); $  q_plugin->init();  // NAMESPACE/cpt.php  namespace Q\Plugin\CPT;  class CPT extends \Q\Plugin {      // construct ##     public function __construct( Array $  args = [] ) {          // store passed args ##         $  this->args = $  args;      }      // public init callback ##     public function init() {          // sanity ##         if(              ! isset( $  this->args['slug'] )          ){              error_log( 'Error in params passed to '.__CLASS__ );              return false;          }          // $  this->args['slug'] is now available to use in register_post_type function         // BUT, I would like to know how to make $  this->slug ( the parent prop ) available cleanly, without having to pass the arguments to this class constructor      }  } 

Thanks!

Can UTM parameters be governed in Analytics or Tag Manager?

I’m trying to understand UTM parameters in relation to Analytics and Tag Manager governance. I understand what the various parameters (utm_source, utm_medium & utm_campaign) are for, and that you append these as querystring parameters to a link that you want to promote in order to track where a visitor from your site came from. However, I’m unsure as to how this is governed. For example, if someone was running a campaign with a link like this:

http://www.example.com/?utm_source=twitter&utm_medium=profile&utm_campaign=email

…do those source, medium and campaign values need to be set up in Analytics or Tag Manager in order to ensure that they’re legitimate? What would stop someone spamming my data by using their own values?:

http://www.example.com/?utm_source=nonsense&utm_medium=haha&utm_campaign=bogus

Many thanks.

Move to pagination with URL parameters

I can not find the way to use URL parameters to define pagination pages /posts?page=2 instead of the conventional WordPress way /posts/page/2/

The goal is to make WordPress change the way it manages pagination, without breaking the website that is using the conventional WordPress permalinks format

/posts/page/2/

and change the pagination to

/posts?page=2

I am happy also with this variant:

/posts/page/2?page=2

if necessary.

Call procedure inside procedure using dynamic sql modifying the parameters getting passed

I have to call a procedure inside a procedure and replace all single quotes inside the parameter to double quotes. Ex: When i call my original proc begin data(10,’"push’s the data"’);end; It throws error due to single quote and i cannot change the string manually at runtime by adding double quote like push”s. I tried replacing inside procedure but probably because the string is passed first it wont take changes.

I wish to call this procedure inside another and using maybe dynamic sql replace single quotes with double.

Something like this:

create procedure dynamic_proc begin execute immediate ‘begin data(id,’||’replace(string,CHR39,CHR39||CHR39)’ AS string)’||’ end;’ end;

So basically the parameter string which is being passed in procedure data needs to have all single quote replace with double at run time.