Search Results

Search found 19541 results on 782 pages for 'event handling'.

Page 66/782 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • How Do I Handle errors in Windows Applications

    - by yytg
    I did a program and in some point - when the program needs to exit he throw an exception here is the code try { Application.Run(new Form1()); } catch (ExitException) { } In the VS it's working fine (VS 2008 - C#) But when I run it separately from the VS - the program say so the error is not handled I know so I can do like this Application.ExitThread() - But... I need to handle the exit of the program. Why In VS its work fine and outside its create errors? And how to solve it without using the global error handling? Thanks in advance

    Read the article

  • Should class IOException in Java have been an unchecked RuntimeException?

    - by Derek Mahar
    Do you agree that the designers of Java class java.io.IOException should have made it an unchecked run-time exception derived from java.lang.RuntimeException instead of a checked exception derived only from java.lang.Exception? I think that class IOException should have been an unchecked exception because there is little that an application can do to resolve problems like file system errors. However, in When You Can't Throw An Exception, Elliotte Rusty Harold claims that most I/O errors are transient and so you can retry an I/O operation several times before giving up: For instance, an IOComparator might not take an I/O error lying down, but — because many I/O problems are transient — you can retry a few times, as shown in Listing 7: Is this generally the case? Can a Java application correct I/O errors or wait for the system to recover? If so, then it is reasonable for IOException to be checked, but if it is not the case, then IOException should be unchecked so that business logic can delegate handling of this exception to a separate system error handler.

    Read the article

  • Handling Exceptions that happen in a asp.net MVC Controller Constructor

    - by Jason
    What's the best way to handle exceptions that happen from within a controller's constructor? All I can think of to do is use Application_OnError() or put a try/catch in my ControllerFactory. Neither of these solutions seem ideal. Application_OnError is to broad - I have some non-mvc content in the site that has its own error handling. Using a try/catch block seems kinda hacky. If I'm serving different content type -html/text/json/rss.... I would like to be able to handle the exception from within the action method instead of having to write all kinds of conditions to determine what kind of error message to serve. Am I missing something here, or has anyone else dealt with this?

    Read the article

  • php: simplexml exception retry

    - by exceptionhandlingnoob
    I am querying an API using SimpleXML which will occasionally fail for reasons unknown. I would like to have the script retry up to 5 times. How can I do this? I assume it has something to do with wrapping the object in a try/catch, but I'm not very experienced with this -- have tried to read the manual on exception handling but am still at a loss. Thanks for any help :) // set up xml handler $xmlstr = file_get_contents($request); $xml = new SimpleXMLElement($xmlstr); Here is the error message I am receiving: [function.file-get-contents]: failed to open stream: HTTP request failed!

    Read the article

  • Will SerialPort DataRecieved Event Trigger Repeatedly..

    - by Gunner
    Suppose I read data from SerialPort whenever there is 100 or bytes available or else nothing is done. That means, the remaining data will still be available in the SerialPort Buffer. This reading is done inside the event handler of DataReceived. Now If a situation arises, when there there is, say 50 bytes in the SerilaPort Buffer and no more data comes. From what I understand, the DataReceived Event will be triggered when ever there is certain amount of bytes available for reading from the Buffer. Now, in the given scenario, If i never read those 50 bytes, will the Event get activated continuously due to the presence of these unread bytes?

    Read the article

  • Detecting DOM event support in Firefox

    - by Andy E
    What's the best way to detect event support in Firefox. Opera, Internet Explorer and Safari/Chrome all support eventName in object, but Firefox doesn't. My test case is this: javascript:alert("onclick" in document.createElement("a")) Which alerts true when entered into the address bar on the aforementioned browsers, and alerts false for Firefox. I figured out a solution using typeof on an event like so: var a = document.createElement("a"); a.setAttribute("onclick", ""); alert(typeof(a.onclick) == "function"); Is there a better method of detecting event support in Firefox?

    Read the article

  • Find the right parameters for an event without using Design Mode in Visual Studio 2010

    - by Jason
    Is there a way to know what parameters are needed by an event in Visual Studio 2010? Let's say I have a DropDownList control and I want to bind a method to the "OnSelectedIndexChanged", I would do something like this In the ASPX File: <asp:DropDownList ID="lstMyList" runat="server" OnSelectedIndexChanged="lstMyList_SelectedIndexChanged"></asp:DropDownList> In the codebehind: protected void lstMyList_SelectedIndexChanged(object sender, EventArgs e) { ... } Is there a way to know what parameters the method needs? (In this case, an object for the sender and an EventArgs parameter for the event.) I know you can easily create the method by double-clicking the right event in Design Mode, but it does a mess with your code so I prefer not to use it. Thanks!

    Read the article

  • Guaranteeing the onmouseout event to fire

    - by n3rd
    Hello everybody, I'm currently developing a web application and have run into a little problem. I'm using ExtJS, but I believe this to be a general JS question. When the cursor enters an HTML element, the onmouseover event is fired, when the cursor leaves that element, onmouseout is triggered. So far, so good. Unfortunately, it seems one can't fully rely on this behaviour. Very quick mouse movements can cause the event not to fire (as does repositioning the cursor with a pen tablet, for example). What are the best practices to handle these issues? Do I need to monitor all onmousemove events and manually keep track of where the cursor was last and fire the appropriate onmouseout event myself?

    Read the article

  • JSTree select_node event and checkbox

    - by Ted Mosbey
    Hi there! I have a jstree in which I used the select_node event to toggle nodes(expand), and have therefore removed the toggle arrows in the tree since they look ugly and I've no need for them. Now I've added the checkbox plugin to use within the tree, but have found the select_node event is disabled when the plugin is active. How would I toggle my nodes with the checkbox plugin active, without re-adding the ugly toggle arrows? I could do it in the check/uncheck event, but I don't want to check/uncheck everytime I expand a node.

    Read the article

  • How can I tell Visual Studio to not catch a particular exception?

    - by Noel Kennedy
    I have a particular type of exception that I would like Visual Studio to not catch with the Exception Assistant. Essentially I would like it just to let my normal exception handling infrastructure deal with it. The exception is an inheritor of System.Exception which I wrote and have the source code for. Any where this is thrown I want VS to not catch it, ie it is not useful to just supress a single throw new BlahException(); in code. This is because the exception is thrown a lot, and I don't want to have to supress every single instance individually. In case it makes a difference I am on Visual Studio 2010 Ultimate, Framework 3.5 SP1.

    Read the article

  • Handling Incoming Data from Multiple Sockets in Python

    - by user859434
    Background: I have a current implementation that receives data from about 120 different socket connections in python. In my current implementation, I handle each of these separate socket connections with a dedicated thread for each. Each of these threads parse the data and eventually store it within a shared locked dictionary. These sockets DO NOT have uniform data rates, some sockets get more data than others. Question: Is this the best way to handle incoming data in python, or does python have a better way on handling multiple sockets per thread?

    Read the article

  • Removing DOM event handlers in long-running browser session

    - by Chris Beck
    I have a browser interface with a ul#contacts list on the left and div#contact property panel (email, phone) on the right. Click a contact in the list and my app makes an XHR request to get the contact property HTML fragment and update div#contact.innerHTML. Each contact fragment has an "Edit Contact" link. With JS, I progressively upgrade that link with an event listener that performs an XHR request to replace the static property panel with an in-place edit form. This can happen many times during a single browser session. How should I clean up my "Edit Contact" event listener? Do I need to remove it manually before the form overwrites the property panel? Or is the event listener cleaned up automatically when the contents of div#contact (and the node that I'm listening on) is overwritten? FWIW, I still consider IE6 to be part of my target market.

    Read the article

  • How can I tell Visual Studio to NOT BREAK on a particular exception?

    - by Noel Kennedy
    I have a particular type of exception that I would like Visual Studio to not catch with the Exception Assistant. Essentially I would like it just to let my normal exception handling infrastructure deal with it. The exception is an inheritor of System.Exception which I wrote and have the source code for. Any where this is thrown I want VS to not catch it, ie it is not useful to just supress a single throw new BlahException(); in code. This is because the exception is thrown a lot, and I don't want to have to supress every single instance individually. In case it makes a difference I am on Visual Studio 2010 Ultimate, Framework 3.5 SP1.

    Read the article

  • Testing whether an event has happened after a period of time in jQuery

    - by chrism
    I'm writing a script for a form-faces xforms product that is keyed off an event built into form faces. The event is called 'xforms-ready'. I have define 'startTime' as happening as soon as the document in 'ready'. What I want the script to do is warn the user that it is taking too long before the 'xforms-ready' happens, say if it's been 6 seconds since 'startTime'. I can easily do things when the 'xforms-ready' event happens using the code below: new EventListener(document.documentElement, "xforms-ready", "default", function() { var endTime = (new Date()).getTime(); } ); however the warning will want to happen before 'endTime' is defined. So I guess I want something that works like this: If 6 seconds has passed since startTime and endTime is not yet defined do X or possibly more efficiently: If 6 seconds has passed since startTime and 'xforms-ready' has not yet happened do X Can anyone suggest a way of doing this?

    Read the article

  • Handling changes in column order when importing CSV files

    - by Scott
    I have a CSV file. The first row will always contain column headers. Depending on a variety of factors, the order of columns may change and, in rare circumstances, some columns may not be present. These changes are beyond my control. My thoughts, so far, on how to address this. I'll read the first row of the file and use the values to generate a list of columns contained in the source file. The destination file will use the same column names as the source. This should be as simple as searching for identical names in the source and destination, then just mapping the column index values, right? What are your recommendations for handling this?

    Read the article

  • VBA form_error vs on error

    - by dmr
    I am trying to set up error handling for a MS-Access application. The standard method to do this seems to be with an On Error statement in each subroutine/function. It seems simpler to me to use the Form_Error function to catch all the runtime errors in that form as opposed to an On Error statement for each sub/function called by an event on that form. (Obviously, for code in modules, there is no Form_Error function and therefore the only method is the On Error statement) What are the pros and cons of using On Error vs Form_Error?

    Read the article

  • How do I trigger a single event defined for a class of objects

    - by mrbinky3000
    I have a question. I have 8 buttons that have unique incrementing id's and a shared class. <button class="btnChapter" id="btnChapter_1" value="1">1</button> <button class="btnChapter" id="btnChapter_2" value="2">2</button> <button class="btnChapter" id="btnChapter_3" value="3">3</button> ... In order to prevent me from duplicating code, I bound a click event to the btnChapter class instead of binding an event individually to each button's ID. $('.btnChapter').click(function(){ .. do stuff .. }); How do I trigger() the click() event only for #btnChapter_2? The following doesn't seem to work. $('#btnChapter_2').click()

    Read the article

  • Routing problem, handling differently online versus local - MVC.net 1.0

    - by VinnyG
    I have there lines in my RegisterToutes : routes.MapRoute("Pages3", "{url1}/{url2}/{url3}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); routes.MapRoute("Pages2", "{url1}/{url2}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); routes.MapRoute("Pages1", "{url1}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); On my local machine and on my demo server (demo.myserver.com/myproject/) it works great for handling the 404, but live(www.mysite.com) it just go to the IIS 404. I have a PageController witch go see if the page exist in the DB and if it don't I return to a 404 view with the status code 404 (Response.StatusCode = 404;) How can I reproduce the same behavior live? Do I need to setup something on IIS? I'm on winserver 2008 using c# and MVC 1.0. Thanks for the help!

    Read the article

  • MYSQL Event Scheduler DELIMITER using PHP

    - by user1440918
    I'm having an issue with my PHP code trying to create events within MySQL. I begin with creating a string like this: $sql="DELIMITER $$ CREATE EVENT `$test_name` ON SCHEDULE EVERY $time1 $sched2 STARTS '$start_date $start_time' DO BEGIN "; $sql .="INSERT INTO blah (foo,bar); "; $sql .="END$$ DELIMITER ;" mysql_query($sql,$dbh); But I keep getting Syntax Errors starting with DELIMITER $$ CREATE EVENT. Without the semicolon behind (foo,bar); the event triggers with a unexecuted payload. Any ideas on where I'm going wrong? Thanks!

    Read the article

  • How to pass around event as parameter in c#

    - by Jerry Liu
    Am writing unit test for a multi-threading application, where I need to wait until a specific event triggered so that I know the asyn operation is done. E.g. When I call repository.add(something), I wait for event AfterChange before doing any assertion. So I write a util function to do that. public static void SyncAction(EventHandler event_, Action action_) { var signal = new object(); EventHandler callback = null; callback = new EventHandler((s, e) => { lock (signal) { Monitor.Pulse(signal); } event_ -= callback; }); event_ += callback; lock (signal) { action_(); Assert.IsTrue(Monitor.Wait(signal, 10000)); } } However, the compiler prevents from passing event out of the class. Is there a way to achieve that?

    Read the article

  • handling Javascript actions in PDF with Java

    - by Stroboskop
    I'm trying to make PDF forms (aka AcroForms) editable in Java. So far i got the GUI editing and printing working using Bruno Lowagie's iText and Sun's pdf-renderer. But now i'm close to scrapping it all, because after switching from try & error to reading the PDF specification, i realized that it's all worthless unless i can make the multitude of possible JavaScript actions work as well. I don't think iText can do that. So in short: are there any Java libraries that do proper form handling including actions? Or maybe even a Java GUI component to edit form data?

    Read the article

  • Correct handling of return data

    - by Serhiy
    Hello, I have a question related to correct handling of returns of the DAO library I'm writing for one project. This library probably is going to be used by another people and I want to do it correctly. So I would like to know, how I should deal with return statements of the functions of my DAO. Example 1 I have function to getCustomer which should return String. In case query doesn't return any result should I return null, empty string or throw some kind of Exception? Example 2 I have function getCutomerList which return ArrayList. In case query doesn't return any result should I return null, empty ArrayList or throw some Exception? Example 3 Some sql exception was detected, what should I do: throw exception or do try..catch of the block where it can occur? What is the "good" practice or "best" practice to apply in my case? Thanks on advance, Serhiy.

    Read the article

  • Click event of buttons is not fired when it causes onChange event of textbox is fired first

    - by bakkujp
    Hi All, I have a textbox like below <h:inputText value="#{bean.strQuantite}"> <a4j:support actionListener="#{tabacListCommandeAltadisDetailBean.actionListenerQuantity}" event="onchange" /> </h:inputText> I input some value into the textbox above and keep the caret inside the textbox. After that, when I continue to click a other button, the event onchange of the input text above is fired. I want to when clicking the button, the click event is fired before. Can anyone help me to solve this problem ?

    Read the article

  • to avoid page refresh during button click event in asp.net

    - by ush
    public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) // If page loads for first time { Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); // Assign the Session["update"] with unique value //=============== Page load code ========================= //============== End of Page load code =================== } } protected void Button1_Click(object sender, EventArgs e) { if (Session["update"].ToString() == ViewState["update"].ToString()) // If page not Refreshed { //=============== On click event code ========================= Label1.Text = TextBox1.Text; //lblDisplayAddedName.Text = txtName.Text; //=============== End of On click event code ================== // After the event/ method, again update the session Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); } else // If Page Refreshed { // Do nothing } } protected override void OnPreRender(EventArgs e) { ViewState["update"] = Session["update"]; } } this is not working for high resolution gradient background

    Read the article

  • DataGridView and the CellEndEdit Event

    - by Brandon
    I have a DataGridView, and would like to hook into the CellEndEdit event. I've been able to successfully hook into the CellContentClick event, but am having issues with CellEndEdit. I added the following code to my Form1.cs file: private void dataGridView1_CellEndEdit(object sender, DataGridViewCellCancelEventArgs e) { dataGridView1[0, 0].Value = "Changed"; } With that code, nothing happens when I am done editing a cell. Is there anything else that I need to do to successfully hook into this event? I see that CellContentClick has a this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); line of code in the Form1.Designer.cs file, but I tried to mimic this for CellEndEdit, and received a compile error (No overload for 'dataGridView1_CellEndEdit' matches delegate 'System.Windows.Forms.DataGridViewCellEventHandler')

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >