Search Results

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

Page 34/257 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • How to select parent object of a hyperlink whose href match the requested page/file name using jQuer

    - by ARS
    How to select parent object of a hyperlink whose href match the requested page/file name using jQuery? I have following code <div> <div class="menu-head"> <a href="empdet.aspx">employees</a> <a href="custdet.aspx">customers</a> </div> <div class="menu-head"> <a href="depdet.aspx">departments</a> </div> <div> I want a Jquery to change the color of the parent div corresponding a hyperlink. If the user is browsing custdet.aspx the respective parent div background should be changed to red. Edit: I have a method to retrieve the file name. I just need the right selector to select the parent.

    Read the article

  • How to call function on parent page from iframe using jQuery?

    - by Michael
    I have an upload form that posts to a hidden iframe. I am attempting to call a function on the parent page from the iframe, but am getting the error "top.stopUpload is not a function". What is the correct way to do this? PARENT PAGE: $(document).ready(function() { $('#document_upload').submit( function() { $('#upload_progress').show(); }); function stopUpload(success){ if (success == 1){ $('#result', window.parent.document).html( '<span class="msg">The file was uploaded successfully!<\/span>'); } else { $('#result', window.parent.document).html( '<span class="emsg">There was an error during file upload!<\/span>'); } $('#upload_progress').hide(); return true; } }) IFRAME: $(document).ready(function() { top.stopUpload(<?php echo $result; ?>); }

    Read the article

  • How do I stop IE6 clipping an element positioned outside its parent via negative margins?

    - by Paul D. Waite
    I have an element positioned outisde its parent via negative margins, like this: <style> .parent { height: 1%; } .element { float: left; margin-left: -4px; } </style> ... <div class="parent"> <div class="element">Element</div> </div> In Internet Explorer 6, the part of .element positioned outside of its parent element is clipped, i.e. invisible, hidden, cut off. How do I fix this?

    Read the article

  • Fluent NHibernate: mapping complex many-to-many (with additional columns) and setting fetch

    - by HackedByChinese
    I need a Fluent NHibernate mapping that will fulfill the following (if nothing else, I'll also take the appropriate NHibernate XML mapping and reverse engineer it). DETAILS I have a many-to-many relationship between two entities: Parent and Child. That is accomplished by an additional table to store the identities of the Parent and Child. However, I also need to define two additional columns on that mapping that provide more information about the relationship. This is roughly how I've defined my types, at least the relevant parts (where Entity is some base type that provides an Id property and checks for equivalence based on that Id): public class Parent : Entity { public virtual IList<ParentChildRelationship> Children { get; protected set; } public virtual void AddChildRelationship(Child child, int customerId) { var relationship = new ParentChildRelationship { CustomerId = customerId, Parent = this, Child = child }; if (Children == null) Children = new List<ParentChildRelationship>(); if (Children.Contains(relationship)) return; relationship.Sequence = Children.Count; Children.Add(relationship); } } public class Child : Entity { // child doesn't care about its relationships } public class ParentChildRelationship { public int CustomerId { get; set; } public Parent Parent { get; set; } public Child Child { get; set; } public int Sequence { get; set; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; var other = obj as ParentChildRelationship; if (return other == null) return false; return (CustomerId == other.CustomerId && Parent == other.Parent && Child == other.Child); } public override int GetHashCode() { unchecked { int result = CustomerId; result = Parent == null ? 0 : (result*397) ^ Parent.GetHashCode(); result = Child == null ? 0 : (result*397) ^ Child.GetHashCode(); return result; } } } The tables in the database look approximately like (assume primary/foreign keys and forgive syntax): create table Parent ( id int identity(1,1) not null ) create table Child ( id int identity(1,1) not null ) create table ParentChildRelationship ( customerId int not null, parent_id int not null, child_id int not null, sequence int not null ) I'm OK with Parent.Children being a lazy loaded property. However, the ParentChildRelationship should eager load ParentChildRelationship.Child. Furthermore, I want to use a Join when I eager load. The SQL, when accessing Parent.Children, NHibernate should generate an equivalent query to: SELECT * FROM ParentChildRelationship rel LEFT OUTER JOIN Child ch ON rel.child_id = ch.id WHERE parent_id = ? OK, so to do that I have mappings that look like this: ParentMap : ClassMap<Parent> { public ParentMap() { Table("Parent"); Id(c => c.Id).GeneratedBy.Identity(); HasMany(c => c.Children).KeyColumn("parent_id"); } } ChildMap : ClassMap<Child> { public ChildMap() { Table("Child"); Id(c => c.Id).GeneratedBy.Identity(); } } ParentChildRelationshipMap : ClassMap<ParentChildRelationship> { public ParentChildRelationshipMap() { Table("ParentChildRelationship"); CompositeId() .KeyProperty(c => c.CustomerId, "customerId") .KeyReference(c => c.Parent, "parent_id") .KeyReference(c => c.Child, "child_id"); Map(c => c.Sequence).Not.Nullable(); } } So, in my test if i try to get myParentRepo.Get(1).Children, it does in fact get me all the relationships and, as I access them from the relationship, the Child objects (for example, I can grab them all by doing parent.Children.Select(r => r.Child).ToList()). However, the SQL that NHibernate is generating is inefficient. When I access parent.Children, NHIbernate does a SELECT * FROM ParentChildRelationship WHERE parent_id = 1 and then a SELECT * FROM Child WHERE id = ? for each child in each relationship. I understand why NHibernate is doing this, but I can't figure out how to set up the mapping to make NHibernate query the way I mentioned above.

    Read the article

  • Creating a menu using xslt for Umbraco

    - by rob_g
    I've created a menu in umbraco using XSLT. The menu is using the usual ul and li elements and I'm displaying only the first level of the menu. The aim is to create a menu that expands to show the sub menu when I click a parent node (in the top level). I am after the xslt I would need to expose the sub menu when clicked. I think I would need to make use of ancestor-or-self to detect the current menu and parent menu and display them and also the $currentPage variable. I have the following xslt: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:urlLib="urn:urlLib" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib urlLib "> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:template match="/"> <div id="kb-categories"> <h3>Categories</h3> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1]"/> </xsl:call-template> </div> </xsl:template> <xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:if test="(umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1)) and $parent/@level = 1"> <ul class="kb-menuLevel1" > <xsl:for-each select="$parent/node [string(./data [@alias='showInMenu']) = 1]"> <li> <a href="/kb{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> <xsl:variable name="level" select="@level" /> <xsl:if test="(count(./node [string(./data [@alias='showInMenu']) = '1']) &gt; 0)"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </xsl:if> </li> </xsl:for-each> </ul> </xsl:if> <xsl:if test="(umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1)) and $parent/@level &gt; 1"> <ul class="kb-menuLevel{@level}" style="display: none;"> <xsl:for-each select="$parent/node [string(./data [@alias='showInMenu']) = 1]"> <li> <a href="/kb{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> <xsl:variable name="level" select="@level" /> <xsl:if test="(count(./node [string(./data [@alias='showInMenu']) = '1']) &gt; 0)"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </xsl:if> </li> </xsl:for-each> </ul> </xsl:if> </xsl:template> </xsl:stylesheet> I suspect this could be improved using apply-templates, but I'm not yet up to speed with that (this being only the second day of my learning xslt). My menu: Item 1 Item 2 Item 3 Item 4 when I click on Item 2 I want to see it's child menu too: Item 1 Item 2 -- Item 2.1 -- Item 2.2 Item 3 Item 4 and so on down the nested menu.

    Read the article

  • T-SQL QUERY PROBLEM

    - by Sam
    Hi All, I have table called Summary and the data in the table looks like this: ID Type Name Parent 1 Act Rent Null 2 Eng E21-01-Rent Rent 3 Prj P01-12-Rent E21-Rent 1 Act Fin Null 2 Eng E13-27-Fin Fin 3 Prj P56-35-Fin E13-Fin I am writing a SP which has to pull the parent based on type. Here always the type Act has ID 1, Eng has ID 2 and Prj has ID 3. The type ACT parent is always NUll, type Eng parent is Act and type Prj parent is Eng Now I have table called Detail.I am writing a SP to insert Detail Table data to the Summary table. I am passing the id as parameter: I am having problem with the parent. How do I get that? I can always say when ID is 1 then parent is Null but when ID is 2 then parent is name of ID 1 similarly when ID is 3 then parent is name of ID2. How do I get that? Can anyone help me with this:

    Read the article

  • Limit child rows in Entity Framework Query

    - by Jim
    Hi, If I have a parent and child modelled relationship. How to I select the parent, and some of the child rows. I cannot seem to do it, and load the parent object. var query = ( from parent in Parents.Include("Children") from child in parent.Children where child.Date == parent.Children.Max(x => x.Date) select parent); the problem is that the parent is returned multiple times, not the parent with the children loaded. Is there any way to populate each of the parents, and include the child rows, but only the ones needed. If I try and navigate again, I get all the children, not just the ones with the latest date. Thanks

    Read the article

  • How to synchronize cuda threads when they are in the same loop and we need to synchronize them to ex

    - by Vickey
    Hi all, I have written a code and Now I want to implement this on cuda GPU but I'm new to synchronization so please help me with this, It's little urgent to me. Below I'm presenting the code and I want to that LOOP1 to be executed by all threads (heance I want to this portion to take advantage of cuda and the remaining portion (the portion other from the LOOP1) is to be executed by only a single thread. do{ point_set = master_Q[(*num_mas) - 1].q; List* temp = point_set; List* pa = point_set; if(master_Q[num_mas[0] - 1].max) max_level = (int) (ceilf(il2 * log(master_Q[num_mas[0] - 1].max))); *num_mas = (*num_mas) - 1; while(point_set){ List* insert_ele = temp; while(temp){ insert_ele = temp; if((insert_ele->dist[insert_ele->dist_index-1] <= pow(2, max_level-1)) || (top_level == max_level)){ if(point_set == temp){ point_set = temp->next; pa = temp->next; } else{ pa->next = temp->next; } temp = NULL; List* new_point_set = point_set; float maximum_dist = 0; if(parent->p_index != insert_ele->point_index){ List* tmp = new_point_set; float *b = &(data[(insert_ele->point_index)*point_len]); **LOOP 1:** while(tmp){ float *c = &(data[(tmp->point_index)*point_len]); float sum = 0.; for(int j = 0; j < point_len; j+=2){ float d1 = b[j] - c[j]; float d2 = b[j+1] - c[j+1]; d1 *= d1; d2 *= d2; sum = sum + d1 + d2; } tmp->dist[tmp->dist_index] = sqrt(sum); if(maximum_dist < tmp->dist[tmp->dist_index]) maximum_dist = tmp->dist[tmp->dist_index]; tmp->dist_index = tmp->dist_index+1; tmp = tmp->next; } max_distance = maximum_dist; } while(new_point_set || insert_ele){ List* far, *par, *tmp, *tmp_new; far = NULL; tmp = new_point_set; tmp_new = NULL; float level_dist = pow(2, max_level-1); float maxdist = 0, maxp = 0; while(tmp){ if(tmp->dist[(tmp->dist_index)-1] > level_dist){ if(maxdist < tmp->dist[tmp->dist_index-1]) maxdist = tmp->dist[tmp->dist_index-1]; if(tmp == new_point_set){ new_point_set = tmp->next; par = tmp->next; } else{ par->next = tmp->next; } if(far == NULL){ far = tmp; tmp_new = far; } else{ tmp_new->next = tmp; tmp_new = tmp; } if(parent->p_index != insert_ele->point_index) tmp->dist_index = tmp->dist_index - 1; tmp = tmp->next; tmp_new->next = NULL; } else{ par = tmp; if(maxp < tmp->dist[(tmp->dist_index)-1]) maxp = tmp->dist[(tmp->dist_index)-1]; tmp = tmp->next; } } if(0 == maxp){ tmp = new_point_set; aloc_mem[*tree_index].p_index = insert_ele->point_index; aloc_mem[*tree_index].no_child = 0; aloc_mem[*tree_index].level = max_level--; parent->children_index[parent->no_child++] = *tree_index; parent = &(aloc_mem[*tree_index]); tree_index[0] = tree_index[0]+1; while(tmp){ aloc_mem[*tree_index].p_index = tmp->point_index; aloc_mem[(*tree_index)].no_child = 0; aloc_mem[(*tree_index)].level = master_Q[(*cur_count_Q)-1].level; parent->children_index[parent->no_child] = *tree_index; parent->no_child = parent->no_child + 1; (*tree_index)++; tmp = tmp->next; } cur_count_Q[0] = cur_count_Q[0]-1; new_point_set = NULL; } master_Q[*num_mas].q = far; master_Q[*num_mas].parent = parent; master_Q[*num_mas].valid = true; master_Q[*num_mas].max = maxdist; master_Q[*num_mas].level = max_level; num_mas[0] = num_mas[0]+1; if(0 != maxp){ aloc_mem[*tree_index].p_index = insert_ele->point_index; aloc_mem[*tree_index].no_child = 0; aloc_mem[*tree_index].level = max_level; parent->children_index[parent->no_child++] = *tree_index; parent = &(aloc_mem[*tree_index]); tree_index[0] = tree_index[0]+1; if(maxp){ int new_level = ((int) (ceilf(il2 * log(maxp)))) +1; if (new_level < (max_level-1)) max_level = new_level; else max_level--; } else max_level--; } if( 0 == maxp ) insert_ele = NULL; } } else{ if(NULL == temp->next){ master_Q[*num_mas].q = point_set; master_Q[*num_mas].parent = parent; master_Q[*num_mas].valid = true; master_Q[*num_mas].level = max_level; num_mas[0] = num_mas[0]+1; } pa = temp; temp = temp->next; } } if((*num_mas) > 1){ List *temp2 = master_Q[(*num_mas)-1].q; while(temp2){ List* temp3 = master_Q[(*num_mas)-2].q; master_Q[(*num_mas)-2].q = temp2; if((master_Q[(*num_mas)-1].parent)->p_index != (master_Q[(*num_mas)-2].parent)->p_index){ temp2->dist_index = temp2->dist_index - 1; } temp2 = temp2->next; master_Q[(*num_mas)-2].q->next = temp3; } num_mas[0] = num_mas[0]-1; } point_set = master_Q[(*num_mas)-1].q; temp = point_set; pa = point_set; parent = master_Q[(*num_mas)-1].parent; max_level = master_Q[(*num_mas)-1].level; if(master_Q[(*num_mas)-1].max) if( max_level > ((int) (ceilf(il2 * log(master_Q[(*num_mas)-1].max)))) +1) max_level = ((int) (ceilf(il2 * log(master_Q[(*num_mas)-1].max)))) +1; num_mas[0] = num_mas[0]-1; } }while(*num_mas > 0);

    Read the article

  • nhibernate will not cascade delete childs

    - by marn
    The scenario is as follows, I have 3 objects (i simplified the names) named Parent, parent's child & child's child parent's child is a set in parent, and child's child is a set in child. mapping is as follows (relevant parts) parent <set name="parentset" table="pc-table" lazy="false" fetch="subselect" cascade="all-delete-orphan" inverse="true"> <key column=FK_ID_PC" on-delete="cascade"/> <one-to-many class="parentchild,parentchild-ns"/> </set> parent's child <set name="childset" table="cc-table" lazy="false" fetch="subselect" cascade="all-delete-orphan" inverse="true"> <key column="FK_ID_CC" on-delete="cascade"/> <one-to-many class="childschild,childschild-ns"/> </set> What i want to achieve is that when i delete the parent, there would be a cascade delete all the way trough to child's child. But what currently happens is this. (this is purely for mapping test purposes) getting a parent entity (works fine) IQuery query = session.CreateQuery("from Parent where ID =" + ID); IParent doc = query.UniqueResult<Parent>(); now the delete part session.Delete(doc); transaction.Commit(); After having solved the 'cannot insert null value' error with cascading and inverse i hopes this would now delete everything with this code, but only the parent is being deleted. Did i miss something in my mapping which is likely to be missed? Any hint in the right direction is more than welcome!

    Read the article

  • django-mptt: how to successfully move nodes around

    - by Parand
    django-mptt seems determined to drive me out of my mind. I'm trying to do something relatively simple: I'm going to delete a node, and need to do something reasonable with the node's children. Namely, I'd like to move them up one level so they're children of their current parent's parent. That is, if the tree looks like: Root | Grandpa | Father | | C1 C2 I'm going to delete Father, and would like C1 and C2 to be children of Grandpa. Here's the code I'm using: class Node(models.Model): first_name = models.CharField(max_length=80, blank=True) parent = models.ForeignKey('self', null=True, blank=True, related_name='children') def reparent_children(self, parent): print "Reparenting" for child in self.get_children(): print "Working on", child.first_name, "to parent", parent.email parent = Node.objects.get(id=parent.id) child.move_to(parent, 'last-child') child.save() So I'd call: father.reparent_children(grandpa) father.parent = None father.save() This works - almost. The children report their parents as Grandpa: c1.parent == grandpa # True Grandpa counts C1 and C2 among its children c1 in grandpa.children.all() # True However, Root disowns these kids. c1.get_root() == father # c1's root is father, instead of Root c1 in root.get_descendants() # False How do I get the children to move and their root not get corrupted?

    Read the article

  • Core Data NSPredicate to filter results

    - by Bryan
    I have a NSManagedObject that contains a bID and a pID. Within the set of NSManagedObjects, I only want a subset returned and I'm struggling to find the correct NSPredicate or way to get what I need out of Core Data. Here's my full list: bid pid 41 0 42 41 43 0 44 0 47 41 48 0 49 0 50 43 There is a parent-child relationship above. Rules: If a record's PID = 0, it means that that record IS a parent record. If a record's PID != 0, then that record's PID refers to it's parent record's BID. Example: 1) BID = 41 is a parent record. Why? Because records BID=42 and record BID=47 have PID's of 41, meaning those are children of its PID record. 2) BID = 42 has a parent record with a BID = 41. 3) BID = 43 is a parent record. 4) BID = 44 is a parent record. 5) BID = 47 has a parent record with a BID = 41 because its PID = 41. See #1 above. 6) BID = 48 is a parent record. 7) BID = 49 is a parent record. 8) BID = 50 is a child record, and its parent record has a BID = 43. See the pattern? Now, basically from that, I want only the following rows fetched: bid pid 44 0 47 41 48 0 49 0 50 43 BID = 41, BID = 48, BID = 49 should all be returned because there are no records with a PID equal to their BID. BID = 47 should be returned because it is the most recent child of PID = 41. BID = 50 should be returned because it is the most recent child of PID = 43. Hope this helps explain it more.

    Read the article

  • How do I correct feature envy in this case?

    - by RMorrisey
    I have some code that looks like: class Parent { private Intermediate intermediateContainer; public Intermediate getIntermediate(); } class Intermediate { private Child child; public Child getChild() {...} public void intermediateOp(); } class Child { public void something(); public void somethingElse(); } class Client { private Parent parent; public void something() { parent.getIntermediate().getChild().something(); } public void somethingElse() { parent.getIntermediate().getChild().somethingElse(); } public void intermediate() { parent.getIntermediate().intermediateOp(); } } I understand that is an example of the "feature envy" code smell. The question is, what's the best way to fix it? My first instinct is to put the three methods on parent: parent.something(); parent.somethingElse(); parent.intermediateOp(); ...but I feel like this duplicates code, and clutters the API of the Parent class (which is already rather busy). Do I want to store the result of getIntermediate(), and/or getChild(), and keep my own references to these objects?

    Read the article

  • Public versus private inheritance when some of the parent's methods need to be exposed?

    - by Vorac
    Public inheritance means that all fields from the base class retain their declared visibility, while private means that they are forced to 'private' within the derived class's scope. What should be done if some of the parent's members (say, methods) need to be publicly exposed? I can think of two solution. Public inheritance somewhat breaks encapsulation. Furthermore, when you need to find out where is the method foo() defined, one needs to look at a chain of base classes. Private inheritance solves these problems, but introduces burden to write wrappers (more text). Which might be a good thing in the line of verbosity, but makes changes of interfaces incredibly cumbersome. What considerations am I missing? What constraints on the type of project are important? How to choose between the two (I am not even mentioning 'protected')? Note that I am targeting non-virtual methods. There isn't such a discussion for virtual methods (or is there).

    Read the article

  • How can I prevent people from looking at a listing of files in parent directory if I haven't uploaded index.html? [closed]

    - by LedZeppelin
    Possible Duplicate: How to restrict the download of all files in a folder? I haven't uploaded index.html or index.php to my root directory. How can I prevent people from looking at a listing of files in parent directory? http://oi56.tinypic.com/sc739e.jpg Also, is it possible for people to obtain a list of all the files in the root directory once I upload index.html? I'm currently using .htaccess and htusers to prompt someone to enter a username and password when they try to access any file in the root directory. This may sound like a weird request but would it be possible to have them come to the site (without an index.html) and just have them not see the files? All it would say on the page would be the following: Index of/ Apache Server at mysite.com Port 80

    Read the article

  • Problem in calling a method recursively in nodejs mongodb [closed]

    - by Nilesh
    I am trying to create a tree using nodejs and mongodb.Wanted to show a path of a particulr node from the root.So I am finding the destination path and looping back to its parent iteratively until the root.So this is the snippet I am using which results in infinite looping articleProvider.finditsparent(t,function(error,tap){ if(tap[0].parent=='null') { t=(tap[0].parent); console.log(n); } else { n.push(tap[0].parent); console.log(tap[0].parent); t=(tap[0].parent); res.send(n); } }); res.send(n); }); How should I get rid of this problem?Is there any way to call it recursively?

    Read the article

  • Pass or Get a value from Parent ViewModel down to Sub-ViewModel?

    - by mkmurray
    I am using the MVVM Light framework as well as Unity for DI. I have some nested Views, each bound to a corresponding ViewModel. The ViewModels are bound to each View's root control DataContext via the ViewModelLocator idea that Laurent Bugnion has put into MVVM Light. This allows for finding ViewModels via a static resource and for controlling the lifetime of ViewModels via a Dependency Injection framework, in this case Unity. It also allows for Expression Blend to see everything in regard to ViewModels and how to bind them. As I stated the Views have a healthy dose of nesting, but the ViewModels don't really know anything about each other. A parent view binds to its corresponding ViewModel via the static resource ViewModelLocator (which uses Unity to control the construction and lifetime of the ViewModel object). That parent view contains a user control in it that is another sub-view, which then goes and gets its corresponding ViewModel via the ViewModelLocator as well. The ViewModels don't have references to each other or know any hierarchy in regard to each other. So here's an example of how the ViewModels do interact via messaging. I've got a parent View that has a ComboBox databound to an ObservableCollection in its ViewModel. The ComboBox's SelectedItem is also bound (two-way) to a property on the ViewModel. When the selection of the ComboBox changes, this is to trigger updates in other Views and sub-Views. Currently I am accomplishing this via the Messaging system that is found in MVVM Light. So I'm wondering what the best practice would be to get information from one ViewModel to another? In this case, what I need to pass down to sub-ViewModels is basically a user Guid representing the currently logged in user. The top-most parent View (well, ViewModel) will know this information, but I'm not sure how to get it down into the sub-ViewModels. Some possible approaches I can think of: Should the sub-ViewModel ask the static resource ViewModelLocator for a reference to the same object the parent View is using and access the property that way? It seems like ViewModels going through each other's properties is not very clean and couples them together unnecessarily. I'm already using messaging to notify the sub-Views that the user selected a new item in the ComboBox and to update accordingly. But the object type that is being selected in the ComboBox is not really directly related to this data value that the sub-Views need.

    Read the article

  • How do you override the opacity of a parent control in WPF?

    - by Metro Smurf
    When you set the opacity on a Grid in WPF, all the child elements appear to inherit its Opacity. How can you have a child element not inherit the parent's opacity? For example, the following parent grid has one child grid in the middle with a background set to red, but the background appears pinkish because of the parent's opacity. I'd like the child grid to have a solid color, non-transparent background: <Grid x:Name="LayoutRoot"> <Grid Background="Black" Opacity="0.5"> <Grid.RowDefinitions> <RowDefinition Height="0.333*"/> <RowDefinition Height="0.333*"/> <RowDefinition Height="0.333*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.333*"/> <ColumnDefinition Width="0.333*"/> <ColumnDefinition Width="0.333*"/> </Grid.ColumnDefinitions> <-- how do you make this child grid's background solid red and not inherit the Opacity/Transparency of the parent grid? --> <Grid Grid.Column="1" Grid.Row="1" Background="Red"/> </Grid> </Grid>

    Read the article

  • Difference between the address space of parent process and its child process in Linux?

    - by abbas1707
    Hi, I am confused about it. I have read that when a child is created by a parent process, child gets a copy of its parent's address space. What it means here by copy? If i use code below, then it prints same addresses of variable 'a' which is on heap in all cases. i.e in case of child and parent. So what is happening here? #include <sys/types.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> int main () { pid_t pid; int *a = (int *)malloc(4); printf ("heap pointer %p\n", a); pid = fork(); if (pid < 0) { fprintf (stderr, "Fork Failed"); exit(-1); } else if (pid == 0) { printf ("Child\n"); printf ("in child heap pointer %p\n", a); } else { wait (NULL); printf ("Child Complete\n"); printf ("in parent heap pointer %p\n", a); exit(0); } }

    Read the article

  • How to prioritize openvpn traffic?

    - by aditsu
    I have an openvpn server, with one network interface. VPN traffic is extremely slow. I tried to do traffic control with this configuration (currently): qdisc del dev eth0 root qdisc add dev eth0 root handle 1: htb default 12 class add dev eth0 parent 1: classid 1:1 htb rate 900mbit #vpn class add dev eth0 parent 1:1 classid 1:10 htb rate 1500kbit ceil 3000kbit prio 1 #local net class add dev eth0 parent 1:1 classid 1:11 htb rate 10mbit ceil 900mbit prio 2 #other class add dev eth0 parent 1:1 classid 1:12 htb rate 500kbit ceil 1000kbit prio 2 filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 1194 0xffff flowid 1:10 filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match ip dst 192.168.10.0/24 flowid 1:11 qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10 qdisc add dev eth0 parent 1:12 handle 12: sfq perturb 10 But it's still extremely slow. I have an imaps connection that keeps transferring data continuously (I successfully limited the rate) but with openvpn I can't seem to get more than about 100kbit/s The internet connection speed is about 3mbit/s (symmetric) What could be the problem? Does the sport filter work for udp?

    Read the article

  • How to prioritize openvpn traffic?

    - by aditsu
    I have an openvpn server, with one network interface. VPN traffic is extremely slow. I tried to do traffic control with this configuration (currently): qdisc del dev eth0 root qdisc add dev eth0 root handle 1: htb default 12 class add dev eth0 parent 1: classid 1:1 htb rate 900mbit #vpn class add dev eth0 parent 1:1 classid 1:10 htb rate 1500kbit ceil 3000kbit prio 1 #local net class add dev eth0 parent 1:1 classid 1:11 htb rate 10mbit ceil 900mbit prio 2 #other class add dev eth0 parent 1:1 classid 1:12 htb rate 500kbit ceil 1000kbit prio 2 filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 1194 0xffff flowid 1:10 filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match ip dst 192.168.10.0/24 flowid 1:11 qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10 qdisc add dev eth0 parent 1:12 handle 12: sfq perturb 10 But it's still extremely slow. I have an imaps connection that keeps transferring data continuously (I successfully limited the rate) but with openvpn I can't seem to get more than about 100kbit/s The internet connection speed is about 3mbit/s (symmetric) What could be the problem? Does the sport filter work for udp?

    Read the article

  • using flock in bash, why does killing a child process kill the parent process too?

    - by Robby
    In the code snippet below, I want the script to be limited to only running one copy at a time, and for it to restart server.x if it dies for any reason. Without flock involved, the loop correctly restarts if I kill the server process, but once I use flock to ensure the script is only running once, if I kill server.x it also kills the parent process. How can I ensure that killing the child process in a flock script keeps the parent around? #!/bin/bash set -e ( flock -x -n 200 while true do ./server.x $1 done ) 200>/var/lock/.m_rst.$1.lock

    Read the article

  • How to get the parent node of a given child node using PowerShell?

    - by kumar
    I am new to PowerShell. I have to write a script which can return me the first parent(node) value by passing the child node. I have the following XML. When I pass my PowerShell script the value "AAA", it should return "parent2", and when I pass "III", it should return "parent311". Can someone help me write this script? XML: <root> <parent> <parent2> <child>AAA</child> </parent2> <parent3> <child>BBB</child> <child>CCC</child> <child>DDD</child> </parent3> <parent4> <child>EEE</child> </parent4> <parent5> <child>FFF</child> </parent5> </parent> <parent21> <parent211> <child>GGG</child> </parent211> <parent311> <child>HHH</child> <child>III</child> <child>JJJ</child> </parent311> <parent411> <child>KKK</child> </parent411> <parent511> <child>LLL</child> </parent511> </parent21> </root>

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >