Search Results

Search found 2177 results on 88 pages for 'children'.

Page 1/88 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • javascript complex recurrsion [on hold]

    - by Achilles
    Given Below is my data in data array. What i am doing in code below is that from that given data i have to construct json in a special format which i also gave below. //code start here var hierarchy={}; hierarchy.name="Hierarchy"; hierarchy.children=[{"name":"","children":[{"name":"","children":[]}]}]; var countryindex; var flagExist=false; var data = [ {country :"America", city:"Kansas", employe:'Jacob'}, {country :"Pakistan", city:"Lahore", employe:'tahir'}, {country :"Pakistan", city:"Islamabad", employe:'fakhar'} , {country :"Pakistan", city:"Lahore", employe:'bilal'}, {country :"India", city:"d", employe:'ali'} , {country :"Pakistan", city:"Karachi", employe:'eden'}, {country :"America", city:"Kansas", employe:'Jeen'} , {country :"India", city:"Banglore", employe:'PP'} , {country :"India", city:"Banglore", employe:'JJ'} , ]; for(var i=0;i<data.length;i++) { for(var j=0;j<hierarchy.children.length;j++) { //for checking country match if(hierarchy.children[j].name==data[i].country) { countryindex=j; flagExist=true; break; } } if(flagExist)//country match now no need to add new country just add city in it { var cityindex; var cityflag=false; //hierarchy.children[countryindex].children.push({"name":data[i].city,"children":[]}) //if(hierarchy.children[index].children!=undefined) for(var k=0;k< hierarchy.children[countryindex].children.length;k++) { //for checking city match if(hierarchy.children[countryindex].children[k].name==data[i].city) { // hierarchy.children[countryindex].children[k].children.push({"name":data[i].employe}) cityflag=true; cityindex=k; break; } } if(cityflag)//city match now add just empolye at that city index { hierarchy.children[countryindex].children[cityindex].children.push({"name":data[i].employe}); cityflag=false; } else//no city match so add new with employe also as this is new city so its emplye will be 1st { hierarchy.children[countryindex].children.push({"name":data[i].city,children:[{"name":data[i].employe}]}); //same as above //hierarchy.children[countryindex].children[length-1].children.push({"name":data[i].employe}); } flagExist=false; } else{ //no country match adding new country //with city also as this is new city of new country console.log("sparta"); hierarchy.children.push({"name":data[i].country,"children":[{"name":data[i].city,"children":[{"name":data[i].employe}]}]}); // hierarchy.children.children.push({"name":data[i].city,"children":[]}); } //console.log(hierarchy); } hierarchy.children.shift(); var j=JSON.stringify(hierarchy); //code ends here //here is the json which i seccessfully formed from the code { "name":"Hierarchy", "children":[ { "name":"America", "children":[ { "name":"Kansas", "children":[{"name":"Jacob"},{"name":"Jeen"}]}]}, { "name":"Pakistan", "children":[ { "name":"Lahore", "children": [ {"name":"tahir"},{"name":"bilal"}]}, { "name":"Islamabad", "children":[{"name":"fakhar"}]}, { "name":"Karachi", "children":[{"name":"eden"}]}]}, { "name":"India", "children": [ { "name":"d", "children": [ {"name":"ali"}]}, { "name":"Banglore", "children":[{"name":"PP"},{"name":"JJ"}]}]}]} Now the orignal problem is that currently i am solving this problem for data of array of three keys and i have to go for 3 nested loops now i want to optimize this solution so that if data array of object has more than 3 key say 5 {country :"America", state:"NewYork",city:"newYOrk",street:"elm", employe:'Jacob'}, or more than my solution will not work and i cannot decide before how many keys will come so i thought recursion may suit best here. But i am horrible in writing recurrsion and the case is also complex. Can some awesome programmer help me writing recurrsion or suggest some other solution.

    Read the article

  • jquery .children() returning wrong size

    - by i need help
    Hi guys, I just found the children size not consistent. Below attach full code with alert, for easy reference. Is the way I get the data wrong? <body> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" valign="top"><strong>Header Title</strong></td> </tr> <tr> <td height="32" valign="top">Date : <strong>01/01/2010 </strong> <br><div><b></b></div><span></span></td> </tr> </table> </body> $("td").each(function() { alert($(this).children().size()); }); //first td showing 1 direct children- <strong> //second td showing 4 direct children- <strong> <br> <div> <span> ----- $("tr").each(function() { alert($(this).children().size()); }); //first tr showing 1 direct children - <td> //second tr showing 1 direct children - <td> ----- $("table").each(function() { alert($(this).children().size()); }); // ERROR // this table showing 1 direct children only.... something WRONG. // I thought there are 2 <tr> inside this table?

    Read the article

  • Children in Enumeration

    - by marionmaiden
    Hello I have a enumeration for elements in a JTree When I find some specific element in this JTree, I want to check it's children. Do the method children() in a Enumeration check it's grandcildren too? For example, let's supose this JTree, considering the identation as new levels of the tree: Fruits apple grape orange peach pineapple strawberry banana If I get the children of grape, will I have just orange and peach or will I get peach children (pineaple) too?

    Read the article

  • WPF: Binding items added to UserControl's exposed children

    - by Brian
    I have a user control that allows items to be added to it by exposing a Grid's Children property. Any control I add shows up fine but when I try to bind a property on the added item to a control in the main window nothing happens (example): <TextBox Name="txtTest" Text="Success!" /> <mycontrols:CustomUserControl.ExposedGridChildren> <TextBox Text="{Binding ElementName=txtTest, Path=Text, FallbackValue=fail}"/> </mycontrols:CustomUserControl.ExposedGridChildren> This example always results in the TextBox's text showing "fail". Here is how I'm exposing the children in the user control: public UIElementCollection ExposedGridChildren { get { return grdContainer.Children; } } Any thoughts? Is it a scope issue? I know I can't name the elements I add to the children because of scope errors. Thanks, Brian.

    Read the article

  • How to add children of an ItemsControl where the children should decide their own position in Wpf?

    - by code-zoop
    Hey all I am using a wpf slider to display the time line in a video player. I need to add an ItemControl of some sort on top of this so that I can add buttons on the time line on certain positions in the time line (the buttons will hold their own position relative to the parent ItemsControl). What ItemsControl container should I use where I can add child elements that know their own position (based on their timecode)? I have looked at the different ItemsControls in Wpf, and it looks like all of them have a certain way to stack their children (Horizontal or vertical one after another)! And to add some more complexity, How can the positioning of the children be relative to the width of the parent ItemsControl? This way scaling up and down the ItemsContol will reposition the children! Thanks

    Read the article

  • PHP: Recursively get children of parent

    - by Nic Hubbard
    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 confused about recursion. function getChildren($parent_id) { $tree = Array(); $tree_string; if (!empty($parent_id)) { // getOneLevel() returns a one-dimentional array of child ids $tree = $this->getOneLevel($parent_id); foreach ($tree as $key => $val) { $ids = $this->getChildren($val); array_push($tree, $ids); //$tree[] = $this->getChildren($val); $tree_string .= implode(',', $tree); } return $tree_string; } else { return $tree; } }//end getChildren() After the function is run, I would like it to return a one-dimentional array of all the child ids that were found.

    Read the article

  • Need a bounding box for CCSprite that includes all children/subchildren

    - by prototypical
    I have a CCSprite that has CCSprite children, and those CCSprite children have CCSprite children. The contentSize property doesn't seem to include all children/subchildren, and seems to only work for the base node. I could write a recursive method to traverse a CCSprite for all children/subchildren and calculate a proper boundingbox, but am curious as to if I am missing something and it's possible to get that information without doing so. I'l be a little surprised if such a method doesn't exist, but I can't seem to find it.

    Read the article

  • In WPF: Children.Remove or Children.Clear doesn't free objects

    - by Bart Roozendaal
    I create some UIElements from code behind and was anticipating the garbage collection to clear up stuff. However, the objects are not free-ed at the time I expected it. I was expecting them to be freeed at RemoveAt(0), but they are only freed at the end of the program. How can I make the objects be freed when removed from the Children collection of the Canvas? <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" MouseDown="Window_MouseDown"> <Grid> <Canvas x:Name="main" /> </Grid> </Window> The code behind is: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_MouseDown(object sender, MouseButtonEventArgs e) { if (main.Children.Count == 0) main.Children.Add(new MyControl() { Background = Brushes.Yellow, Width = 100, Height = 50 }); else main.Children.RemoveAt(0); } } public class MyControl : UserControl { ~MyControl() { Debug.WriteLine("Goodbye"); } }

    Read the article

  • jQuery: one-liner for removing all children but one

    - by user1352530
    HTML code is: <li> <a href="#" /> <ul> <li> <a href="#"/> </li> </ul> </li> I want to delete any node under $(this) = li that is not a link. If there are more than one link, just the first one is saved, and if there are links inside the ul tag, they are not included because they are descendants and no childrens. Something like this (I am cloning and outputting html): $(this).clone().remove('not(a:first)').html(); //Assuming remove looks for "a" as a first child Does not work, so I try with this: $(this).clone().children().remove('not(a:first)').parent().html(); Does not work so I try with this: $(this).clone().remove('not(>a:first)').html(); I need the original element as a reference after removal for chaining more operations EDIT: Ok! Second one works with a little syntax correction as some appointed (:not( instead of not() but I would like to know if there is any other solution similar to the third line so I don't have to do children().remove().parent(). Thank you!

    Read the article

  • how do I find the number of xml children in AS3

    - by vasion
    so live docs says this for calling .lenght() on an XML object For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an XMLList object that contains only one value. i called it on an xml that looked like this: <xml> <picture>1</picture> <picture>2</picture> </xml> and it reallt returned 1. how do i get the number of children in my xml?

    Read the article

  • jQuery Children length of an ol

    - by DMin
    I am trying to count the child elements of an OL jQuery : $(document).ready(function(){ $("#my_select").change(function(){ alert($("#ol3").children.length); });}); HTML: <ol id="ol1"> <li class="2">Location 1-1</li> </ol> <ol id="ol2"> <li class="15">Location 2-1</li> <li class="20">Location 2-2</li> </ol> <ol id="ol3"> <li class="17">Location 3-1</li> <li class="16">Location 3-2</li> <li class="14">Location 3-3</li> </ol> I always get the number 2 no matter how many li are there under the ol. Know what's going on..?

    Read the article

  • How do I make this loop all children recursively?

    - by Matrym
    I have the following: for (var i = 0; i < children.length; i++){ if(hasClass(children[i], "lbExclude")){ children[i].parentNode.removeChild(children[i]); } }; I would like it to loop through all children's children, etc (not just the top level). I found this line, which seems to do that: for(var m = n.firstChild; m != null; m = m.nextSibling) { But I'm unclear on how I refer to the current child if I make that switch? I would no longer have i to clarify the index position of the child. Any suggestions? Thanks!

    Read the article

  • jquery ui sortable serialize from children

    - by FFish
    I want to send an Array with image paths and captions to a PHP script after I sorted the images. I can do 'serialize' or 'toArray' on the lists, but how to get the attributes from the img tag? <ul class="gallery"> <li id="li-1"> <img src="tn/001.jpg" alt="first caption" /> </li> <li mycaption="some caption" id="li-2"> <img src="tn/002.jpg" alt="second caption with éèçà international chars" /> </li> </ul> $(".gallery").sortable({ update : function() { serial = $('.gallery').sortable('serialize'); alert(serial); /* $.ajax({ url: "sort.php", type: "post", data: serial, error: function() {alert("theres an error with AJAX");} }); */ } });

    Read the article

  • Rails, Deleting Children without Deleting Parent using :has_many

    - by Dex
    I have a model called MyContainer, which :has_many MyObjects. I want to delete all the MyObjects in the container without having to delete the MyContainer. My model does have :dependent = :destroy, however I don't want to have to delete and re-create the object because it is slower. Something like this does not work: @obj = MyContainer.find_by_id(10) @obj.my_objects.delete_all How can I accomplish this?

    Read the article

  • find the children in jquery

    - by armin etemadi
    i have a tree structure,there is an unordered list(ul) in that tree.i have li items in it,and in that li items it could be a span or an ul list. this is one part of my codes : <li id="main_li"> <div class="first_division"></div> <span>products</span> <ul style="display: block;"> <li> <div class="division1"></div> <span>products_cat_1</span> <ul style="display: none;"> <li> <span>products_cat_1_milk</span> </li> </ul> </li> <li> <span>products_yoghurt</span> </li> <li> <span>products_butter</span> </li> </ul> </li> i want to access li elements in ul tag where the parent li id is "main_li",i want to get it done by clicking on the span within li. how can i do this with jquery?

    Read the article

  • Writing a DTD: How to achieve this children setup

    - by Boldewyn
    The element tasklist may contain at most one title and at most one description, additionally any number (incl. 0) task elements in any order. The naive approach is not applicable, since the order should not matter: <!ELEMENT tasklist (title?, description?, task*) > Alternatively, I could explicitly name all possible options: (title, description?, task*) | (title, task+, description?, task*) | (task+, title, task*, description?, task*) | (description, title?, task*) | (description, task+, title?, task*) | (task+, description, task*, title?, task*) | (task*) but then it's quite easy to write a non-deterministic rule, and furthermore it looks like the direct path to darkest madness. Any ideas, how this could be done more elegantly? And no, an XSD or RelaxNG is no option. I need a plain, old DTD.

    Read the article

  • Hiding elements based on last closed element jquery script

    - by Jared
    Hi my question is, how can I make this jquery script close all previously opened children when entering a new parent? At the moment it traverses thru all the tree structure fine, but switching from one parent to another does not close the previous children, but rather only the each individual parents elements as a user browses. Here is the jquery I'm using: <script type="text/javascript"> $(document).ready($(function(){ $('#nav>li>ul').hide(); $('.children').hide(); $('#nav>li').mousedown(function(){ // check that the menu is not currently animated if ($('#nav ul:animated').size() == 0) { // create a reference to the active element (this) // so we don't have to keep creating a jQuery object $heading = $(this); // create a reference to visible sibling elements // so we don't have to keep creating a jQuery object $expandedSiblings = $heading.siblings().find('ul:visible'); if ($expandedSiblings.size() > 0) { $expandedSiblings.slideUp(0, function(){ $heading.find('ul').slideDown(0); }); } else { $heading.find('ul').slideDown(0); } } }); $('#nav>li>ul>li').mousedown(function(){ // check that the menu is not currently animated if ($('#nav ul:animated').size() == 0) { // create a reference to the active element (this) // so we don't have to keep creating a jQuery object $heading2 = $(this); // create a reference to visible sibling elements // so we don't have to keep creating a jQuery object $expandedSiblings2 = $heading2.siblings().find('.children:visible'); if ($expandedSiblings2.size() > 0) { $expandedSiblings2.slideUp(0, function(){ $heading2.find('.children').slideDown(0); }); } else { $heading2.find('.children').slideDown(0); } } }); })); </script> and here is my html output <ul id="nav"> <li><a href="#">folder 4</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder 4/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder 4/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder 4/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder 4/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder1</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder1/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder1/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder1/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder1/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder2</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder2/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder2/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder2/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder2/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder3</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder3/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder3/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder3/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder3/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> </ul> I assume my problem is, jquery isn't closing the children between each new parent so I need to make a call, but I'm a bit lost on how to do that. I know the code is pretty messy, this project was done in a huge rush and a very tight timeframe. Appreciate your answers and any other constructive comments, cheers :)

    Read the article

  • Quering XElements for children with children attributes.

    - by Arnej65
    Here is the XML outline: <Root> <Thing att="11"> <Child lang="e"> <record></record> <record></record> <record></record> </Child > <Child lang="f"> <record></record> <record></record> <record></record> </Child > </Thing> </Root> I have the following: TextReader reader = new StreamReader(Assembly.GetExecutingAssembly() .GetManifestResourceStream(FileName)); var data = XElement.Load(reader); foreach (XElement single in Data.Elements()) { // english records var EnglishSet = (from e in single.Elements("Child") where e.Attribute("lang").Equals("e") select e.Value).FirstOrDefault(); } But I'm getting back nothing. I want to be able to for Each "Thing" select the "Child" where the attribute "lang" equals a value. I have also tried this, which has not worked. var FrenchSet = single.Elements("Child") .Where(y => y.Attribute("lang").Equals("f")) .Select(x => x.Value).FirstOrDefault();

    Read the article

  • XNA- Transforming children

    - by user1806687
    So, I have a Model stored in MyModel, that is made from three meshes. If you loop thrue MyModel.Meshes the first two are children of the third one. And was just wondering, if anyone could tell me where is the problem with my code. This method is called whenever I want to programmaticly change the position of a whole model: public void ChangePosition(Vector3 newPos) { Position = newPos; MyModel.Root.Transform = Matrix.CreateScale(VectorMathHelper.VectorMath(CurrentSize, DefaultSize, '/')) * Matrix.CreateFromAxisAngle(MyModel.Root.Transform.Up, MathHelper.ToRadians(Rotation.Y)) * Matrix.CreateFromAxisAngle(MyModel.Root.Transform.Right, MathHelper.ToRadians(Rotation.X)) * Matrix.CreateFromAxisAngle(MyModel.Root.Transform.Forward, MathHelper.ToRadians(Rotation.Z)) * Matrix.CreateTranslation(Position); Matrix[] transforms = new Matrix[MyModel.Bones.Count]; MyModel.CopyAbsoluteBoneTransformsTo(transforms); int count = transforms.Length - 1; foreach (ModelMesh mesh in MyModel.Meshes) { mesh.ParentBone.Transform = transforms[count]; count--; } } This is the draw method: foreach (ModelMesh mesh in MyModel.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.View = camera.view; effect.Projection = camera.projection; effect.World = mesh.ParentBone.Transform; effect.EnableDefaultLighting(); } mesh.Draw(); } The thing is when I call ChangePosition() the first time everything works perfectlly, but as soon as I call it again and again. The first two meshes(children meshes) start to move away from the parent mesh. Another thing I wanted to ask, if I change the scale/rotation/position of a children mesh, and then do CopyAbsoluteBoneTransforms() will children meshes be positioned properlly(at the proper distance) or would achieving that require more math/methods? Thanks in advance

    Read the article

  • What If Nintendo Made Children’s Books?

    - by Jason Fitzpatrick
    What if the great minds at Nintendo had directed their energy towards children’s literature? These humorous cover mock-ups show us what the titles may have looked like. Hit up the link below for more books from the Nintendo universe; if you have a clever idea for a game-based children’s book that should exist, sound off in the comments. Videogame Children’s Books [via Neatorama] How to Stress Test the Hard Drives in Your PC or Server How To Customize Your Android Lock Screen with WidgetLocker The Best Free Portable Apps for Your Flash Drive Toolkit

    Read the article

  • [Grails] How to enlist children of specified Parent in treeview colum (table)

    - by Rehman
    I am newbie in grails and tried to implement treeview using RichUI plugin, which shows all parents with individual children in Parent.list.gsp xml for parent and their children <parents name='Parents'> <Parent id='1' name='Parent_1'> <Children name='Children'> <child name='Child_2' id='2' /> <child name='Child_4' id='4' /> <child name='Child_1' id='3' /> <child name='Child_3' id='1' /> </Children> </Parent> <Parent id='2' name='Parent_2'> <Children name='Children'> <child name='Child_1' id='8' /> <child name='Child_2' id='7' /> <child name='Child_4' id='6' /> <child name='Child_3' id='5' /> </Children> </Parent> </parents> Parent Domain Class class Parent { String name static hasMany = [children:Child] } Child Domain Class class Child { String name Parent parent static belongsTo = [parent:Parent] } Parent Controller def list = { def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.parents(name: "Parents"){ Parent.list().each { Parent parentt = it Parent( id:parentt.id,name:parentt.name) { Children(name:'Children'){ parentt.children.each { Child childd = it child(name:childd.name,id:childd.id) } } } } } if(!params.max)params.max=10 ["data":writer.toString(),parentInstanceList: Parent.list(params), parentInstanceTotal: Parent.count()] } Parent.list.gsp <head> <resource:treeView/> ...</head> <body> <table> <thead> <tr> <g:sortableColumn property="id" title="${message(code: 'parent.id.label', default: 'Id')}" /> <g:sortableColumn property="name" title="${message(code: 'parent.name.label', default: 'Name')}" /> <g:sortableColumn property="relationship" title="${message(code: 'parent.relationhsip.label', default: 'Relationship')}" /> </tr> </thead> <tbody> <g:each in="${parentInstanceList}" status="i" var="parentInstance"> <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> <td><g:link action="show" id="${parentInstance.id}">${fieldValue(bean: parentInstance, field: "id")}</g:link></td> <td>${fieldValue(bean: parentInstance, field: "name")}</td> <td><richui:treeView xml="${data}" /></td> </tr> </g:each> </tbody> </table> </body> Problem Currently, in list view, every Parent entry has list of all parents and their children under relationship column Parent List view Snapshot link text Question how can i enlist all children only for each parent instead of enlisting all parents with their children in each Parent entry ? thanks in advance Rehman

    Read the article

  • Web Crawler for Learnign Topics on Wikipedia

    - by Chris Okyen
    When I want to learn a vast topic on wikipedia, I don't know where to start. For instance say I want to learn about Binary Stars, I then have to know other things linked on that pages and linked pages on all the linked pages and so on for the specified number of levels. I want to write a web crawler like HTTracker or something similiar, that will display a heiarchy of the links on a certain page and the links on those linked pages.I wish to use as much prewritten code as possible. Here is an example: Pretending we are bending the rules by grabing links from only the first sentence of each pages The example archives and "processes" two levels deep The page is Ternary operation The First Level In mathematics a ternary operation is an N-ary operation The Second Level Under Mathmatics: Mathematics (from Greek µ???µa máthema, “knowledge, study, learning”) is the abstract study of topics encompassing quantity, structure, space, change and others; it has no generally accepted definition. Under N-ary In logic,mathematics, and computer science, the arity i/'ær?ti/ of a function or operation is the number of arguments or operands that the function takes Under Operation In its simplest meaning in mathematics and logic, an operation is an action or procedure which produces a new value from one or more input values ------------------------------------------------------------------------- I need some way to determine what oder to approach all these wiki pages to learn the concept ( in this case ternary operations )... Following along with this exmpakle, one way to show the path to read would a printout flowout like so: This shows that the first sentence of the Mathematics page doesn't link to the first sentence of pages linked on ternary page two levels deep. (Please tell me how I should explain this ) --- In otherwords, the child node of the top pages first sentence, ternary_operation, does not have any child nodes that reference the children of the top pages other children nodes- N-ary and operation. Thus it is safe to read this first. Since N-ary has a link to operations we shoudl read the operation page second and finally read the N-ary page last. Again, I wish to use as much prewritten code as possible, and was wondering what language to use and what would be the simpliest way to go about doing this if there isn't already somethign out there? Thank You!

    Read the article

  • sql select puzzle: remove children when parent is filtered out

    - by knicnak32
    I have a table essentially: name has_children parent_id row_id values0.....valuesn parent 1 1 1 children 0 1 2 children 0 1 3 parent 0 4 4 parent 1 5 5 children 0 5 6 children 0 5 7 the values for the children can be different than the values for the parent. i want some selects/joins that will filter the table on a value column (i.e. 10) and will return the parent (even if false for the filter) if one of it's children is true for the filter. acceptable return: parent=true all children=false, return just parent parent=false >=1 children=true, return parent and one non-filtered child i'm sure this has been thought about before but i don't have the faintest idea how to phrase the question to find a solution.

    Read the article

  • How to access child element out of children()?

    - by user291701
    Hi, I'd like to get the # of immediate children an element has, and then get the class of a child at a particular index. Something like: var index = 25; var children = $("#myListElement").children(); if (index < children.length) { if (children[index].hasClass("testClass")) { alert("hi!"); } } I think the syntax for .children() is ok, but how do I get the indexed element out of them in jquery style? Thanks

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >