Search Results

Search found 1557 results on 63 pages for 'horizontal'.

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

  • Algorithm to Render a Horizontal Binary-ish Tree in Text/ASCII form

    - by Justin L.
    It's a pretty normal binary tree, except for the fact that one of the nodes may be empty. I'd like to find a way to output it in a horizontal way (that is, the root node is on the left and expands to the right). I've had some experience expanding trees vertically (root node at the top, expanding downwards), but I'm not sure where to start, in this case. Preferably, it would follow these couple of rules: If a node has only one child, it can be skipped as redundant (an "end node", with no children, is always displayed) All nodes of the same depth must be aligned vertically; all nodes must be to the right of all less-deep nodes and to the left of all deeper nodes. Nodes have a string representation which includes their depth. Each "end node" has its own unique line; that is, the number of lines is the number of end nodes in the tree, and when an end node is on a line, there may be nothing else on that line after that end node. As a consequence of the last rule, the root node should be in either the top left or the bottom left corner; top left is preferred. For example, this is a valid tree, with six end nodes (node is represented by a name, and its depth): [a0]------------[b3]------[c5]------[d8] \ \ \----------[e9] \ \----[f5] \--[g1]--------[h4]------[i6] \ \--------------------[j10] \-[k3] Which represents the horizontal, explicit binary tree: 0 a / \ 1 g * / \ \ 2 * * * / \ \ 3 k * b / / \ 4 h * * / \ \ \ 5 * * f c / \ / \ 6 * i * * / / \ 7 * * * / / \ 8 * * d / / 9 * e / 10 j (branches folded for compactness; * representing redundant, one-child nodes; note that *'s are actual nodes, storing one child each, just with names omitted here for presentation sake) (also, to clarify, I'd like to generate the first, horizontal tree; not this vertical tree) I say language-agnostic because I'm just looking for an algorithm; I say ruby because I'm eventually going to have to implement it in ruby anyway. Assume that each Node data structure stores only its id, a left node, and a right node. A master Tree class keeps tracks of all nodes and has adequate algorithms to find: A node's nth ancestor A node's nth descendant The generation of a node The lowest common ancestor of two given nodes Anyone have any ideas of where I could start? Should I go for the recursive approach? Iterative?

    Read the article

  • Multiplying numbers on horizontal, vertial, and diagonal lines

    - by untwisted
    I'm currently working on a project Euler problem (www.projecteuler.net) for fun but have hit a stumbling block. One of the problem provides a 20x20 grid of numbers and asks for the greatest product of 4 numbers on a straight line. This line can be either horizontal, vertical, or diagonal. Using a procedural language I'd have no problem solving this, but part of my motivation for doing these problems in the first place is to gain more experience and learn more Haskell. As of right now I'm reading in the grid and converting it to a list of list of ints, eg -- [[Int]]. This makes the horizontal multiplication trivial, and by transposing this grid the vertical also becomes trivial. The diagonal is what is giving me trouble. I've thought of a few ways where I could use explicit array slicing or indexing, to get a solution, but it seems overly complicated and hackey. I believe there is probably an elegant, functional solution here, and I'd love to hear what others can come up with.

    Read the article

  • Explaining the need to avoid horizontal scroll

    - by Bradley Herman
    I need help explaining to my boss why her design is poor on a client's website. She has no knowledge of the web, and it can be difficult as a web developer working with a woman who is a graphic designer (not even a web designer really). On a current site she has designed, an image bar "needs" to be ~1200px according to her, though it isn't necessary with the content. A quick sketch to illustrate what's going on: As you see, the banner spills out past the 960px of the content and as wide as 1200px. This creates a horizontal scroll when all the content is viewable within the 960px wide viewport. I need to make this an <img and not a CSS background because it's a jQuery slideshow that fades from image to image. I think this is a big problem because a lot of people are going to get a horizontal scroll bar imposed in their browser when they're still able to see all the relevant content. She thinks no one will notice and it'll be fine; I think it's very bad practice and confusing to the end user. How do I explain the problem to her?

    Read the article

  • Explaining to boss why we need to avoid horizontal scroll

    - by Bradley Herman
    I need help explaining to my boss why her design is poor on a clients website. She has no knowledge of web and it can be difficult as a web developer working with a woman who is a graphic designer (not even a web designer really). On a current site she has designed, an image bar "needs" to be like 1200px according to her, though it isn't necessary with the content. I'll show a quick sketch to illustrate what's going on: http://imgur.com/MNGOT.jpg As you see, the banner spills out past the 960px of the content and as wide as 1200px. This creates a horizontal scroll when all the content is viewable within the 960px wide viewport. I need to make this an img and not a css background because it's a jquery slideshow that fades from image to image. I think this is a big problem because a lot of people are going to get a horizontal scroll bar imposed in their browser when they're still able to see all the relevant content. How do I help her explain it. She thinks no one will notice and it'll be fine, I think it's very bad practice and confusing to the end user. Any help?

    Read the article

  • How to stop the horizontal scrolling programmatically ?

    - by srikanth rongali
    I have a UITextView *textView in cocos2d's CCLayer. The text is scrolling in both the horizontal and vertical directions. But, I need it to scroll and bounce only in vertically. How to stop the horizontal scrolling programmatically ? UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(100,200, windowSize.height/2,windowSize.width/2)]; textView.backgroundColor = [UIColor clearColor]; textView.text = @"I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy"; [textView setEditable:NO]; textView.font = [UIFont fontWithName:@"Helvetica" size:24.0f]; CGPoint location = CGPointMake(200, 160); textView.showsHorizontalScrollIndicator = NO; //textView.bounces = NO; //textView.alwaysBounceVertical = YES; textView.center = location; textView.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS( 90.0f )); What should I do stop scrolling horizontally ? Thank You.

    Read the article

  • Horizontal histogram won't accept input after the first input

    - by vincentbelkin
    So I'm making a program which is supposed to print a horizontal histogram of the lengths of words in its input. I don't know if most of it is OK since the main problem is it won't accept any input after the first one. Oh I also put comments on the parts I'm having some trouble with, like how to print "-" multiple times in order to represent histogram. I've tried making other versions of the code but I couldn't check if I'm close to getting it because again it won't accept another input after the first input. /*Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal*/ #include <stdio.h> #define MAX 30 #define IN 1 #define OUT 0 int main() { int a,c,i,k,state,word[MAX]; a=0; k=0; state=OUT; for(i=0;i<MAX;i++) word[i]=0; while((c=getchar())!=EOF) { if(c==' '||c=='\t'||c=='\n') state=OUT; else state=IN; while(state==IN) a++; if(state==OUT) { word[i]=a; i++; } /*This part is hard for me, I don't know how to print X multiple times!*/ if((c==getchar())&&c==EOF) { for(i=0;i<MAX;i++) { for(i=0;i<=word[i];i++) putchar('-'); putchar('\n'); } } } }

    Read the article

  • Mysterious horizontal lines on my site when rendered on iPad

    - by Ferdy
    The following site: http://staging.jungledragon.com Has a few rendering issues on the iPad using Safari, so I'm trying to fix them. There is one issue where I am stuck though. If you have an iPad, open the site in portrait mode. There are two unwanted horizontal lines appearing, a top one that crosses the tabs (Popular, Fresh, etc) and a bottom one that sits right above the lizard illustration. Both lines should not be there. These lines do not appear on any other browser tested, including Safari on Windows. When you move that same site into landscape mode on the iPad, the top horizontal line dissapears, whilst the bottom one stays. If you zoom in a bit to the bottom line, it then dissapears too. I've been trying out various CSS fixes to no avail and am now beginning to think this is a rendering issue of Safari, although possibly triggered by me. Any help is greatly appreciated. It seems like a minor issue but I hate sloppiness.

    Read the article

  • Silverlight horizontal stretch and get position issue

    - by David
    I have a Grid (container) wich in turn has several grids(subContainers) arranged by rows. Each one of those "subContainers" has diferent columns and controls. And each of those "subContainers" has the horizontal alignment set to stretch, and it has to stay that way, since the layout this viewer depends on it. I use the "container" to set each control on it's adequate position. So far so good. Now comes my headache... I want to remove the control from the grid and put it in a canvas, at the same exact position, only, the position it returns is as if the control is set to the beggining of the grid and not it's true position. For testing purposes, I've set the "subContainters" horizontal alignment to center and (despite the layout is totally wrong) every control is in it's right position when sent to a canvas, wich it doesn't happen when HA = stretch. Here's the code I'm using to get position: GeneralTransform gt = nc.TransformToVisual(gridZoom); Point offset = gt.Transform(new Point()); So you can understand, for example, my first control should be somewhere like (80, 1090), but the point that I get is (3,3). Can anyone help me? Thanks

    Read the article

  • CSS and Page Size and Horizontal Scrollbar

    - by Steve
    When I added some CSS stuff to my page, the page got wider and and horizontal appeared even the content is very minimal and does not require to scroll. How can I remove it. I used the following to remove it but it appears as a hack and I am just playing around with CSS, so is there a proper way to do this

    Read the article

  • Totally Sweet Horizontal Rules in LaTeX

    - by Arcane
    I have been trying to find a way to easily drop a nice horizontal rule into a LaTeX document. \hline just makes a line across the page. It would seem that some package must provide something that is maybe half a page wide, with little bedknobs on the ends or something to act as a nice section marker for paragraphs. Any ideas? Or am I boned, and need to come up with my own macro to create such a beast?

    Read the article

  • Print table with horizontal scroll

    - by Nicole
    Hi everyone! I have to print a table with horizontal scroll and I need to print everything. The thing is that when te code does "Window.Print()" it cuts my page and doesn't show all the info of the table. I really need your help!! I need to "cut" my table and put it below if it doesn't fit the page. Thanks!!!!

    Read the article

  • Horizontal(tabbed) menu with ability to wrap overflowed items into collapsible dropdown

    - by wik
    It's about html/css/javascript menu ;) I am looking for unified solution to hide extra tabs of horizontal/tabbed menu when it overflows it's container. The initial idea plagiarized from firefox tabs workflow, i.e. when you have too much tabs it will wrap extra ones into collapsible dropdown button "List all tabs". I am thinking to play with overflow:auto in conjunction with javascript, but is there anything like this already implemented or maybe some better idea? Thanks.

    Read the article

  • Marquee horizontal text scroll with a fading effect?

    - by Peter
    I am looking for a solution for a single line Marquee horizontal text scroll with a fading effect using javascript (jquery if possible). Like a carousel text scroll. All the google searches gave me scrolling effects but with no fading effect. I know that this can be done in flash but im avoiding it if there are other solutions. Any help would be greatly appreciated.

    Read the article

  • removing horizontal scrollbar for textarea

    - by charan
    Hi. im working on javaswings. i had a textarea in a panel. i dont need horizontal scrollbar for that textArea. only vertical scrollbar is needed. i disabled auto scrollbar options, but still the horizantal scrollbar is working. please help me in thz..

    Read the article

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