Search Results

Search found 5180 results on 208 pages for 'outside'.

Page 130/208 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • Best practice for creating objects used in for/foreach loops

    - by StupidDeveloper
    Hi! What's the best practice for dealing with objects in for or foreach loops? Should we create one object outside the loops and recreate it all over again (using new... ) or create new one for every loop iteration? Example: foreach(var a in collection) { SomeClass sc = new SomeClass(); sc.id = a; sc.Insert(); } or SomeClass sc = null; foreach(var a in collection) { sc = new SomeClass(); sc.id = a; sc.Insert(); } Which is better?

    Read the article

  • html file upload as part of another form

    - by samsina
    Idealy I would like to have the following: <form1 ...> ... <form2 ...> //This form uploads a file using AJAX and writes the content into a text field below. </form2> <input type="text"/> </form1> Firefox handles this but IE likes to follow the rules of W3C this time and it doesn't really work. So now I have to handle form2 outside of form1 through javascript. Can you provide some help about how to go about this? Thanks in advance.

    Read the article

  • Interesting XSL Dilemma

    - by bobber205
    I've got this issue. A template called "checkbox" that's called from while inside a table HTML element and also outside of it. To solve an issue, I've added tags to "checkbox" input control. Here's what I'd like to do to but I'm not sure if it's possible or not. When I hit my "row" (part of the custom table markup) template, I would set some variable or pass some parameter, that for each template applied afterwards, would know it was in a "row" and do something special based on this information. I know I can't add parameters to apply-templates. I may be able to add a row "mode" but I can't make changes to each template and have one copy with the mod parameter and one without. Thanks for any suggestions. I know the ideal solution would to be to make changes to the XML but I'm not sure if I can do that as this point. That's a "content" issue. :P Thanks!

    Read the article

  • Ruby (with Rails) convert a string of time into seconds?

    - by Ryan
    So, I've got a string of time... something along the lines of '4 hours' '48 hours' '3 days' '15 minutes' I would like to convert those all into seconds. For '4 hours', this works fine Time.parse('4 hours').to_i - Time.prase('0 hours').to_i => 14400 # 4 hours in seconds, yay However, this doesn't work for 48 hours (outside of range error). It also does not work for 3 days (no information error), etc. Is there a simple way to convert these strings into seconds?

    Read the article

  • Accessing Java Connector Architecture (JCA) from a Non-Managed environment

    - by Paul Kuykendall
    Hi, We have been using a JCA to interface with a low-level network resource from within WebSphere, however we have a requirement to be able to access the same network resource externally from Tomcat (i.e. not in a managed environment). The network communication and protocol layouts is very verbose, so we would rather not copy/paste several thousand lines of code (and then have to maintain them separately). From reading the JCA spec, there is supposedly some support to execute the code in a non-managed environment (such as Tomcat). Unfortunately, I have no idea what the interfaces are supposed to do, or how to call them from outside a managed environment (the spec is pretty vague). Are there any implementation examples out there that show how to modify a JCA to be usable in a non-managed environment? Thanks!

    Read the article

  • Python: How to use code.InteractiveConsole?

    - by Rosarch
    I'm trying to use InteractiveConsole to create a new front-end for a Python interpreter. These code fragments are from me playing around with InteractiveConsole in IDLE: >>> ses = code.InteractiveConsole() >>> ses.runsource("def foo():") True >>> ses.runsource(" return 2") File "<input>", line 1 SyntaxError: 'return' outside function (<input>, line 1) False Why does it raise a syntax error? How else can I finish writing the function? Also, for something like this: >>> ses.runsource("x = 1") False >>> ses.runsource("x") 1 False How can I capture the 1 value from above? False is the return value, but 1 is written to some stream.

    Read the article

  • Want to 'sandbox' user form submitted HTML

    - by pmmenneg
    Hi all. I have a user form with a textarea that allows users to submit html formatted data. The html itself is limited by PHP strip_tags, but of course that does no completion checking etc. My basic problem is that should a user leave a tag unclosed, such as the tag, then all the content following that, including page content that follows that is 'outside' the user content display area, could now be malformed. Checking for proper tag completion is one solution I will look at, but ideally I'd like to firewall the user htmlified content away from the rest of the site somehow. Any suggestions on the best approach? Thanks!

    Read the article

  • Javascript if/else statement in iframe

    - by gr33nh4t
    So I'm trying to use javascript to pop up a video, and need to know when I'm in an iframe so I can resize the video accordingly. When outside the iframe, I see three alerts ('this is seen by both', 'not in iframe', and 'this is after the fact') When in the iframe, I just see the first alert ('this is seen by both'). var handleViewVideoClick = function (dataAction, eventType, targetElement, dataActionElement) { alert('this is seen by both'); if ($('iframe', window.parent.document).length == 0) { alert('not in iframe'); } else { alert('in iframe'); } alert('this is after the fact...'); }; What's going on here?

    Read the article

  • checking the return code using python (MAC)

    - by cyberbemon
    I have written a script that checks if an SVN Repo is up and running, the result is based on the return value. import subprocess url = " validurl" def check_svn_status(): subprocess.call(['svn info'+url],shell=True) def get_status(): subprocess.call('echo $?',shell=True) def main(): check_svn_status() get_status() if __name__ == '__main__': main() The problem I'm facing is that if I change the url to something that does't exist I still get the return value as 0, but if I were to run this outside the script, i.e go to the terminal type svn info wrong url and then do a echo $? I get a return value of 1. But I can't re-create this in the python. Any guidelines ?

    Read the article

  • Button border radius and cursor

    - by noober
    CSS border radius does affect button rendering (I see it's round form), but does not affect how it interacts with the user (I still can click button outside its border). How should I fix it? I see the behavior in Chrome. button { cursor: pointer; outline: none; background-size: 100% 100%; background-color: red; /*transparent;*/ /* It's actually red and ROUND. */ background-position: center center; background-repeat: no-repeat; border: 0px; -webkit-border-top-left-radius: 73px; -webkit-border-top-right-radius: 73px; -webkit-border-bottom-left-radius: 73px; -webkit-border-bottom-right-radius: 73px; width: 146px; height: 146px; background-image: url('leftarrow.png'); } Regards,

    Read the article

  • Can a thread call wait() on two locks at once in Java (6)

    - by Dr. Monkey
    I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinking of: synchronized(token1) { synchronized(token2) { token1.wait(); token2.wait(); //won't run until token1 is returned System.out.println("I got both tokens back"); } } In this (very contrived) case token2 will be held until token1 is returned, then token1 will be held until token2 is returned. The goal is to release both token1 and token2, then resume when both are available (note that moving the token1.wait() outside the inner synchronized loop is not what I'm getting at). A loop checking whether both are available might be more appropriate to achieve this behaviour (would this be getting near the idea of double-check locking?), but would use up extra resources - I'm not after a definitive solution since this is just to satisfy my curiosity.

    Read the article

  • Dynamically create Javascript object and give class

    - by George
    I'm dynamically creating option elements for a drop down menu using Javascript and would like to know how to add a class to them so that I can style them with CSS. I have the following code: for (var i=0;i<portfolio.length-1;i++) { portfolioSelect.options[portfolioSelect.options.length] = new Option(portfolio[i]); } where portfolio is an array populated by an outside source. HTML where options inserted: <select id="portfolio" name="portfolio"> <option selected="selected" value="Select One">Select One</option> </select>

    Read the article

  • divs with z-index & position class

    - by Sotos
    hello, i need your help with div positioning into a page. i have the below divs: - the header with z-index 10, position absolute, top 0, height 250px, width 100% - wrapper with margin 0 auto, width 990 and inside - the menu with z-index 8 - content to the right of the menu with z-index 9 so that i could scroll it below the header. the problem is that i want the menu to have fixed position and this is not possible cause it is not working for the x-axis as it gets outside wrapper. Any ideas? thanks Sot

    Read the article

  • MessageBox not shown when opened processing WM_CLOSE from taskbar thumbnail close button

    - by Katana
    Trying to put up a "Do you want to save"-dialog when trying to close window with close-button in taskbar thumbnail in windows 7(with aero peek active). Using MessageBox() when processing WM_CLOSE does not work. MessageBox won't show until you move mouse cursor outside thumbnail so aero peek is disabled. Lots of applications have this buggy behaviour so it's probably a design flaw in Windows 7, but for some programs it works (Word, Notepad, Visual Studio, ...), so I'm wondering what trick they are using(or what it takes to "exit" aero peek-mode programmatically). The small "Sound Recorder" application that comes with Windows 7 has the same problem (if you have recorded something without saving and try to close it using thumbnail close-button)...

    Read the article

  • Looking for a Toolbox (Crop/Position/Rotate) for a Website

    - by VIRTUALWEB
    I'm looking for a Toolbox for a Website that can do the following things: Write Text in a Text Editor (change its color/font size/font) and display it over an product image (plus drag&drop, do rotation). As Texteditor i could use TinyMCE but how to rotate/drag&drop? the same with images (upload a logo, display it over an existing product image) where the user could drag&drop it around or rotate it left/right in 90 degrees, and change its size. are there any tools outside that can handle that requirements? They could be AJAX, Flash, jQuery, JavaScript, ... tia

    Read the article

  • Preventing the "[YourProgramName] has stopped working" dialog on unhandled exceptions.

    - by Serapth
    I have a WinForm application, with some dependencies on an external library that can on occasion cause an exception outside of the running threads context. As it stands now, this is completely OK behavior ( well, except of course the exception ) and we wired up AppDomain.CurrentDomain.UnhandledException to simply restart the program. The only problem is, the [Your Program] has stopped working like the one below, appears: Is there a way to prevent this dialog from appearing at all, be it in the AppDomain unhandled exception handler or in a config setting, as no end users are going to be reading it and it just holds up resources until it is clicked.

    Read the article

  • MySQL is there a Single Select to Query Various Unrelated Values from a database?

    - by zzapper
    I saw somewhere what seemed to be nested selects, one "master" select on the "outside" and a series of selects inside- is this possible? I'm not talking about joins as there is particular relation between the selects. I seem not to be explaining myself very well. I want to do a single query which will pull out a series of stats from various tables latest order, latest customer, largest order. Obviously I can do that with a series of selects. The example I saw was something like select ( select ... from tbl_1 where .., select ... from tbl_2 where .., select ... from tbl_3 where .., ... )

    Read the article

  • One database or many?

    - by dsims
    I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single "dashboard". So should I have one database for everything, or keep the data seperated into individual databases? Is there a best-practice? What are the positives/negatives for having a: database for the entire site (entity has a "customerID", data has "entityID") database for each customer (data has "entityID") database for each entity (relation of database to customer is outside of database) Multiple databases seems like it would have better performance (fewer rows and joins) but may eventually become a maintenance nightmare.

    Read the article

  • Help with implementing a function to change size of dynamic array

    - by iRobot
    I'm trying to write a function that will change the size of a dynamic array to a new size. In my header file, I have: Image **images; //pointer to a dynamic array of image pointers int maximum; //size I want to do this by allocating a new array and copying the values over without changing their indices. If there are non-null pointers outside the range newmax, then we cant do this. So heres what I have: There are no compilation or runtime errors. However, I find that the new array isnt getting sized right. When I run the following test case: I should get an index out of bounds error, but instead the system lets it slide. Can anyone see the mistake? I've looked for hours but cant find anything.

    Read the article

  • Firefox 17.0.1 ignoring font-weight

    - by jphogan
    http://iamsinc.com/blog/new-producer-bonus/ For some reason Firefox 17.0.1 on my Windows 7 machine is ignoring the font-weight of the td elements. It should be normal. This works fine in Chrome, IE 7 8, & 9, but not in FF. I have also tested it on an XP machine running 17.0.1 and it works fine. The font-weight should be normal, not bold. In the second box down ($300k level), the font-weight is showing up as bold on Win 7 FF 17.0.1 which pushes the pictures outside of the box. I have even tried reducing the font-weight waaay down and it has not effect on the problematic FF browser Does anybody have a solution or even a work-around? I hate to make the pictures all smaller just to work around this. Thanks!

    Read the article

  • Difference between :: and -> in PHP

    - by vrode
    I always see people in serious projects use :: everywhere, and - only occasionally in local environment. I only use - myself and never end up in situations when I need a static value outside of a class. Am I a bad person? As I understand, the only situation when -> won't work is when I try following: class StaticDemo { private static $static } $staticDemo = new StaticDemo( ); $staticDemo->static; // wrong $staticDemo::static; // right But am I missing out on some programming correctness when I don't call simple public methods by :: ? Or is it just so that I can call a method without creating an instance?

    Read the article

  • Find Field In Access Table

    - by user3535895
    I need to connect to a local table in Access and find a an entry in the name field then find the id of that name. I know how to connect to access and create the connection there, but actually manipulating the table I am lost. I can use this to connect to access, but how would I access the table and find the field I am looking for? The data structure of the table I want to connect to is: name text, address text, id autonumber. System.Collections.ArrayList outside = new System.Collections.ArrayList(); System.Data.OleDb.OleDbConnection olecon = new System.Data.OleDb.OleDbConnection"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path); olecon.Open();

    Read the article

  • How to specify 2 different positions for Colorbox or Fancybox on the same page?

    - by Eric
    I know this question has been asked before, but I'm having difficulty implementing it. I'm looking for a more specific answer. Here is my html code: <head> <meta charset=utf-8 /> <title>ColorBox Examples</title> <style type="text/css"> body{font:12px/1.2 Verdana, Arial, san-serrif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link media="screen" rel="stylesheet" href="colorbox.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="../colorbox/jquery.colorbox.js"></script> <script> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $(".example7").colorbox({width:"80%", height:"80%", iframe:true}); $(".example7").colorbox({width:"80%", height:"80%", iframe:true}); }); </script> </head> <body> <p><a class='example7' href="http://google.com">Outside Webpage 1 (Iframe)</a></p> <p><a class='example7' href="http://google.com">Outside Webpage 2 (Iframe)</a></p> (Excuse the wrong indentation - I had to mess with the formatting to get the body content to show up.) Here is my CSS code(default colorbox code): #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative; overflow:visible;} #cboxLoadedContent{overflow:auto;} #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} #cboxTitle{margin:0;} #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} #cboxOverlay{background:#fff;} #colorbox{} #cboxContent{margin-top:32px;} #cboxLoadedContent{background:#000; padding:1px;} #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} #cboxLoadingOverlay{background:#000;} #cboxTitle{position:absolute; top:-22px; left:0; color:#000;} #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;} #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;} #cboxPrevious{background-position:0px 0px; right:44px;} #cboxPrevious.hover{background-position:0px -25px;} #cboxNext{background-position:-25px 0px; right:22px;} #cboxNext.hover{background-position:-25px -25px;} #cboxClose{background-position:-50px 0px; right:0;} #cboxClose.hover{background-position:-50px -25px;} .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;} .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;} .cboxSlideshow_on #cboxSlideshow.hover{background-position:-100px -25px;} .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;} .cboxSlideshow_off #cboxSlideshow.hover{background-position:-75px -25px;} Can someone please tell me how this can be achieved? Forgive my lack of css knowledge :) Any help would be greatly appreciated. Thanks a ton.

    Read the article

  • Call inner function of jQuery-Plugin-function?

    - by faileN
    Hello Everyone, I've written an jQuery-Plugin, which I want to use as Object. So I declared some functions within the plugin, which I want to call from any other location, just like an object with methods. Is that even possible? To keep it simple: (function( $ ){ $.fn.myPlugin = function(){ // Here I want methods... function foo() { // do something... } } })(jQuery); Then I want to call the inner function from outside the plugin like: $.myPlugin.foo(); But that doesn't seem to work. So is it even possible? Or are there any other solutions? I don't want to use an normal unrelated jQuery-Class for this purpose. Because this plugin should work together with some other jQuery-Plugins. Thank you

    Read the article

  • it's not possible to loop .click function (To create multipple buttons)

    - by user1542680
    Im Trying to create multiple buttons that each one of them doing something else. It working great outside of the "each" loop, But in the moment I'm inserting the .click function in the .each function it doesn't work... Here is the Code: $.each(data.arr, function(i, s){ html += '<div id="mybtn'+s.id+'"><button class="first">Btn1</button><button class="second">Btn2</button></div>'; var btnclass="#mybtn"+s.id+" .first"; $(btnclass).click(function(){ //do something }); }); Please Let me know what is wrong... Thank you very much!!! Eran.

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >