Questions tagged [parent-child]

A relationship between entities in which one acts in a major role and the other in a minor role. Also an inheritance relationship paradigm.

In software, a parent-child relationship may involve ownership and/or containership semantics.

Ownership usually makes allocation, initialization, and destruction of child nodes the responsibility of the parent node.

Containership in a visual system often makes rendering, coordinate systems, clipping, and z-order of the child nodes the responsibility of the parent node.

For Object Oriented inheritance the parent is the base class and the child is the derived class.

A C++ example of a parent class: A and a child class: B:

class A{};

class B : public A{};
5263 questions
68
votes
3 answers

Height of parent div is zero even if it has child with finite heights

I have a website whose layout has been shown in the diagram. The body consists of a main container, which comprises of header, parent div and footer. The parent div further contains several child div as shown. The problem being height of all the…
Prashant Singh
  • 3,725
  • 12
  • 62
  • 106
66
votes
6 answers

How to specify the parent query field from within a subquery in MySQL?

How do I specify the parent query field from within a subquery in MySQL? For Example: I have written a basic Bulletin Board type program in PHP. In the database each post contains: id(PK) and parent_id(the id of the parent post). If the post is…
justinl
  • 10,448
  • 21
  • 70
  • 88
58
votes
7 answers

get parent's view from a layout

I have a FragmentActivity with this layout:
Salvatore Ucchino
  • 717
  • 1
  • 8
  • 17
57
votes
1 answer

Are child processes created with fork() automatically killed when the parent is killed?

I'm creating child processes with fork() in C/C++. When the parent process ends (or is killed for some reason) I want all child processes to be killed as well. Is that done automatically by the system? Or I have to do it myself? Pre-existing…
GetFree
  • 40,278
  • 18
  • 77
  • 104
57
votes
6 answers

Why is forEach not working for children?

I have a
with some child
in it. E.g.
I tried to loop through them with the forEach function, because I thought that…
erik
  • 2,278
  • 1
  • 23
  • 30
53
votes
6 answers

Selecting second children of first div children in javascript

I have an html that look something like this:
<-- I have this
<-- I need to get this
i am using: var mainDiv =…
James Harzs
  • 1,853
  • 5
  • 21
  • 30
52
votes
13 answers

How do I pass a value from a child back to the parent form?

How do I pass a value from a child back to the parent form? I have a string that I would like to pass back to the parent. I launched the child using: FormOptions formOptions = new FormOptions(); formOptions.ShowDialog();
Jayne M
52
votes
6 answers

How can I rename files with Grunt, based on the respective file's parent folder name?

I have a the following structure: src/ modules/ module1/ js/ main.js scss/ main.scss index.html module2/ js/ main.js …
keirog
  • 2,158
  • 1
  • 19
  • 17
46
votes
1 answer

Search on descendants of an element

With protractor whats the best way to select child elements? Say we have the layout below...
Red
Blue
Red
Brad8118
  • 4,672
  • 11
  • 36
  • 48
45
votes
5 answers

JPA @OneToMany -> Parent - Child Reference (Foreign Key)

i have a Question about referencing ParentEntities from Child Entites ir If i have something like this: Parent.java: @Entity(name ="Parent") public class Parent { @Id @Generate..... @Column private int id; @OneToMany(cascade…
Sim0rn
  • 632
  • 1
  • 6
  • 9
45
votes
8 answers

Start new process, without being a child of the spawning process

How would I go about starting a new process without it being the child of the calling process. Example: Main Program (Caller.exe) process.start("file.exe") Image:
Andrew Paglusch
  • 767
  • 1
  • 7
  • 17
38
votes
14 answers

FormStartPosition.CenterParent does not work

In the following code, only the second method works for me (.NET 4.0). FormStartPosition.CenterParent does not center the child form over its parent. Why? Source: this SO question using System; using System.Drawing; using…
kol
  • 27,881
  • 12
  • 83
  • 120
36
votes
2 answers

three.js - mesh group example? (THREE.Object3D() advanced)

I'm attempting to understand how to group / link child meshes to a parent. I want to be able to: drag the parent rotate child elements relative to the parent have parent rotation / translation do the right thing for children My only background in…
Daniel Smith
  • 535
  • 1
  • 5
  • 10
36
votes
1 answer

When exactly is component destroyed?

In Angular 2 with Ahead-of-Time (AOT) compiling, I have a parent component and a child component, like this:

I am a parent

I know that the child template is inserted to the DOM…
gye
  • 1,374
  • 3
  • 16
  • 27