Search Results

Search found 3950 results on 158 pages for 'float'.

Page 11/158 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • jQuery Cycle plugin z-index float problem

    - by Antony Carthy
    When I try to place an element on top of my jQuery Cycle element, it doesn't work. The element is always behind the jQuery cycle element. I use float: right; to position the element, and set its z-index to 100000, to no avail. Firebug sees the Cycle element and its children as having low z-indexes, and shows the floating element to be in the right place. The element never shows above the Cycling images. <!-- the cycling set --> <div id='headerimages'> <img src='images/header1.jpg' alt='' style='' /> <img src='images/header2.jpg' alt='' style='' /> <img src='images/header3.jpg' alt='' style='' /> </div> <!-- the floating element --> <img src='images/logotransparent.png' alt='' id='logo' />

    Read the article

  • Sublime text 2 syntax highlighter?

    - by BigSack
    I have coded my first custom syntax highlighter for sublime text 2, but i don't know how to install it. It is based on notepad++ highlighter found here https://70995658-a-62cb3a1a-s-sites.googlegroups.com/site/lohanplus/files/smali_npp.xml?attachauth=ANoY7criVTO9bDmIGrXwhZLQ_oagJzKKJTlbNDGRzMDVpFkO5i0N6hk_rWptvoQC1tBlNqcqFDD5NutD_2vHZx1J7hcRLyg1jruSjebHIeKdS9x0JCNrsRivgs6DWNhDSXSohkP1ZApXw0iQ0MgqcXjdp7CkJJ6pY_k5Orny9TfK8UWn_HKFsmPcpp967NMPtUnd--ad-BImtkEi-fox2tjs7zc5LabkDQ%3D%3D&attredirects=0&d=1 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>fileTypes</key> <array> <string>smali</string> </array> <dict> <key>Word1</key> <string>add-double add-double/2addr add-float add-float/2addr add-int add-int/2addr add-int/lit16 add-int/lit8 add-long add-long/2addr aget aget-boolean aget-byte aget-char aget-object aget-short aget-wide and-int and-int/2addr and-int/lit16 and-int/lit8 and-long and-long/2addr aput aput-boolean aput-byte aput-char aput-object aput-short aput-wide array-length check-cast cmp-long cmpg-double cmpg-float cmpl-double cmpl-float const const-class const-string const-string-jumbo const-wide const-wide/16 const-wide/32 const-wide/high16 const/16 const/4 const/high16 div-double div-double/2addr div-float div-float/2addr div-int div-int/2addr div-int/lit16 div-int/lit8 div-long div-long/2addr double-to-float double-to-int double-to-long execute-inline fill-array-data filled-new-array filled-new-array/range float-to-double float-to-int float-to-long goto goto/16 goto/32 if-eq if-eqz if-ge if-gez if-gt if-gtz if-le if-lez if-lt if-ltz if-ne if-nez iget iget-boolean iget-byte iget-char iget-object iget-object-quick iget-quick iget-short iget-wide iget-wide-quick instance-of int-to-byte int-to-char int-to-double int-to-float int-to-long int-to-short invoke-direct invoke-direct-empty invoke-direct/range invoke-interface invoke-interface/range invoke-static invoke-static/range invoke-super invoke-super-quick invoke-super-quick/range invoke-super/range invoke-virtual invoke-virtual-quick invoke-virtual-quick/range invoke-virtual/range iput iput-boolean iput-byte iput-char iput-object iput-object-quick iput-quick iput-short iput-wide iput-wide-quick long-to-double long-to-float long-to-int monitor-enter monitor-exit move move-exception move-object move-object/16 move-object/from16 move-result move-result-object move-result-wide move-wide move-wide/16 move-wide/from16 move/16 move/from16 mul-double mul-double/2addr mul-float mul-float/2addr mul-int mul-int/2addr mul-int/lit8 mul-int/lit16 mul-long mul-long/2addr neg-double neg-float neg-int neg-long new-array new-instance nop not-int not-long or-int or-int/2addr or-int/lit16 or-int/lit8 or-long or-long/2addr rem-double rem-double/2addr rem-float rem-float/2addr rem-int rem-int/2addr rem-int/lit16 rem-int/lit8 rem-long rem-long/2addr return return-object return-void return-wide rsub-int rsub-int/lit8 sget sget-boolean sget-byte sget-char sget-object sget-short sget-wide shl-int shl-int/2addr shl-int/lit8 shl-long shl-long/2addr shr-int shr-int/2addr shr-int/lit8 shr-long shr-long/2addr sparse-switch sput sput-boolean sput-byte sput-char sput-object sput-short sput-wide sub-double sub-double/2addr sub-float sub-float/2addr sub-int sub-int/2addr sub-int/lit16 sub-int/lit8 sub-long sub-long/2addr throw throw-verification-error ushr-int ushr-int/2addr ushr-int/lit8 ushr-long ushr-long/2addr xor-int xor-int/2addr xor-int/lit16 xor-int/lit8 xor-long xor-long/2addr</string> </dict> <dict> <key>Word2</key> <string>v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29 v30 v31 v32 v33 v34 v35 v36 v37 v38 v39 v40 v41 v42 v43 v44 v45 v46 v47 v48 v49 v50 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30</string> </dict> <dict> <key>Word3</key> <string>array-data .catch .catchall .class .end .end\ local .enum .epilogue .field .implements .line .local .locals .parameter .prologue .registers .restart .restart\ local .source .subannotation .super</string> </dict> <dict> <key>Word4</key> <string>abstract bridge constructor declared-synchronized enum final interface native private protected public static strictfp synchronized synthetic system transient varargs volatile</string> </dict> <dict> <key>Word4</key> <string>(&quot;0)&quot;0</string> </dict> <dict> <key>Word5</key> <string>.method .annotation .sparse-switch .packed-switch</string> </dict> <dict> <key>word6</key> <string>.end\ method .end\ annotation .end\ sparse-switch .end\ packed-switch</string> </dict> <dict> <key>word7</key> <string>&quot; ( ) , ; { } &gt;</string> </dict> <key>uuid</key> <string>27798CC6-6B1D-11D9-B8FA-000D93589AF6</string> </dict> </plist>

    Read the article

  • simple float issue on wordpress blog

    - by JCHASE11
    I am modifying a wordpress theme completely, and have run into one very simple problem. Please look at my page here: wordpress blog When you scroll down, you can see the one blank area under the first post. For some reason, that block isn't floating left. Each post has the following css that fits in a 645px container: .home-post-wrap { width: 285px; margin:0; float: left; background-color: #FFF; padding: 15px; overflow: hidden; border-bottom:1px dotted #C5C5C5; border-right:1px dotted #C5C5C5; } Any idea on how to make the page flow correctly here?

    Read the article

  • text not wrapping around some floated images, wraps in IE & FF but not chrome, safari

    - by Hartley
    This is unlike anything I've read about and I've been totally scratching my head for the last few hours trying to figure out what's going on. I have a hand-coded site @ hartbro.com Part of the site is a blog, in which I include pictures. Here's the HTML code around one of the images that's causing trouble. <a href="blogcontent/090811.jpg" class="img"> <img src="blogcontent/090811.jpg" alt="Downed trees" width="25%" class="floatright" /></a> The storm left as quickly as it came. The sky cleared up and we were glad that the oppressive heat had let up. What I've noticed is that, on some of the blog entries that include more than one image, the 2nd image isn't really floating like its supposed to be, with the text wrapping around it. I figure its got to be some sort of conflict with some CSS that I have that's causing the problem but I just can't figure out what it is. I don't understand how it works in FF & IE but not Chrome or Safari?? Here's all of the relevant CSS, let me know if you need anything else. Thanks in advance. img{ margin:10px; } img.floatleft{ float:left; } img.floatright{ float:right; } edit: here's an screen-shot of what's happening.

    Read the article

  • Platformer Starter Kit - Collision Issues

    - by Cyral
    I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision (Being it needs to be more precise). Standing on the edge of a tile and jumping causes the player to move off the the tile when he lands. And 80% of the time, when the player lands, he goes flying though SOLID tiles in a diagonal fashion. This is very annoying as it is almost impossible to test other features, when spawning and jumping will result in the player landing in another part of the level or falling off the edge completely. The code is as follows: /// <summary> /// Updates the player's velocity and position based on input, gravity, etc. /// </summary> public void ApplyPhysics(GameTime gameTime) { float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds; Vector2 previousPosition = Position; // Base velocity is a combination of horizontal movement control and // acceleration downward due to gravity. velocity.X += movement * MoveAcceleration * elapsed; velocity.Y = MathHelper.Clamp(velocity.Y + GravityAcceleration * elapsed, -MaxFallSpeed, MaxFallSpeed); velocity.Y = DoJump(velocity.Y, gameTime); // Apply pseudo-drag horizontally. if (IsOnGround) velocity.X *= GroundDragFactor; else velocity.X *= AirDragFactor; // Prevent the player from running faster than his top speed. velocity.X = MathHelper.Clamp(velocity.X, -MaxMoveSpeed, MaxMoveSpeed); // Apply velocity. Position += velocity * elapsed; Position = new Vector2((float)Math.Round(Position.X), (float)Math.Round(Position.Y)); // If the player is now colliding with the level, separate them. HandleCollisions(); // If the collision stopped us from moving, reset the velocity to zero. if (Position.X == previousPosition.X) velocity.X = 0; if (Position.Y == previousPosition.Y) velocity.Y = 0; } /// <summary> /// Detects and resolves all collisions between the player and his neighboring /// tiles. When a collision is detected, the player is pushed away along one /// axis to prevent overlapping. There is some special logic for the Y axis to /// handle platforms which behave differently depending on direction of movement. /// </summary> private void HandleCollisions() { // Get the player's bounding rectangle and find neighboring tiles. Rectangle bounds = BoundingRectangle; int leftTile = (int)Math.Floor((float)bounds.Left / Tile.Width); int rightTile = (int)Math.Ceiling(((float)bounds.Right / Tile.Width)) - 1; int topTile = (int)Math.Floor((float)bounds.Top / Tile.Height); int bottomTile = (int)Math.Ceiling(((float)bounds.Bottom / Tile.Height)) - 1; // Reset flag to search for ground collision. isOnGround = false; // For each potentially colliding tile, for (int y = topTile; y <= bottomTile; ++y) { for (int x = leftTile; x <= rightTile; ++x) { // If this tile is collidable, ItemCollision collision = Level.GetCollision(x, y); if (collision != ItemCollision.Passable) { // Determine collision depth (with direction) and magnitude. Rectangle tileBounds = Level.GetBounds(x, y); Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds); if (depth != Vector2.Zero) { float absDepthX = Math.Abs(depth.X); float absDepthY = Math.Abs(depth.Y); // Resolve the collision along the shallow axis. if (absDepthY < absDepthX || collision == ItemCollision.Platform) { // If we crossed the top of a tile, we are on the ground. if (previousBottom <= tileBounds.Top) isOnGround = true; // Ignore platforms, unless we are on the ground. if (collision == ItemCollision.Impassable || IsOnGround) { // Resolve the collision along the Y axis. Position = new Vector2(Position.X, Position.Y + depth.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } else if (collision == ItemCollision.Impassable) // Ignore platforms. { // Resolve the collision along the X axis. Position = new Vector2(Position.X + depth.X, Position.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } } } } // Save the new bounds bottom. previousBottom = bounds.Bottom; } It also tends to jitter a little bit sometimes, I'm solved some of this with some fixes I found here on stackexchange, But Ive only seen one other case of the flying though blocks problem. This question seems to have a similar problem in the video, but mine is more crazy. Again this is a very annoying bug! Any help would be greatly appreciated! EDIT: Speed stuff // Constants for controling horizontal movement private const float MoveAcceleration = 13000.0f; private const float MaxMoveSpeed = 1750.0f; private const float GroundDragFactor = 0.48f; private const float AirDragFactor = 0.58f; // Constants for controlling vertical movement private const float MaxJumpTime = 0.35f; private const float JumpLaunchVelocity = -3500.0f; private const float GravityAcceleration = 3400.0f; private const float MaxFallSpeed = 550.0f; private const float JumpControlPower = 0.14f;

    Read the article

  • Text over floated images

    - by Barbara
    I need to put some text over a series of images in a gallery. I found many tutorials about the text part however the images need to be floated. Whenever I add float:left though the trick no longer works. My code (css inline for sack of brevity): <a href="/photos/photo1.php" title="photo1"> <span style="position: relative; width: 100%;"> <img src="/photos/photo1.jpg" alt="" /> <span style="position: absolute; top: 10px; left: 0; width: 100%;">Text over image</span> </span> </a> <a href="/photos/photo2.php" title="photo2"> <span style="position: relative; width: 100%;"> <img src="/photos/photo2.jpg" alt="" /> <span style="position: absolute; top: 10px; left: 0; width: 100%;">Text over image</span> </span> </a> This way the images are one under another but like I said I need to float them without breaking everything else.

    Read the article

  • Fast 4x4 matrix multiplication in Java with NIO float buffers

    - by kayahr
    I know there are LOT of questions like that but I can't find one specific to my situation. I have 4x4 matrices implemented as NIO float buffers (These matrices are used for OpenGL). Now I want to implement a multiply method which multiplies Matrix A with Matrix B and stores the result in Matrix C. So the code may look like this: class Matrix4f { private FloatBuffer buffer = FloatBuffer.allocate(16); public Matrix4f multiply(Matrix4f matrix2, Matrix4f result) { {{{result = this * matrix2}}} <-- I need this code return result; } } What is the fastest possible code to do this multiplication? Some OpenGL implementations (Like the OpenGL ES stuff in Android) provide native code for this but others doesn't. So I want to provide a generic multiplication method for these implementations.

    Read the article

  • Strange layout behaviour

    - by andrii
    I am a little bit confused. Here is an small web page. There are two main div-s: top and mainBlock. First contain image. The problem is that firebug shows that div#top's height is equal to 0 and because of that the next div mainBlock moves up. If I would delete this peace of code: div#logo{ float: left; } everything will start working fine and div#mainBlock will be below the div#top. Could you, please, explain me how it works and how to avoid this in proper way? Here is my code: <!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 http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Paralab - Website &amp; interface design, web apps development, usability</title> <style text="text/css"> html, body{ } div#logo{ float: left; } #top{ width: 100%; } #mainBlock{ width:100%; } </style> </head> <body> <div id="top"> <div id="logo"> <img alt="logo" src="img/logo.png" /> </div> </div> <div id="mainBlock"> Contact Us </div> </body> </html>

    Read the article

  • Strange(?) Opera Floating

    - by SkaveRat
    I have some strange floating behaviour on opera (IE f's up completely different, but that's for later). I'm floating the i-icons to the right. It works nicely on Fx and WebKit, but opera shifts the icons down a bit. Anyone got an idea how this happenes? CSS: .dataRow { margin: 5px 0; clear:right; } .dataRow label{ display: block; float:left; width: 160px; vertical-align: middle; font-size: 80%; } .dataGroup a img { border:0;float:right; position:relative; right:0; } .dataGroup a:hover { background:#EBEDC7; text-decoration:none; } .dataGroup a.tooltip span { display:none; padding:2px 3px; margin-top:20px; width:100px; font-size: 80%; } .dataGroup a.tooltip:hover span { display:inline; position:absolute; border:1px solid #632D11; background:#C2BD6C; color:#fff; } HTML: <fieldset class="dataGroup"> <div class="dataRow"><label>Foobar:</label> <input name="foobar" size="10" value="somedata" /> <a href="#" class="tooltip"><img src="/img/admin/information.png"/><span>Tooltip Info</span></a></div> </fieldset>

    Read the article

  • min() and max() give error: TypeError: 'float' object is not iterable

    - by PythonUser3.3
    markList=[] Lmark=0 Hmark=0 while True: mark=float(input("Enter your marks here(Click -1 to exit)")) if mark == -1: break markList.append(mark) markList.sort() mid = len(markList)//2 if len(markList)%2==0: median=(markList[mid]+ markList[mid-1])/2 print("Median:", median) else: print("Median:" , markList[mid]) Lmark==(min(mark)) print("The lowest mark is", Lmark) Hmark==(max(mark)) print("The highest mark is", Hmark) My program is a basic grade calculator using lists. My program asks the user to input their grades into a list in which it then calculates your average and finds your lowest and highest mark. I have found the average but I can't seem to figure out how to find the lowest and highest grade. Can you please show me pr tell me what to do?

    Read the article

  • div with float next to div with width

    - by dragonfly
    Hi, I have html: <div class="field-label"><label>Email: </label></div> <div class="field"><input class="input" ......></div> and piece of css: .field-label { clear:left; float:left; padding:0.5em; width:6em; } .field { padding:0.5em; } And it worked fine. But for some elements I wanted to apply following change: when I add width to .field class layout goes to blazes: element with .field class appears under element with field-label class. Container of whole form is width enough to hold elements with field-label & field class. Why is it happening, did I miss something in css basics? Thanks ,Pawel

    Read the article

  • Loss of precision - int -> float or double

    - by stan
    I have an exam question i am revising for and the question is for 4 marks "In java we can assign a int to a double or a float". Will this ever loose infromation and why? I have put that because ints are normally of fixed length or size - the precision for sotring data is finite, where storing information in floating point can be infinite, essentially we loose infromation because of this Now i am a little sketchy as to whetehr or not i am hitting the right areas here. I very sure it will loose precision but i cant exactly put my finger on why. Can i getsome help please Thanks

    Read the article

  • Why is sqrt() not a method on Float?

    - by KaptajnKold
    In Ruby everything is an object. That's why I don't understand why we have the Math module. It seems to me that most (all?) of the functions in the Math module should have been methods on the numeric types like Integer, Float and so on. E.g. instead of Math.sqrt(5) it would make more sense to have 5.sqrt The same goes for sin, cos, tan, log10 and so on. Does anyone know why all these functions ended up in the Math module?

    Read the article

  • Clearing block affects wrong floating

    - by HiveHicks
    I've got two-column layout <div class="left-pane"> Left pane </div> <div class="central-pane"> <div> <ul class="customers-types-tabs"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> </div> <div>Main content</div> </div> and the stylesheet: .left-pane { width: 248px; float: left; background-color: #f6f6f6; border: 1px solid #e6e6e6; padding: 20px 5px; } .central-pane { margin-left: 270px; } .customers-types-tabs li { background-color: #f6f6f6; border: 1px solid #d5d5d5; line-height: 38px; padding: 0 20px; float: left; margin-right: 10px; position: relative; top: 1px; } The problem is that I want "Main content" to appear right below the div with ul inside it (that represents tabs control), but if I set Main content's div's style to clear: both, it appears below the left pane, which is taller than the ul. What should I do to get correct position of main content?

    Read the article

  • Float as DateTime

    - by lp1
    SQL Server 2008 I almost have, I think, what I'm looking to do. I'm just trying to fine tune the result. I have a table that stores timestamps of all transactions that occur on the system. I'm writing a query to give an average transaction time. This is what I have so far: With TransTime AS ( select endtime-starttime AS Totaltime from transactiontime where starttime > '2010-05-12' and endtime < '2010-05-13') Select CAST(AVG(CAST(TotalTime As Float))As Datetime) from TransTime I'm getting the following result: 1900-01-01 00:00:00.007 I can't figure out how to strip the date off and just display the time, 00:00:00:007. Any help would be appreciated. Thank you.

    Read the article

  • Make floating element "maximally wide"

    - by bobobobo
    I have some floating elements on a page. What I want is the div that is floated left to be "maximally wide" so that it is as wide as it possibly can be without causing the red div ("I go at the right") to spill over onto the next line. An example is here: The width:100%; doesn't produce the desired effect! ** I don't want the green element ("I want to be as wide as possible") to go "under" the red element. Its very important that they both stay separate i.e. .. I think they must both be floated! <div class="container"> <div class="a1">i go at the right</div> <div class="a2">i want to be as wide as possible,</div> <div class="clear"></div> </div> <style> div { border: solid 2px #000; background-color: #eee; margin: 8px; padding: 8px; } div.a1 { float:right; background-color: #a00; border: solid 2px #f00; margin: 12px; padding: 6px; } div.a2 { float: left; /*width: 100%;*/ /*this doens't produce desired effect!*/ background-color: #0b0; border: solid 2px #0f0; margin: 12px; padding: 14px; } .clear { border: none; padding: 0 ; margin: 0; clear:both; } </style>

    Read the article

  • IE7 - jquery addClass() breaks floating elements

    - by Patrick
    I have this nav that uses addClass('hover') when the mouse is rolled over an item. This works fine except in IE7 when the addClass function is called every element with float:left stops floating and the page totally loses its structure. This is my JS: _this.position_sub_menus = function(){ $('#header #nav > ul > li').mouseenter( function(e){ pos = $(this).offset(); height = $(this).height(); lvl2 = '#' + $(this).attr('id') + '-submenu'; if( $(this).position().left > ($('#nav').width()/2)){ pos.left = pos.left - $(lvl2).width() + $(this).width(); } $(this).addClass('hover'); $(lvl2).show(); $(lvl2).css( { 'left' : (pos.left - 12) + 'px', 'top' : pos.top + height + 'px'}); } ); This is the CSS of the of the elements that break: display: inline; float: left; margin-left: 10px; margin-right: 10px; position: relative; It's CSS from the 960 grid system. When I comment out the $(this).addClass('hover'); line the floated elements dont break. Is anyone familiar with this IE7 problem? Thanks guys

    Read the article

  • How to float span properly

    - by brianr1
    I am developing this site http://indigonightlife.com/ The second section down is This Weeks Events. To the right of that heading is an image of the 5 little blue lines. The problem Im having is I cant get it to float to the right side of the container. As it is now, its in the middle of the container. Ive tried all kinds of combos of floats, clearfixes, and such but I cant get it to stay to the right. The section below titled Resident and Guest DJs has the same image but its floated fine. Not sure what the difference is. Any help would be appreciated. Thanks.

    Read the article

  • int and float increment condition in for loop [on hold]

    - by Mazaya Jamil
    I am doing a program that involves integer and float number.Let say I want to calculate atx={1,1/2,2,3,4} and want to use for-loop. But I know the condition of increment for(x=1;x<=4;x++) as x++=x+1. I want to find the iteration at x={1,2,3,4} and at x={1/2}. But I do not have idea how to modify the for-loop statement; either to make the increment of 0.5 or 1. But if I set 0.5, I will get the answers for 5/2 and 7/2 instead.

    Read the article

  • how to use static function in header and compare with float array

    - by ed k
    I wrote this function: static bool colorIsEmpty(const Color col) { return (col[0] == 0 && col[1] == 0 && col[2] == 0 ); } where Color is simply a float[3]; the function doesn't work if col[3] are all 0; but this works: if(col[0] == col[1] == col[2] == 0) { //gets called } however gcc gives me warning: cColorTest.c:212:5: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] so it would be nice if that function works,why it doesn't work?

    Read the article

  • height autoflow autofill into out div

    - by Brian Putt
    I have a fiddle(http://jsfiddle.net/pwnagecss/LnNYv/) and need help in making it so the classes sideBar, and rightContentWrapper autofill to the height. <div class="wrapper"> <div class="sideBar"> </div> <div class="rightContentWrapper"> <div class="rightContent"> </div> </div> </div> .wrapper { width: 960px; height: 100%; margin: 0 auto 20px auto; padding: 0; background-color:black; } .wrapper:after{ clear: both; display: block; height: 0; visibility: hidden; content: "0020"; } .sideBar { float: left; width: 200px; background-color:blue; min-height: inherit; height: 100%; } .rightContentWrapper { float: left; width: 760px; height: 100%; min-height: inherit; } .rightContent { margin: 0 auto; background-color: red; min-height: inherit; } Any help is appreciated

    Read the article

  • Rails nil can't be coerced into Float

    - by alex
    After adding items, attempting to view my cart leads me to this error: nil can't be coerced into Float with the math line in this method in my line_item model highlighted: def total_price product.price * quantity end line items create action def create product = Product.find(params[:product_id]) @line_item = @cart.add_product(product.id) @line_item.quantity = params[:quantity] view <div id= "text_field"><%= text_field_tag 'quantity' %> </div> <%= button_to 'Add to Cart', line_items_path(:product_id => product) %> This has held me back for a couple days. (I'm new). Thanks.

    Read the article

  • How to pass one float as four unsigned chars to shader by glVertexPointAttrib?

    - by Kog
    For each vertex I use two floats as position and four unsigned bytes as color. I want to store all of them in one table, so I tried casting those four unsigned bytes to one float, but I am unable to do that correctly... All in all, my tests came to one point: GLfloat vertices[] = { 1.0f, 0.5f, 0, 1.0f, 0, 0 }; glEnableVertexAttribArray(0); glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); // VER1 - draws red triangle // unsigned char colors[] = { 0xff, 0, 0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0, // 0xff }; // glEnableVertexAttribArray(1); // glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, GL_TRUE, 4 * sizeof(GLubyte), // colors); // VER2 - draws greenish triangle (not "pure" green) // float f = 255 << 24 | 255; //Hex:0xff0000ff // float colors2[] = { f, f, f }; // glEnableVertexAttribArray(1); // glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, GL_TRUE, 4 * sizeof(GLubyte), // colors2); // VER3 - draws red triangle int i = 255 << 24 | 255; //Hex:0xff0000ff int colors3[] = { i, i, i }; glEnableVertexAttribArray(1); glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, GL_TRUE, 4 * sizeof(GLubyte), colors3); glDrawArrays(GL_TRIANGLES, 0, 3); Above code is used to draw one simple red triangle. My question is - why do versions 1 and 3 work correctly, while version 2 draws some greenish triangle? Hex values are one I read by marking variable during debug. They are equal for version 2 and 3 - so what causes the difference?

    Read the article

  • boost::spirit (qi) decision between float and double

    - by ChrisInked
    I have a parser which parses different data types from an input file. I already figured out, that spirit can decide between short and int, for example: value %= (shortIntNode | longIntNode); with shortIntNode %= (qi::short_ >> !qi::double_) [qi::_val = phoenix::bind(&CreateShortIntNode, qi::_1)]; longIntNode %= (qi::int_ >> !qi::double_) [qi::_val = phoenix::bind(&CreateLongIntNode, qi::_1)]; I used this type of rules to detect doubles as well (from the answers here and here). The parser was able to decide between int for numbers 65535 and short for numbers <= 65535. But, for float_ and double_ it does not work as expected. It just rounds these values to parse it into a float value, if there is a rule like this: value %= (floatNode | doubleFloatNode); with floatNode %= (qi::float_) [qi::_val = phoenix::bind(&CreateFloatNode, qi::_1)]; doubleFloatNode %= (qi::double_) [qi::_val = phoenix::bind(&CreateDoubleFloatNode, qi::_1)]; Do you know if there is something like an option or some other trick to decide between float_ and double_ depending on the data type range? Thank you very much!

    Read the article

  • Storing float numbers as strings in android database

    - by sandis
    So I have an app where I put arbitrary strings in a database and later extract them like this: Cursor DBresult = myDatabase.query(false, Constant.DATABASE_NOTES_TABLE_NAME, new String[] {"myStuff"}, where, null, null, null, null, null); DBresult.getString(0); This works fine in all cases except for when the string looks like a float number, for example "221.123123123". After saving it to the database I can extract the database to my computer and look inside it with a DB-viewer, and the saved number is correct. However, when using cursor.getString() the string "221.123" is returned. I cant for the life of me understand how I can prevent this. I guess I could do a cursor.getDouble() on every single string to see if this gives a better result, but that feels sooo ugly and inefficient. Any suggestions? Cheers, edit: I just made a small test program. This program prints "result: 123.123", when I would like it to print "result: 123.123123123" SQLiteDatabase database = openOrCreateDatabase("databas", Context.MODE_PRIVATE, null); database.execSQL("create table if not exists tabell (nyckel string primary key);"); ContentValues value = new ContentValues(); value.put("nyckel", "123.123123123"); database.insert("tabell", null, value); Cursor result = database.query("tabell", new String[]{"nyckel"}, null, null, null, null, null); result.moveToFirst(); Log.d("TAG","result: " + result.getString(0));

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >