Search Results

Search found 250905 results on 10037 pages for 'overflow'.

Page 22/10037 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • What is Causing This Memory Leak in Delphi?

    - by lkessler
    I just can't figure out this memory leak that EurekaLog is reporting for my program. I'm using Delphi 2009. Here it is: Memory Leak: Type=Data; Total size=26; Count=1; The stack is: System.pas _UStrSetLength 17477 System.pas _UStrCat 17572 Process.pas InputGedcomFile 1145 That is all there is in the stack. EurekaLog is pointing me to the location where the memory that was not released was first allocated. According to it, the line in my program is line 1145 of InputGedcomFile. That line is: CurStruct0Key := 'HEAD' + Level0Key; where CurStruct0Key and Level0Key are simply defined in the procedure as local variables that should be dynamically handled by the Delphi memory manager when entering and leaving the procedure: var CurStruct0Key, Level0Key: string; So now I look at the _UStrCat procedure in the System Unit. Line 17572 is: CALL _UStrSetLength // Set length of Dest and I go to the _UStrSetLength procedure in the System Unit, and the relevant lines are: @@isUnicode: CMP [EAX-skew].StrRec.refCnt,1 // !!! MT safety JNE @@copyString // not unique, so copy SUB EAX,rOff // Offset EAX "S" to start of memory block ADD EDX,EDX // Double length to get size JO @@overflow ADD EDX,rOff+2 // Add string rec size JO @@overflow PUSH EAX // Put S on stack MOV EAX,ESP // to pass by reference CALL _ReallocMem POP EAX ADD EAX,rOff // Readjust MOV [EBX],EAX // Store MOV [EAX-skew].StrRec.length,ESI MOV WORD PTR [EAX+ESI*2],0 // Null terminate TEST EDI,EDI // Was a temp created? JZ @@exit PUSH EDI MOV EAX,ESP CALL _LStrClr POP EDI JMP @@exit where line 17477 is the "CALL _ReallocMem" line. So then what is the memory leak? Surely a simple concatenate of a string constant to a local string variable should not be causing a memory leak. Why is EurekaLog pointing me to the ReallocMem line in a _UStrSetLength routine that is part of Delphi? This is Delphi 2009 and I am using the new unicode strings. Any help or explanation here will be much appreciated.

    Read the article

  • Help with inner content box margins/padding

    - by Wolfgang
    I am working on a layout for a new site, and I'm having some trouble achieving what I want with the CSS. First of all, I want everything to always stay within the view of the current browser window, with scroll being in my content and not the browser itself. I have an outermost DIV which acts as my "wrapper" for the site displayed centered, with a set width, and having 100% height of the bowser window. Inside of this I place a header and all of this works as intended in all interested browsers. However, once I place my actual content DIV inside this "wrapper" I am unable to define it to be the size I want. If I simply give it margins or padding to make up for the header I have absolutely positioned, the content will overflow and I can't set scroll. And if I try to set the size directly, there are no values I can put in that will work since the margins/padding will add to the size and it will now be bigger than the current browser window, and overflow. Are there any styles people can think of I can use on the wrapper/content DIV(s) to get the desired look? Here is a diagram illustrating the look I want.

    Read the article

  • Eliminate horizontal scrolling in div in favor of horizontal scrolling in browser window

    - by Casey Flynn
    I have a div, set to 800px wide, that will automatically scroll horizontally if the browser window is resized to < 800px. The behavior I would like, is to have the browser window scroll instead of the div. It would seem simple but for some reason I'm getting hung up on it. Any ideas? The page in question: http://www.caseyflynn.com/game/ The div CSS: div#main_container { border: 1px solid #FFF; width:800px; margin-left:auto; margin-right:auto; padding:0px; background-color:#FFF; overflow:hidden; } The BODY CSS: html, body { background-color:#000; border:0px; margin:0px; padding:0px; font-family : Arial, Helvetica, sans-serif; font-size : 62.5%; overflow:auto; } I'm assuming anyone looking at this will have the ability to see the HTML and the CSS. Thanks!

    Read the article

  • tinymce text area in facebox modal window not allowing me to type

    - by jeansymolanza
    i am using facebox (a jquery modal plug-in) and tinymce for my textboxes. however when i open any modal windows, i cannot type anything within the tinymce input box. any help? <script type="text/javascript" src="resources/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "simple" }); </script> <link href="resources/facebox.css" media="screen" rel="stylesheet" type="text/css"/> <script src="resources/facebox.js" type="text/javascript"></script> <script> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() }) </script> <?php echo "<div style='display: none;' id='c".$oh_id."' rel='facebox'><div style='overflow: -moz-scrollbars-vertical; overflow-y: auto; width: 100%; height: 375px;'><h2 style='color: #3399cc;'>Comments for ".$row_clientName['clientName']."</h2>"; echo '<form method="post" action="somepage"> <textarea name="content" id="content" style="width: 300px; height: 125px;"> Comments... </textarea><br /> <input type="submit" value="Update" name="submit" class="comment_button"/><p> </form></div>'; ?>

    Read the article

  • IIS: How to get the Metabase path?

    - by Ian Boyd
    i'm trying to get the list of mime types known to an IIS server (which you can see was asked and and answered by me 2 years ago). The copy-pasted answer involves: GetObject("IIS://LocalHost/MimeMap") msdn GetObject("IIS://localhost/mimemap") KB246068 GetObject("IIS://localhost/MimeMap") Scott Hanselman's Blog new DirectoryEntry("IIS://Localhost/MimeMap")) Stack Overflow new DirectoryEntry("IIS://Localhost/MimeMap")) Stack Overflow New DirectoryServices.DirectoryEntry("IIS://localhost/MimeMap") Velocity Reviews You get the idea. Everyone agrees that you use a magical path iis://localhost/mimemap. And this works great, except for the times when it doesn't. The only clue i can find as to why it fails, is from an IIS MVP, Chris Crowe's, blog: string ServerName = "LocalHost"; string MetabasePath = "IIS://" + ServerName + "/MimeMap"; // Note: This could also be something like // string MetabasePath = "IIS://" + ServerName + "/w3svc/1/root"; DirectoryEntry MimeMap = new DirectoryEntry(MetabasePath); There are two clues here: He calls iis://localhost/mimemap the Metabase Path. Which sounds to me like it is some sort of "path" to a "metabase". He says that the path to the metabase could be something else; and he gives an example of what it could be like. Right now i, and the entire planet, are hardcoding the "MetabasePath" as iis://localhost/MimeMap What should it really be? What should the code be doing to construct a valid MetabasePath? Note: i'm not getting an access denied error, the error is the same when you have an invalid MetabasePath, e.g. iis://localhost/SoTiredOfThis

    Read the article

  • Why would javascript click-areas not be working in IE8?

    - by Edward Tanguay
    I'm trying to find a bug in an old ASP.NET application which causes IE8 to not be able to click on the following "button" area in our application: <td width="150px" class="ctl00_CP1_UiCommandManager1i toolBarItem" valign="middle" onmouseout="onMouseOverCommand(this,1,'ctl00_CP1_UiCommandManager1',0,0);" onmouseover="onMouseOverCommand(this,0,'ctl00_CP1_UiCommandManager1',0,0);" onmousedown="onMouseDownCommand(this, 'ctl00_CP1_UiCommandManager1', 0, 0);" onmouseup="onMouseUpCommand(this, 'ctl00_CP1_UiCommandManager1', 0, 0);" id="ctl00_CP1_UiCommandManager1_0_0"> <span style="width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap;"> NEW </span> </td> When we switch IE8 to IE7 compatibility mode, the problem disappears, IE7 is able to click on it. Since the above HTML is generated by a third party control (Janus, http://www.janusys.com/controls), we don't have the source code. has anyone experienced any similar problems with IE8? I've determined that it actually fires the onMouseDownCommand command also the CSS of the button area is different in IE8, it doesn't have color shading that it does in IE7. I can imagine that somewhere the HTML is not valid and IE8 being stricter is not playing along, but where? any advice on how to narrow in on this bug welcome ANSWER: Turned out to be that the application was not checking the navigator.agent for "MSIE 8.0" and was thus treating IE8 has a non-Internet-Explorer browser. Thanks Lazarus for the tip, the IE8 Javascript debugger is very nice, like a Firebug for IE, will be using it more!

    Read the article

  • CSS absolute DIV causing other absolute DIV problems

    - by Tim
    Hello, I have implemented a chat script which requires an absolutely positioned DIV to be wrapped around the pages content. This is to ensure the chat windows stay at the bottom. The problem is that because of the absolute positioning of this main wrapper, all other absolutely positioned elements (eg. Jquery Auto-completes, datepicker's etc) now scroll up and down with the page. Here is an example of the HTML: <body> <div id="main_container"> <div id="content">Elements like Jquery Autocompletes, Datepickers with absolute positioned elements in here</div> </div> The DIV "main_container" style looks like this: #main_container { width:100%; background-color:#ffffff; /* DO NOT REMOVE THIS; or you'll have issue w/ the scrollbar, when the mouse pointer is on a white space */ overflow-x: hidden; overflow-y: scroll; height:100%; /* this will make sure that the height will extend at the bottom */ position:absolute; /* container div must be absolute, for our fixed bar to work */ } I hope there is a simple fix as the chat script is too good to get rid of. Thanks, Tim

    Read the article

  • Java error on bilinear interpolation of 16 bit data

    - by Jon
    I'm having an issue using bilinear interpolation for 16 bit data. I have two images, origImage and displayImage. I want to use AffineTransformOp to filter origImage through an AffineTransform into displayImage which is the size of the display area. origImage is of type BufferedImage.TYPE_USHORT_GRAY and has a raster of type sun.awt.image.ShortInterleavedRaster. Here is the code I have right now displayImage = new BufferedImage(getWidth(), getHeight(), origImage.getType()); try { op = new AffineTransformOp(atx, AffineTransformOp.TYPE_BILINEAR); op.filter(origImage, displayImage); } catch (Exception e) { e.printStackTrace(); } In order to show the error I have created 2 gradient images. One has values in the 15 bit range (max of 32767) and one in the 16 bit range (max of 65535). Below are the two images 15 bit image 16 bit image These two images were created in identical fashions and should look identical, but notice the line across the middle of the 16 bit image. At first I thought that this was an overflow problem however, it is weird that it's manifesting itself in the center of the gradient instead of at the end where the pixel values are higher. Also, if it was an overflow issue than I would suspect that the 15 bit image would have been affected as well. Any help on this would be greatly appreciated.

    Read the article

  • Google Maps: openInfoWindowTabsHtml + GDownloadUrl (Ajax call) question

    - by Spiros
    I am facing the following problem. On an Google Map I want to add info windows with tabs, where content is loaded from an external file using the GDownloadUrl method. The code works about fine, but with two problems. a) The first time I click on a marker, nothing hapens. I need to click twice to get an info box. After that it works ok. b) When I close an info box and open it again, the tabs repeat themselves. Every time I reopen the info box, those tabs get repeated. So, if using the code below and open the info box 3 times, I get 6 tabs (Info, Photos, Info, Photos, Info, Photos). Any idea of what I am doing wrong here? I have also tried this with JQuery's $.get method, but the results are exactly the same. function createREMarker(lat,long,reID) { var reMarker = new GMarker(rePoint,iconRE); GEvent.addListener(reMarker, "click", function() { GDownloadUrl('testcontent.php?reID='+reID+'&what=info', function(data) { content1 = data; }); GDownloadUrl('testcontent.php?reID='+reID+'&what=photos', function(data) { content2 = data; }); tabs.push(new GInfoWindowTab('Info', '<div id="mapOverlayContent" style="width:375px; height:220px; overflow:auto;">'+content1+'</div>')); tabs.push(new GInfoWindowTab('Photos', '<div id="mapOverlayContent" style="width:375px; height:220px; overflow:auto;">'+content2+'</div>')); reMarker.openInfoWindowTabsHtml(tabs); }); return reMarker; };

    Read the article

  • How to hide the outer scroll bar in IE?

    - by user198729
    Live demo: http://222.73.204.65:81/stumbleupon.html This works in firefox,but in IE there will be two scrollbars,making it ugly: <!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>Stumbleupon</title> </head> <style type="text/css"> div.webtoolbar { -moz-background-clip:border; -moz-background-inline-policy:continuous; -moz-background-origin:padding; background:transparent url(http://cdn.stumble-upon.com/i/toolbar/bgToolbar.gif) repeat-x scroll 0 0; border-top:1px solid #000000; height:33px; min-width:760px; overflow:hidden; position:absolute; top:0; width:100%; z-index:3; } </style> <body style="margin: 0pt; padding: 0pt; overflow: hidden; height: 100%;"> <iframe id="stumbleFrame" frameborder="0" noresize="noresize" src="http://www.livescience.com/animals/green-slug-animal-plant-100112.html" name="stumbleContent" style="position: absolute; background: transparent; width: 100%; height:100%; top: 0; padding: 32px 0; z-index: 1;"></iframe> <div class="webtoolbar">menus here</div> </body> </html>

    Read the article

  • How can I get the data from an ajax request to appear inside a div?

    - by Aaron Brokmeier
    I am unable to get the data from my ajax request to appear inside <div class="l_p_i_c_w"></div>. What am I doing wrong? I know the function inside my_file.php works, because if I refresh the page, then the data shows up where it should. jQuery: $.ajax({ type: "POST", url: "my_file.php", dataType: 'html', success: function(data){ $('div#myID div.l_p_c div.l_p_i_c_w').prepend(data); } }); HTML: <div class="l_p_w" id="myID"> <div class="l_p_c"> <div class="l_p_i_c_w"> <!-- stuff, or may be empty. This is where I want my ajax data placed. --> </div> </div> </div> CSS: .l_p_w { width:740px; min-height:250px; margin:0 auto; position:relative; margin-bottom:10px; } .l_p_c { position:absolute; bottom:10px; right:10px; width:370px; top:60px; } .l_p_i_c_w { position:absolute; left:5px; top:5px; bottom:5px; right:5px; overflow-x:hidden; overflow-y:auto; }

    Read the article

  • How close can I get C# to the performance of C++ for small intensive tasks?

    - by SLC
    I was thinking about the speed difference of C++ to C# being mostly about C# compiling to byte-code that is taken in by the JIT compiler (is that correct?) and all the checks C# does. I notice that it is possible to turn a lot of these functions off, both in the compile options, and possibly through using the unsafe keyword as unsafe code is not verifiable by the common language runtime. Therefore if you were to write a simple console application in both languages, that flipped an imaginary coin an infinite number of times and displayed the results to the screen every 10,000 or so iterations, how much speed difference would there be? I chose this because it's a very simple program. I'd like to test this but I don't know C++ or have the tools to compile it. This is my C# version though: static void Main(string[] args) { unsafe { Random rnd = new Random(); int heads = 0, tails = 0; while (true) { if (rnd.NextDouble() > 0.5) heads++; else tails++; if ((heads + tails) % 1000000 == 0) Console.WriteLine("Heads: {0} Tails: {1}", heads, tails); } } } Is the difference enough to warrant deliberately compiling sections of code "unsafe" or into DLLs that do not have some of the compile options like overflow checking enabled? Or does it go the other way, where it would be beneficial to compile sections in C++? I'm sure interop speed comes into play too then. To avoid subjectivity, I reiterate the specific parts of this question as: Does C# have a performance boost from using unsafe code? Do the compile options such as disabling overflow checking boost performance, and do they affect unsafe code? Would the program above be faster in C++ or negligably different? Is it worth compiling long intensive number-crunching tasks in a language such as C++ or using /unsafe for a bonus? Less subjectively, could I complete an intensive operation faster by doing this?

    Read the article

  • How to resize table via javascript in IE?

    - by MartyIX
    I've got this table: <table id="correctness" style="overflow: hidden;"> <tr><td style="overflow: hidden;"> <div id="correctness-message"></div> <span class="hide"> <button type="button" class="hide" onclick="new DisplayEffect('correctness').Hide(500);">Hide</button> </span> </td> </tr> </table> and a function for resizing the table: function resize(element, size) { element.style.height = size + "px";}; which is called for a certain amount of time (e.g. 1 second) with the ID of table (i.e. "correctness") in order to resize the table from zero height to its full height. This code works in Firefox and Chrome but it doesn't work in IE8. What it does is that it displays right away whole table even thought the height set in "resize" method is much lower. It seems that the cell sets the height of parent table and not the other way around. Is it possible to change the behaviour? I like changing the height of the table better because I can set visibility of the table easily. Thanks for any help!

    Read the article

  • Drag/drop problem (draggable in position:relative parent)

    - by MackDaddy
    Here's the scenario, I'm using prototype and scriptaculous, but I believe jquery would have the same issue. I have a list draggable images in a relatively positioned div. The problem is I can't drag the images out of the parent div... well... you can, they're just not visible. If you remove the position:relative on the parent div, it works just fine, I can drag items out of the div perfectly. However because of this little IE7 bug: http://snook.ca/archives/html%5Fand%5Fcss/position%5Frelative%5Foverflow%5Fie/ that position:relative is required. IS there another work around to this bug that does not require setting position? I've tried playing with z-index and everything I can think of to no avail. Here's the CSS for the box: #products{ width: 680px; height: 400px; border: 1px solid gray; /*background-color: #66FF00;*/ overflow-y: scroll; overflow-x: hidden; font-family:"Helvetica Neue","Helvetica"; font-size:12px; font-weight:bold; position: relative; } If you would like to see this bug in action, you can visit it here: http://twinmed-dev.com/template%5Fadd.php. Try searching for an item like "gloves" then adding it to the cart below. Thanks for any help.

    Read the article

  • Truncating long strings with CSS: feasible yet?

    - by Sam Stokes
    Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout? I've been truncating server-side by logical width (i.e. a blindly-guessed number of characters), but since a 'w' is wider than an 'i' this tends to be suboptimal, and also requires me to re-guess (and keep tweaking) the number of characters for every fixed width. Ideally the truncation would happen in the browser, which knows the physical width of the rendered text. I've found that IE has a text-overflow: ellipsis property that does exactly what I want, but I need this to be cross-browser. This property seems to be (somewhat?) standard but isn't supported by Firefox. I've found various workarounds based on overflow: hidden, but they either don't display an ellipsis (I want the user to know the content was truncated), or display it all the time (even if the content wasn't truncated). Does anyone have a good way of fitting dynamic text in a fixed layout, or is server-side truncation by logical width as good as I'm going to get for now?

    Read the article

  • Is it bad use "display: table;" to organise a layout into 2 columns?

    - by Colen
    Hello, I am trying to make a 2 column layout, apparently the bane of CSS. I know you shouldn't use tables for layout, but I've settled on this CSS. Note the use of display: table etc. div.container { width: 600px; height: 300px; margin: auto; display: table; table-layout: fixed; } ul { white-space: nowrap; overflow: hidden; display: table-cell; width: 40%; } div.inner { display: table-cell; width: auto; } With this layout: <div class="container"> <ul> <li>First</li> <li>Second</li> <li>Third</li> </ul> <div class="inner"> <p>Hello world</p> </div> </div> This seems to work admirably. However, I can't help wondering - am I obeying the letter of the "don't use tables" rule, but not the spirit? I think it's ok, since there's no positioning markup in the HTML code, but I'm just not sure about the "right" way to do it. I can't use css float, because I want the columns to expand and contract with the available space. Please, stack overflow, help me resolve my existential sense of dread at these pseudo-tables.

    Read the article

  • Declaration, allocation and assignment of an array of pointers to function pointers

    - by manneorama
    Hello Stack Overflow! This is my first post, so please be gentle. I've been playing around with C from time to time in the past. Now I've gotten to the point where I've started a real project (a 2D graphics engine using SDL, but that's irrelevant for the question), to be able to say that I have some real C experience. Yesterday, while working on the event system, I ran into a problem which I couldn't solve. There's this typedef, //the void parameter is really an SDL_Event*. //but that is irrelevant for this question. typedef void (*event_callback)(void); which specifies the signature of a function to be called on engine events. I want to be able to support multiple event_callbacks, so an array of these callbacks would be an idea, but do not want to limit the amount of callbacks, so I need some sort of dynamic allocation. This is where the problem arose. My first attempt went like this: //initial size of callback vector static const int initial_vecsize = 32; //our event callback vector static event_callback* vec = 0; //size static unsigned int vecsize = 0; void register_event_callback(event_callback func) { if (!vec) __engine_allocate_vec(vec); vec[vecsize++] = func; //error here! } static void __engine_allocate_vec(engine_callback* vec) { vec = (engine_callback*) malloc(sizeof(engine_callback*) * initial_vecsize); } First of all, I have omitted some error checking as well as the code that reallocates the callback vector when the number of callbacks exceed the vector size. However, when I run this code, the program crashes as described in the code. I'm guessing segmentation fault but I can't be sure since no output is given. I'm also guessing that the error comes from a somewhat flawed understanding on how to declare and allocate an array of pointers to function pointers. Please Stack Overflow, guide me.

    Read the article

  • In CSS, how to not float a 300px wide Div to the next line?

    - by Jian Lin
    Say, there is a bar that is styled at the bottom of the viewport, using position: fixed; bottom: 0; left: 0; width: 100%; height 50px; overflow: hidden and then there are 4 Divs inside it, each one floated to the left. Each Div is about 300px wide or can be more (depending on the content) Now, when the window is 1200 pixel wide, and we see all 4 Divs, but when the window is resize to be 1180 pixel wide (just 20 pixels less), then the whole 300px wide Div will disappear, because it is "floated" to the next line. So how can this be made so that, the Div will stay there and showing 280px of itself, rather than totally disappear? By the way, white-space: nowrap won't work as that probably has to do with not wrapping inline content. I was thinking of putting another Div inside this Div, having a fixed width of 1200px or 2000px, so that all Divs will float on the same level in this inner Div, and the outer Div will cut it off with the overflow: hidden. But this seems more like a hack... since the wide of all those Divs can be dynamic, and setting a fixed width of 1200px or 2000px seems like too much of a hack.

    Read the article

  • Making a table in a scrolling div resizable?

    - by Mason Jones
    I've got a table in a div, with a vertical scrollbar on the div to allow the table to be longer than the div can hold. Works fine. But I'd like to allow the user to resize the div vertically if they want to be able to view more of the table. I've been playing with the jQueryUI resizable interaction, but it doesn't seem to quite do what I want; at least, not so far. I've tried making the wrapper div resizable, but the behavior's erratic. If I have the style "height:20em; overflow:auto;" on it, then I can resize the table horizontally, but not vertically. If I remove the overflow, then the table flows outside the div of course. If I remove the height, then the table is actually resizable, but it is initially drawn at full height. Anyone know of a way to specify an initial height, but allow it to be resized larger than that? If I make the table resizable rather than the div, then I can resize the table horizontally within the div but I can't increase the height of the displayed table. Which makes sense, of course, but I thought I'd mention it. Also, is there a way to make the resize "handle" the corner between the horizontal and vertical scrollbars? Right now it's a sort of invisible handle in the bottom-right of the table. Thanks for any thoughts.

    Read the article

  • position of options in HTML select element

    - by frenchie
    I have a element that contains options. The element is 150px wide but some of the options are wider. So when rendering, the browser shows the overflow to the right. How can I make the options list overflow to the left? JSFiddle Thanks. <select id="MySelect"> <option value="60" selected="selected"></option><option value="-60">(UTC-01:00) Azores</option> <option value="-60">(UTC-01:00) Cape Verde Is.</option><option value="0">(UTC) Casablanca</option> <option value="0">(UTC) Dublin, Edinburgh, Lisbon, London</option><option value="0">(UTC) Monrovia, Reykjavik</option> <option value="60">(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option> <option value="60">(UTC+01:00) Brussels, Copenhagen, Madrid, Paris</option> <option value="60">(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option> <option value="60">(UTC+01:00) West Central Africa</option> <option value="120">(UTC+01:00) Windhoek</option> </select>?????????????????????????????????????????????? ?#MySelect{ margin-top:20px; margin-left:200px; width:150px;}

    Read the article

  • SystemStackError in Rails::ActiveSupport::Callbacks

    - by coreyward
    I'm building a Rails app that connects to Dropbox and syncs with a folder to update a personal site. I'm using Rails 3.0.3, Ruby 1.9.2, and the Dropbox gem. Right now I have a DropboxAccounts Controller, and two models: DropboxSession, which wraps calls to the gem with application-specific functionality, and DropboxAccount, which stores the session and settings in the database. After the user authorizes their account with Dropbox they're redirected back over and the DropboxAccount is saved with the authorized session. That all works just fine. My problem is that when I try to call Dropbox::API#create_folder(any path) I end up with a SystemStackError in lib/activesupport/callbacks.rb:421 which refers to the code below. If I remove the call to create the folder, it works. If I call create folder from another request, it works. I doubled the stack size to 16K to no avail. # This is called the first time a callback is called with a particular # key. It creates a new callback method for the key, calculating # which callbacks can be omitted because of per_key conditions. # def __create_keyed_callback(name, kind, object, &blk) #:nodoc: @_keyed_callbacks ||= {} @_keyed_callbacks[name] ||= begin str = send("_#{kind}_callbacks").compile(name, object) class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def #{name}() #{str} end # THIS IS LINE 421 protected :#{name} RUBY_EVAL true end end I'm not very familiar with Rails yet, and I'm not sure what the intention of the code above is or why it would cause a stack overflow. I'm not using any method_missing/ghost method magic in my code. I suspected it was something with a callback serialize :files but commenting it out did nothing. My DropboxAccount model contains only a call to belongs_to :user, and DropboxSession is just a handful of methods, none of which contain callbacks. Bypassing them and using the Dropbox::Session methods directly doesn't help. I hope someone on StackOverflow can help me with this stack overflow. ;)

    Read the article

  • How would you code an efficient Circular Buffer in Java or C#

    - by Cheeso
    I want a simple class that implements a fixed-size circular buffer. It should be efficient, easy on the eyes, generically typed. EDIT: It need not be MT-capable, for now. I can always add a lock later, it won't be high-concurrency in any case. Methods should be: .Add and I guess .List, where I retrieve all the entries. On second thought, Retrieval I think should be done via an indexer. At any moment I will want to be able to retrieve any element in the buffer by index. But keep in mind that from one moment to the next Element[n] may be different, as the Circular buffer fills up and rolls over. This isn't a stack, it's a circular buffer. Regarding "overflow": I would expect internally there would be an array holding the items, and over time the head and tail of the buffer will rotate around that fixed array. But that should be invisible from the user. There should be no externally-detectable "overflow" event or behavior. This is not a school assignment - it is most commonly going to be used for a MRU cache or a fixed-size transaction or event log.

    Read the article

  • scrollLeft works but scrollTop doesn't work

    - by Xiao Jia
    I have the following HTML with CSS .container { overflow: scroll; } etc. <body> <div class="container"> <div id="markers"></div> <img id="map" src="/img/map.jpg"/> </div> </body> map.jpg is very large and I want to scroll to a fixed position like this: $(function(){ console.log($('.container').scrollTop()); $('.container').scrollTop(1000); console.log($('.container').scrollTop()); console.log($('.container').scrollLeft()); $('.container').scrollLeft(1750); console.log($('.container').scrollLeft()); }); scrollLeft works fine but scrollTop doesn't. Below is the console output. 0 0 0 1750 I've been searching for half an hour but still don't know how to fix it... UPDATE: CSS about .container #markers and #map .container { overflow: scroll; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; } #map { width: 5000px; max-width: 5000px; height: 2907px; max-height: 2907px; cursor: crosshair; } #markers { position: relative; top: 0; left: 0; width: 0; height: 0; margin: 0; padding: 0; }

    Read the article

  • Why do I get errors when using unsigned integers in an expression with C++?

    - by neuviemeporte
    Given the following piece of (pseudo-C++) code: float x=100, a=0.1; unsigned int height = 63, width = 63; unsigned int hw=31; for (int row=0; row < height; ++row) { for (int col=0; col < width; ++col) { float foo = x + col - hw + a * (col - hw); cout << foo << " "; } cout << endl; } The values of foo are screwed up for half of the array, in places where (col - hw) is negative. I figured because col is int and comes first, that this part of the expression is converted to int and becomes negative. Unfortunately, apparently it doesn't, I get an overflow of an unsigned value and I've no idea why. How should I resolve this problem? Use casts for the whole or part of the expression? What type of casts (C-style or static_cast<...)? Is there any overhead to using casts (I need this to work fast!)? EDIT: I changed all my unsigned ints to regular ones, but I'm still wondering why I got that overflow in this situation.

    Read the article

  • Make TBODY scrollable in Webkit browsers

    - by Andrew
    I'm aware of this question, but none of the answers work in Safari, Chrome, etc. The accepted strategy (as demonstrated here) is to set the tbody height and overflow properties like so: <table> <thead> <tr><th>This is the header and doesn't scroll</th></tr> </thead> <tbody style="height:100px; overflow:auto;"> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> <tr><td>content that scrolls</td></tr> </tbody> </table> Unfortunately, this does not work in any webkit browsers. There is a bug report about it that doesn't seem to be a high priority (reported June 05). So my question is: are there alternate strategies that do actually work? I've tried the two-table approach, but it's impossible to guarantee that the header will line up with the content. Do I just have to wait for Webkit to fix it?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >