Search Results

Search found 4467 results on 179 pages for 'red rover'.

Page 55/179 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Which way to store this data is effective?

    - by Tattat
    I am writing a game, which need a map, and I want to store the map. The first thing I can think of, is using a 2D-array. But the problem is what data should I store in the 2D-array. The player can tap different place to have different reaction. So, I am thinking store a 2D-array with objects, when player click some position, and I find it in the array, and use the object in that array to execute a cmd. But I have a concern that storing lots of object may use lots of memory. So, I am think storing char/int only. But it seems that not enough for me. I want to store the data like that: { Type:1 Color:Green } No matter what color is, if they are all type 1, the have same reactions in logic, but the visual effect is based on the color. So, it is not easy to store using a prue char/int data, unless I make something like this: 1-5 --> all type 1. 1=color green , 2=color red, 3 = color yellow.... ... 6-10 --> all type 2. 2 = color green, 2 = color red ... ... So, do you have any ideas on how to minimize the ram use, but also easy for me to read... ...thx

    Read the article

  • SQL Server: String Manipulation, Unpivoting

    - by OMG Ponies
    I have a column called body, which contains body content for our CMS. The data looks like: ...{cloak:id=1.1.1}...{cloak}...{cloak:id=1.1.2}...{cloak}...{cloak:id=1.1.3}...{cloak}... A moderately tweaked for readability example: ## h5. A formal process for approving and testing all external network connections and changes to the firewall and router configurations? {toggle-cloak:id=1.1.1}{tree-plus-icon} *Compliance:* {color:red}{*}Partial{*}{color} (?) {cloak:id=1.1.1} || Date: | 2010-03-15 || || Owner: | Brian || || Researched by: | || || Narrative: | Jira tickets are normally used to approve and track network changes\\ || || Artifacts: | Jira.bccampus.ca\\ || || Recommendation: | Need to update policy that no Jira = no change\\ || || Proposed Remedy(ies): | || || Approved Remedy(ies): | || || Date: | || || Reviewed by: | || || Remarks/comments: | || {cloak}## h5. Current network diagrams with all connections to cardholder data, including any wireless networks? {toggle-cloak:id=1.1.2}{tree-plus-icon} *Compliance:* {color:red}{*}TBD{*}{color} (?) {cloak:id=1.1.2} I'd like to get the cloak values out in the following format: requirement_num ----------------- 1.1.1 1.1.2 1.1.3 I'm looking at using UNIONs - does anyone have a better recommendation? Forgot to mention: I can't use regex, because CLR isn't enabled on the database. The numbers aren't sequencial. The current record jumps from 1.1.6 to 1.2.1

    Read the article

  • C++ union data-structure, easy acccess of bits within a DWORD

    - by TK
    Im running through a set of DirectX tutorials online and I have the following structure: struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag DWORD color; // from the D3DFVF_DIFFUSE flag } My basic understanding of directX leads me to thing tha color is made up of 8-bit alpha, red, green and blue channels. I am attempting to get east access to these channels. Rather than write the following code numerous times (within the CUSTOMVERTEX structure): public: int red() { return (color & 0x00FF0000) >> 16; } I could write a more elegant somution with a combination of a union and a structure e.g. struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag #pragma pack(2) union { DWORD color; // from the D3DFVF_DIFFUSE flag struct { char a; char r; char g; char b; }; }; } However this does not appear to function as expected, the values in r, g, & b almost appear the reverse of whats in color e.g. if color is 0x12345678 a = 0x78, r = 0x56. Is this an endieness issue? Also what other problems could I be expecting from this solution? e.g. overflow from the color members? I guess what Im asking is ... is there a better way to do this?!

    Read the article

  • Adding a ActionPerformed Array to a String Array

    - by user267490
    Hey, Before you guys ask, yes I've searched online for the answer, but everything I found just leaves a lil confuse and nothing is recent so asking in those forums won't really help. My problems is this: I have an array that holds my name for a menu. String[] fontColor = new String[] {"Red", "Blue", "Green"}; for (int i = 0; i < fontColors.length; i++) { JMenuItem fontC = new JMenuItem(fontColors[i]); fontC.addActionListener(new fontColorAction()); changeFontColor.add(fontC); } Then I have an array that holds my color change in a class called fontColorAction in that class I have another array that does the same thing as my string array except all thats in the statement is textarea.setForeground(colorArr[i]); that will set the setForeground() in order, but now how do I successfully attact the action listner in my class to my menuItems? my class looks like this private class fontColorAction implements ActionListener { Color[] colorArr - new Color[] {"Color.RED","Color.BLUE","Color.GREEN"}; public void actionPerformed(ActionEvent e){ for(i = 0; i < collorArr.length; i++){ textarea.setForeground(colorArr[i]); } } }

    Read the article

  • Connecting grouped dots/points on a scatter plot based on distance

    - by ToNoY
    I have 2 sets of depth point measurements, for example: > a depth value 1 2 2 2 4 3 3 6 4 4 8 5 5 16 40 6 18 45 7 20 58 > b depth value 1 10 10 2 12 20 3 14 35 I want to show both groups in one figure plotted with depth and with different symbols as you can see here plot(a$value, a$depth, type='b', col='green', pch=15) points(b$value, b$depth, type='b', col='red', pch=14) The plot seems okay, but the annoying part is that the green symbols are all connected (though I want connected lines also). I want connection only when one group has a continued data points at 2 m interval i.e. the symbols should be connected with a line from 2 to 8 m (green) and then group B symbols should be connected from 10-14 m (red) and again group A symbols should be connected (green), which means I do NOT want to see the connection between 8 m sample with the 16 m for group A. An easy solution may be dividing the group A into two parts (say, A-shallow and A-deep) and then plotting A-shallow, B, and A-deep separately. But this is completely impractical because I have thousands of data points with hundreds of groups i.e. I have to produce many depth profiles. Therefore, there has to be a way to program so that dots are NOT connected beyond a prescribed frequency/depth interval (e.g. 2 m in this case) for a particular group of samples. Any idea?

    Read the article

  • Parent-child height problem

    - by Vector
    I have a parent div that has position: relative and his child has position: absolute. Such positions is a must. The problem is the parent does not stretch to the height of the child. The question is how to make it stretch to the height of the child? The mark-up is similar to this: <!DOCTYPE HTML> <html> <head> <style> .parent { position: relative; border: solid 1px red; } .child { position: absolute; border: solid 1px red; } </style> </head> <body> <div class="parent"> <div class="child">Hello World!</div> </div> </body> </html>

    Read the article

  • Connect 4 C# (How to draw the grid)

    - by Matt Wilde
    I've worked out most of the code and have several game classes. The one bit I'm stuck on at the moment, it how to draw the actual Connect 4 grid. Can anyone tell me what's wrong with this for loop? I get no errors but the grid doesn't appear. I'm using C#. private void Drawgrid() { Brush b = Brushes.Black; Pen p = Pens.Black; for (int xCoor = XStart, col = 0; xCoor < XStart + ColMax * DiscSpace; xCoor += DiscSpace, col++) // x coordinate beginning; while the x coordinate is smaller than the max column size, times it by // the space between each disc and then add the x coord to the disc space in order to create a new circle. for (int yCoor = YStart, row = RowMax - 1; yCoor < YStart + RowMax * DiscScale; yCoor += DiscScale, row--) { switch (Grid.State[row, col]) { case GameGrid.Gridvalues.Red: b = Brushes.Red; break; case GameGrid.Gridvalues.Yellow: b = Brushes.Yellow; break; case GameGrid.Gridvalues.None: b = Brushes.Aqua; break; } MainDisplay.DrawEllipse(p, xCoor, yCoor, 50, 50); MainDisplay.FillEllipse(b, xCoor, yCoor, 50, 50); } Invalidate(); } Thanks.

    Read the article

  • Filling a region draws it off canvas

    - by Xanyx
    Hi Using the following code in Delphi 2007: procedure TfrmTest.PaintBox1Paint(Sender: TObject); const Rect_Size = 10; begin PaintBox1.Canvas.Brush.Color := clYellow; PaintBox1.Canvas.FillRect(Rect(0, 0, PaintBox1.width, PaintBox1.height)); PaintBox1.Canvas.Brush.Color := clRed; DrawARect(PaintBox1.Canvas, 0, 0, Rect_Size, Rect_Size); end; procedure TfrmTest.DrawARect(ACanvas: TCanvas; iLeft, iTop, iWidth, iHeight: Integer); var rgnMain: HRGN; begin rgnMain := CreateRectRgn(iLeft, iTop, iLeft + iWidth, iTop + iHeight); try SelectClipRgn(ACanvas.handle, rgnMain); ACanvas.FillRect(ACanvas.ClipRect); SelectClipRgn(ACanvas.handle, 0); finally DeleteObject(rgnMain); end; end; I get this: (Yellow area shows boundaries of PaintBox1). HMMM, NOT ALLOWED TO POST IMAGE Please go to: http://www.freeimagehosting.net/uploads/62cf687d29.jpg (Linked image shows a form with a yellow box [PaintBox1] in the center. However my red rectange [rgnMain] has been drawn at pos 0,0 on the form) My expectation was that the red rectangle would be at the top left of the PaintBox1 canvas, not the form's canvas. Why is it not? Can regions only be used with controls that have a Windows handle? Thanks

    Read the article

  • Action listener for JButton array

    - by user530809
    Let's say I have a program with 2D array of buttons, and when you click one of them it turns red. I didn't want to declare every single button seperately so I just created JButton[][] array for them. The problem is that I don't know how to use action listener on any of the buttons in the array so it would change the color of this particular button, and none of related questions is relevant to this. I tried to use "for" but it doesn't help: package appli; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MainW extends JFrame implements ActionListener { public MainW(){ setSize(640,480); setTitle("title"); setLayout(null); JButton[][] btnz = new JButton[5][5]; for(Integer i=0;i<5;i++) { for(Integer j=0;j<5;j++) { btnz[i][j]= new JButton(""); btnz[i][j].setBackground(Color.WHITE); btnz[i][j].setBounds(10+20*i,10+20*j,20,20); add(btnz[i][j]); btnz[i][j].addActionListener(this); } } setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public void actionPerformed(ActionEvent e){ for(Integer i=0;i<5;i++) { for(Integer j=0;j<5;j++) { if (e.getSource()==btnz[i][j]); { btnz[i][j].setBackground(Color.RED); } } } } }

    Read the article

  • CSS: Parent-Div does not grow with it's children (horizontal)

    - by vyden_st
    I would like the parent-div (red) to grow with the green child-div. Now it just stops at the viewport. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="de" xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <title>simple document</title> <style type="text/css"> * { font-family: verdana; margin: 0px; padding: 0px; } </style> </head> <body> <div style="margin: 30px; background: red; padding: 10px;"> <div style="background: green; width: 2000px;">dxyf</div> </div> </body> </html> I don't want to use display:table; since it does not work well in IE. Any ideas?

    Read the article

  • Java for loop with multiple incrementers

    - by user2517280
    Im writing a program which combines the RGB pixel values for 3 images, e.g. red pixel of image 1, green pixel of image 2 and blue pixel of image 3 and I want to then create a final image of it. Im using the code below, but this seems to be incrementing x2 and x3 whilst x1 is the same, i.e. not giving the right pixel value for same co-ordinate for each image. for (int x = 0; x < image.getWidth(); x++) { for (int x2 = 0; x2 < image2.getWidth(); x2++) { for (int x3 = 0; x3 < image3.getWidth(); x3++) { for (int y = 0; y < image.getHeight(); y++) { for (int y2 = 0; y2 < image2.getHeight(); y2++) { for (int y3 = 0; y3 < image3.getHeight(); y3++) { So I was wondering if anyone can tell me how to iterate through each of the 3 images on the same co-ordinate, so for example read 1, 1 of each image and record the red, green and blue value accordingly. Apologies if it doesnt make complete sense, its a bit hard to explain. I can iterate the values for one image fine but when I add in another, things start to go a bit wrong as obviously its quite a bit more complicated! I was thinking it might be easier to create an array and replace the according values in that just not sure how to do that effectively either. Thanks

    Read the article

  • plot 4 different plots inside 1 pdf

    - by ifreak
    I have 2 data frames which i want to generate 3 plots from them and place them inside 1 pdf file as a single column. i want all the plots to have the same x-axis limits(basically the same x-axis) even thought they differ in the name and how they were obtained. the dataframes looks something like that: d1 X Y Z 0.04939317 -0.4622222 13651 0.03202451 -0.4261000 13401 0.09950793 -0.3233025 13151 0.11548556 -0.4637981 12486 0.09817597 -0.4751886 12236 0.15770701 -0.5819355 11986 and d2 V0 V1 V2 V3 sign 1 1 0.379 0.612 pos 2 1 0.378 0.620 pos 3 1 0.578 0.571 neg 4 1 0.978 0.561 pos 5 1 0.758 0.261 neg 6 1 0.378 0.126 neg P.S : both data frames are bigger than this, this is only a part of them V0, V1 and Z range from 1 to 20000 the plots that i created are : From d2 d2plot=ggplot(d1, aes(V0,V1, fill=sign)) + geom_tile()+ scale_fill_manual(values = c("neg" = "yellow", "pos"="red")) +geom_vline(xintercept =10000 ) +geom_text(mapping=aes(x=10000,y=0, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) From d1 d1plot = ggplot(d2) + geom_errorbarh(aes(x=z,xmin=z-50,xmax=z+50, y=Y, height = 0.02),color="red")+ opts(legend.position = "none") +geom_vline(xintercept = 10000) +geom_text(mapping=aes(x=10000,y=-0.3, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) i've tried grid.arrange(d1plot,d2plot,ncol=1) but the x-axis is different for each plot, i tried changing the aspect ratio, but this will change the y-axis ..i've also tried to use facet_wrap but the problem that my x-axis values have different values, i just want the limits and breaks to be the same and the plots all be aligned in 1 column based on 1 x-axis to comapre the value of the statistical methods in an easy way.

    Read the article

  • Retain numerical precision in an R data frame?

    - by David
    When I create a dataframe from numeric vectors, R seems to truncate the value below the precision that I require in my analysis: data.frame(x=0.99999996) returns 1 (see update 1) I am stuck when fitting spline(x,y) and two of the x values are set to 1 due to rounding while y changes. I could hack around this but I would prefer to use a standard solution if available. example Here is an example data set d <- data.frame(x = c(0.668732936336141, 0.95351462456867, 0.994620622127435, 0.999602102672081, 0.999987126195509, 0.999999955814133, 0.999999999999966), y = c(38.3026509783688, 11.5895099585560, 10.0443344234229, 9.86152339768516, 9.84461434575695, 9.81648333804257, 9.83306725758297)) The following solution works, but I would prefer something that is less subjective: plot(d$x, d$y, ylim=c(0,50)) lines(spline(d$x, d$y),col='grey') #bad fit lines(spline(d[-c(4:6),]$x, d[-c(4:6),]$y),col='red') #reasonable fit Update 1 Since posting this question, I realize that this will return 1 even though the data frame still contains the original value, e.g. > dput(data.frame(x=0.99999999996)) returns structure(list(x = 0.99999999996), .Names = "x", row.names = c(NA, -1L), class = "data.frame") Update 2 After using dput to post this example data set, and some pointers from Dirk, I can see that the problem is not in the truncation of the x values but the limits of the numerical errors in the model that I have used to calculate y. This justifies dropping a few of the equivalent data points (as in the example red line).

    Read the article

  • How to highlight parent li text only on :hover?

    - by metal-gear-solid
    How to highlight Article only on mouse over? current when i hover on Article it highlights all child item also. Is it possible to highlight Articles only see example here http://jsbin.com/ubunu/2 <style> li:hover {background:red} li li:hover {background:yellow} </style> </head> <body> <p id="hello">Hello World</p> <ul> <li>Weblog</li> <li>Articles <ul> <li>How to Beat the Red Sox</li> <li>Pitching Past the 7th Inning <ul> <li>Part I</li> <li>Part II</li> </ul> </li> <li>Eighty-Five Years Isn't All That Long, Really</li> </ul> </li> <li>About</li> </ul>

    Read the article

  • Polling a web URL until event

    - by Jaxo
    I'm really sorry about the crappy title - if anybody has a better way of wording it, please edit it! I basically need to have a C# application run a function if the output of a URL is a certain value. For example, if the website says blue the background colour will be blue, red to make it red, etc. The problem is I don't want to spam my webserver with checks. The 4 bytes it downloads each time is negligible, but if I were to deploy this type of system on multiple computers, it would get slower and slower and the bandwidth would add up quickly. So my question is: How can my desktop application run a piece of code only when a web URL has a different output without checking each time? I can't use sockets, and any sort of LAN protocol won't end up working. My reasoning behind this potentially nefarious code is to be able to mute computers by updating a file on the website (as you may have seen in my previous question today, sorry!). I'd like it to be rather quick, and not have the refresh time minutes apart, a few seconds at the most would be ideal. How can I accomplish this? The website's code is easy, but getting the C# application to check when it changes is the part I'm stuck on. Nothing shows up on the website other than the command. Thanks!

    Read the article

  • How do I select only the 4th and higher LIs in each UL?

    - by KatieK
    For this XHTML: <ul class="collapse"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul> <ul class="collapse"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> Using jQuery, how do I select only the 4th and higher LIs in each UL? I've tried: $("ul.collapse li:gt(2)").css("color", "red"); But it selects the 4th and higher LIs in the whole document. "Four", "Five", and "1", "2", "3", "4" are red.

    Read the article

  • JavaScript: supposed to execute functions sequentially, not actually doing so?

    - by AP257
    I'm seeing a lot of answers on StackOverflow that say that JavaScript executes code sequentially, but I can actually see my own JavaScript not doing so. From the following code: function centre_map(lat, lng, zoom_level) { alert('centre_map'); map = new GMap2(document.getElementById('map_canvas')); var latlng = new GLatLng(lat, lng); map.setCenter(latlng, zoom_level); } function add_markers_within_bounds() { alert('add_markers_within_bounds'); // add numerous BLUE markers within map bounds using MarkerClusterer } function add_marker(lat, lng, place_name, grid, county) { alert('add_marker'); // add one ordinary RED Google Maps marker } centre_map('{{lat}}', '{{lng}}', 12); add_markers_within_bounds('{{grid}}', '{{place_name}}'); add_marker('{{lat}}', '{{lng}}', '{{place_name}}', '{{grid}}', '{{county}}'); I get the following sequence of events: 'centre_map' alert 'add_markers_within_bounds' alert 'add_marker' alert individual RED marker appears on map (i.e. add_marker renders) multiple BLUE markers appear on map (i.e. add_markers_within_bounds renders) Why doesn't add_markers_within_bounds complete before add_marker gets under way: and how can I make it do so? I know that one way might be to call add_marker from within add_markers_within_bounds, but for various reasons I'd rather keep it as a separate function.

    Read the article

  • How can I programmatically get the connection status of OSX network services?

    - by BigBrainz
    In the OS X System Preferences, when I click on 'Network' I see a green dot by 'Ethernet', and red dots by 'AirPort' and 'FireWire'. This is because I turned off AirPort and FireWire, as I access networks and the Internet via Ethernet. I need to programmatically determine which of these network services displayed in System Preferences have green dots and which have red dots. For Ethernet and FireWire the displayed status is 'Connected' or 'Not Connected', and for AirPort the displayed status is 'On' or 'Off'. Perhaps other network services have other status labels. I have picked through all the plist files in '/Library/Preferences/SystemConfiguration', particularly 'preferences.plist' and 'NetworkInterfaces.plist'. I can get all sorts of information there, such as the Location set, network service order, proxy information (which is also important to my task), but I cannot find how to determine whether a given network service is on or off--the equivalent of having the green dot displayed. I have also tried using System Configuration framework, specifically the SCNetworkConnectionGetStatus function, but all I get are invalid connection statuses. Does anyone know how to actually retrieve this connection status information? Thanks.

    Read the article

  • SVG 100% document height don't work

    - by whizzo
    I'm trying to fill a document with a SVG image using the width="100%" and height="100%" properties, I have height="100%" in html and body tags too, and different colours for body(red) and svg(blue). Result is a full height svg but with a scrollbar in the right, and a thin line of red(body) at the bottom. ¿How can I fill the document with the svg without the scrollbar? Thanks. The code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>SVG full page</title> <style> html, body { margin: 0; padding: 0; height: 100%; background-color: #ff0000; } </style> </head> <body> <svg width="100%" height="100%"> <rect x="0" y="0" width="100%" height="100%" fill="#0000ff"></rect> </svg> </body> </html>

    Read the article

  • php png image transparency

    - by user1334130
    I have been working with some code to draw a circle but I am having problems with removing the black background from the shape. I am using imagecopyresampled for its AA features in order to draw a smooth circle, so I can't use a different drawing function. Thanks. <?php $img_2 = imagecreatetruecolor(200, 200); $red = imagecolorallocate($img_2, 255, 0, 0); imagefill($img_2, 0, 0, $red); //set circle values $xPos = 50; $yPos = 80; $diameter = 40; $img_1 = imagecreatetruecolor(($diameter + 2) * 2, ($diameter + 2) * 2); $green = imagecolorallocate($img_1, 0, 255, 0); //draw the circle imagefilledarc($img_1, $diameter+1, $diameter+1, ($diameter + 2) * 2, ($diameter + 2) * 2, 0, 360, $green, IMG_ARC_PIE); imagecopyresampled($img_2, $img_1, $xPos, $yPos, 0, 0, $diameter+2, $diameter+2, ($diameter + 2) * 2, ($diameter + 2) * 2); header("Content-type: image/png"); imagepng($img_2); imagedestroy($img_1); imagedestroy($img_2); ?>

    Read the article

  • Color difference between vista and Win7

    - by MSGrimpeur
    Have an indicator in the form of an image which is displayed in a graphics viewport. The indicator can be any colour the user selects so we created a single image with a pallette and change a specific color in the pallette to the one the user picks using the following code. /// <summary> /// Copies the image and sets transparency and fill colour of the copy. The image is intended to be a simple filled shape such as a square /// with the inside all in one colour. /// </summary> /// <remarks>Assumes the fill colour to be changed is Red, /// black is the boundary colour and off white (RGB 233,233,233) is the colour to be made transparent</remarks> /// <param name="image"></param> /// <param name="fillColour"></param> /// <returns></returns> protected Bitmap CopyWithStyle(Bitmap image, Color fillColour) { ColorPalette selectionIndicatorPalette = image.Palette; int fillColourIndex = selectionIndicatorPalette.IndexOf(Color.Red); selectionIndicatorPalette.Entries[fillColourIndex] = fillColour; image.Palette = selectionIndicatorPalette; Bitmap tempImage = image; tempImage.MakeTransparent(transparentColour); return tempImage; } To be honest I'm not sure if this is a bit cludgy and there is some smarter approach or not, so any thoughts there would help. However the main issue is that this appears to work fine on Win7 but in vista and XP the color does not change. Has any one seen this before. I've found one or two articles that suggest there are some differences in ARGB between them but nothing particularly concrete. Any help greatfully accepted.

    Read the article

  • All X elements below Y, but before another, descendent, Y

    - by JPM
    <div n="a"> . . . . . . <spec>red</spec> <spec>green</spec> . . . <div n="b"> . . . <spec>blue</spec> . . . </div> <div n="c"> <spec>yellow</spec> </div> . . . . . . . . . </div> When the current element is <div n="a">, I need an XPATH expression that returns the red and green elements, but not the blue and yellow ones, as .//spec does. When the current element is <div n="b">, the same expression needs to return the blue element; when <div n="c">, the yellow element. Something like .//spec[but no further than another div if there is one]

    Read the article

  • How do I make a shrinkable scrollbar?

    - by diadem
    What I want: <div style="overflow:scroll;width:100%;height:50%;"> &nbsp; <div style="height:500px;width:400px;border:solid 3px red;"> </div> </div> <div style="overflow:scroll;width:100%;HEIGHT:50%;"> &nbsp; <div style="height:500px;width:400px;border:solid 3px red;"> </div> </div> Notice how if I shrink the height of the window the scrollbars shrink. This is the functionality I want. The issue: I want to make something similar to the above, only with a fixed height of 100 pixels for the top div. If I do this in practice the bottom scrollbar no longer shrinks as I shrink the page - the system adds an outer scrollbar to manage both sections. I don't want this, I want to retain the behavior seen above. How do I do this?

    Read the article

  • Position a div relative to a top-level container?

    - by Seifeddine Dridi
    I'm trying to model an HTML document which only contains div elements positioned in absolute. For each div, properties left and top are precalculated wrt. the top-level div, but a problem occurs with nested divs since according to the CSS standard an element is positioned relative to its first ancestral element whose positioning is either relative or absolute. Does anyone know any workaround? EDIT: small code snippet that demonstrates the problem <html> <body style="background-color: #444444"> <div style="position: relative; background-color: white;"> <div style="position: absolute; background-color: red; width: 4cm; height: 3cm; top: 1cm">div 1 <div style="position: absolute; background-color: green; top: 4cm"> div 1.1</div> </div> </div> </body> </html> The green div is expected to be positioned right after the red div, instead there is a gap of 1cm in between.

    Read the article

  • Just a small help about switch's use

    - by Laurent Fournier
    If an answer on this already exist, my apologies i've not found on this question... is this statement correct if i want presice actions on integers from -2 to 0, and for those between 1 and 6 apply the same methods with only my integer who'll change ? Like this: public void setCaseGUI(Point pt, int i, boolean b){ plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setSelected(b); plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setIcon(null); switch(i) { case -2: plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setText("F"); plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setForeground(Color.red); break; case -1: plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setText("B"); plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setForeground(Color.red); break; case 0: plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setText(""); plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setForeground(null); break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setText(String.valueOf(i)); plateau.cellule[(int)pt.getAbs()][(int)pt.getOrd()].setForeground(null); break; default: System.out.println("Erreur de changement d'état/case !"); } } Please don't be too harsh on me i've started to learn dev only a few month ago

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >