Search Results

Search found 11056 results on 443 pages for 'min height'.

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

  • C++ min heap with user-defined type.

    - by bsg
    Hi, I am trying to implement a min heap in c++ for a struct type that I created. I created a vector of the type, but it crashed when I used make_heap on it, which is understandable because it doesn't know how to compare the items in the heap. How do I create a min-heap (that is, the top element is always the smallest one in the heap) for a struct type? The struct is below: struct DOC{ int docid; double rank; }; I want to compare the DOC structures using the rank member. How would I do this? I tried using a priority queue with a comparator class, but that also crashed, and it also seems silly to use a data structure which uses a heap as its underlying basis when what I really need is a heap anyway. Thank you very much, bsg

    Read the article

  • Using max-width = 100% and max-height = 100% on an image, calculate the display width/height

    - by NatalieMac
    I am creating a slideshow for images of various sizes to display centered vertically and horizontally within a canvas area. In my CSS, I set the width and height of the image to 100% so that each image would proportionally fill the canvas. I want the canvas to auto-size itself to fit within the viewer's screensize as the original size of the images is quite large (up to 800 pixels tall). I am using jQuery 1.4, and using the height of the image to calculate the top value for absolute positioning it to the middle of the canvas. I have tried using jQuery to get the .height(), innerHeight(), and outerHeight(), but it always gets the full size of the image. I extracted the DOM element from the jQuery object and tried using .width, .offsetWidth, and .clientWidth, but that too always seems to return the full size of the image. Firebug displays the correct dimensions, so I know there's some way of calculating the actual display height of the image, I just can't figure out what it is. How do you get the actual display height of an image if you've set max-height = 100%? I didn't want to have to calculate and set the height of each image in the js, but if I have to, I will. It just seems like I should be able to set the canvas size and have the images auto-adjust.

    Read the article

  • Hello World Problem in Eclipse with Android 2.3 used min 7 instead of min 9

    - by Gnev
    */I am Having a Similar Problem.......... Any Suggestions/ package com.example.helloandroid6; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android Developers"); setContentView(tv); } }

    Read the article

  • Why does obj.getBounds().height give a larger height than obj.height?

    - by TC
    I'm new to Flash and ActionScript, but managing quite nicely. One thing that is continuously getting in my way are the width and height properties of DisplayObject(Container)s. I'm finally starting to get my head around them and learned that the width and height of a Sprite are determined solely by their contents for example. I do not understand the following though: I've got a Sprite that I add a bunch of Buttons to. The buttons all have a height of 30 and an y of 0. As such, I'd expect the height of the containing Sprite to be 30. Surprisingly, the height is 100. The Adobe documentation of the height property of a DisplayObject states: Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. Apparently, the 'bounds' of the object are important. So I went ahead and wrote this little test in the Sprite that contains the Buttons: for (var i:int = 0; i < numChildren; ++i) { trace("Y: " + getChildAt(i).y + " H: " + getChildAt(i).height); trace("BOUNDS H: " + getChildAt(i).getBounds(this).height); } trace("SCALEY: " + scaleY + " TOTAL HEIGHT: " + height); This code iterates through all the objects that are added to its display list and shows their y, height and getBounds().height values. Surprisingly, the output is: Y: 0 H: 30 BOUNDS H: 100 ... (5x) SCALEY: 1 TOTAL HEIGHT: 100 This shows that the bounds of the buttons are actually larger than their height (and the height that they appear to be, visually). I have no clue why this is the case however. So my questions are: Why are the bounds of my buttons larger than their height? How can I set the bounds of my buttons so that my Sprite isn't larger than I'd expect it to be based on the position and size of the objects it contains? By the way, the buttons are created as follows: var control:Button = new Button(); control.setSize(90, 30); addChild(control);

    Read the article

  • Beginner question about CSS and layout and height

    - by vtortola
    Hi, I'm trying to create a very simple page that contains a container, a header, a left column and a footer: [containter] [header /] [content /] [leftBar /] [footer /] [/containter] (Sorry, I cannot paste the code properly, only appears the tag "body" and the rest disapears :S ... ) As you can see, very simple stuff. I want to use the 100% of the height, as I can do with the width, but I simply don`t get it work :S At his moment I'm using min-height, but how could I use the height:100% ? What I like is that the footer is always visible, and you scroll the content. This is what I have till the moment: body { font-family: Verdana; font-size: 0.8em; background-color:#f1f1f1; } container { border:solid 2px Black; position:absolute; left:10%; width:80%; margin:auto; } header { height:20px; background: #DDDDDD; } leftBar { width: 20%; background: #669966; min-height:600px; postion:absolute; top:20px; bottom:20px; } content { float:right; background-color: #cdcde6; position:absolute; left:20%; right:0px; bottom:20px; top:20px; padding:5px; } footer { position:absolute; height:20px; } I'm reading a book about CSS, but I still don't get the part about the height :S Thanks in advance.

    Read the article

  • Changing CSS height property removes anchors?

    - by JMan
    I am working on a standard header/navigation for my website. I started with having a CSS "height" value of 100% for the html, body elements but this resulted in the wrong layout. However, when I change the CSS height property from "100%" to "auto", the layout is correct, but I lose the anchors in the navigation. Why is this? Here's my CSS: html,body { height: auto; /* This is the only property that I'm toggling */ margin: 0; } body { margin: 0; min-width: 978px; font: 12px/16px Arial, Helvetica, sans-serif; color: #000; background: #000001 url('../images/bg-body.jpg') no-repeat 50% 0; } #nav { position: relative; float: left; margin: 0; padding: 0 2px 0 271px; list-style: none; background: url('../images/sep-nav.gif') no-repeat 100% 0; } #nav li { float: left; padding: 11px 0 0 2px; height: 35px; width: 128px; line-height: 22px; font-size: 18px; text-align: center; background: url('../images/sep-nav.gif') no-repeat 0 -1px; display: inline; } #nav li a {color: #FFFEFE;} ..... I compared the computed CSS in Firebug when the html, body height property was set to "auto" vs. "100%" and they were the same. Can somebody please shed some light on how retain the anchors in the navigation while setting height to "auto"? Thanks for your help.

    Read the article

  • CSS: auto height on containing div, 100% height on background div inside containing div.

    - by user47831
    The problem, is that I have a content div which stretches its container height-wise (container and content div have auto height). I want the background container, which is a sister div of the content div to stretch to fill the container. The background container contains divs to break the background into chunks. The background and container divs have 100% width, the content container doesn't. HTML: <div id="container"> <div id="content"> Some long content here .. </div> <div id="backgroundContainer"> <div id="someDivToShowABackground"/> <div id="someDivToShowAnotherBackground"/> </div> </div> CSS: #container { height:auto; width:100%; } #content { height: auto; width:500px; margin-left:auto; margin-right:auto; } #backgroundContainer { height:100%;??? I want this to be the same height as container, but 100% makes it the height of the viewport. }`

    Read the article

  • CSS: auto height on containing div, 100% height on background div inside containing div.

    - by user47831
    The problem, is that I have a content div which stretches its container height-wise (container and content div have auto height). I want the background container, which is a sister div of the content div to stretch to fill the container. The background container contains divs to break the background into chunks. The background and container divs have 100% width, the content container doesn't. HTML: <div id="container"> <div id="content"> Some long content here .. </div> <div id="backgroundContainer"> <div id="someDivToShowABackground"/> <div id="someDivToShowAnotherBackground"/> </div> </div> CSS: container ` container { height:auto; width:100%; } content { height: auto; width:500px; margin-left:auto; margin-right:auto; } backgroundContainer { height:100%;??? I want this to be the same height as container, but 100% makes it the height of the viewport. }`

    Read the article

  • Little CSS problem with Auto height and nested div's

    - by GeekDrop.com
    So I'm finally learning my way around CSS more and have run into a small problem. I have a container div, with a few divs inside of it, one of them is a bit if text (which can be a random height) and an image that will have a MAX height of 200px. I am using a dotted/colored background behind them that needs to auto expand to the height of whichever is the tallest, either the text or the image. Right now when i use height:auto on the container div it works perfect for the random height text: Example Screenshot But it's only adjusting according to the text's height; if the image is taller than the text, the image overflows the bottom of the background dotted/colored box. Example Screenshot The CSS I'm using currently is this: h1 div#like_detailed { margin: 0; font-size: 1.1em; width: 700px; } #details-image img { border: none; clear: left; float: right; margin: -45px 0 0 0; max-height: 200px; padding: 0 7px 0 10px; } #deets-container { background-color: #FEF; border: #190AE7 1px dotted; height: auto; margin-top: 0; margin-bottom: 30px; padding-top: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 0; } And the HTML for it is this: <div id="deets-container" class="rounded"> <!-- Button --> <div class="likebtnframe">(some code)</div> <!-- Button --> <div class="tweetbtnframe">(some code)</div> <!-- Button --> <ul id="share"> <li><a name="share">(some code)</a></li> </ul> <!-- Submitted By --> <div class="submitter_detailed"><span class="submitter-color smalltext">(some code)</span> (some code)</div> <!-- Image --> <div id="**details-image**">(some code)</div> <!-- Like / Quote --> <h1 id="**like_detailed**">(some code)</h1> </div> I have a feeling this is pretty easy but I'm running out of time to sort it out on my own. Anyone?

    Read the article

  • Height in IE is displaying diffrent to firefox

    - by user268707
    I have a problem with displaying a set height in ie. In my css I have set a height for my sidebar div as 2150px; which it displays fine in firefox but does not display the full height in ie. How can I get ie to display the height I have set in ie? Thanks in advance The source code is below #sidebar_newspr{ width:160px; min-height:2150px; margin-top:1px; margin-right:2px; border-right-style:solid; border-right-color:#900; border-right-width:1px; float:left; } #sidebar_newspr a{ text-decoration:none; color:#FFF; font-size:12px; font-family:Verdana,Arial,Helvetica,sans-serif; } #sidebar_newspr a:hover{ color:#900; }

    Read the article

  • jQuery: How can I animate to a taller height with the height being added to the top of the element?

    - by Jannis
    Hi, I have a simple problem but I am not sure how to solve it. Basically I have some hidden content that, once expanded, requires a height of 99px. While collapsed the element holding it section#newsletter is set to be 65px in height. LIVE EXAMPLE: http://dev.supply.net.nz/asap-finance-static/ On the click of a#signup_form the section#newsletter is expanded to 99px using the following jQuery: $('#newsletter_form').hide(); // hide the initial form fields $('#form_signup').click(function(event) { event.preventDefault(); // stop click // animate $('section#newsletter').animate({height: 99}, 400, function() { $('#newsletter_form').show(300); }) }); All this works great except for the fact that this element sits in a sticky footer so its initial height is used to position it. Animating the height of this element causes scrollbars on the browser, because the 34px added are added to the bottom of the element, so my question: How can I add these 34px to the top of the element so the height expands upwards into the body not downwards? Thanks for reading, I look forward to your help and suggestions. Jannis

    Read the article

  • Using recursion to to trim a binary tree based on a given min and max value

    - by Justin
    As the title says, I have to trim a binary tree based on a given min and max value. Each node stores a value, and a left/right node. I may define private helper methods to solve this problem, but otherwise I may not call any other methods of the class nor create any data structures such as arrays, lists, etc. An example would look like this: overallRoot _____[50]____________________ / \ __________[38] _______________[90] / \ / _[14] [42] [54]_____ / \ \ [8] [20] [72] \ / \ [26] [61] [83] trim(52, 65); should return: overallRoot [54] \ [61] My attempted solution has three methods: public void trim(int min, int max) { rootFinder(overallRoot, min, max); } First recursive method finds the new root perfectly. private void rootFinder(IntTreeNode node, int min, int max) { if (node == null) return; if (overallRoot.data < min) { node = overallRoot = node.right; rootFinder(node, min, max); } else if (overallRoot.data > max) { node = overallRoot = node.left; rootFinder(node, min, max); } else cutter(overallRoot, min, max); } This second method should eliminate any further nodes not within the min/max, but it doesn't work as I would hope. private void cutter(IntTreeNode node, int min, int max) { if (node == null) return; if (node.data <= min) { node.left = null; } if (node.data >= max) { node.right = null; } if (node.data < min) { node = node.right; } if (node.data > max) { node = node.left; } cutter(node.left, min, max); cutter(node.right, min, max); } This returns: overallRoot [54]_____ \ [72] / [61] Any help is appreciated. Feel free to ask for further explanation as needed.

    Read the article

  • HTML/CSS - No 100% height on div in IE

    - by Jordan Rynard
    Okay, so I've got a problem - and I'd love to have it fixed. I am using my favourite way of setting up a simple header/content/footer layout. The problem is that any elements I add to the 'content' div of my layout can not be expanded to 100% in Internet Explorer (as far as I know, IE only). I understand there is no height declared to the 'content' element, but because of the style of its positioning (declaring an absolute top AND bottom), the element fills the desired area. (The content element has a background color defined so you can see that the div is in fact filling between both the header and the footer.) So my problem is, since the div is clearly expanded between the two, why can't a child be set to 100% to fill that area? If anyone has any solutions, I'd love to hear them. (I'm looking for a solution that won't involve designing by an entire different layout.. or at least perhaps an explanation of why this is happening. I'm assuming at this point it's because of the lack of a height declaration -- but the div is expanded, so I don't get it!) You can view a page of the example here: http://www.elizabethlouter.com/html/index.html And here is the code as used on the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>No 100% height on 'content' child div in IE</title> </head> <style> html, body { width:100%; height:100%; margin:0px; padding:0px; } body { position:relative; } #wrapper { position:absolute; top:0px; width:960px; height:100%; left:50%; margin-left:-480px; } #header{ position:absolute; top:0px; left:0px; width:100%; height:200px; background-color:#999; } #content{ position:absolute; top:100px; bottom:50px; left:0px; width:100%; background-color:#F7F7F7; } #content_1{ width:200px; background-color:black; height:100%; } #footer{ position:absolute; bottom:0px; left:0px; width:100%; height:50px; background-color:#999; } </style> <body> <div id="wrapper"> <div id="header"> </div> <div id="content"> <div id="content_1"> </div> </div> <div id="footer"> </div> </div> </body> </html>

    Read the article

  • Flex fixed and variable height - can it be set in markup?

    - by Prutswonder
    I've got the following Flex application markup: <app:MyApplicationClass xmlns:app="*" width="100%" height="100%" layout="vertical" horizontalScrollPolicy="off" verticalScrollPolicy="off"> <mx:VBox id="idPageContainer" width="100%" height="100%" verticalGap="0" horizontalScrollPolicy="off" verticalScrollPolicy="off"> <mx:HBox id="idTopContainer" width="100%" height="28" horizontalGap="2"> (top menu stuff goes here) </mx:HBox> <mx:HBox id="idBottomContainer" width="100%" height="100%" verticalScrollPolicy="off" clipContent="false"> (page stuff goes here) </mx:HBox> </mx:VBox> </app:MyApplicationClass> When I run it, it displays top panel with a fixed height, and a bottom panel with variable height. I expect the bottom panel's height to contain the remaining height, but it somehow overflows off-page. The only way I found to fix this height issue (so far) is to programmatically set the height to be fixed instead of variable: <mx:HBox id="idBottomContainer" width="100%" height="700" verticalScrollPolicy="off" clipContent="false"> (page stuff goes here) </mx:HBox> And code-behind: package { import mx.containers.HBox; import mx.core.Application; import mx.events.ResizeEvent; // (...) public class MyApplicationClass extends Application { public var idBottomContainer:HBox; // (...) private function ON_CreationComplete (event:FlexEvent) : void { // (...) addEventListener(ResizeEvent.RESIZE, ON_Resize); } private function ON_Resize (event:Event) : void { idBottomContainer.height = this.height - idTopContainer.height; } } } But this solution is too "dirty" and I'm looking for a more elegant way. Does anyone know an alternative?

    Read the article

  • div's height like remaining height

    - by Erick
    i have two div <div id="uno"> text </div> <div id="due"> text </div> div#uno{ width:300px; height: 100px; border: 1px solid blue; overflow:hidden; } div#due{ width:300px; height: 200px; border: 1px solid yellow; overflow:scroll; } how can i have the height of the div id="due" equal to the remaining height of the page?

    Read the article

  • Set height of Flex Accordion to height of tallest child

    - by Mike Deck
    By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected. I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected. My current thought is to extend the accordion class setting the creation policy to "all" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach. Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?

    Read the article

  • Keeping footer visible and height 100% in CSS

    - by vtortola
    I'm trying to create a very simple page that contains a container, a header, a left column and a footer: <containter> <header /> <content /> <leftBar /> <footer /> </containter> I want to use the 100% of the height, as I can do with the width, but I simply dont get it work.At his moment I'm usingmin-height, but how could I use theheight:100%` ? What I like is that the footer is always visible, and you scroll the content. Current CSS body { font-family: Verdana; font-size: 0.8em; background-color:#f1f1f1; } #container { border:solid 2px Black; position:absolute; left:10%; width:80%; margin:auto; } #header { height:20px; background: #DDDDDD; } #leftBar { width: 20%; background: #669966; min-height:600px; postion:absolute; top:20px; bottom:20px; } #content { float:right; background-color: #cdcde6; position:absolute; left:20%; right:0px; bottom:20px; top:20px; padding:5px; } #footer { position:absolute; height:20px; }

    Read the article

  • GWT forced height HTMLPanel

    - by Nils
    Hello, I'm developing a GWT project, and I encountered a problematic cross-browsering problem. When using firefox, there are problems with the display of all the pages. I found the reason why : In UIBinder, each of my pages are wrapped by a "g:HTMLPanel" : at start and at the end of the xml file, to wrap the content of all the pages When doing this, the generated code of the panel goes like this : div style="width: 100%; height: 100%; .... The problem is that "height : 100%". If I remove it with firebug, the display is perfect. So my goal is to programatically remove that generated 100% height.. But no way to do it ! I tried everything : setHeight, setSize, working on the Element itself with getElement().methods()... I tried to do things like style.clear(), everything that could have a chance to work.. But in the generated code that "height: 100%" will ALWAYS be there. If I set it's height to "50%" or "50px" it has no effect at all. I even tried to give it an ID, then with pure javascript to change it's style, but no solution either.. Note : I'm sure that I'm working on the right element : adding a styleName, for example, works well. Any idea ? Your help would be really appreciated, I have no clue of how to remove this bit of generated code, and I've been looking for hours already :(:(:(:( Best regards, Nils

    Read the article

  • CSS3 transition on table row using height property

    - by Alexis Leclerc
    I have an HTML table displaying some information with a few rows. On each row, the user can click to reveal some additional rows that contains information related to the clicked row. Something like this: While the additional rows are being created with an AJAX request, a loading row is inserted right after the clicked row : Currently, everything works perfectly (drill down style), but I would like to add some animation to the loading row. I found a question ( this one ) that has a JSFiddle showing kind of what I want ( this fiddle ). I tried to implement something similar with CSS3 transitions, but I can't get it to work. Here's my simulated attempt ( fiddle only for deployment of the loading row ) using these transitions : -webkit-transition: height 0.1s ease-in-out; -moz-transition: height 0.1s ease-in-out; -ms-transition: height 0.1s ease-in-out; -o-transition: height 0.1s ease-in-out; transition: height 0.1s ease-in-out; Any thought on why my fiddle doesn't do any animation? Any other methods you would propose? Thanks!

    Read the article

  • ListBoxItem height not getting updated

    - by Gili
    Hi, I have a listbox inside another list box, in inner list box listboxitems height may grow or shrink. My problem is that when the inner items shrink the outer list box doesn't re-render its height. Thus - stays with the previous height before the inner list shrinked. I have tried so many things here, among Invalidate of all types, selection and de-selection of the list box item that should be updated and more - nothing helps.... Can anyone pls help me with this? Thanx, Gili

    Read the article

  • Problem setting dynamic UITableViewCell height

    - by HiveHicks
    I've got a UITableView with two dynamic rows. Each of the rows is a subclass of UITableViewCell and is loaded from nib. As my rows contain dynamic content, I use layoutSubviews to reposition all subviews: - (void)layoutSubviews { [super layoutSubviews]; CGFloat initialHeight = titleLabel.bounds.size.height; CGSize constraintSize = CGSizeMake(titleLabel.bounds.size.width, MAXFLOAT); CGSize size = [titleLabel.text sizeWithFont:titleLabel.font constrainedToSize:constraintSize]; CGFloat delta = size.height - initialHeight; CGRect titleFrame = titleLabel.frame; titleFrame.size.height += delta; titleLabel.frame = titleFrame; locationLabel.frame = CGRectOffset(locationLabel.frame, 0, delta); dayLabel.frame = CGRectOffset(dayLabel.frame, 0, delta); timeLabel.frame = CGRectOffset(timeLabel.frame, 0, delta); } The problem is that I can't find a way to determine the height in table view delegate's tableView:heightForRowAtIndexPath: method. The trick is that I load cell from nib, so just after it's loaded titleLabel.bounds.size.width is 300 px (as in nib), not taking into account type of the device (iPhone/iPad) and current orientation, so it seems impossible to calculate the height without conditional checks for orientation and device type. Any ideas?

    Read the article

  • How can I make Excel's MIN function ignore zeroes in a set?

    - by mfg
    In Excel, I have the following formula =(MIN(H69,H52,H35,H18)*(1/H18))*10 that is supposed to return the MIN of a range, and divide it by the current cell (*(1/H18) ), then multiply by 10. I am having difficulty with adding a type of NULLIF statement. I want to be able to have (the possibility for) blank rows, and have the MIN function ignore zero/blank fields while selecting the next lowest value (all are between 1.0-0.1). Is there a modifier i can apply to the MIN function to make it not compare zeroes in the MIN set? Is there a better funtion than MIN to use? This is to prevent the following situation: users will need to eliminate fields that are zeros from the form, theres 2 formula edits per entry, averaging 4 entries per use, so 8 possible errors per form use...

    Read the article

  • CSS - 100% Height Layout with Variable Height Header

    - by Brian D.
    The layout I want to achieve is pretty simple. I want a 100% height layout with a header, and below the header I will have a side bar for navigation and then the content area beside the navigation bar (2-column with header). I can easily do this if I give the header a specified height but I want the header to just take up as much room as is needed. Does anyone know how to do this? Is it possible without knowing the height of the header? Thanks for any help.

    Read the article

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