Merge output of two different subqueries into onto one in postgresql

I have two different queries which provide me the XML response as output. I want to merge the output of both queries into one single response. Below are the queries whose responses I want to be merged in postgresql.

Query 1: SELECT xmlforest(xmlforest(‘PPP Program’ AS promotionProgramName, coalesce(t.rus_id, 0) AS shipToId, CASE WHEN t.C_2021_PPP_PARA IS NOT NULL OR t.c_2021_ppp_vaccine = ‘2021 PPP Vaccine’ THEN ‘Enrolled’ ELSE ‘Not-Enrolled’ END AS participationStatus, ” AS participationStatusUpdateDate, xmlforest(‘2021_PPP_Parasiticide_Program’ AS "name", CASE WHEN t.C_2021_PPP_PARA IS NOT NULL THEN ‘True’ ELSE ‘False’ END AS requirementsMet, coalesce(t.YTD_2021_Qualifying_Carton_Purchased, 0) AS qualifyingPurchaseAmount, ‘Carton’ AS qualifyingPurchaseAmountType, CASE WHEN t.C_2021_PPP_PARA IS NOT NULL THEN ‘Active’ ELSE ‘In-Active’ END AS componentLevels, xmlforest(‘q1_parasiticide_carton_rebate’ AS "rewardName", CASE WHEN q1_parasiticide_carton_rebate IS NULL THEN CAST(0 AS VARCHAR) ELSE cast(coalesce(q1_parasiticide_carton_rebate, 0) AS VARCHAR(10)) END AS rewardAmount) AS "componentRewards") AS "programComponents", xmlforest(‘2021_PPP_Vaccine_Program’ AS "name", CASE WHEN C_2021_PPP_VACCINE = ‘2021 PPP Vaccine’ THEN ‘True’ ELSE ‘False’ END AS requirementsMet, coalesce(t.ytd_vaccine_sales, 0) AS qualifyingPurchaseAmount, ‘Dollar’ AS qualifyingPurchaseAmountType, CASE WHEN C_2021_PPP_VACCINE = ‘2021 PPP Vaccine’ THEN ‘Active’ ELSE ‘In-Active’ END AS componentStatus, xmlforest(‘CONTRACT_REQUIREMENT_Q1’ AS "name", coalesce(t.vaccine_requirement_q1, 0) AS targetAmount, CASE WHEN (coalesce(t.vaccine_requirement_q1, 0) – coalesce(t.vaccine_sales_q1, 0)) < 0 THEN 0 ELSE (coalesce(t.vaccine_requirement_q1, 0) – coalesce(t.vaccine_sales_q1, 0)) END AS achievedAmount) AS "componentLevels") AS "programComponents") AS "ProgramStatus") FROM temptable t LEFT JOIN ( SELECT * FROM view_programs_enrollment WHERE program_name LIKE ‘PPP%’ AND ( Participation_Start_Date IS NOT NULL OR participation_modify_date IS NOT NULL ) ORDER BY Participation_Start_Date DESC ,participation_modify_date DESC LIMIT 1 ) AS p ON t.rus_id = p.customer_location_id WHERE t.rus_id = ‘70192’;

Query-1 Output: PPP Program 70192 Enrolled 2021_PPP_Parasiticide_Program True 10 Carton Active q1_parasiticide_carton_rebate 6258777.90 2021_PPP_Vaccine_Program True 6608.6000000000 Dollar Active CONTRACT_REQUIREMENT_Q1 3750 0

Query-2: SELECT xmlforest(xmlforest(promotionProgramName, coalesce(cast(shiptoid AS VARCHAR), ”) AS shipToId, coalesce(Participation_Status, p.Participation_Status, ‘In-Active’) AS participationStatus, CAST(coalesce(p.participation_modify_date, p.Participation_Start_Date, NULL) AS DATE) AS participationStatusUpdateDate, xmlforest(‘Advance 2021 program’ AS name, CASE WHEN Participation_Status = ‘Enrolled’ THEN ‘True’ ELSE ‘False’ END AS requirementsMet, coalesce(advanceytdamt, 0) AS qualifyingPurchaseAmount, ‘Dollar’ AS qualifyingPurchaseAmountType, coalesce(currentlevel, ‘Level0’) AS componentStatus, xmlforest(level1 AS name, coalesce(cast(level1taget AS INT), 0) AS targetAmount, coalesce(Level1TagetRemaining, 0) AS achievedAmount) AS componentLevels) AS programComponents) AS ProgramStatus) FROM view_programs_enrollment p JOIN adavncedata ON adavncedata.shiptoid = p.customer_location_id WHERE p.program_name LIKE (‘Advance%’) AND p.customer_location_id = ‘70192’;

Query-2 Output: Advance 70192 NOT-ENROLLED Advance 2021 program False 0 Dollar 0 7% Rebate 2500 0

Expected Output: <CustomerProgramStatus_response> PPP Program 70192 Enrolled 2021_PPP_Parasiticide_Program True 10 Carton Active q1_parasiticide_carton_rebate 6258777.90 2021_PPP_Vaccine_Program True 6608.6000000000 Dollar Active CONTRACT_REQUIREMENT_Q1 3750 0 Advance 70192 NOT-ENROLLED Advance 2021 program False 0 Dollar 0 7% Rebate 2500 0 </CustomerProgramStatus_response>

Can Anyone help me with this?

How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?

On the Edit Screen in the WP Admin there is a meta box for WP’s built-in Category taxonomy. This meta box is built using post_categories_meta_box() (/wp-admin/includes/meta-boxes.php).

This meta box uses wp_popular_terms_checklist( $ tax_name ) and wp_terms_checklist( $ tax_name ) to output the actual categories (with checkboxes) within the meta box.

wp_terms_checklist() (wp-admin/includes/template.php) uses the Walker_Category_Checklist (/wp-admin/includes/class-walker-category.checklist) to build the categories/checkboxes.

Walker_Category_Checklist inherits from Walker (wp-includes/class-wp-walker.php) just like a number of other WP walkers (Walker_Nav_Menu, Walker_Comment, Walker_Category, etc.).

When extending the Walker_Nav_Menu we can hook into the wp_edit_nav_menu_walker filter and return our custom walker. Is there a way to do this with Walker_Category_Checklist?

===

Update 1:

I see in wp_terms_checklist() there is:

apply_filters( 'wp_terms_checklist_args', $ args, $ post_id );

I’m thinking that I can hook into this filter, change the walker argument to a custom walker and that this may do the trick?

Derivative of NDSolve output

I am trying to study the stability of a 2-dimensional discrete system (X, Y) by finding the Jacobian at the systems non-trivial equilibrium (X*, Y*). The functions that map the system from one iterate, n, to the next are given by the solutions to ordinary differential equations solved at time t = T

X(n+1) = f(x(T), y(T))

Y(n+1) = g(x(T), y(T))

where x(T) and y(T) depend on X(n) and Y(n).

Here is a MWE of the problem

sol[T_?NumericQ, a_, b_, c_, x0_?NumericQ, y0_?NumericQ] :=    NDSolve[{     x'[t] == x0 a - b *x[t]*y[t],     y'[t] == b*x[t]*y[t] - c y[t],     x[0] == 0, y[0] == y0},     {x, y}, {t, 0, T];  xmap[T_?NumericQ, a_, b_, c_, x0_?NumericQ, y0_?NumericQ] :=   x[T] /. sol[T, a, b, c, x0, y0] ymap[tt_?NumericQ, a_, b_, c_, h_, j_, x0_?NumericQ, y0_?NumericQ] :=   h (y[T] /. sol[T, a, b, c, x0, y0])/(1 +       j (y[T] /. sol[T, a, b, c, x0, y0])) 

where x0 and y0 are placeholders for X(n-1) and Y(n-1). Is it possible to take the partial derivatives of xmap and ymap w.r.t. x0 and y0? I tried this

D[xmap[5, 0.5, 0.25, 1, x0, 200], x0] /. x0 -> 100 

But it does not evaluate.

Damage Output of Lightning Recovery (Tome of Battle Maneuver)

Lightning Recovery is a Tome of Battle maneuver that allows a reroll on an attack d20 if it misses, along with an additional +2 on the second attempt. How can I calculate the value of the damage added per round? Here are some figures we can use:

Rapier Attack: +10/+5
Base Damage: 1d6+2
Extra feat damage: 2d6
Critical: 18/x2
Battle Ardor (warblade ability): +2 to confirm critical threat
Target AC: 20

How much damage per round does the use of this maneuver Lightning Recovery add? I’m guessing it’s an array of spread due to the 5e ‘advantage’-like nature of the maneuver mechanic? Could that even be averaged?

Matching TWF to GWF DPR output with magic item

I’m new to D&D. I currently have one character built: a human fighter. I’ve given him the Two-Weapon Fighting (TWF) fighting style, as it sits nicely with his character. I’m currently at Level 3, and intend to take the Dual Wielder feat at Level 4.

I note that past Level 5, TWF starts to fall behind the Great Weapon Fighting (GWF) fighting style for damage output per round. This doesn’t bother me too much but I’d like to keep up with the rest of my group. I have just been granted a wish by drawing the wish card from the Deck of Many Things, and I would like to use it to bridge the gap between the two styles regarding DPR.

I’m thinking of wishing for a pair of magic longswords with a damage modifier that increases per level. I ran over the idea with the DM and he agrees it’s a reasonable wish, as I’d like to continue with the character. I am really interested in knowing how I could make this modifier match the DPR from GWF, and I don’t want to create anything that will be overpowered in the early stages or underpowered further down the line.

My output is washed out when in windowed

I have the following setup:

RGBA8_Unorm_srgb swapchain buffer
RGBA16Float render targets
RGBA8_Unorm_srgb color textures
RGBA8_Unorm tangent normals textures

I use the render targets for actual rendering. In the very last step in my pipeline, I use the render target as a shader resource and do a fullscreen post processing via shader onto the swapchain buffer as render target

However, I noticed that when I am in fullscreen, I have darker (desired) output compared to when I am in windowed. In Windowed, everything looks washed out and brighter.

Windowed

Fullscreen

What is the cause of this?

AnyDice: semantics of output headers in “export” view

I hope this is on-topic: In AnyDice, when choosing the "Export" view, output d6 is displayed as:

"output 1",3.5000000000069997,1.707825127661641,1,6 #,% 1,16.6666666667 2,16.6666666667 3,16.6666666667 4,16.6666666667 5,16.6666666667 6,16.6666666667 

I’m not quite sure what the numbers in the first line signify, the last two (1 and 6) are presumably the range of values that the rolls can take on but what about the other two (3.5 and 1.7…)? I have not been able to figure this out from the documentation.

How to output choices from a custom sortable checkboxes control via Customizer settings

I’m trying to dynamically output some settings from theme Customizer. I use this custom controls, Example 3.

How can I display the settings so that the selected options appear as well as in the order in which they were placed in Customizer?

So far I’ve tried without success:

    $  box = get_theme_mod( 'sample_pill_checkbox3' ) ;       switch ( $  box ) {                  case 'author':                 echo 'Author';                 break;                  case 'date':                 echo 'Date' ;                 break; } 

Basically, if Author and Date is selected and Date is placed first, so I would need to appear in the frontend, Date first then Author.

Thank you!

General::stop: Further output of ParametricNDSolveValue::ndsz will be suppressed during this calculation

How to overcome this error?

ode = D[theta[x], {x, 2}] == SH*theta[x]^2 sol = ParametricNDSolveValue[{ode, theta[0] == 1, theta'[1] == 0}, theta[x], {x, 0, 1}, {SH}] Ns[SH_, Tr_] := SH*sol[SH]*(Log[1 + Tr*sol[SH]] - sol[SH]/(sol[SH] + (Tr - 1)^(-1))) Plot[Ns[10, 1.2], {x, 0, 1}] 

General::stop: Further output of ParametricNDSolveValue::ndsz will be suppressed during this calculation.