Search Results

Search found 8049 results on 322 pages for 'concerned parent'.

Page 25/322 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Performing an action on Parent/Child elements independently.

    - by Matt Weldon
    I have HTML similar to the following in my page <div id="someDiv"> <img src="foo.gif" class="someImg" /> </div> The wrapper div is set up such that when it is clicked, it's background-color changes using the following jQuery code. $("div").click(function(event){ $(this).css("background-color", "blue"); }); I also have some jQuery associated with my img that will do some other function (for the sake of argument I am going to display and alert box) like so: $("img[class=someImg]").click(function(event){ alert("Image clicked"); }); The issue I have come across is that when I click on the img, the event associated with the div is also triggered. I'm pretty sure that this is due to the way that jQuery (or indeed JavaScript) is handling the two DOM elements - clicking the img would require you to also technically click the div, thus triggering both events. Two questions then really: Is my understanding of the DOM/JavaScript flawed in some way or is this actually how things are occurring? Are there any jQuery methods that would allow me to perform actions on a child element without invoking those associated with its parent?

    Read the article

  • Get the parent class of a null object (C# Reflection)

    - by Nick
    How would I get the parent class of an object that has a value of null? For example... 'Class A' contains 'int? i' which is not set to any value when the class is created. Then in some other place in the code I want to pass in 'i' as a parameter to some function. Using 'i' as the only info, I want to be able to figure out that 'Class A' "owns" 'i'. The reason for this is because 'Class A' also contains some other object, and I want to call this other object's value from that same function mentioned in the above paragraph. Could also be: public class A { public class B { public int? i; public int? j; } B classBInstance = new B(); public string s; } { ... A someClassAInstance = new A(); ... doSomething(someClassAInstance.classBInstance.i); ... } public static bool doSomething(object theObject) { string s = /* SOMETHING on theObject to get to "s" from Class A */; int someValue = (int)theObject; }

    Read the article

  • How to Change Style of Parent <li> on Hover

    - by Stuart Haiz
    I have a WordPress site (on my localhost) that uses a <ul> for a custom menu. How can I change the CSS of a <li> on hover only if it has a <ul> sub-menu? All the main menu items have a border-radius and I want to remove this on the current item (Services, below) for example: <div class="main-nav"> <ul class="menu" id="menu-main-nav"> <li><a href="#">Home</a></li> <li><a href="#">Services</a> <ul class="sub-menu"> <li><a href="#">Item One</a></li> <li><a href="#>Item Two</a></li> </ul> </li> <li><a href="#>Contact</a></li> </ul> </div> I can't find a CSS solution and I've tried jQuery too: $('ul.sub-menu').parent().hover(function(){ $(this).addClass('no-radius'); });

    Read the article

  • Entity Framework - Store parent reference on child relationship (one -> many)

    - by contactmatt
    I have a setup like this: [Table("tablename...")] public class Branch { public Branch() { Users = new List<User>(); } [Key] public int Id { get; set; } public string Name { get; set; } public List<User> Users { get; set; } } [Table("tablename...")] public class User { [Key] public int Id {get; set; } public string Username { get; set; } public string Password { get; set; } [ForeignKey("ParentBranch")] public int? ParentBranchId { get; set; } // Is this possible? public Branch ParentBranch { get; set; } // ??? } Is it possible for the User to know what parent branch it belongs to? The code above is not working. Entity Framework version 5.0 .NET 4.0 c#

    Read the article

  • Deserializing child elements as attributes of parent

    - by LloydPickering
    I have XML files which I need to deserialize. I used the XSD tool from Visual Studio to create c# object files. the generated classes do deserialize the files except not in the way which I need. I would appreciate any help figuring out how to solve this problem. The child elements named 'data' should be attributes of the parent element 'task'. A shortened example of the XML is below: <task type="Nothing" id="2" taskOnFail="false" > <data value="" name="prerequisiteTasks" /> <data value="" name="exclusionTasks" /> <data value="" name="allowRepeats" /> <task type="Wait for Tasks" id="10" taskOnFail="false" > <data value="" name="prerequisiteTasks" /> <data value="" name="exclusionTasks" /> <data value="" name="allowRepeats" /> </task> <task type="Wait for Tasks" id="10" taskOnFail="false" > <data value="" name="prerequisiteTasks" /> <data value="" name="exclusionTasks" /> <data value="" name="allowRepeats" /> </task> </task> The Class definition I am trying to deserialize to is in the form: public class task { public string prerequisiteTasks {get;set;} public string exclusionTasks {get;set;} public string allowRepeats {get;set;} [System.Xml.Serialization.XmlElementAttribute("task")] public List<task> ChildTasks {get;set;} } The child 'task's are fine, but the generated files put the 'data' elements into an array of data[] rather than as named members of the task class as I need.

    Read the article

  • scala: defining a tratit and referencing the corresponding companion object

    - by opensas
    I'm trying to define a trait that uses the corresponding companion object, that is, the componion object of the class using the trait. for example, I have: :paste class Parent { def callMyCompanion = print(Parent.salute) } object Parent { def salute = "Hello from Parent companion object" } class Child extends Parent { } object Child { def salute = "Hello from Child companion object" } And then I create a parent object: scala> val p = new Parent() p: Parent = Parent@1ecf669 scala> p.callMyCompanion Hello from Parent companion object But with a child: scala> val c = new Child() c: Child = Child@4fd986 scala> c.callMyCompanion Hello from Parent companion object I'd like to get: Hello from Child companion object How can I achieve it???

    Read the article

  • Best practice to handle Parent Form Child Form relation using Presentation Model

    - by Rajarshi
    According to Presentation Model notes by Martin Fowler and also on MSDN documentation about Presentation Model, it is explained that the Presentation Model Class should be unaware of the UI class and similarly Business Model Class should be unaware of the Presentation Model class. The UI should databind extensively to the Presentation Model, the Presentation Model in turn will co-ordinate with one or more Domain/Business Model objects to get the job done. The Presentation Model basically presents the Domain Model data in a way to facilitate maximum data binding in UI, allowing the UI take as less decisions as possible and thus increase testability of Presentation behaviours. This also makes the presentation model class generic, i.e. agnostic of any particular UI technology. Now, consider there is a List form (say CustomerList) and there is another Root form (say Customer) and there is a Use Case of allowing to Edit a Customer from the CustomerList form on a button click. For simplicity of discussion, consider that some actions took place when Customer List is opened from menu (i.e. Customer menu clicked) and the Customer List has been shown from the Menu click event. Now as per the above Use Case, I need to open the Customer Root UI (single Customer) from the Customer List. How do I do that? Build necessary objects (BusinessModel, PresentationModel, UI) in click event of Edit button and call CustomerEdit UI from there? Build the CustomerEdit UI from Presentation Model Class and show UI from presentation model? this can be done in any of the two ways below - a. Create objects in the following sequence DomainModel-PresentationModel-UIForm b. Use Unity.Resolve(); Either ways, Presentation Model is violated as the P model now has to the refer the concrete UI assembly, where CustomerEdit is located. Also the P Model has to refer and use a WinForm directly making it less UI technology agnostic. Even though the violations are in theory and can be ignored, I would still seek the community's opinion about whether I am going wrong direction. Please suggest if there's a better way to call the Child Form from the List (Parent) Form. Rajarshi

    Read the article

  • Rails: Passing new child object placeholder (build) to parent view

    - by Meltemi
    I've got 2 classes of objects... Magician has_many Rabbits and Rabbit belongs_to Magician. When viewing a Magician (show.html) I'd like to list all the associated Rabbits and then have some blank fields with a submit button to add a new Rabbit. To do so I build a new rabbit (associated to the current magician) in the Magician's show method (below). Edit2: found way to make it work but not sure if it's the "Rails way"? see comments inline (below): If I build the rabbit in Magician's show method then when show is rendered an empty (and invalid) rabbit ends the list before the new rabbit form fields are then shown. If I build it in the view itself then everything works & renders correctly. I was led to believe that we should not be doing this type of stuff in the view...if so, what's the proper way to address this? #/app/controllers/magicians_controller.rb class MagiciansController < ApplicationController respond_to :html, :json def show @magician = Magician.find(params[:id]) @rabbit = @magician.rabbits.build # <=== build here and empty rabbit gets # included in @magician.rabbits when they're rendered... # but is NOT included in @magician.rabbits.count for some reason?!?!? respond_with(@magician) end ... end #view/magicians/show.html.haml %p %b Name: = @magician.name %h2 Rabbits = "There are #{pluralize(@magician.rabbits.count, "rabbit")}" = render @magician.rabbits, :target => @magician %h2 Add a rabbit: - @rabbit = @clown.rabbits.build -# <=== build here and everything SEEMS to work = render :partial =>"rabbits/form", :locals => { :parent => @magician, :foreign_key => :magician_id, :flash => flash } Edit1: Adding generated html from partial as per request: <p> <b>Rabbit:</b> <b>Color:</b> | <b>ID:</b> <a href="/magicians/2/rabbits" data-confirm="Sure? A bunny will die" data-method="delete" rel="nofollow">Kill Rabbit</a> </p> And I suppose you probably want to see the partial that generates this: %p %b Rabbit: = rabbit.name %b Color: = rabbit.color | %b ID: = rabbit.id = link_to("Kill Rabbit", [target, rabbit], :method => :delete, :confirm => "Sure? A bunny will die")

    Read the article

  • How to read XML parent node tag value

    - by kaibuki
    HI Guys, I have a java code to read XML nodes, I want to add in the addition and want to read the parent node value also. my XML file sample is below: <breakfast_menu><food id=1><name> Belgian Waffles </name><price> $5.95 </price><description> two of our famous Belgian Waffles with plenty of real maple syrup </description><calories> 650 </calories></food><food id=2><name>Strawberry Belgian waffles</name><price>$7.95</price><description>light Belgian waffles covered with strawberries and whipped cream</description><calories>900</calories></food></breakfast_menu> and my code for parsing xml is : public static String getProductItem(String pid, String item) { try { url = new URL(""); urlConnection = url.openConnection(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { } try { dBuilder = dbFactory.newDocumentBuilder(); } catch (ParserConfigurationException e) { } try { doc = dBuilder.parse(urlConnection.getInputStream()); } catch (SAXException e) { } catch (IOException e) { } doc.getDocumentElement().normalize(); NodeList nList = doc.getElementsByTagName("food"); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; data = getTagValue(item, eElement); } } doc = null; dBuilder = null; return data; } private static String getTagValue(String sTag, Element eElement) { NodeList nlList = eElement.getElementsByTagName(sTag).item(0) .getChildNodes(); Node nValue = (Node) nlList.item(0); return nValue.getNodeValue(); } What I want to do is to read the "id" value of food, so if if I am searching for a food, it only checks those food nodes, whose id matched the food node id. thanks in advance. cheers.. kai

    Read the article

  • JarOutputStream put parent folder before my-wanted folder

    - by adhitya kristanto
    I tried to make jar with code from How to use JarOutputStream to create a JAR file? but that code always makes new parent folder of my input file/folder before it's inserted into .jar Folder's Path that I want to be added into jar: C:/Trial/MyFolder Folder that I want in MyJar.jar: MyFolder But Folder that was inserted in MyJar.jar: Trial Has it to be done that way? Thanks. here is the code: import EditorXML.GlobalStatus.GlobalStatus; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; /** * * @author Photosphere */ public class JarCreatingProgram { public JarCreatingProgram() { } public void proceedNow() throws IOException{ File ed = new File("C:/Trial/EditingDini"); File meta = new File("C:/Trial/META-INF"); File net = new File("C:/Trial/net"); File org = new File("C:/Trial/org"); JarOutputStream target = new JarOutputStream(new FileOutputStream("D:/EditingDiniApp.jar")); add(ed, target); add(meta, target); add(net, target); add(org, target); target.close(); } private static void add(File source, JarOutputStream target) throws IOException { BufferedInputStream in = null; try{ if (source.isDirectory()) { String name = source.getPath().replace("\\", "/"); if (!name.isEmpty()) { if (!name.endsWith("/")) name += "/"; JarEntry entry = new JarEntry(name); entry.setTime(source.lastModified()); target.putNextEntry(entry); System.out.println("ENTRY DALAM IF: "+entry.toString()); target.closeEntry(); } for (File nestedFile: source.listFiles()) add(nestedFile, target); return; } JarEntry entry = new JarEntry(source.getPath().replace("\\", "/")); entry.setTime(source.lastModified()); target.putNextEntry(entry); in = new BufferedInputStream(new FileInputStream(source)); System.out.println("ENTRY: "+entry.toString()); byte[] buffer = new byte[1024]; while (true) { int count = in.read(buffer); if (count == -1) break; target.write(buffer, 0, count); } target.closeEntry(); } finally{ if (in != null) in.close(); } } }

    Read the article

  • Many DIVs inside parent DIV, CSS height issue

    - by Benjamin
    Hi everyone, I am putting together a dynamic photo gallery and getting stuck trying to place thumbnails. Basically I am trying to place each thumbnail and caption in its own DIV, floated to the left. The thumbnails are working just as I want them to but for some reason the parent DIV refuses to cover the height of the thumbnail area. Here is the CSS I am using.. #galleryBox { width: 650px; background: #fff; margin: auto; padding: 5px; text-align: center; } .item { display: block; margin: 10px; padding: 10px; float: left; background: #353535; min-width: 120px; } .label { display: block; color: #fff; } I have tried height: auto and that hasn't done anything. Here is what I am trying to style: <div id="galleryBox" class="ui-corner-all"> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> </div> Thanks!

    Read the article

  • bind parent child listview asp.net

    - by Chris
    I'm trying to display two linq query results in a prent and child listview. I have the following code which gets the correct values to populate the listviews but when I nest the child listview inside the parent list view, I get an error saying "The name 'ListView2' does not exist in the current context". I presume I need to bind the two listviews in the code behind but my problem is I don't know how or the best way to do this. I have read a couple of posts on similar problems but my lack of knowledge on the subject doesn't make it clear to me. Please can somebody help me figure this out? It's the final piece of code I need to complete. Many thanks in advance. Here is my .aspx code: <asp:ListView ID="ListView1" runat="server"> <EmptyDataTemplate>No data was returned.</EmptyDataTemplate> <ItemSeparatorTemplate><br /></ItemSeparatorTemplate> <ItemTemplate> <li> <asp:Label ID="LabelID" runat="server" Text='<%# Eval("RecordID") %>'></asp:Label><br /> <asp:Label ID="LabelNumber" runat="server" Text='<%# Eval("CartID") %>'></asp:Label><br /> <asp:Label ID="LabelName" runat="server" Text='<%# Eval("Number") %>'></asp:Label><br /> <asp:Label ID="LabelDestination" runat="server" Text='<%# Eval("Destination") %>'></asp:Label><br /> <asp:Label ID="LabelPkgName" runat="server" Text='<%# Eval("PkgName") %>'></asp:Label> <li> <!-- LIST VIEW FOR FEATURES --> <asp:ListView ID="ListView2" runat="server"> <EmptyDataTemplate>No data was returned.</EmptyDataTemplate> <ItemSeparatorTemplate><br /></ItemSeparatorTemplate> <ItemTemplate> <li> <asp:Label ID="LabelFeatureName" runat="server" Text='<%# Eval("FeatureName") %>'></asp:Label><br /> <asp:Label ID="LabelFeatureSetUp" runat="server" Text='<%# Eval("FeatureSetUp") %>'></asp:Label><br /> <asp:Label ID="LabelFeatureMonthly" runat="server" Text='<%# Eval("FeatureMonthly") %>'></asp:Label><br /> </li> </ItemTemplate> <LayoutTemplate> <ul ID="itemPlaceholderContainer" runat="server" style=""> <li runat="server" id="itemPlaceholder" /> </ul> </LayoutTemplate> </asp:ListView> <!-- LIST VIEW FOR FEATURES [END] --> </li> </li> </ItemTemplate> <LayoutTemplate> <ul ID="itemPlaceholderContainer" runat="server" style=""> <li runat="server" id="itemPlaceholder" /> </ul> </LayoutTemplate> </asp:ListView> Here is my code behind: MyShoppingCart userShoppingCart = new MyShoppingCart(); string cartID = userShoppingCart.GetShoppingCartId(); using (ShoppingCartv2Entities db = new ShoppingCartv2Entities()) { var CartNumber = from c in db.NewViews where c.CartID == cartID select c; foreach (NewView item in CartNumber) { ListView1.DataSource = CartNumber; ListView1.DataBind(); } var CartFeature = from f in db.NewViews join o in db.NumberFeatureViews on f.RecordID equals o.RecordID where f.CartID == cartID select new { o.FeatureName, o.FeatureSetUp, o.FeatureMonthly }; foreach (var x in CartFeature) { ListView2.DataSource = CartFeature; ListView2.DataBind(); } }

    Read the article

  • OWB 11gR2 - Early Arriving Facts

    - by Dawei Sun
    A common challenge when building ETL components for a data warehouse is how to handle early arriving facts. OWB 11gR2 introduced a new feature to address this for dimensional objects entitled Orphan Management. An orphan record is one that does not have a corresponding existing parent record. Orphan management automates the process of handling source rows that do not meet the requirements necessary to form a valid dimension or cube record. In this article, a simple example will be provided to show you how to use Orphan Management in OWB. We first import a sample MDL file that contains all the objects we need. Then we take some time to examine all the objects. After that, we prepare the source data, deploy the target table and dimension/cube loading map. Finally, we run the loading maps, and check the data in target dimension/cube tables. OK, let’s start… 1. Import MDL file and examine sample project First, download zip file from here, which includes a MDL file and three source data files. Then we open OWB design center, import orphan_management.mdl by using the menu File->Import->Warehouse Builder Metadata. Now we have several objects in BI_DEMO project as below: Mapping LOAD_CHANNELS_OM: The mapping for dimension loading. Mapping LOAD_SALES_OM: The mapping for cube loading. Dimension CHANNELS_OM: The dimension that contains channels data. Cube SALES_OM: The cube that contains sales data. Table CHANNELS_OM: The star implementation table of dimension CHANNELS_OM. Table SALES_OM: The star implementation table of cube SALES_OM. Table SRC_CHANNELS: The source table of channels data, that will be loaded into dimension CHANNELS_OM. Table SRC_ORDERS and SRC_ORDER_ITEMS: The source tables of sales data that will be loaded into cube SALES_OM. Sequence CLASS_OM_DIM_SEQ: The sequence used for loading dimension CHANNELS_OM. Dimension CHANNELS_OM This dimension has a hierarchy with three levels: TOTAL, CLASS and CHANNEL. Each level has three attributes: ID (surrogate key), NAME and SOURCE_ID (business key). It has a standard star implementation. The orphan management policy and the default parent setting are shown in the following screenshots: The orphan management policy options that you can set for loading are: Reject Orphan: The record is not inserted. Default Parent: You can specify a default parent record. This default record is used as the parent record for any record that does not have an existing parent record. If the default parent record does not exist, Warehouse Builder creates the default parent record. You specify the attribute values of the default parent record at the time of defining the dimensional object. If any ancestor of the default parent does not exist, Warehouse Builder also creates this record. No Maintenance: This is the default behavior. Warehouse Builder does not actively detect, reject, or fix orphan records. While removing data from a dimension, you can select one of the following orphan management policies: Reject Removal: Warehouse Builder does not allow you to delete the record if it has existing child records. No Maintenance: This is the default behavior. Warehouse Builder does not actively detect, reject, or fix orphan records. (More details are at http://download.oracle.com/docs/cd/E11882_01/owb.112/e10935/dim_objects.htm#insertedID1) Cube SALES_OM This cube is references to dimension CHANNELS_OM. It has three measures: AMOUNT, QUANTITY and COST. The orphan management policy setting are shown as following screenshot: The orphan management policy options that you can set for loading are: No Maintenance: Warehouse Builder does not actively detect, reject, or fix orphan rows. Default Dimension Record: Warehouse Builder assigns a default dimension record for any row that has an invalid or null dimension key value. Use the Settings button to define the default parent row. Reject Orphan: Warehouse Builder does not insert the row if it does not have an existing dimension record. (More details are at http://download.oracle.com/docs/cd/E11882_01/owb.112/e10935/dim_objects.htm#BABEACDG) Mapping LOAD_CHANNELS_OM This mapping loads source data from table SRC_CHANNELS to dimension CHANNELS_OM. The operator CHANNELS_IN is bound to table SRC_CHANNELS; CHANNELS_OUT is bound to dimension CHANNELS_OM. The TOTALS operator is used for generating a constant value for the top level in the dimension. The CLASS_FILTER operator is used to filter out the “invalid” class name, so then we can see what will happen when those channel records with an “invalid” parent are loading into dimension. Some properties of the dimension operator in this mapping are important to orphan management. See the screenshot below: Create Default Level Records: If YES, then default level records will be created. This property must be set to YES for dimensions and cubes if one of their orphan management policies is “Default Parent” or “Default Dimension Record”. This property is set to NO by default, so the user may need to set this to YES manually. LOAD policy for INVALID keys/ LOAD policy for NULL keys: These two properties have the same meaning as in the dimension editor. The values are set to the same as the dimension value when user drops the dimension into the mapping. The user does not need to modify these properties. Record Error Rows: If YES, error rows will be inserted into error table when loading the dimension. REMOVE Orphan Policy: This property is used when removing data from a dimension. Since the dimension loading type is set to LOAD in this example, this property is disabled. Mapping LOAD_SALES_OM This mapping loads source data from table SRC_ORDERS and SRC_ORDER_ITEMS to cube SALES_OM. This mapping seems a little bit complicated, but operators in the red rectangle are used to filter out and generate the records with “invalid” or “null” dimension keys. Some properties of the cube operator in a mapping are important to orphan management. See the screenshot below: Enable Source Aggregation: Should be checked in this example. If the default dimension record orphan policy is set for the cube operator, then it is recommended that source aggregation also be enabled. Otherwise, the orphan management processing may produce multiple fact rows with the same default dimension references, which will cause an “unstable rowset” execution error in the database, since the dimension refs are used as update match attributes for updating the fact table. LOAD policy for INVALID keys/ LOAD policy for NULL keys: These two properties have the same meaning as in the cube editor. The values are set to the same as in the cube editor when the user drops the cube into the mapping. The user does not need to modify these properties. Record Error Rows: If YES, error rows will be inserted into error table when loading the cube. 2. Deploy objects and mappings We now can deploy the objects. First, make sure location SALES_WH_LOCAL has been correctly configured. Then open Control Center Manager by using the menu Tools->Control Center Manager. Expand BI_DEMO->SALES_WH_LOCAL, click SALES_WH node on the project tree. We can see the following objects: Deploy all the objects in the following order: Sequence CLASS_OM_DIM_SEQ Table CHANNELS_OM, SALES_OM, SRC_CHANNELS, SRC_ORDERS, SRC_ORDER_ITEMS Dimension CHANNELS_OM Cube SALES_OM Mapping LOAD_CHANNELS_OM, LOAD_SALES_OM Note that we deployed source tables as well. Normally, we import source table from database instead of deploying them to target schema. However, in this example, we designed the source tables in OWB and deployed them to database for the purpose of this demonstration. 3. Prepare and examine source data Before running the mappings, we need to populate and examine the source data first. Run SRC_CHANNELS.sql, SRC_ORDERS.sql and SRC_ORDER_ITEMS.sql as target user. Then we check the data in these three tables. Table SRC_CHANNELS SQL> select rownum, id, class, name from src_channels; Records 1~5 are correct; they should be loaded into dimension without error. Records 6,7 and 8 have null parents; they should be loaded into dimension with a default parent value, and should be inserted into error table at the same time. Records 9, 10 and 11 have “invalid” parents; they should be rejected by dimension, and inserted into error table. Table SRC_ORDERS and SRC_ORDER_ITEMS SQL> select rownum, a.id, a.channel, b.amount, b.quantity, b.cost from src_orders a, src_order_items b where a.id = b.order_id; Record 178 has null dimension reference; it should be loaded into cube with a default dimension reference, and should be inserted into error table at the same time. Record 179 has “invalid” dimension reference; it should be rejected by cube, and inserted into error table. Other records should be aggregated and loaded into cube correctly. 4. Run the mappings and examine the target data In the Control Center Manager, expand BI_DEMO-> SALES_WH_LOCAL-> SALES_WH-> Mappings, right click on LOAD_CHANNELS_OM node, click Start. Use the same way to run mapping LOAD_SALES_OM. When they successfully finished, we can check the data in target tables. Table CHANNELS_OM SQL> select rownum, total_id, total_name, total_source_id, class_id,class_name, class_source_id, channel_id, channel_name,channel_source_id from channels_om order by abs(dimension_key); Records 1,2 and 3 are the default dimension records for the three levels. Records 8, 10 and 15 are the loaded records that originally have null parents. We see their parents name (class_name) is set to DEF_CLASS_NAME. Those records whose CHANNEL_NAME are Special_4, Special_5 and Special_6 are not loaded to this table because of the invalid parent. Error Table CHANNELS_OM_ERR SQL> select rownum, class_source_id, channel_id, channel_name,channel_source_id, err$$$_error_reason from channels_om_err order by channel_name; We can see all the record with null parent or invalid parent are inserted into this error table. Error reason is “Default parent used for record” for the first three records, and “No parent found for record” for the last three. Table SALES_OM SQL> select a.*, b.channel_name from sales_om a, channels_om b where a.channels=b.channel_id; We can see the order record with null channel_name has been loaded into target table with a default channel_name. The one with “invalid” channel_name are not loaded. Error Table SALES_OM_ERR SQL> select a.amount, a.cost, a.quantity, a.channels, b.channel_name, a.err$$$_error_reason from sales_om_err a, channels_om b where a.channels=b.channel_id(+); We can see the order records with null or invalid channel_name are inserted into error table. If the dimension reference column is null, the error reason is “Default dimension record used for fact”. If it is invalid, the error reason is “Dimension record not found for fact”. Summary In summary, this article illustrated the Orphan Management feature in OWB 11gR2. Automated orphan management policies improve ETL developer and administrator productivity by addressing an important cause of cube and dimension load failures, without requiring developers to explicitly build logic to handle these orphan rows.

    Read the article

  • How to implement child-parent aggregation link in C++?

    - by Giorgio
    Suppose that I have three classes P, C1, C2, composition (strong aggregation) relations between P <>- C1 and P <>- C2, i.e. every instance of P contains an instance of C1 and an instance of C2, which are destroyed when the parent P instance is destroyed. an association relation between instances of C1 and C2 (not necessarily between children of the same P). To implement this, in C++ I normally define three classes P, C1, C2, define two member variables of P of type boost::shared_ptr<C1>, boost::shared_ptr<C2>, and initialize them with newly created objects in P's constructor, implement the relation between C1 and C2 using a boost::weak_ptr<C2> member variable in C1 and a boost::weak_ptr<C1> member variable in C2 that can be set later via appropriate methods, when the relation is established. Now, I also would like to have a link from each C1 and C2 object to its P parent object. What is a good way to implement this? My current idea is to use a simple constant raw pointer (P * const) that is set from the constructor of P (which, in turn, calls the constructors of C1 and C2), i.e. something like: class C1 { public: C1(P * const p, ...) : paren(p) { ... } private: P * const parent; ... }; class P { public: P(...) : childC1(new C1(this, ...)) ... { ... } private: boost::shared_ptr<C1> childC1; ... }; Honestly I see no risk in using a private constant raw pointer in this way but I know that raw pointers are often frowned upon in C++ so I was wondering if there is an alternative solution.

    Read the article

  • How to get correct children ids using fields_for "parents[]", parent do |f| using f.fields_for :children, child ?

    - by Anatortoise House
    I'm editing multiple instances of a parent model in an index view in one form, as in Railscasts #198. Each parent has_many :children and accepts_nested_attributes_for :children, as in Railscasts #196 and #197 <%= form_tag %> <% for parent in @parents %> <%= fields_for "parents[]", parent do |f| <%= f.text_field :job %> <%= f.fields_for :children do |cf| %> <% cf.text_field :chore %> <% end %> <% end %> <% end %> <% end %> Given parent.id==1 f.text_field :job correctly generates <input id="parents_1_job" type="text" value="coding" size="30" name="parents[1][job]"> But cf.text_field :chore generates ids and names that don't have the parent index. id="parents_children_attributes_0_chore" name="parents[children_attributes][0][chore]" If I try passing the specific child object to f.fields_for like this: <% for child in parent.children %> <%= f.fields_for :children, child do |cf| %> <%= cf.text_field :chore %> <% end %> <% end %> I get the same. If I change the method from :children to "[]children" I get id="parents_1___children_chore" which gets the right parent_index but doesn't provide an array slot for the child index. "[]children[]" isn't right either: id="parents_1__children_3_chore" as I was expecting attributes_0_chore instead of 3_chore. Do I need to directly modify an attribute of the FormBuilder object, or subclass FormBuilder to make this work, or is there a syntax that fits this situation? Thanks for any thoughts.

    Read the article

  • Accessing preloaded images from parent script two use in child script. How?

    - by Matt
    I'm trying to update an image in a parent window with clickable links in a child window. I've preloaded the images in the parent window with one javascript file. "scriptss.js" My problem is I need to access the preloaded images of the parent window with the childscript "scriptremote.js" Thanks again for all the JS Help! The JS (scriptss.js) var newWindow = null; window.onload = init; var i = 0; image_object = new Image(); myImages = new Array(); // declare array myImages[0]="images/img1.jpg" // load array myImages[1]="images/img2.jpg" myImages[2]="images/img3.jpg" myImages[3]="images/img4.jpg" myImages[4]="images/img5.jpg" myImages[5]="images/img6.jpg" Here's the HTML for parent window: <img src="" width="200px" height="200px" id="myimage" name="myimage" /></img> Here's the JS for child window: window.onload = init; function init() { } function first_image() { window.parent.image_object.src = myImages[3]; //Problem happens here I think document.getElementById("myimage")window.parent.src = window.parent.image_object.src; } The HTML Child Window <h1>My Remote</h1> <a href="#" id="first" onclick="first_image()" >First Image</a> </br>

    Read the article

  • Accessing preloaded images from parent script too use in child script. How?

    - by Matt
    I'm trying to update an image in a parent window with clickable links in a child window. I've preloaded the images in the parent window with one javascript file. "scriptss.js" My problem is I need to access the preloaded images of the parent window with the childscript "scriptremote.js" Thanks again for all the JS Help! The JS (scriptss.js) var newWindow = null; window.onload = init; var i = 0; image_object = new Image(); myImages = new Array(); // declare array myImages[0]="images/img1.jpg" // load array myImages[1]="images/img2.jpg" myImages[2]="images/img3.jpg" myImages[3]="images/img4.jpg" myImages[4]="images/img5.jpg" myImages[5]="images/img6.jpg" Here's the HTML for parent window: <img src="" width="200px" height="200px" id="myimage" name="myimage" /></img> Here's the JS for child window: window.onload = init; function init() { } function first_image() { window.parent.image_object.src = myImages[3]; //Problem happens here I think document.getElementById("myimage")window.parent.src = window.parent.image_object.src; } The HTML Child Window <h1>My Remote</h1> <a href="#" id="first" onclick="first_image()" >First Image</a> </br>

    Read the article

  • How to select parent row only if has at least one child?

    - by Matt McCormick
    I have a simple one-to-many relationship. I would like to select rows from the parent only when they have at least one child. So, if there are no children, then the parent row is not returned in the result set. Eg. Parent: +--+---------+ |id| text | +--+---------+ | 1| Blah | | 2| Blah2 | | 3| Blah3 | +--+---------+ Children +--+------+-------+ |id|parent| other | +--+------+-------+ | 1| 1 | blah | | 2| 1 | blah2 | | 3| 2 | blah3 | +--+------+-------+ I want the results to be: +----+------+ |p.id|p.text| +----+------+ | 1 | Blah | | 2 | Blah2| +----+------+

    Read the article

  • How to get a random item from the tree given a parent node?

    - by Bryan
    I have a scenario where I would like to randomize the display of some items. Given a Parent item, how can I randomly select one of its child items? Of course I could load ALL the children and apply some random index or whatnot... but that would be wildly inefficient. I'm wondering if this is also inefficient: Parent.Children[random(Parent.Children.Count)]? At what point do the items get loaded when you access Parent.Children?

    Read the article

  • Have a child window be notified when parent window goes to a different page?

    - by Heinrich Schmetterling
    i have a parent window and a child window. in javascript, i want a function in child window to be called whenever the parent window loads a new page. i'd like to use something similar to jQuery's $(document).ready() so that I don't have to worry about whether the parent is done loading yet - but ready() only appears to fire when the window loads the first page - but not when, say, a link is clicked in the parent and it loads a second page. any suggestions? thanks.

    Read the article

  • jQuery: have a child window be notified when parent window goes to a different page?

    - by Heinrich Schmetterling
    i have a parent window and a child window. in javascript, i want a function in child window to be called whenever the parent window loads a new page. i'd like to use something similar to jQuery's $(document).ready() so that I don't have to worry about whether the parent is done loading yet - but ready() only appears to fire when the window loads the first page - but not when, say, a link is clicked in the parent and it loads a second page. any suggestions? thanks.

    Read the article

  • Enum types, FlagsAttribute & Zero value – Part 2

    - by nmgomes
    In my previous post I wrote about why you should pay attention when using enum value Zero. After reading that post you are probably thinking like Benjamin Roux: Why don’t you start the enum values at 0x1? Well I could, but doing that I lose the ability to have Sync and Async mutually exclusive by design. Take a look at the following enum types: [Flags] public enum OperationMode1 { Async = 0x1, Sync = 0x2, Parent = 0x4 } [Flags] public enum OperationMode2 { Async = 0x0, Sync = 0x1, Parent = 0x2 } To achieve mutually exclusion between Sync and Async values using OperationMode1 you would have to operate both values: protected void CheckMainOperarionMode(OperationMode1 mode) { switch (mode) { case (OperationMode1.Async | OperationMode1.Sync | OperationMode1.Parent): case (OperationMode1.Async | OperationMode1.Sync): throw new InvalidOperationException("Cannot be Sync and Async simultaneous"); break; case (OperationMode1.Async | OperationMode1.Parent): case (OperationMode1.Async): break; case (OperationMode1.Sync | OperationMode1.Parent): case (OperationMode1.Sync): break; default: throw new InvalidOperationException("No default mode specified"); } } but this is a by design constraint in OperationMode2. Why? Simply because 0x0 is the neutral element for the bitwise OR operation. Knowing this singularity, replacing and simplifying the previous method, you get: protected void CheckMainOperarionMode(OperationMode2 mode) { switch (mode) { case (OperationMode2.Sync | OperationMode2.Parent): case (OperationMode2.Sync): break; case (OperationMode2.Parent): default: break; } This means that: if both Sync and Async values are specified Sync value always win (Zero is the neutral element for bitwise OR operation) if no Sync value specified, the Async method is used. Here is the final method implementation: protected void CheckMainOperarionMode(OperationMode2 mode) { if (mode & OperationMode2.Sync == OperationMode2.Sync) { } else { } } All content above prove that Async value (0x0) is useless from the arithmetic perspective, but, without it we lose readability. The following IF statements are logically equals but the first is definitely more readable: if (OperationMode2.Async | OperationMode2.Parent) { } if (OperationMode2.Parent) { } Here’s another example where you can see the benefits of 0x0 value, the default value can be used explicitly. <my:Control runat="server" Mode="Async,Parent"> <my:Control runat="server" Mode="Parent">

    Read the article

  • Do parent website application pools serve child application pools as well?

    - by Mike G
    I am running a .NET web application in its own application pool on IIS7. The parent website is set to run in its own application pool. Today we noticed a huge number of connections going to IIS. I tried to browse a plain ol' .html page in the directory of the web application and it hangs. I then try to browse another plain .html file in the root of the parent website, and it too hangs. In performance monitor, i see there are some 8k connections to the default website and climbing. I cant seem to understand if my application was the problem, or IIS itself. If it was my application, wouldnt the html page in the root of the parent website still be able to be served? edit: Also, if i shut down the app pool to my application, the html page on the root of the parent website is still not able to be displayed.

    Read the article

  • Selecting a different parent in Family Safety filters for Windows 8?

    - by Zhaph - Ben Duguid
    I've got Family Safety up and running nicely on a Windows 8 Surface, with two parent accounts and two child accounts. When one of the child accounts reaches its time limit, the user can "Ask a parent for more time". However, the next dialog doesn't allow the parents to choose which parent account to use - it always comes up with my account, and my wife can't log in to authorise. How can I allow the her account to allow more time/authorise sites etc? She can use the same Live login on our Windows 7 computers to control these settings, and is listed as a Parent on the Family Safety website.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >