parent-child

How to find position number of a certain child element in a parent element using jQuery

Hi. I have a div containing several other divs containing an image. It looks smth like this <div id="parentHldr"> <div class="imgHldr"><img src="foo/bar.png" id="1"></div> <div class="imgHldr"><img src="foo/bar.png" id="2"></div> <div class="imgHldr"><img src="foo/bar.png" id="3"></div> <div class="imgHldr active"<img src="foo/bar....

Hibernate parent-child modeling

I have a Model class. This class should be able to reference itself, i.e. the resulting "output" from the model should be like this. Some instanceOf Model.class |-> Some instanceOf Model.class having parent instance referenced as parent_id |-> Some instanceOf Model.class having ........... The instances represent geographical enti...

Select which handles are inherited by child process.

When creating a child process in C++ using Windows API, one can allow inheritance of handles from parent to child. In a Microsoft example "Creating a Child Process with Redirected Input and Output", redirecting a child process' std in/out to pipes created by the parent, it is necessary to allow inheritance for the redirection pipes to be...

Terminate all (grand)children when terminating a child process

I will jump right in, to be brief and descriptive: C++, Windows API I am creating child processes using CreateProcess to run external (command-line) applications. I have built in a time-out, and if the child process has not returned normal execution by that time, I wish to force termination on that child process. Ideally, I would lik...

PHP: Recursively get children of parent

I have a function which gets the ids of all children of a parent from my DB. So, if I looked up id 7, it might return an array with 5, 6 and 10. What I then want to do, is recursively find the children of those returned ids, and so on, to the final depth of the children. I have tried to write a function to do this, but I am getting co...

Help with generating a report from data in a parent-children model

Hi, I need help with a problem regarding data saved in a parent-children model table and a report I need to build upon it. I've already tried searching for topics about parent-children issues, but I couldn't find anything useful in my scenario. What I have A Microsoft SQL Server 2000 database server. A categories table, which has four...

Disallow an element to be a child of itself in XML Schema

Hi! Im writing a XML schema for a project. I cannot solve following problem: A element cannot be nested by itself, ex: <document> <text> <b> <i> <a link="http://wikipedia.org"&gt; <b /> </a> </i> </b> </text> </document> This example shouldn't be allow becaus...

assign value from parent class. easy

How do something like that: Class Car: string Name, int year Class SUV:Car; SUV bmw=ToCar(car); Something like that ?? public object ToObject(Type type, Car car) { // here i just wanna take string and int pool } I did something like: List<Car> cars=new List<Car> SUV suv=new SUV(); cars.Add(suv). And next I want: SUV suv=(Suv...

Class reference to parent

Hi, i'm pretty new at using C++ and I'm actually stopped at a problem. I have some class A,B,C defined as follow (PSEUDOCODE) class A { ... DoSomething(B par1); DoSomething(C par1); ... } class B { A parent; ... } class C { A parent; ... } The problem is : How to make this? If I simply do it (as I've always done in c...

I need to change a variable in the parent from the child in actionscript 3.

I am new at actionscript 3. I want to change a variable set to 0 in the parent to 1 when a button in the child is clicked. This is the parent zero.swf: var noPass:Number=0; function getPass(event:onLoad, noPass):void { if(noPass==0) { var passRequest:URLRequest=new URLRequest("PasswordPage.swf"); var passLoader:Lo...

Absolute element inheriting relative parent div's width

I am trying to position a gradient over an inline / inline-block anchor link, and have that gradient inherit the width of that parent anchor. The problem is that the span either inherits the entire width of the anchor's parent, or just the width of the &nbsp;. I am unable to get the span element to properly inherit the width while mainta...

NHibernate. Initiate save collection at saving parent

Hello, colleagues. I've got a problem at saving my entity. MApping: ?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Clients.Core" namespace="Clients.Core.Domains"> <class name="Sales, Clients.Core" table='sales'> <id name="Id" unsaved-value="0"> ...

Creating a child process on Unix systems?

I'm trying to create a child process in another process. I am writing both the programs in C language. First I write a dummy process which will be the child process. What it is doing is only to write a string on the screen. It works well on its own. Then I write another program which will be the parent process. However, I can't make it h...

How to detect defunct processes on Linux?

I have a parent and a child process written in C language. Somewhere in the parent process HUP signal is sent to the child. I want my parent process to detect if the child is dead. But when I send SIGHUP, the child process becomes a zombie. How can I detect if the child is a zombie in the parent process? I try the code below, but it does...

Element is already the child of another element.

I get the folowing error in my Silverlight application. But i cant figure out what control it is that is the problem. If i debug it don't break on anything in the code, it just fails in this framework callstack with only framework code. Is there any way to get more information on what part of a Silverlight app that is the problem in this...

Nature of Lock is child table while deletion(sql server)

Dear Devs From couple of days i am thinking of a following scenario Consider I have 2 tables with parent child relationship of kind one-to-many. On removal of parent row i have to delete the rows in child those are related to parents. simple right? i have to make a transaction scope to do above operation i can do this as following; (i...

Fastest way of creating XML from parent-child table in c#?

Assume we have some DataTable or IEnumerable with ChildID, ParentID and Title. We need to serialize it to XML like <Entity title=""> <Entity title=""></Entity> <Entity title=""></Entity> </Entity> As i found out, standard DataTable.GetXML() returns something different. I thought about initializing class tree like Entity e = n...

How to implement parent-child windows and pass values from child to parent?

I am working on an ASP.NET MVC 2 application. In one of my data entry forms, I have an "employer" field which has a "search" link next to it. When a user clicks on this link, another window is opened with a search form. The user uses the search form to search for the correct employer. A list of employers is shown to the user. Currently,...

C# - Close a child form from parent

I have a parent form and a child form. I need to open the child form at the beginning of a method, do some pretty intensive tasks and then close the child form upon completion. Here is basically what I've tried so far (with no luck): Parent Form: Child child = new Child(); Method() { child.ShowDialog(); //Method code here ...

Hibernate GenericDAO for parent/child relationships and DAO/DTO patterns

Hi, I'm looking for a Generic DAO implementation in Hibernate that includes parent/child relationship management (adding, removing, getting children, setting parents, etc). Actually the most used generic DAO on the web is the one I found on jboss.org. And also, i was looking for some DAO/DTO sample implementations and design pattern...