postgresql – Merge 2 columns from the joined table

Let's say I have 2 tables:

group
{
username,
export boolean not null default
}

and

channel
{
username,
group_id null,
boolean export null
}

Is it possible, with 1 query, to request the Boolean export value for a specified channel identifier, such as:

  • channel.export is not null return it as is
  • if channel.export is null and channel.group_id is null, returns false
  • if channel.export is null and channel.group_d is not null, return group.export

I'm using postgresql 10.

It seems a bit difficult.

Ansible Tower – Merge Multiple Inventories

We have two inventories, whose contents are stored in the git. Below the structure of the two

common-inven /
├── group_vars
├── group-1
├── group-2
├── group-3
├── group-3
└── inventory (definition of groups and their children)

model-inven /
├── group_vars
├── group-1
├── Location-1
├── Location-2
├── Location-3
├── host_vars
├── HOST_1
├── HOST_2
├── HOST_3
├── HOST_4
└── inventory (the host is mapped to his groups)

Inventories are properly merged when using the ansible-playbook option in the command line with multiple inventories

ansible-playbook -i common-inven / -i model-inven / some-playbook.yml

In the Ansible tower, we have the following standard configuration

  1. 2 projects each mapped to the above inventories (SCM type: Git)
  2. An inventory with 2 sources (Type: Source of a project) mapped to the above projects.
  3. A working model using the inventory above.

When the job is started using the template above, the inventories are not merged as with ansible-playbook on the command line.

So, is it possible to get the same behavior in the ansible tower as the anible-playbook command line (merging two inventories)?

Magento2: How to merge a tab (description and additional details)

I want to merge these 2 tabs because a problem occurs in the mobile view (too wide):

https://prnt.sc/o2a0be

https://prnt.sc/o2a0dj

Can someone help how can I do it?

java – Unexpected output of a quadtree merge, when these data are converted to Box2D projectors

I look at this code trying to solve it for 3 days, but it seems that I have become Code Blind. I know the problem is stupidly simple, but I just can not solve the problem.

I'm using a bastard quadtree to store the land on a map. Each node is filled with children or stores an instance of a mosaic dataset (the position data is saved in the mosaic dataset). the tile stores its type AABB (x, y, w, h) and its block type (1 = ground, 0 = air / nothing). Later, it will also store objects and entities. Insertion (for now) does NOT cause the merge – it's a separate function call.

The sacred thing correctly renders if attracted by a pixmap. Which makes me absolutely crazy.

Expected output (image generated in PixMap from data):

Expected release of a properly merged quadtree

Output WITHOUT fusion (tile width / height: 8 pixels), totally as expected:

Perfectly normal representation of the quadtree above, without merging the same blocks (all 8x8 pixel data)

Output WITH fusion (bizzare.):
The exact same quadtree in all other pictures, except that the squares are not aligned at all.

Code of which I am pretty sure that it is the problem (of tile class) PPM is a constant defined elsewhere (pixels per meter), set to 8. All this is made by LibGDX:

                public void setPhys (World w) {
if (this.block! = 0) {
this.bdef = new BodyDef ();
NovaLog.debug ("bdef.position.set (" + (this.aabb.x / PPM) + "," + (this.aabb.y / PPM) + ");");
bdef.position.set (this.aabb.x / PPM, this.aabb.y / PPM);
bdef.type = BodyType.StaticBody;
this.body = w.createBody (bdef);

PolygonShape form = new PolygonShape ();
NovaLog.debug ("shape.setAsBox (" + ((this.aabb.width / PPM) / 2) + +, "+ ((this.aabb.height / PPM) / 2) +"); ");
shape.setAsBox ((this.aabb.width / PPM) / 2, (this.aabb.height / PPM) / 2);
this.fdef = new FixtureDef ();
this.fdef.shape = form;
this.fixture = this.body.createFixture (fdef);
this.fixture.setUserData (this);
}
}

And the merge code of the quadnode class (maybe some problems here, I do not even know anymore).

protected Boolean merge () {

// The sheets are already merged!
if (this.isLeaf ()) {returns true;}

boolean canMerge = true;
// If we have child nodes, try to merge them.
if (c[0] ! = null) {if (! c[0].merge ()) {NovaLog.debug ("NW can not merge."); canMerge = false;}}
if (c[1] ! = null) {if (! c[1].merge ()) {NovaLog.debug ("Can not merge."); canMerge = false;}}
if (c[3] ! = null) {if (! c[3].merge ()) {NovaLog.debug ("SW can not merge."); canMerge = false;}}
if (c[2] ! = null) {if (! c[2].merge ()) {NovaLog.debug ("SE can not merge."); canMerge = false;}}

// If the nodes are not leaf nodes and we can not merge them, return false.
if (canMerge == false) {NovaLog.debug ("Unable to merge children."); returns false; }

// we should be able to try to merge this node.
if (c[0].data.equalTo (c[1].data) && c[3].data.equalTo (c[2].data) && c[0].data.equalTo (c[3].The data)) {
// The data is the same, WE CAN MERGE.
this.data.block = c[0].data.block;
this.c[0] = null;
this.c[1] = null;
this.c[3] = null;
this.c[2] = null;
//this.setFixture ();
NovaLog.debug ("Merge Success ->" + this.toString ());
return true;
} other {
// The data are not identical, we can not merge!
NovaLog.debug ("Data not identical -");
for (int x = 0; x <4; x ++) {NovaLog.debug ("" + c[x].data.block);} return false;
}
}

At this point, I'm a Westworld host watching something that could hurt his psyche – "It's nothing like me." Help me please – the bruise on my forehead that hits my head against the wall enlarges.

algorithms – Can I merge them with standard STL C ++ cards?

I was wondering if it was possible to merge standard STL cards into O (log (n)) with the help of DSU Tip.

For example, Map a = {{1,2}, {3,2}, {4,3}}, Map b = {{2,3}, {3,2}, {4,1}} and Map c = {{2,1}, {3,2}, {4,4}}

The resulting map will then be: {{1,2}, {2,4}, {3,6}, {4,8}}

If this is not achievable by DSU, is there another algorithm to achieve this in the complexity O (logn)?

Here, n is the number of cards and the sum of the sizes of all cards is 10 ^ 5.
n can go from 1-10 ^ 5.

r – Merge the rows of a data frame according to the column

I am a beginner in the world of programming and I find this problem:
I have a database on patients and diseases and the goal is to find models to predict the disease. To be able to use arules, I understand that the first thing to do is to organize the data block. Here is the structure (there are 9700 patients and 35 different diagnoses):

Patient pathology

1 sarcopenia

1 obesity

2 sarcopenia

2 lupus

2 pain

I want to group all the diagnoses of each patient so that the structure becomes the following:

Patient pathology

1 sarcopenia, obesity

2 Sarcopenia, Lupus, Pain

In this way, I could later create a matrix of this type:

Sarcopenia Patient Obesity Pain Lupus
1 1 1 0 0
2 1 0 1 1  

I have tried the following code and I get an error message that I do not understand.

Sarcopenia_PatientSymptoms%>% group_by (PatientID)%>% summary_all (list (paste, paste (., Collapse = "")))))

Error in get (.x, .env, mode = "function"): Variable names are limited to 10,000 bytes.

Could someone help me?

Thanks in advance

Magento Cloud: resolve the merge conflict

I am working on a project based on Magento Commerce Cloud.

I'm trying to synchronize the master's code to the middle branch, but I'm getting a message of failure. And when I look at the logs, I see a merging conflict with some files.

Can any one please guide on how can i solve this problem

Thank you!

hyper v – Merge VHDS checkpoint files that do not merge

I have a VHDS file from which I took a checkpoint, but I can not merge the checkpoint file. I have tried the GUIs (Hyper-V Manager -> Edit Disk) and Powershell (Merge-VHD), to no avail. This gives the error "If the merge succeeds, the system will still not be able to delete the file".

This is a Server 2016 Hyper-V failover cluster and the VHDS is shared between a Server 2016 failover cluster file server role. This VHDS has a capacity of 20 TB and is currently located around 10TB, with a 500GB checkpoint file.

I had the same problem with a couple of smaller VHDS files. I ended up converting the main avhdx file to a VHDX file, and then I created a new VHDS file and selected the option to copy the contents of the new VHDX file. This file is so large that the conversion and the new VHDS file would take 24 hours. I would prefer not to have that kind of time off.

Does anyone know a better way to accomplish this without these two long steps? I've read that avhdx is very similar to a standard VHDX. Would it be risky (in terms of data corruption) to rename this file to VHDX and create a new VHDS from this VHDX?

List Manipulation – Merge Two Lines by Rounding Up Their First Elections

lst = {{-0.410927, {{11, 16}, {12, 16}, {15, 5}, {15, 6}}},
{-0.41, {{11, 16}, {12, 16}, {15, 5}, {15, 6}}},
{-0.45123, {{11, 16}, {12, 16}, {15, 5}, {15, 6}}},
{-0.410927, {{9, 14}, {10, 14}, {13, 7}, {13, 8}}}};

Values ​​@ GroupBy[lst,  Round[First@#, .001] &, {#[[1, 1]], Join @@ #[[All, 2]]} &]

{{-0.410927, {{11, 16}, {12, 16}, {15, 5}, {15, 6}, {9, 14}, {10,
14}, {13, 7}, {13, 8}}},
{-0.41, {{11, 16}, {12, 16}, {15,
5}, {15, 6}}},
{-0.45123, {{11, 16}, {12, 16}, {15, 5}, {15,
6}}}}

Values ​​@ GroupBy[lst,  Round[First@#, .01] &, {#[[1, 1]], Join @@ #[[All, 2]]} &]

{{-0.410927, {{11, 16}, {12, 16}, {15, 5}, {15, 6}, {11, 16}, {12,
16}, {15, 5}, {15, 6}, {9, 14}, {10, 14}, {13, 7}, {13,
8}}},
{-0,45123, {{11, 16}, {12, 16}, {15, 5}, {15, 6}}}}

formulas – How to import / merge data from 2 separate sheets from another worksheet

I need to import data from "Spreadsheet A" into "Spreadsheet B" but all data is in two separate sheets "MY" and "NY" in "Spreadsheet A".

I basically need this, but with a function to import from another worksheet, not just in the same

= QUERY ({{ARRAYFORMULA (ROW (INDIRECT), "A1: A" & COUNTA (QUERY (MY! A2: A; "select A if A is not null"),)))))  QUERY (MY! A2: A; "select A where A is not zero")}; {ARRAYFORMULA (ROW (INDIRECT ("A1: A" ") & COUNTA (QUERY (NY! A2: A;" choice of A - where A is not zero ")))))  QUERY (NY! A2: A; "select A where A is not zero")}}; "select Col2 order by Col1")