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?

Unwanted scaling when overlaying GraphicsComplex graphic onto image?

I have a collection of complex hull meshes, which I would like to overlay onto an image. These complex hull meshes were obtained from the original image, and I have verified that their mesh coordinates (pastebin link for reference) are close to the original bounds of the image of size {2752,2192} pixels.

Convex hull meshes

However, converting their mesh coordinates to a GraphicsComplex graphic seems to resize the output image to {360,282} instead of a larger graphic near the size {2752,2192}.

ImageDimensions@[Graphics[GraphicsComplex[MeshCoordinates[#], {Thick, Red, MeshCells[#, 1]}]] & /@ allCluster] ImageDimensions@pic

Output: {360, 282}, {2752, 2192}

As a result, overlaying the complex hull meshes over the original image results in a translated/scaled offset that I’m unable to fix. Show[pic, Graphics[GraphicsComplex[MeshCoordinates[#], {Thick, Red, MeshCells[#, 1]}]] & /@ allCluster]

scaled overlay

This used to work in an older version of Mathematica (12.0.2), but since upgrading to the 12.2 I have been unable to obtain the same overlays that I used to get. correct overlay with older version of mathematica

Is there an option to output Graphics at its original size instead of rescaling so that I can overlay my images properly? I have tried adding an ImageSize parameter as such, to no avail. I have also tried using ImageResize, but got the same image with the red outlines in a lower resolution.

Show[pic, Graphics[GraphicsComplex[MeshCoordinates[#], {Thick, Red, MeshCells[#, 1]}], ImageSize -> {2752, 2192}] & /@ allCluster]

Thank you!

Whats the damage for dropping a 3,600lb tortle 30ft onto someone? [duplicate]

Dnd 5e. I’m a 450lb tortle that can cast enlarge on myself and become a 3,600lb large creature. A fellow party member can telekineticly move a willing large creature 30ft. Obviously we immediately did this to try and crush enemies and broke our DM. What’s a good damage/save for this tortle bomb?

How to generate a star onto a render texture with spherical warping

How would one proceduraly generate a star in a compute shader that looks like one of thes two at any size needed. Also any way transfer this into a spherical map, would be appreciated. Goal is to create a spherical skybox of stars, (stars a pre generated, and not just decoration).

So far got accurate positioning of the stars on the spherical skybox but lack the equations to get it looking like I want.

Preferably the one on the right.

enter image description here enter image description here

This below is what I currently have, ~~5 to 15ms processing time, little over 30k stars

enter image description here

Using Unity2019.3.1f1, needs to be compute shader compatible. (if not I will convert it somehow) Render Texture output.

How Can I Prevent Hackers From Spoofing TCP messages onto my server?

I have a Python client and server communicating over a TCP socket – they send and receive a certain set of standardized string commands to each other.

How can I prevent a hacker from creating their own client that sends the same kind of string commands (but with their own values) to the server?

Is it right that I can assume the hacker has access to the TCP messages being transmitted/received, but not the individual code that is being executed (if I only give them the executable)?

I’m new to network security and wanted to decide how best to design my network communication scheme.

Idea – I was imagining that I could possibly encrypt the messages before sending and decrypt on the server (assuming the hacker can’t find any of the keys in the source code?). Is this a secure way of going about it and am I on the right track?

How can I cast light onto a sprite in 3D environment?

I’m making a 2.5D game, where 2D sprites are in a 3D environment. I’m using URP and I have a problem with lighting the sprites. The sprites are lighting up from behind, and not front. I tried with directional, spot and point lights but the result is the same no matter what official shader I use they only light up when they receive light from behind. Front light has no effect whatsoever on the sprites.

I spent the entire day looking for a solution but I’ve got almost nothing. Only solution I saw someone else mention is making the game object with the "sprite renderer" on, a child of another gameobject and rotate it 180 degrees on Y. But that is not an option for me cause I’m using custom scripts to rotate that game object already.

So can there be a custom shader? Can one be created using shadergraph maybe? I know some others have faced the same problem but did anyone really solve it?

Thanks.

Can a firewall duplicate denied traffic onto a TAP/SPAN port?

We have quite a number of Palo Alto firewalls at various points in our infrastructure, for east-west, north-south, and DMZ traffic, all managed with Panorama. These firewalls have TAP ports which are connected to a network packet broker (NBP) platform that balances session streams and captures all traffic as pcaps. Frequently, I will want to investigate traffic that the firewall has denied – either incoming attack traffic from the internet, or internal east-west traffic that is being incorrectly blocked. However it would seem that only traffic the firewall has allowed to pass is being mirrored to the TAP port. Is it possible to configure the firewalls to also mirror denied traffic? How would this be done?

Can i dimension door ONTO the back of, say, an ancient green dragon?

I am familiar with the DMG rules for climbing on to the back of a larger creature, and I think that dimension door or perhaps misty step would allow me to bypass the Opposed dex vs str/dex check, to place myself onto its back. From there, it can use its action to shake me, or whatever the dm can come up with, mostly im curious about rulings for teleporting ONTO a creature. Certainly the place it is is occupied, but im not trying to land there. What say ye, oh wise masters?

What happens if you drag an aquatic creature onto land?

There are creatures such as the hunter shark which has a 40 foot swim speed, and a 0-foot “normal/walking” speed. It’s longest range attack is 5 feet so could you (by some means) drag this creature onto land, and then stab it with a reach weapon? It just is somewhat of a disconnect that a creature (such as a PC) with only a “walking/normal” speed can swim through the water but a creature with only a swim speed cannot walk on land.


If you’d like a creature that can more reasonably survive on land there is the dolphin, which can hold it’s breath for 20 minutes, and the ixitxachitl, which can breathe even on land.

What happens if you drag an aquatic creature onto land?