Search Results

Search found 1939 results on 78 pages for 'closing'.

Page 46/78 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Why is this if statement failing?

    - by Rawling
    I'm working on an existing class that is two steps derived from System.Windows.Forms.Combo box. The class overrides the Text property thus: public override string Text { get { return this.AccessibilityObject.Value; } set { if (base.Text != value) { base.Text = value; } } } The reason given for that "get" is this MS bug: http://support.microsoft.com/kb/814346 However, I'm more interested in the fact that the "if" doesn't work. There are times where "base.Text != value" is true and yet pressing F10 steps straight to the closing } of the "set" and the Text property is not changed. I've seen this both by just checking values in the debugger, and putting a conditional breakpoint on that only breaks when the "if" statement's predicate is true. How on earth can "if" go wrong? The class between this and ComboBox doesn't touch the Text property. The bug above shouldn't really be affecting anything - it says it's fixed in VS2005. Is the debugger showing different values than the program itself sees?

    Read the article

  • PHP regex help -- reverse search?

    - by Ian Silber
    So, I have a regex that searches for HTML tags and modifies them slightly. It's working great, but I need to do something special with the last closing HTML tag I find. Not sure of the best way to do this. I'm thinking some sort of reverse reg ex, but haven't found a way to do that. Here's my code so far: $html = "<div id="test"><p style="hello_world">This is a test.</p></div>"; $pattern = array('/<([A-Z][A-Z0-9]*)(\b[^>]*)>/i'); $replace = array('<tag>'); $html = preg_replace($pattern,$replace,$html); // Outputs: <tag><tag>This is a test</p></div> I'd like to replace the last occurance of "" with something special, say for example, "". Any ideas?

    Read the article

  • How to read from a method that returns a filehandle in perl?

    - by Ryan Thompson
    I have an object with a method that returns a filehandle, and I want to read from that handle. The following doesn't work, because the right angle bracket of the method call is interpreted as the closing angle bracket of the input reader: my $input = <$object->get_handle()>; That gets parsed as: my $input = ( < $object- > ) get_handle() >; which is obviously a syntax error. Is there any way I can perform a method call within an angle operator, or do I need to break it into two steps like this? my $handle = $object->get_handle(); my $input = <$handle>;

    Read the article

  • Ethics of assisting other programmers, where do we draw the line?

    - by Chris
    In general, not just in relation to stackoverflow, sometimes I'm asked a programming question for which the answer will probably be used for good purposes, but there is a chance that it could not be. Two recent examples which reminded me of some real world questions I've been asked are: Send email to many users, and keep a formless application from closing for a keyboard hook Though I don't believe the intent of the authors of those questions is in any way nefarious, occasionally someone does ask such a question for purposes of aiding a spamming effort, or creating a keylogger. Even though the questioner and answerers had good intent, a 3rd party could pervert those answers to create a piece of malware or a spam utility. Should we always trust the questioner to use the answer for good? Should we feel obligated to ask the purpose of a question, and how the answer will be used? And how can we prevent answers from being overheard (when asked verbally) or being referenced (when posted publicly online) and then used for unsavory purposes?

    Read the article

  • serial port close hangs in compact frame work 3.5

    - by ananda
    I have developed the application for windows mobile 5.0 and .net compact framework 2.0 sp2. This application communicates to the hardware device using serial port. This application works fine in windows mobile 5.0 based PDAs. I have handled data received event to get the data from serial port. But when I run my application on windows mobile 6.1 and .net compact framework 3.5, my application hangs on serial port close API call. There are many workarounds mentioned in the .net compact framework blog like (closing the com port on different thread, opening the port in the beginning of the application and close once application exists, polling for data instead of event handling), but nothing is working consistently.

    Read the article

  • Unit testing UDP socket handling code

    - by JustJeff
    Are there any 'good' ways to cause a thread waiting on a recvfrom() call to become unblocked and return with an error? The motivation for this is to write unit tests for a system which includes a unit that reads UDP datagrams. One of the branches handles errors on the recvfrom call itself. The code isn't required to distinguish between different types of errors, it just has to set a flag. I've thought of closing the socket from another thread, or do a shutdown on it, to cause recvfrom to return with an error, but this seems a bit heavy handed. I've seen mention elsewhere that sending an over-sized packet would do it, and so set up an experiment where a 16K buffer was sent to a recvfrom waiting for just 4K, but that didn't result in an error. The recvfrom just return 4096, to indicate it had gotten that many bytes.

    Read the article

  • vs10 intellisense for jQuery

    - by justSteve
    I'm not able to get intellisense to work with javascript/jquery code in vs10. Not even getting highlighted opening/closing bracket and parens, much less autocomplete. In VS08 we had to install a patch to get intellisense for jquery. VS10 doesn't need that patch to support -vsdoc files. There was a bug in 08's intellisense that, if any of a project's included .js files had an error, we'd lose intellisense for javascript. That was supposed to be fixed in vs10. What the current set of troubleshooting steps to enable intellisense for VS10? thx

    Read the article

  • how to load add-in ?

    - by Ashwin Upadhyay
    I have one silly qus. i created one shared add-in in c#.net. This add-in is working fine. now i want this add-in is load again n again when any office application is opened. For e.g. when i open any MS word document then add-in is load for that and if after that i opened another MS word document without closing previously opened document then add-in is again load for newly opend MS word document. But when i opened MS word at first time the add-in is load and if i opened MS word again but add-in is already loaded.

    Read the article

  • Plugin architecture in .net: unloading

    - by henchman
    Hello everybody, I need to implement a plugin architecture within c#/.net in order to load custom user defined actions data type handling code for a custom data grid / conversion / ... from non-static linked assembly files. Because the application has to handle many custom user defined actions, Iam in need for unloading them once executed in order to reduce memory usage. I found several good articles about plugin architectures, eg: ExtensionManager PluginArchitecture ... but none of them gave me enough sausage for properly unloading an assembly. As the program is to be distributed and the user defined actions are (as the name states) user defined: how to i prevent the assembly from executing malicious code (eg. closing my progra, deleting files)? Are there any other pitfalls one of you has encountered?

    Read the article

  • Can't type after "ruby script/server" in InstantRails

    - by mathee
    I'm a newb to RoR. I'm using the book "Agile Web Development with Rails" to get started on Windows 7. In the command window, I run the following. >rails demo >cd demo >ruby script/server At this point, it boots the Mongrel server: => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server The book goes on to tell me to run ruby script/generate controller Say but, I cannot Ctrl-C -- or type anything for that matter -- after booting the Mongrel server. Am I supposed to create the new controller in another instance of the InstantRails command window? Right now, the only way I can stop the server is closing the window in which I started the server! Please let me know if you need any other details. tia.

    Read the article

  • declaring constraint to consider prog logic

    - by shantanuo
    I can open a trip only once but can close it multiple times. I can not declare the Trip_no + status as primary key since there can be multiple entries while closing the trip. Is there any way that will assure me that a trip number is opened only once? For e.g. there should not be the second row with "Open" status for trip No. 3 since it is already there in the following table. Trip No | Status 1 Open 1 Close 1 Close 2 Open 2 Close 3 Open 3 Close 3 Close 3 Close 3 Close

    Read the article

  • Sending SMTP e-mail at a high rate in .NET

    - by Martin Liversage
    I have a .NET service that processes a queue on a background thread and from the items in the queue sends out a large number of small e-mail messages at a very high rate (say 100 messages per second if that is even possible). Currently, I use SmtpClient.Send() but I'm afraid that it may hamper performance. Each call to Send() goes through a full cycle of opening the socket, performing the SMTP conversation (HELO, MAIL FROM, RCPT TO, DATA) and closing the socket. In pseudo code: for each message { open socket send HELO send MAIL FROM send RCPT TO send DATA close socket } I would think that the following pseudo code would be more optimal: open socket send HELO for each message { send MAIL FROM send RCPT TO send DATA } send QUIT close socket Should I be concerned about the performance of SmtpClient.Send() when sending e-mail at a high rate? What are my options for optimizing the performance?

    Read the article

  • using ruby test and selenium grid how can I keep the same browser window for multiple tests?

    - by George Horlacher
    Each of my tests start a new selenium client browser and tear it down so they can run stand alone with this code: def setup if $selenium @selenium = $selenium else @selenium = Selenium::SeleniumDriver.new("#$sell_server", 4444, "#$browser", "http://#$network.#$host:2086", 10000); @selenium.start end @selenium.set_context("test_login") end def teardown @selenium.stop unless $selenium assert_equal [], @verification_errors end What I'd like is to run a suite of tests that all use the same browser and don't keep opening and closing new browsers for every test. I've tried using $selenium as a global object / browser but each test still opens up a new browser and closes it. How should this be done?

    Read the article

  • Getting Bad file descriptor when running Tornado AsyncHTTPTestCase

    - by Will
    When running a test using the Tornado AsyncHTTPTestCase I'm getting a stack trace that isn't related to the test. The test is passing so this is probably happening on the test clean up? I'm using Python 2.7.2, Tornado 2.2. The test code is: class AllServersHandlerTest(AsyncHTTPTestCase): endpoint = AllServersHandler.endpoint # '/rest/test/' def test_server_status_with_advertiser(self): on_new_host(None, '127.0.0.1') response = self.fetch(self.endpoint, method='GET') result = json.loads(response.body, 'utf8').get('data') self.assertEquals(['127.0.0.1'], result) The test passes ok, but I get the following stack trace from the Tornado server. OSError: [Errno 9] Bad file descriptor INFO:root:200 POST /rest/serverStatuses (127.0.0.1) 0.00ms DEBUG:root:error closing fd 688 Traceback (most recent call last): File "C:\Python27\Lib\site-packages\tornado-2.2-py2.7.egg\tornado\ioloop.py", line 173, in close os.close(fd) OSError: [Errno 9] Bad file descriptor Any ideas how to cleanly shutdown the test case?

    Read the article

  • How to prevent modal view controllers flashing when changing

    - by KP Overflow
    I have three view controllers, let's call them A, B and C. When a button is pressed on view A, view B is shown using presentModalViewController:animated: When the finish button is pressed on screen B, it dismisses itself. View A is notified whereupon it immediately shows view C, again using presentModalViewController:animated: The problem is that view A's content is momentarily flashed on the screen between view B closing and view C opening. I can get around this by making view A blank and moving it's current content to a new view, D. (For various reasons, I don't want view B to own view C, that's why it's not opening it) Am I over-complicating this? I'm sure there is a smarter way to go? ThanksT

    Read the article

  • How can one put together multiple arrays into one string?

    - by Noor
    I'm having a hard time describing what I'm looking for. If we pretend that we're pulling an array (I've used the .split to get user input data) where each line represents a link. How can I then add an anchor tagg to that link that I'm pulling? I need to be able to put < a href=" + thearray + "anything< /a. The reason for this is that I'm dynamically creating a list. I think that if I create two variables, one with this part < a href=" one with the closing and then call some sort of function that puts those two and the pulled array in between them until the list is complete. Does this make any sense?

    Read the article

  • C#, WinForms: What would prevent KeyDown events from chaining up from focused control up to main For

    - by blak3r
    As i understand it, when a keyboard button is pressed it should invoke the KeyDown event for the control which has focus. Then, the KeyDown for the parent control, so on and so forth until it reaches main form. UNLESS - along the chain one of the EventHandlers did: e.SuppressKeyPress = true; e.Handled = true; In my case, KeyDown events never get to the main form. I have Form - Panel - button for example. Panel doesn't offer a KeyDown Event, but it shouldn't stop it from reaching the main form right? Right now as a work around I set every single control to call an event handler I wrote. I'm basically trying to prevent Alt-F4 from closing the application and instead minimize it.

    Read the article

  • C++ iostream not setting eof bit even if gcount returns 0

    - by raph.amiard
    Hi I'm developping an application under windows, and i'm using fstreams to read and write to the file. I'm writing with fstream opened like this : fs.open(this->filename.c_str(), std::ios::in|std::ios::out|std::ios::binary); and writing with this command fs.write(reinterpret_cast<char*>(&e.element), sizeof(T)); closing the file after each write with fs.close() Reading with ifstream opened like this : is.open(filename, std::ios::in); and reading with this command : is.read(reinterpret_cast<char*>(&e.element), sizeof(T)); The write is going fine. However, i read in a loop this way : while(!is.eof()) { is.read(reinterpret_cast<char*>(&e.element), sizeof(T)); } and the program keeps reading, even though the end of file should be reached. istellg pos is 0, and gcount is equal to 0 too, but the fail bit and eof bit are both ok. I'm running crazy over this, need some help ...

    Read the article

  • Any difference between lazy loading Javascript files vs. placing just before </body>

    - by mhr
    Looked around, couldn't find this specific question discussed. Pretty sure the difference is negligible, just curious as to your thoughts. Scenario: All Javascript that doesn't need to be loaded before page render has been placed just before the closing </body> tag. Are there any benefits or detriments to lazy loading these instead through some Javascript code in the head that executes when the DOM load/ready event is fired? Let's say that this only concerns downloading one entire .js file full of functions and not lazy loading several individual files as needed upon usage. Hope that's clear, thanks.

    Read the article

  • How to maintain unique login in windows form application?

    - by Vivek
    Hello All, I am developing a winform application in which user's login is validated through ms sql server 2000 database.When user entry its user name and password, application checks its exists in user table or not. Now my requirement is if a user already login through one system it should not log in through another system. if solution like make entry in database about status of user like on successful log in mark user status is true and on closing application mark false , then in the case of network or hardware failure or system exception. so, please suggest me a optimal solution .

    Read the article

  • Can't send key to window with SendMessage

    - by user297313
    I'm writing a C program under Windows that should send an ENTER key to a dialog box to close it automatically. I retrieve the handle to the top level window I'm interested in (by means of EnumDesktopWindows()) and then try to send an ENTER key using SendMessage (note also that closing the window by sending WM_CLOSE works fine). None of the following works: SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 0 ); SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYDOWN, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYUP, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYDOWN, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYUP, VK_RETURN, 1 ); and so on... As a possibly simpler scenario, I also tried to send an ascii key to, say, notepad. How is this supposed to work? Thanks in advance

    Read the article

  • How can one close html tags in vim quickly

    - by wds
    It's been a while since I've had to do any html-like code in vim, but recently I came across this again. Say I'm doing a simple bit of a html page: <html><head><title>This is a title</title></head></html> How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that does not involve me going through writing them all down one by one. Of course I can use ^P to autocomplete the individual tag names but what gets me on my laptop keyboard is actually getting the brackets and slash right.

    Read the article

  • Are Java GUIs always slow to update or is it just me?

    - by ChrisD
    I've just started making my first GUI application in Java and I decided to use the NetBeans IDE to do it. I think its working fine so far, except for one problem; it seems to be slow updating the content of a window. Even in very simple windows with few controls I find that when - for example - closing or resizing a window, I get the normal window border working properly but the inside is completely see through for a second. It's not the biggest deal in the world, I just find it mildly annoying.

    Read the article

  • Partial Upload With storbinary in python

    - by brian
    I've written some python code to download an image using urllib.urlopen().read() and then upload it to an FTP site using ftplib.FTP().storbinary() but I'm having a problem. Sometimes the image file is only partially uploaded, so I get images with the bottom 20% or so cut off. I've checked the locally downloaded version and I have successfully downloaded the entire image, which leads me to believe that it is a problem with storbinary. I believe I am opening and closing all of the files correctly. Does anyone have any clues as to why I'm getting a partial upload with storbinary? Update: When I run through the commands in the Python shell, the upload completes successfully, I don't know why it would be different from when run as a script...

    Read the article

  • How to remove duplicate line in a file

    - by Abs
    Hi I'm using the below method to write to a file from the Jtextarea and I call this method every 30 second within a Timer but instead to add only new line in file it rewrite the entire lines contained in Jtextarea so then I have duplicate lines. I want to avoid this and update the file just with new lines. Could you help me please. public void loger() { FileWriter writer = null; try { writer = new FileWriter("MBM_Log_"+date()+".txt" , true); textArea.write(writer); } catch (IOException exception) { System.err.println("log error"); exception.printStackTrace(); } finally { if (writer != null) { try { writer.close(); } catch (IOException exception) { System.err.println("Error closing writer"); exception.printStackTrace(); } } } }

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >