Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

Page 70/257 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • Auto height and the float issue.

    - by William Hand
    I have had this issue before and can't remember if and how I fixed it. I have to create a scenario where I have 2 DIV's floated left and right inside a parent DIV. The 2 floating DIV's have height:auto, but the parent ignores them (perfectly logical) and the background of the parent DIV can't be seen. I know what the issue is, but are there any suggestions of how to solve it? Or any alternatives, I am willing to try a new approach. Thanks in advance for any help.

    Read the article

  • IPhone CoreData: How should I relate many child entities to thier parents

    - by Robert
    I am trying to import data from a database that uses primary key / forign key relations to a core data database in Xcode. I have code that creates hundreds of child entities in a managed object context: Each child has an ID that corresponds to a parent. child1 parentID = 3 child2 parentID = 17 child3 parentID = 17 ... childn parentID = 5 I now need to relate each child to its parent. The parents are all stored in persistent memory. My first thought was to preform a fetch for each child to get its parent. However, I think this would be slow. Am I correct? How should I do this instead?

    Read the article

  • NHibernate FetchMode

    - by Sandra
    Hi All, I have an object Parent which has a list of Children: class Parent {Id, Name, IList children} class Child {Id, Name} I need to select all parents where there is a condition for their children but I do not want to get duplicate rows (don't want the children details to appear in select list) Here is the code: session.CreateCriteria(typeof(Parent)) .SetFetchMode("children", FetchMode.Select); .CreateCriteria("children").Add(Subqueries.PropertyIn("Id", {1,2,3,4})) .List(); The query adds all proprties of child class to select list which results in duplicate Parents. Is there any way I can select all parents without having the child details in the select list? Thanks

    Read the article

  • What to do if exec() fails?

    - by Grigory
    Let's suppose we have a code doing something like this: int pipes[2]; pipe(pipes); pid_t p = fork(); if(0 == p) { dup2(pipes[1], STDOUT_FILENO); execv("/path/to/my/program", NULL); ... } else { //... parent process stuff } As you can see, it's creating a pipe, forking and using the pipe to read the child's output (I can't use popen here, because I also need the PID of the child process for other purposes). Question is, what should happen if in the above code, execv fails? Should I call exit() or abort()? As far as I know, those functions close the open file descriptors. Since fork-ed process inherits the parent's file descriptors, does it mean that the file descriptors used by the parent process will become unusable?

    Read the article

  • crash in the handler that moves up a treenode in a treeview c#

    - by voodoomsr
    i have a event handler that moves the selected treenode up. I don't know why is crash in the line with comented. treeviewdocxml is a treeview object, from System.Windows.Forms treeViewDocXml.BeginUpdate(); TreeNode sourceNode = treeViewDocXml.SelectedNode; if (sourceNode.Parent == null) { return; } if (sourceNode.Index > 0) { sourceNode.Parent.Nodes.Remove(sourceNode); sourceNode.Parent.Nodes.Insert(sourceNode.Index - 1, sourceNode); //HERE CRASH } treeViewDocXml.EndUpdate();

    Read the article

  • How to know if a std::list has been modified

    - by Nick
    I have this class: class C { public: C* parent; std::list<C> children; }; I can use this class in this way for example: C root; C child; root.children.push_back(child); // or other method of std::list (es: push_front, insert, ...) // Here child.parent is root // How can I set the parent of child? I want to do this work internally to my class without losing the functionality of std::list, is it possible?

    Read the article

  • find() or children() to search top-level children only for a style?

    - by user291701
    Hi, I'd like to find if a child element exists which has either of two class styles applied. My code looks like this: var listOfMatchedResults = $("#parentList").find(".myStyle1, .myStyle2"); My styles are defined like this: .parent li, .myStyle0 { } .parent li.myStyle1 { } .parent li.myStyle2 { } I don't need to traverse more than one level deeper than the children level, like: <ul id='parentList'> <li><p>foo</p><p>grok</p></li> <li class='myStyle2'><p>Here</p><p>I am!</p></li> <li><p>foo</p><p>grok</p></li> </ul> I'm not clear as to what find() is doing, is it going into each of the paragraph elements too? I just need it to traverse the top-level children - is there a way to specify that? Thank you

    Read the article

  • What to use to wait on a indeterminate number of tasks?

    - by Scott Chamberlain
    I am still fairly new to parallel computing so I am not too sure which tool to use for the job. I have a System.Threading.Tasks.Task that needs to wait for n number number of tasks to finish before starting. The tricky part is some of its dependencies may start after this task starts (You are guaranteed to never hit 0 dependent tasks until they are all done). Here is kind of what is happening Parent thread creates somewhere between 1 and (NUMBER_OF_CPU_CORES - 1) tasks. Parent thread creates task to be run when all of the worker tasks are finished. Parent thread creates a monitoring thread Monitoring thread may kill a worker task or spawn a new task depending on load. I can figure out everything up to step 4. How do I get the task from step 2 to wait to run until any new worker threads created in step 4 finish?

    Read the article

  • Show a django relationship in a template

    - by kevin_82
    I have a django model as follows: class Person(models.Model): name = models.CharField(max_length=255) class Relationship(models.Model): parent = models.ForeignKey(Person) child = models.ForeignKey(Person) description = models.TextField(blank=True) In my view, I pass a certain person, and the relationships in which he/she is parent: person = Person.objects.filter(name ='some name') descendant_relationships = Relationship.objects.filter(parent = person) An I want to show this person's descendants in a list in a template: <ul> {% for item in descendant_relationships%} <li> {{item.child.name}} - {{item.description}} </li> {% endfor %} </ul> But this template code will not show the children of children (i.e. grandchildren, great-grandchildren etc.). How can I get these lower level descendants to show up? I imagine recursion is necessary somewhere, but where?

    Read the article

  • Java combine parents of two large inheritance chains

    - by Soylent Green
    I have two parent classes in a huge project, let's say ClassA and ClassB. Each class has many subclasses, which in turn have many subclasses, which in turn have many subclasses, etc. My task is to "marry" these two "families" so that both inherit from a SINGLE parent. I need to essentially make ClassA and ClassB one class (parent) to both of their combined subclasses (children). ClassA and ClassB both currently implement Serializable. I am currently trying to make both inheritance chains inherit from ClassA, and then copy all functions and data members from ClassB into ClassA. This is tedious, and I think a terrible solution. What would be the CORRECT way to solve this problem?

    Read the article

  • ManyToManyField error when having recursive structure. How to solve it?

    - by luc
    Hello, I have the following table in the model with a recursive structure (a page can have children pages) class DynamicPage(models.Model): name = models.CharField("Titre",max_length=200) parent = models.ForeignKey('self',null=True,blank=True) I want to create another table with manytomany relation with this one: class UserMessage(models.Model): name = models.CharField("Nom", max_length=100) page = models.ManyToManyField(DynamicPage) The generated SQL creates the following constraint: ALTER TABLE `website_dynamicpage` ADD CONSTRAINT `parent_id_refs_id_29c58e1b` FOREIGN KEY (`parent_id`) REFERENCES `website_dynamicpage` (`id`); I would like to have the ManyToMany with the page itself (the id) and not with the parent field. How to modify the model to make the constraint using the id and not the parent? Thanks in advance

    Read the article

  • How to create a nested form in backbone relational?

    - by jebek
    I would like to be able to create nested models at the same time in backbone. I know how to use backbone relational to create the parent model. Then once it is saved, I can create child models through backbone relational. However, I want to be able to create both the parent and child models at the same time, which might not be possible because I can only create the child model once the parent model has already been created. For example, let's say I was creating a forum like the one from the awesome backbone relational tutorial - http://antoviaque.org/docs/tutorials/backbone-relational-tutorial/. I would want to create a thread and a message at the same time(through the click of a single button) rather than create a thread then a message. Is this possible? Is there a better way of doing this that I'm not thinking of?

    Read the article

  • Working by group by for grouping data into string format

    - by Shantanu Gupta
    I have a table that contains some data given below. It uses a tree like structure i.e. Department SubD1, SubD2 ..... PreSubD1, PreSubD1... PreSubD2, PreSubD2... pk_map_id preferences ImmediateParent Department_Id -------------------- -------------------- -------------------- -------------------- 20 14 5 1 21 15 5 1 22 16 6 1 23 9 4 2 24 4 3 2 25 24 20 2 26 25 20 2 27 23 13 2 I want to group my records on behalf of department then immediate parent then preferences each seperated by ',' i.e. department Immediate Parent preferences 1 5,6 14,15,16 2 4,3,20,13 9,4,24,25,23 and this table also Immediate parent preferences 5 14,15 6 16 4 9 3 4 20 24,25 13 13 In actual scenario all these are my ids which are to be replaced by their string fields. I am using sql server 2k5

    Read the article

  • Using Java, can I have one JVM spawn another, and then have the original one exit?

    - by CarlG
    I have a need to have a running JVM start another JVM and then exit. I'm currently trying to do this via Runtime.getRuntime().exec(). The other JVM starts, but my original JVM won't exit until the "child" JVM process stops. It appears that using Runtime.getRuntime().exec() creates a parent-child relationship between the processes. Is there some way to de-couple the spawned process so that the parent can die, or some other mechanism to spawn a process without any relationship to the creating process? Note that this seems exactly like this question: http://stackoverflow.com/questions/2566502/using-java-to-spawn-a-process-and-keep-it-running-after-parent-quits but the accepted answer there doesn't actually work, at least not on my system (Windows 7, Java 5 and 6). It seems that maybe this is a platform-dependent behavior. I'm looking for a platform independent way to reliably invoke the other process and let my original process die.

    Read the article

  • Overriding vs Virtual

    - by anonymous
    What is the purpose of using the reserved word virtual in front of functions? If I want a child class to override a parent function, I just declare the same function such as "void draw(){}". class Parent{ public: void say(){ std::cout << "1"; }}; class Child : public Parent{public:void say(){ std::cout << "2"; } }; int main() { Child* a = new Child(); a->say(); return 0; } The output is 2. So again, why would the reserved word "virtual" be necessary in the header of say() ? Thanks a bunch.

    Read the article

  • Problem TreeView OnTreeNodePopulate event

    - by purnang.advant
    Hi. I am using a treeview in asp.net 3.5(using c#.net),which is populated from sqldatabase. OnTreeNodePopulate event fires this event, protected void tvLabs_TreeNodePopulate(object sender, System.Web.UI.WebControls.TreeNodeEventArgs e) { PopulateSubLevelLab(e.Node.Value, e.Node); //This function is used for populating the child node. FillLabGrid(e.Node.Value);---My Question? } ---My Question? The FillLabGrid method used for fill a grid view on the basis of selecting the treeview parent node. But this function filled the grid only once when i click the parent node for the first time. Secondly when i collapse the treeview and again click on the parent node function (tvLabs_TreeNodePopulate)is not called? Hope you are getting my point. Please advice me. Thanks in advance.

    Read the article

  • Iterating Through a jQuery Object Array

    - by DeltaFox
    I know this has been asked and answered a couple times already, but I'm still confused about how to reference the current object when iterating over a jQuery array. For example, the following code gives me the error "TypeError: genH3Array[i].next is not a function". What is the right way to reference the current array object? var genH3Array = $('#Generation_II').parent(); genH3Array.push($('#Generation_III').parent());; genH3Array.push($('#Generation_IV').parent()) $.each(genH3Array, function(i, value) { if(genH3Array[i].next().attr("align") == "center") { genH3Array[i].next().next().next().insertBefore(heading.next()) } genH3Array[i].next().next().insertBefore(heading.next()) genH3Array[i].next().insertBefore(heading.next()) })

    Read the article

  • jQuery .toggle() not working as expected with second function?!

    - by Christopher
    I'm trying to create a button to show / hide a div below it, all is working fine, I'm just struggling with the last bit! I need to distinguish wether it's a show or hide action so I can pass the variable elsewhere, here's what I have.. $(this).find('.hide-close').click( function() { $(this).siblings('.dragbox-content').toggle(function() { alert($(this).parent().attr("id") + ' Show'); },function() { alert($(this).parent().attr("id") + ' Hide'); } ); }) .end() }); If use the following code, taking out the second function within toggle(), it works?! But then I don't have a show / hide variable. $(this).find('.hide-close').click( function() { $(this).siblings('.dragbox-content').toggle(function() { alert($(this).parent().attr("id") + ' Show'); } ); }) .end() }); Thanks in advance for any help, hopefully it's something really simple I just can't see! :)

    Read the article

  • will destroyed() be emitted if the constructor of a class derived from QObject throws?

    - by PorkyBrain
    Ive seen Qt GUI syntax like the following all over the place: myDialog::myDialog(QWidget *parent, Qt::WFlags flags):QDialog(parent, flags) { QPushButton *button = new QPushButton("&Download", this); QVBoxLayout *layout = new QVBoxLayout(this); //something that can throw here layout ->addWidget(button ); setLayout(layout); } I've always wondered if this can leak in the event of an exception because the "this" I'm giving as a parent to button and layout is not fully constructed so it might not destroy its children. I tried it out in MSVC2010 Qt4.8.3 and it looks like as soon as the base QObject class is fully created (which is done first of course) it is ok to pass "this" to other objects in the constructor, they will destroyed correctly. I haven't found the spot in the Qt docs guaranteeing this though, can someone point me to it so I have assurance that this will not change in the future?

    Read the article

  • PHP inheriting/extending a particular instance of an Object

    - by delta9
    Is there any way to force PHP to extend an existing/particular (and for that matter, already instantiated) instance of an object? This imaginary code should explain what I am wondering: class Base { public $var; function __construct($var){ $this->var = $name; } } class Extender extends Base { function __construct($parent) { parent = $parent; } } $base = new Base('yay!'); $extender = new Extender($base); echo 'Extended base var value: '.$extender->var.'<br/>'; Output (would be): Extended base var value: yay! To be clear, I am wanting to instantiate an object that extends a PARTICULAR INSTANCE of another object, one that has already been instantiated. I am aware that I can pass a reference to an object to another object (via it's constructor function) and then add it as a property of the receiving object, I'm wondering if there is a real way to do this?

    Read the article

  • problem getting a form image background

    - by Deumber
    I'm creating a datagridview transparent //I got the parent background image Bitmap parentBackGround = new Bitmap(this.Parent.BackgroundImage); //Set the area i want to create equal to the size of my grid Rectangle rect = new Rectangle(this.Location.X, this.Location.Y, this.Width, this.Height); //And draw in the entire grid the area of the background image that is cover with my grid, making a "transparent" effect. graphics.DrawImage(parentBackGround.Clone(rect, PixelFormat.Format32bppRgb), gridBounds); When the backgroundimage of the grid's parent is show in an normal layout all work ok, but if the layout is stretch, center or any other, the transparency effent gone, have you any idea to fix it?

    Read the article

  • how can i resize font of div by resizing the div using jQuery?

    - by chirag
    Hello every one can any one help me out please? by using this code my font size is go beyound the size of parent div here $(divid).resizable({ maxHeight: parseInt(200), maxWidth: parseInt(180), resize: function(event, ui) { var width1 = parseInt(ui.element.css('width')); var height1 = parseInt(ui.element.css('height')); ui.element.css({'font-size': width1+'px'}); ui.element.css({'line-height': height1+'px'}); } }); where 'divid' is parent div where child div is present to fire resizing event of font, but i don't want font size go beyond the parent div, text is also not hidden.. can you please help me out???

    Read the article

  • Find the clicked li number

    - by fire
    I have a standard list... <ul> <li><a href="#">blah 1</a></li> <li><a href="#">blah 2</a></li> <li><a href="#">blah 3</a></li> <li><a href="#">blah 4</a></li> </ul> And my jQuery: $('ul li a').live('click', function() { var parent = $(this).parent('li'); }); What I want to find out is the parent li's position in the list of the clicked link e.g. clicking on blah 3 would give me 2, blah 4 would give 3 etc. Any ideas?

    Read the article

  • Small questions on data structure

    - by John Graveston
    Hi, I'm trying to search the parent of a node with Kruskal's algorithm. My program works just fine, but I think I have heard of a method to improve the speed of the algorithm by reconstructing the tree while searching for the parent node and connecting it to the parent node. I'm pretty sure that I've heard of this somewhere, maybe in a lecture. Can anyone refresh my memory? And also, given a number of arrays, when searching for the minimum and the maximum value from a certain section of an array, what is the name of the tree that can calculate the minimum/maximum value from the array by making a binary tree that has the minimum/maximum value of each array in O(log N)?

    Read the article

  • Abstract class get parameter from implementing subclass?

    - by soren.qvist
    I'm wondering if there is way to do this without breaking encapsulation, I want the abstract class to rely on parameters defined in the implementing subclass. Like so: public abstract class Parent { private int size; private List<String> someList; public Parent() { size = getSize(); someList = new ArrayList<String>(size); } public abstract int getSize(); } public class Child extends Parent { @Override public int getSize() { return 5; } } Is this ugly? Is there a better way? And perhaps more importantly, is this even a good idea?

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >