depth

MySQL: Calculate depth in a parent-child model?

As title says: How do I calculate a node's depth in a parent-child model? I'll need the depth to, among other things, create the indent in my list (coded with PHP). Thank you in advance. ...

xcode debugging maximum depth for investigating variables?

Hey There! I use Xcode to code for a current iPhone Project. It's the first time i work with XCode. What i wonder is, whether i need to set somewhere how 'deep' i can be able to recursively look into the variables in the debugger. If i have the debugger open, i can see all the current variables and open them. I can see all the fields o...

Tree enumeration, n-depth and m-width

Hi all, I am trying to develop a java algorithm for the enumeration of n-depth and m-width trees: Each node can have at maximum 7 children. Nodes are of different type: a first kind of node can have children but can not be a leaf. The second can have no child (so it must be a leaf). The root is at depth 0 and the width is the maximum ...

Stack of photos AS3 - stuck on somthing simple

Hi there I found a tutorial on creating a stack of photos in flash using AS3 (http://designreviver.com/tutorials/create-an-interactive-stack-of-photos/). I have been trying to make a dynamic XML version of the photo stack and I have a problem (obviously :) I have a class called Polaroid, and im using a loop to add multiple instances o...

Proof for depth of balanced search tree

If T is a balanced BST with n elements, L its left subtree and R its right one, how can I prove that its depth is less than or equal to 2log(n) + 1? There is a proof by induction which I have but I don't get it. (I understand that stackoverflow is mainly programming oriented but I found some questions about binary search trees and dec...

How does this work in computing the depth map?

From this site: http://www.catalinzima.com/?page%5Fid=14 I've always been confused about how the depth map is calculated. The vertex shader function calculates position as follows: VertexShaderOutput VertexShaderFunction(VertexShaderInput input) { VertexShaderOutput output; float4 worldPosition = mul(input.Position, World)...

Calculate the depth of a binary search tree?

I am having difficulty calculating the summation of depths [the sum of the individual depths for all children of the root] for a given BST. I have the total number of nodes for the tree, and I am trying to calculate the average depth for the tree, requiring I have this depth sum. Recursion and I don't get along very well.. I am finding ...

Cocos2d and chipmunk how to simulate depth?

Hello, I am developing a game that intends to toss an object but instead of having it being tossed horizontally I would like to simulate it being thrown along the imaginary z axis that is simulate depth in my game. Something like the nintendo duck hunt game. Can someone point me in the right direction to implement this?. My first idea w...

PHP: high depth array, how do return current key name?

I have a huge array from a json_decode result (assoc set to true) and have the following code to check if (one of the arrays within, a random serial) has the key 'set_true' $out = ""; foreach ($array as $sub) { //$out[] = $sub['set_true']; if (in_array($sub['set_true'], $sub) && $sub['set_true'] == '1' ) { $out[] = 'User: ' . $...

Hitting Maximum Recursion Depth Using Python's Pickle / cPickle

The background: I'm building a trie to represent a dictionary, using a minimal construction algorithm. The input list is 4.3M utf-8 strings, sorted lexicographically. The resulting graph is acyclic and has a maximum depth of 638 nodes. The first line of my script sets the recursion limit to 1100 via sys.setrecursionlimit(). The prob...

event question in Flex / FlashBuilder 4 beta2

I see that others are reporting bugs relating to a spurious "Stack depth is unbalanced" error, so I don't know whether the error I'm getting is my programming error or a bug in FB4 b2. It it legal to instantiate a class that raises an event in an eventHandler? I'm getting such an error at the place located below. All of these classes ex...

What is the average asymptotic depth of a simple unbalanced search tree?

For a balanced search tree, it is O(log(N)) for all cases. For unbalanced search trees, the worst case is O(N), e.g., insert 1, 2, 3, 4,.. and best case complexity is when it is balanced, e.g., insert 6, 4, 8, 3, 5 7. How do we define the average case complexity for unbalanced search tree? ...

GLSL check if fragment is on geometry

I am currently writing the positions of my geometry to the RGB channels of gl_FragColor and I would like to write 1.0 to the alpha channel if the fragment is part of geometry, and 0.0 if its empty. Is there a simple way to tell if a fragment is geometry or not? Maybe through gl_FragCoord.z? thanks ...

Flash AS3 Coloring Book - Movieclip only clickable in certain spots (Event Listeners)

I am working on a coloring book and have a movieclip (outlines) containing many movieclips that can be changed to whatever color the user has selected. However it seems like some of the movieclips can be clicked anywhere and work great, and others you need to click a certain spot for it to color in. I have an example here: http://jeffki...

How to use 2 different item renderers in mx:Tree

Question for Flex guys. How can I use multiple item renderers in mx:Tree depending on item's depth/level in tree? For example. For the first level items I want to use label with button and for second level items combobox. Is this somehow possible? ...

Item's depth in ArrayCollection

Hi, is it somehow possible to get item's depth in ArrayCollection? ...

Image Applet Bit Depth

Hi all. May I know is it true that a java applet only supports 24 bits image? If a 48 bits image is loaded, it will be truncated to 24 bits? Thank you. ...

Implementing your own depth buffer with GLSL

I need a datastructure of the same size as the normal depth buffer and I need to be able to read from and write to it in a shader. Is this possible, and what does this datastructure look like? ...

How to write to the OpenGL Depth Buffer

I'm trying to implement an old-school technique where a rendered background image AND preset depth information is used to occlude other objects in the scene. So for instance if you have a picture of a room with some wires hanging from the ceiling in the foreground, these are given a shallow depth value in the depthmap, and when rendered...

Retrieving/simulating run-time "layer" functionality in Flash under ActionScript 3.

Are there any AS3 classes to help arrange objects into layers, like in the designer, such that the objects all have the same parent? Obviously, I can use container clips to simulate layers, but I specifically want this kind of functionality for objects that have the same parent. My understanding is that the design-time notion of layers...