Search Results

Search found 374 results on 15 pages for 'traverse'.

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

  • Is there any decent OpenGL SceneGraph API/framework?

    - by JohnIdol
    I am new to OpenGL. Wondering if there is any good Scenegraph API/framework for OpenGL. At the moment I am using glut with a custom node based solution: I am setting children and siblings for each node the calling a traverse function. I'd like a more flexible solution when it comes to managing dynamic elements in the scene.

    Read the article

  • C++/STL: std::transform with given stride?

    - by Arman
    Hello, I have a 1d array containing Nd data, I would like to effectively traverse on it with std::transform or std::for_each. unigned int nelems; unsigned int stride=3;// we are going to have 3D points float *pP;// this will keep xyzxyzxyz... Load(pP); std::transform(pP, pP+nelems, strMover<float>(pP, stride));//How to define the strMover?? Kind Regards, Arman.

    Read the article

  • Efficient code to avoid circular references in c# object model

    - by Kumar
    I have an excel like grid where values can be typed referencing other rows To check for circular references when a new value is entered, i traverse the tree and create a list of values referenced thus far, if the current value is found in this list, i return an error thus avoiding a circular reference. This is infrequent enough where extreme performance is not an issue but... Question - is there a better way ? I'm told it's not the most optimal but no answer was provided so on to the experts @ SO :)

    Read the article

  • Looking a lightweight PHP ORM

    - by allenskd
    At first I was going to use doctrine ORM as the main one but it was an overkill, unneeded features and probably excessive calls. One of the main reasons was the "helper" that handled traverse trees (the hierarchy tree) easily but I'm starting to prefer building my own class. This is what I'm looking for: 1) Can manage multiple database connections, (sort of like doctrine manager) 2) Models 3) flexible All suggestions are welcome

    Read the article

  • C++ enum in foreach

    - by Spencer
    I've have a card class for a blackjack game with the following enums: enum Rank { Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; enum Suit { Clubs, Diamonds, Hearts, Spades }; When I create the deck I want to write the code like this: // foreach Suit in Card::Suit // foreach Rank in Card::Rank // add new card(rank, suit) to deck I believe there is no foreach in c++. However, how do I traverse an enum? Thanks, Spencer

    Read the article

  • Generate all unique substrings for given string

    - by Yuval A
    Given a string s, what is the fastest method to generate a set of all its unique substrings? Example: for str = "aba" we would get substrs={"a", "b", "ab", "ba", "aba"}. The naive algorithm would be to traverse the entire string generating substrings in length 1..n in each iteration, yielding an O(n^2) upper bound. Is a better bound possible? (this is technically homework, so pointers-only are welcome as well)

    Read the article

  • Dynamically Forming a JSON object traversion without using eval.

    - by Matt Willhite
    Given I have the following: (which is dynamically generated and varies in length) associations = ["employer", "address"]; Trying to traverse the JSON object, and wanting to form something like the following: data.employer.address or data[associations[0]][association[1]] Without doing this: eval("data."+associations.join('.')); Finally, I may be shunned for saying this, but is it okay to use eval in an instance like this? Just retrieving data.

    Read the article

  • How to build a function on the fly in java?

    - by stereos
    I'm parsing a text file that is being mapped to some java code like such: public void eval(Node arg) { if(arg.data.equals("rand")) { moveRandomly(); } else if(arg.data.equals("home")) { goHome(); }//snip.. This is going to need to be re-evaluated about a thousand times and I'd rather not have to traverse the whole thing every time. Is there any way to make this traversal once and then have it be a function that is called every other time?

    Read the article

  • Git dirctet acyclic graph - children know their parents but not the other way around

    - by dayscott
    Git is implemented as a directed acyclic graph. Children know their parents but not the other way round. This makes sense because i can reach every commit only through a branch or a tag ( generally speaking through a reference). That's how i traverse the tree. What other reasons had the developers of Git to make "the children know their parents but not the other way around"?/ What are the key benefits of this?

    Read the article

  • bm.el is broken.

    - by maindoor
    Is anyone using bm.el to traverse through bookmarks in multiple buffers ? If so did you notice that bm-next is broken ? I see several people using it but no one seems to have noticed this. The buggy version got into emacs-goodies as well. How do I go about debugging this ?

    Read the article

  • ruby parseexecel gem - array not implemented

    - by josh
    I am trying to work with two worksheets at the same time. So I have code require 'parseexcel' #Open the excel file passed in from the commandline workbook = Spreadsheet::ParseExcel.parse(ARGV[0]) workbook2 = Spreadsheet::ParseExcel.parse(ARGV[1]) #Get the first worksheet worksheet = workbook.worksheet(0) worksheet2 = workbook2.worksheet(0) However, when I run this code I get an error: array is not implemented This error goes away when I comment out line: workbook2 = Spreadsheet::ParseExcel.parse(ARGV[1]) Why is this happeneing? Way I am running script is: ruby -rubygems traverse.rb excel.xls so.xls

    Read the article

  • How to delete the widget from the stack in Qt

    - by Solitaire
    Hi, i am using Qstackedwidget to switch between the views, i will be able to traverse between the views, i am facing problem in some scenario, where i do not require the widgets, i want to remove them completely.. stackedwidget provides the functionality to removewidgets, still the ownership of the widget will be there, i mean widget will be hidden. i dont want this to be happen, when i call remove widget the widget should be deleted. how to handle this?

    Read the article

  • retriving python objects ...python newbie

    - by gizgok
    I have a Club class and Player Class.The player class has an attribute Fav.clubs which will have unique club values.So the user is suppose to enter various club names.Based on the club names I have to retrieve those club objects and establish the relationship that this particular player has this Fav.clubs.The attribute Fav.clubs in Player class should store the names of Club .Now what I have to do is,take input from user about fav.clubs.This will be a list.After that traverse each element in the list and acc to string name find the corresponding club object and then store that object instance in Player class.

    Read the article

  • What are the Options for Storing Hierarchical Data in a Relational Database?

    - by orangepips
    Good Overviews One more Nested Intervals vs. Adjacency List comparison: the best comparison of Adjacency List, Materialized Path, Nested Set and Nested Interval I've found. Models for hierarchical data: slides with good explanations of tradeoffs and example usage Representing hierarchies in MySQL: very good overview of Nested Set in particular Hierarchical data in RDBMSs: most comprehensive and well organized set of links I've seen, but not much in the way on explanation Options Ones I am aware of and general features: Adjacency List: Columns: ID, ParentID Easy to implement. Cheap node moves, inserts, and deletes. Expensive to find level (can store as a computed column), ancestry & descendants (Bridge Hierarchy combined with level column can solve), path (Lineage Column can solve). Use Common Table Expressions in those databases that support them to traverse. Nested Set (a.k.a Modified Preorder Tree Traversal) First described by Joe Celko - covered in depth in his book Trees and Hierarchies in SQL for Smarties Columns: Left, Right Cheap level, ancestry, descendants Compared to Adjacency List, moves, inserts, deletes more expensive. Requires a specific sort order (e.g. created). So sorting all descendants in a different order requires additional work. Nested Intervals Combination of Nested Sets and Materialized Path where left/right columns are floating point decimals instead of integers and encode the path information. Bridge Table (a.k.a. Closure Table: some good ideas about how to use triggers for maintaining this approach) Columns: ancestor, descendant Stands apart from table it describes. Can include some nodes in more than one hierarchy. Cheap ancestry and descendants (albeit not in what order) For complete knowledge of a hierarchy needs to be combined with another option. Flat Table A modification of the Adjacency List that adds a Level and Rank (e.g. ordering) column to each record. Expensive move and delete Cheap ancestry and descendants Good Use: threaded discussion - forums / blog comments Lineage Column (a.k.a. Materialized Path, Path Enumeration) Column: lineage (e.g. /parent/child/grandchild/etc...) Limit to how deep the hierarchy can be. Descendants cheap (e.g. LEFT(lineage, #) = '/enumerated/path') Ancestry tricky (database specific queries) Database Specific Notes MySQL Use session variables for Adjacency List Oracle Use CONNECT BY to traverse Adjacency Lists PostgreSQL ltree datatype for Materialized Path SQL Server General summary 2008 offers HierarchyId data type appears to help with Lineage Column approach and expand the depth that can be represented.

    Read the article

  • stun and p2p communication

    - by sr-dusad
    hi I m new in network programming.I want to traverse NAT using Stun .I use the stun client application defined in code project Stun Client .It returned me a mapped ip and port.But i don't know how to use this ip and port for p2p communication in c#.net. Pls Help me . Any help will be appriciated

    Read the article

  • list of uids / names of System Preferences > Accounts

    - by neoneye
    How can I obtain an array with uid and names? I could iterate from 0 to 99999 and do a getpwnam(). However most machines have less than 5 accounts, so it's not optimal. I don't know what framework is responsible for this and thus I have no clue what to search for. Is there a more optimal solution that can traverse the accounts?

    Read the article

  • Java library for trees similar to JGraphT for graphs?

    - by lexicore
    I'm a big fan of JGraphT, a Java library for graphs. Could anyone recommend a similar Java library for trees? Preferrably FOSS. What I need is a good API, preferrably typesafe with generics which allows modelling different kinds of trees (with some user data attached to verticies/edges) and run different algorithms and operations on these trees. For instance, traverse or balance. At the moment I'm not interested in visualization of trees.

    Read the article

  • Serializing persistent/functional data structures

    - by Rob
    Persistent data structures depend on the sharing of structure for efficiency. For an example, see here. How can I preserve the structure sharing when I serialize the data structures and write them to a file or database? If I just naively traverse the datastructures, I'll store the correct values, but I'll lose the structure sharing. I'd like to be able to save data-structures with shared components to a file, restore them, and still have most of the structure shared in the restored data.

    Read the article

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