Search Results

Search found 5987 results on 240 pages for 'nested sets'.

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

  • C++ visibility of privately inherited typedefs to nested classes

    - by beldaz
    First time on StackOverflow, so please be tolerant. In the following example (apologies for the length) I have tried to isolate some unexpected behaviour I've encountered when using nested classes within a class that privately inherits from another. I've often seen statements to the effect that there is nothing special about a nested class compared to an unnested class, but in this example one can see that a nested class (at least according to GCC 4.4) can see the public typedefs of a class that is privately inherited by the closing class. I appreciate that typdefs are not the same as member data, but I found this behaviour surprising, and I imagine many others would, too. So my question is threefold: Is this standard behaviour? (a decent explanation of why would be very helpful) Can one expect it to work on most modern compilers (i.e., how portable is it)? #include <iostream> class Base { typedef int priv_t; priv_t priv; public: typedef int pub_t; pub_t pub; Base() : priv(0), pub(1) {} }; class PubDerived : public Base { public: // Not allowed since Base::priv is private // void foo() {std::cout << priv << "\n";} class Nested { // Not allowed since Nested has no access to PubDerived member data // void foo() {std::cout << pub << "\n";} // Not allowed since typedef Base::priv_t is private // void bar() {priv_t x=0; std::cout << x << "\n";} }; }; class PrivDerived : private Base { public: // Allowed since Base::pub is public void foo() {std::cout << pub << "\n";} class Nested { public: // Works (gcc 4.4 - see below) void fred() {pub_t x=0; std::cout << x << "\n";} }; }; int main() { // Not allowed since typedef Base::priv_t private // std::cout << PubDerived::priv_t(0) << "\n"; // Allowed since typedef Base::pub_t is inaccessible std::cout << PubDerived::pub_t(0) << "\n"; // Prints 0 // Not allowed since typedef Base::pub_t is inaccessible //std::cout << PrivDerived::pub_t(0) << "\n"; // Works (gcc 4.4) PrivDerived::Nested o; o.fred(); // Prints 0 return 0; }

    Read the article

  • Array with nested values. Display in ul list. php html.

    - by btwong
    i have a record set returned from a data base that is looking like this: id | level | lft | rgt | title --------------------------------- 1 |    | 1 | 8 | title 1 2 | -  | 2 | 5 | sub title 1-1 3 | -- | 3 | 4 | sub sub title 1 4 | -  | 6 | 7 | sub title 1-2 5 |    | 9 | 12 | title 2 6 | -  | 10 | 11 | sub title 2 AS you can see its a hierarchy list, with left n right values. I am trying to display this record set in a list with the correct indentation, so that it appears like this: Title 1 Sub title 1-1 Sub sub title sub title 1-2 Title 2 sub title 2 Any pointers to do this with the one record set? Or should i use multiple queries to display this?

    Read the article

  • joining two sets in LINQ

    - by user343209
    var setsA = new List<SetA> { new SetA { SsnA = "3450734507", name = "setA"}, new SetA { SsnA = "6833467788", name = "setA"}, new SetA { SsnA = "5452347787", name = "setA"}, new SetA { SsnA = "9345345345", name = "setA"}, }; var setsB = new List<SetB> { new SetB { SsnB = "5452347787" ,name = "setB"}, new SetB { SsnB = "9345345345", name = "setB"}, }; when i use this linq: var Set = from seta in setsA join setb in setsB on seta.SsnA equals setb.SsnB select new { SSN = seta.SsnA, NAME = setb.name }; i get this value: { SSN = "5452347787", NAME = "setB" } { SSN = "9345345345", NAME = "setB" } but i would want to have SET which combines these two and the result would be: { SSN = "3450734507", NAME = "setA" } { SSN = "6833467788", NAME = "setA" } { SSN = "5452347787", NAME = "setB" } { SSN = "9345345345", NAME = "setB" } This would be a result set that would tell me with the name NAME property which set it was taken from, if SSN was found in SetA and SetB it would have property NAME = "setB" could someone help me with this?

    Read the article

  • T-SQL: Build Nested Set From Parent-Child Relationship

    - by Peder Rice
    I have a table that stores my Customer hierarchy with a nested set (due to the specific design of the application, I wasn't able to leverage just a Customer/Parent Customer mapping table). To simplify maintenance of this table, I've built a couple of stored procedures to handle moving nodes around and creating new nodes, but it's significantly more work than maintaining a Customer/Parent Customer table. Further, these structures are very fragile. So I'm looking for a way to have a Customer/Parent Customer table and then convert that table to a nested set on demand. Does anyone have a link to such an implementation?

    Read the article

  • python / sets / dictionary / initialization

    - by Mario D
    Can someone explain help me understand how the this bit of code works? Particularly how the myHeap assignment works. I know the freq variable is assigned as a dictionary. But what about my myHeap? is it a Set? exe_Data = { 'e' : 0.124167, 't' : 0.0969225, 'a' : 0.0820011, 'i' : 0.0768052, } freq = exe_Data) myHeap = [[pct, [symbol, ""]] for symbol, pct in freq.items()]

    Read the article

  • Securing Flexfield Value Sets in EBS 12.2

    - by Sara Woodhull
    Release 12.2 includes a new feature: flexfield value set security. This new feature gives you additional options for ensuring that different administrators have non-overlapping responsibilities, which in turn provides checks and balances for sensitive activities.  Separation of Duties (SoD) is one of the key concepts of internal controls and is a requirement for many regulations including: Sarbanes-Oxley (SOX) Act Health Insurance Portability and Accountability Act (HIPAA) European Union Data Protection Directive. Its primary intent is to put barriers in place to prevent fraud or theft by an individual acting alone. Implementing Separation of Duties requires minimizing the possibility that users could modify data across application functions where the users should not normally have access. For flexfields and report parameters in Oracle E-Business Suite, values in value sets can affect functionality such as the rollup of accounting data, job grades used at a company, and so on. Controlling access to the creation or modification of value set values can be an important piece of implementing Separation of Duties in an organization. New Flexfield Value Set Security feature Flexfield value set security allows system administrators to restrict users from viewing, adding or updating values in specific value sets. Value set security enables role-based separation of duties for key flexfields, descriptive flexfields, and report parameters. For example, you can set up value set security such that certain users can view or insert values for any value set used by the Accounting Flexfield but no other value sets, while other users can view and update values for value sets used for any flexfields in Oracle HRMS. You can also segregate access by Operating Unit as well as by role or responsibility.Value set security uses a combination of data security and role-based access control in Oracle User Management. Flexfield value set security provides a level of security that is different from the previously-existing and similarly-named features in Oracle E-Business Suite: Function security controls whether a user has access to a specific page or form, as well as what operations the user can do in that screen. Flexfield value security controls what values a user can enter into a flexfield segment or report parameter (by responsibility) during routine data entry in many transaction screens across Oracle E-Business Suite. Flexfield value set security (this feature, new in Release 12.2) controls who can view, insert, or update values for a particular value set (by flexfield, report, or value set) in the Segment Values form (FNDFFMSV). The effect of flexfield value set security is that a user of the Segment Values form will only be able to view those value sets for which the user has been granted access. Further, the user will be able to insert or update/disable values in that value set if the user has been granted privileges to do so.  Flexfield value set security affects independent, dependent, and certain table-validated value sets for flexfields and report parameters. Initial State of the Feature upon Upgrade Because this is a new security feature, it is turned on by default.  When you initially install or upgrade to Release 12.2.2, no users are allowed to view, insert or update any value set values (users may even think that their values are missing or invalid because they cannot see the values).  You must explicitly set up access for specific users by enabling appropriate grants and roles for those users.We recommend using flexfield value set security as part of a comprehensive Separation of Duties strategy. However, if you choose not to implement flexfield value set security upon upgrading to or installing Release 12.2, you can enable backwards compatibility--users can access any value sets if they have access to the Values form--after you upgrade. The feature does not affect day-to-day transactions that use flexfields.  However, you must either set up specific grants and roles or enable backwards compatibility before users can create new values or update or disable existing values. For more information, see: Release 12.2 Flexfield Value Set Security Documentation Update for Patch 17305947:R12.FND.C (Document 1589204.1) R12.2 TOI: Implement and Use Application Object Library (AOL) - Flexfields Security and Separation of Duties for Value Sets (recorded training)

    Read the article

  • Efficiency of nested Loop

    - by didxga
    See the following snippet: //first nested loops for(int i=0;i<10;i++) { for(int j=1;j<1000000;j++) { //do some stuff } } //second nested loops for(int i=0;i<1000000;i++) { for(int j=1;j<10;j++) { //do some stuff } } I am wondering why the first nested loops is running slower than the second one? Regards!

    Read the article

  • Adjacency List Tree Using Recursive WITH (Postgres 8.4) instead of Nested Set

    - by Koobz
    I'm looking for a Django tree library and doing my best to avoid Nested Sets (they're a nightmare to maintain). The cons of the adjacency list model have always been an inability to fetch descendants without resorting to multiple queries. The WITH clause in Postgres seems like a solid solution to this problem. Has anyone seen any performance reports regarding WITH vs. Nested Set? I assume the Nested set will still be faster but as long as they're in the same complexity class, I could swallow a 2x performance discrepancy. Django-Treebeard interests me. Does anyone know if they've implemented the WITH clause when running under Postgres? Has anyone here made the switch away from Nested Sets in light of the WITH clause?

    Read the article

  • Nested function in C

    - by Sachin Chourasiya
    Can we have a nested function in C? What is the use of nested functions? If they exist in C does there implementation differes from compiler to compiler. Are nested functions allowed in any other language? If yes then what is there significance?

    Read the article

  • Mounting a Nested SSH Location

    - by Brandon Pelfrey
    I have a server that is only SSH-accessible to machines within a network and my only access to that network from the outside world is a single publicly-SSH-accessible node. Is there some way that I can mount the nested machine from the outside? Me - Public SSH-accessible Node - Internal SSH-accessible Machine Thanks!

    Read the article

  • Patterns for Handling Changing Property Sets in C++

    - by Bhargav Bhat
    I have a bunch "Property Sets" (which are simple structs containing POD members). I'd like to modify these property sets (eg: add a new member) at run time so that the definition of the property sets can be externalized and the code itself can be re-used with multiple versions/types of property sets with minimal/no changes. For example, a property set could look like this: struct PropSetA { bool activeFlag; int processingCount; /* snip few other such fields*/ }; But instead of setting its definition in stone at compile time, I'd like to create it dynamically at run time. Something like: class PropSet propSetA; propSetA("activeFlag",true); //overloading the function call operator propSetA("processingCount",0); And the code dependent on the property sets (possibly in some other library) will use the data like so: bool actvFlag = propSet["activeFlag"]; if(actvFlag == true) { //Do Stuff } The current implementation behind all of this is as follows: class PropValue { public: // Variant like class for holding multiple data-types // overloaded Conversion operator. Eg: operator bool() { return (baseType == BOOLEAN) ? this->ToBoolean() : false; } // And a method to create PropValues various base datatypes static FromBool(bool baseValue); }; class PropSet { public: // overloaded[] operator for adding properties void operator()(std::string propName, bool propVal) { propMap.insert(std::make_pair(propName, PropVal::FromBool(propVal))); } protected: // the property map std::map<std::string, PropValue> propMap; }; This problem at hand is similar to this question on SO and the current approach (described above) is based on this answer. But as noted over at SO this is more of a hack than a proper solution. The fundamental issues that I have with this approach are as follows: Extending this for supporting new types will require significant code change. At the bare minimum overloaded operators need to be extended to support the new type. Supporting complex properties (eg: struct containing struct) is tricky. Supporting a reference mechanism (needed for an optimization of not duplicating identical property sets) is tricky. This also applies to supporting pointers and multi-dimensional arrays in general. Are there any known patterns for dealing with this scenario? Essentially, I'm looking for the equivalent of the visitor pattern, but for extending class properties rather than methods. Edit: Modified problem statement for clarity and added some more code from current implementation.

    Read the article

  • Update ancestors in a nested set?

    - by Travis
    I am using nested sets to represent a tree in mysql, like so: Tree ID title lft rgt Given the ID of a node in the tree, what is the easiest / best way to UPDATE that node as well as all of it's ancestors? For example, let's say that the node ID (36) is 4 levels deep in the tree. I would like to update its title, as well as every parent node's title, all the way to the root, to the word "fish". (Should be four updates in all.) Thanks for your help!

    Read the article

  • MySQL nested set hierarchy with foreign table

    - by Björn
    Hi! I'm using a nested set in a MySQL table to describe a hierarchy of categories, and an additional table describing products. Category table; id name left right Products table; id categoryId name How can I retrieve the full path, containing all parent categories, of a product? I.e.: RootCategory > SubCategory 1 > SubCategory 2 > ... > SubCategory n > Product Say for example that I want to list all products from SubCategory1 and it's sub categories, and with each given Product I want the full tree path to that product - is this possible? This is as far as I've got - but the structure is not quite right... select parent.`name` as name, parent.`id` as id, group_concat(parent.`name` separator '/') as path from categories as node, categories as parent, (select inode.`id` as id, inode.`name` as name from categories as inode, categories as iparent where inode.`lft` between iparent.`lft` and iparent.`rgt` and iparent.`id`=4 /* The category from which to list products */ order by inode.`lft`) as sub where node.`lft` between parent.`lft` and parent.`rgt` and node.`id`=sub.`id` group by sub.`id` order by node.`lft`

    Read the article

  • How to render all records from a nested set into a real html tree

    - by Christoph Schiessl
    I'm using the awesome_nested_set plugin in my Rails project. I have two models that look like this (simplified): class Customer < ActiveRecord::Base has_many :categories end class Category < ActiveRecord::Base belongs_to :customer # Columns in the categories table: lft, rgt and parent_id acts_as_nested_set :scope => :customer_id validates_presence_of :name # Further validations... end The tree in the database is constructed as expected. All the values of parent_id, lft and rgt are correct. The tree has multiple root nodes (which is of course allowed in awesome_nested_set). Now, I want to render all categories of a given customer in a correctly sorted tree like structure: for example nested <ul> tags. This wouldn't be too difficult but I need it to be efficient (the less sql queries the better). Update: Figured out that it is possible to calculate the number of children for any given Node in the tree without further SQL queries: number_of_children = (node.rgt - node.lft - 1)/2. This doesn't solve the problem but it may prove to be helpful.

    Read the article

  • javascript filter nested object based on key value

    - by murray3
    I wish to filter a nested javascript object by the value of the "step" key: var data = { "name": "Root", "step": 1, "id": "0.0", "children": [ { "name": "first level child 1", "id": "0.1", "step":2, "children": [ { "name": "second level child 1", "id": "0.1.1", "step": 3, "children": [ { "name": "third level child 1", "id": "0.1.1.1", "step": 4, "children": []}, { "name": "third level child 2", "id": "0.1.1.2", "step": 5, "children": []} ]}, ]} ] }; var subdata = data.children.filter(function (d) { return (d.step <= 2)}); This just returns the unmodified nested object, even if I put value of filter to 1. does .filter work on nested objects or do I need to roll my own function here, advise and correct code appreciated. cjm

    Read the article

  • Checking for duplicates with nested forms

    - by Cyrus
    I'm making a rails 3.2.9 app that allows users to create pages and they can embed youtube videos through a nested form. I'm trying to figure out how to make it so that I can prevent duplicate video records from being stored in my db. So I have a Video model that takes the youtube url and just parses out the video id and stores that instead of the full user submitted youtube url, which may have extraneous url query parameters. So here's the situation that I'm trying to figure out: There's page1 with video1 - url: 123 and video2 - url: abc Then another user creates page2 and submits video3 - url: def and video4 - url: 123 Currently each page has_many videos. But I think I should change it to a many-to-many relationship. But how would I make it so that the url submitted as video4 in the nested form points to video1? Also I how would I make a nested form that creates objects that are connected through a join table?

    Read the article

  • Required Skill Sets Of A Software Architect

    The question has been asked as to what is the required skill sets of a software architect. The answer to this is that it truly depends. When I state that it depend, it depends on the organization, industry, and skill sets available on the open market and internally within a company. With open ended skill sets even Napoleon Dynamite could be an architect. Napoleon Dynamite’s Skills Pedro: Have you asked anybody yet? Napoleon Dynamite: No, but who would? I don't even have any good skills. Pedro: What do you mean? Napoleon Dynamite: You know, like nunchuck skills, bow hunting skills, computer hacking skills... Girls only want boyfriends who have great skills. Pedro: Aren't you pretty good at drawing, like animals and warriors and stuff? This example might be a little off base but it does illustrate a point. What are the real required skills of a software architect? In my opinion, an architect needs to demonstrate the knowledge of the following three main skill set categories so that they are successful. General Skill Sets of an Architect Basic Engineering Skills Organizational  Skills Interpersonal Skills Basic Engineering Skills are a very large part of what a software architect deal with on a daily bases when designing or updating systems. Think about it, how good would a lead mechanic be if they did not know how to fix or repair cars? They would not be, and that is my point that architects need to have at least some basic skills regarding engineering. The skills listed below are generic in nature because they change from job to job, so in this discussion I am trying to focus more on generalities so that anyone can apply this information to their individual situation. Common Basic Engineering Skills Data Modeling Code Creation Configuration Testing Deployment/Publishing System and Environment Knowledge Organizational Skills If an Architect works for or with an origination then they will need strong organization skills to survive. An architect is no use to a project if the project is missed managed. Additionally, budgets and timelines can really affect a company and their products when established deadlines are repeated not meet. By not meeting these timelines a company is forced to cancel the project and waste all the money and time spent or spend more money until it is completed, if it is ever completed. Common Organizational Skills Project Management Estimation (Cost and Time) Creation and Maintenance of Accepted Standards Interpersonal Skills For me personally Interpersonal skill ranks above the other types of skill sets because an architect can quickly pick up the other two skill sets by communicating with other team/project members so that they are quickly up to speed on a project. Additionally, in order for an architect to manage a project or even derive rough estimates they will more than likely have to consult with others actually working on the code (Programmers/Software Engineers) to get there estimates since they will be the ones actually working on the changes to be implemented. Common Interpersonal Skills Good Communicator Focus on projects success over personal Honors roles within a team Reference: Taylor, R. N., Medvidovic, N., & Dashofy, E. M. (2009). Software architecture: Foundations, theory, and practice Hoboken, NJ: John Wiley & Sons

    Read the article

  • Nested class - calling the nested class from the parent class

    - by insanepaul
    I have a class whereby a method calls a nested class. I want to access the parent class properties from within the nested class. public class ParentClass { private x; private y; private z; something.something = new ChildClass public class ChildClass { need to get x, y and z; } } How do I access x,y and z from within the child class. Something to do with referencing the parent class but how? }

    Read the article

  • not able to remove nested lists in a jQuery variable

    - by Pradyut Bhattacharya
    Hi I have a nested oredered list which i m animating using this code... var $li = $("ol#update li"); function animate_li(){ $li.filter(':first') .animate({ height: 'show', opacity: 'show' }, 500, function(){ animate_li(); }); $li = $li.not(':first'); } animate_li(); now i want not to show or animate the nested lists(ol s) or the li s in the ols take a look at the example here The structure of my ols are <ol> <li class="bar248"> <div class="nli"> <div class="pic"> <img src="dir/anonymous-thumb.png"alt="image" /> </div> <div align="left" class="text"> <span> <span class="delete_button"><a href="#" id="test" class="delete_update">R</a></span> test shouted <span class="timestamp"> 2010/02/24 18:34:26 </span> <br /> this </span> </div> <div class="clear"></div> </div> <div class="padd"> </div> <ol class="comment"> <li> <div>Testing </div> </li> <li> <div>Another Test </div> </li> </ol> </li> </ol> I m able to hide the nested ols using this code... $("ol#update li ol").hide(); But still time is being consumed in animating them although they are hidden I m not able to remove the nested li s using this code var $li = $("ol#update li").not("ol#update li ol"); $li = $li.not("ol#update li ol"); Take a look at this here Any help thanks < br Pradyut

    Read the article

  • Nested Row problem

    - by Patrick
    Hi, I'm using the 1kb css grid framework for a site, and although nested rows are apparently supported by the framework, when I try to drop in a nested row it doesn't work! Sorry not to explain it better - the site's here, may be easier to just look at the source: http://2605.co.uk/saf/build/ the grid: /grid.css the stylesheet: /style.css I'm a graphic designer hacking his way through a site he shouldn't be having to build but there's no budget to speak of! Cheers for any help, Patrick

    Read the article

  • MYSQL join - reference external field from nested select?

    - by PHP thinker
    Is it allowed to reference external field from nested select? E.g. SELECT FROM ext1 LEFT JOIN (SELECT * FROM int2 WHERE int2.id = ext1.some_id ) as x ON 1=1 in this case, this is referencing ext1.some_id in nested select. I am getting errors in this case that field ext1.some_id is unknow. Is it possible? Is there some other way?

    Read the article

  • Look for match in a nested list in Python

    - by elfuego1
    Hello everybody, I have two nested lists of different sizes: A = [[1, 7, 3, 5], [5, 5, 14, 10]] B = [[1, 17, 3, 5], [1487, 34, 14, 74], [1487, 34, 3, 87], [141, 25, 14, 10]] I'd like to gather all nested lists from list B if A[2:4] == B[2:4] and put it into list L: L = [[1, 17, 3, 5], [141, 25, 14, 10]] Additionally if the match occurs then I want to change last element of sublist B into first element of sublist A so the final solution would look like this: L1 = [[1, 17, 3, 1], [141, 25, 14, 5]]

    Read the article

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