Search Results

Search found 5259 results on 211 pages for 'interrupt handling'.

Page 26/211 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • 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

  • 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

  • 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

  • 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

  • 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

  • Avoid stuck calling callback

    - by andlomba
    Hello all, This is a question about generic c++ event driven applications design. Lets assume that we have two threads, a "Dispatcher" (or "Engine"...) and a "Listener" (or "Client"...). Let's assume that I write the Dispatcher code, and release it as a library. I also write the Listener interface, of course. When the Dispatcher executes (after Listener registration) listenerInstance.onSomeEvent(); the event handling code will actually be executed by the Dispatcher thread, so if the person that implements the Listener writes something like void Listener::onSomeEvent() { while(true) ; } The Dispatcher will stuck forever. Is there a "plain old c++" (I mean no boost or libsigc++) way to "decouple" the two classes, so I can be sure that my Dispatcher will work fine whatever the Listeners does in the callbacks? bye and thanks in advance, Andrea

    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

  • Handling download abort in PHP

    - by Aron Rotteveel
    Is it somehow possible to handle a download abort in PHP? In this specific case I am not speaking of a connection abort, but handling the event that triggers when the 'cancel' button in the browser download dialog button is clicked. Since this dialog already interprets the headers of the file that is to be download but does not actually start the download, it only seems logical there should be some way to catch this. Small (pseudo) code example to clear things up: // set some headers header('...'); // Question: what happens between the part where the headers are sent // and the actual data is being outputted to the client? IE: this is the part // where the download dialog should show up // Logical question that follows is: is there a way to detect a 'cancel'? $filename = '/some/file.txt'; $handle = fopen($filename, 'rb'); // output data to client while (!feof($handle)) { echo fread($handle, 8096); } fclose($handle);

    Read the article

  • Errors not being redirected to an Http handler if redirectMode="ResponseRewrite"

    - by Luk
    I see similar questions, but it looks like there were due to an unrelated issue. in 3.5, I have a custom error handler that logs errors and redirects users. My web.config is set up as such: <httpHandlers> <add path="error.ashx" type="MySite.Tools.WebErrorLogger, MySite.Tools" verb="*"/> </httpHandlers> <customErrors mode="On" defaultRedirect="error.ashx" redirectMode="ResponseRewrite"> </customErrors> When redirectMode is set to "ResponseRedirect", everything works fine (but Server.GetLastError() being null but that seems to be intended) However, when using ResponseRewrite, my handler is not called and I see ASP.Net default error pages. Any idea on how I could do this? (I unfortunately can't use either an aspx page or do my error handling in global.asax due to other constraints)

    Read the article

  • Command line tool (PDF Workflow) in OSX that detects if key is down

    - by kroko
    Hello! I'm writing a OSX PDF Workflow in ObjC and C. A single executable ("UNIX Tool" as named in the Apple reference), that reads in the spooled PDF file, does some parsing. I'd like to give more functionality by enabling a key-down event handling, meaning - when user opens print dialog in an application - and chooses to left-mouse-click on the custom made pdf workflow to run it - depending on if a keyboard key is down (i.e. option key, but "any key down" would be enough for me) when running that workflow - a decision is made in the code. I have read NSEvent and Carbon Event Manager reference and it seems that in this case (a plain unix executable + not run as root) it's not possible. Or is it? Many thanks in advance, Kroko

    Read the article

  • Is the "message" of an exception culturally independent?

    - by Ray Hayes
    In an application I'm developing, I have the need to handle a socket-timeout differently from a general socket exception. The problem is that many different issues result in a SocketException and I need to know what the cause was. There is no inner exception reported, so the only information I have to work with is the message: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" This question has a general and specific part: is it acceptable to write conditional logic based upon the textual representation of an exception? Is there a way to avoid needing exception handling? Example code below... try { IPEndPoint endPoint = null; client.Client.ReceiveTimeout = 1000; bytes = client.Receive(ref endPoint); } catch( SocketException se ) { if ( se.Message.Contains("did not properly respond after a period of time") ) { // Handle timeout differently.. } }

    Read the article

  • MVC way of handling data input

    - by korki
    I have a data input module where I add the information of my product and its sub information like: product basic info product price info product price details price info and price details are related to product and are lists In my web forms approach I would store my main product object on the view state and I would populate it's pricing info and details while doing ajax postbacks. This way I can create a compact module that is very user friendly in terms of defining a lot of data from one place without the need to enter these data from seperate modules. And when I am done I would do one product.save() and that would persist all the data to the respective tables on db. Now I am building similar app on .net mvc framework and pondering on what would be the good way of handling this on mvc. I don't resonate towards storing all this on client side till I click save. And saving to the db after each action makes me remember the days I was coding on asp. Will appreciate your inputs on ways to approach this on mvc framework

    Read the article

  • SWIG: Throwing exceptions from Python to C++

    - by wheaties
    We've got an interface we've defined in C++ (abstract class, all functions pure virtual) which will be extended in Python. To overcome the cross-language polymorphism issues we're planning on using SWIG directors. I've read how to catch exceptions thrown from C++ code in our Python code here, here, here, and even on SO. It's fairly straight forward and I'm not expecting issues with handling our library's own exceptions. What I'd like to know and can't seem to find in the documentation is how to have our Python implementation of the extended C++ interface throw those C++ exceptions in a way that makes them visible to the C++ code. We could make small functions within the *.i files such that each function throws our exceptions: void throw_myException(){ throw MyException; } but I'm wondering how it will interact with the Python code. Anyone have any experience with throwing C++ exceptions from Python code?

    Read the article

  • Why and How to avoid Event Handler memory leaks ?

    - by gillyb
    Hey There, I just came to realize, by reading some questions and answers on StackOverflow, that adding event handlers using += in C# (or i guess, other .net languages) can cause common memory leaks... I have used event handlers like this in the past many times, and never realized that they can cause, or have caused, memory leaks in my applications. How does this work (meaning, why does this actually cause a memory leak) ? How can I fix this problem ? Is using -= to the same event handler enough ? Are there common design patterns or best practices for handling situations like this ? Example : How am I supposed to handle an application that has many different threads, using many different event handlers to raise several events on the UI ? Are there any good and simple ways to monitor this efficiently in an already built big application ? Thanks in advance!

    Read the article

  • Unicode string handling using Windows API

    - by DeadMG
    I always assumed that Unicode string handling was some dark art. However, I've seen that the Windows API has functions for comparing Unicode strings, for example. Does that mean that it's actually feasible to write a Unicode string class that can perform simple actions like sorting, equality comparison, and extraction from a file? Or are there hidden gotchas in the use of these functions that makes it actually a really bad idea? I'm just looking at libraries like ICU and they seem incredibly over-complicated compared to what a Unicode string class backed by the Windows API could actually look like, which would resemble the Standard string classes quite closely.

    Read the article

  • How to handle this "session failed to write file" error in PHP?

    - by alex
    I am using the Kohana 3 framework, and am using the native session driver. For some reason, occasionally the sessions fail to write to their file. Warning: session_start() [function.session-start]: open(/tmp/sess_*****, O_RDWR) failed: Permission denied (13) in /home/site/public_html/system/classes/kohana/session/native.php on line 27 I am pretty sure Kohana has its own in built error handler, but it is not triggered with this error (i.e. it shows up like a normal PHP error, not the Kohana error). Anyone that has ever used Kohana will notice this seems to have bypassed Kohana's error handling (perhaps set with set_error_handler()). Is there anyway to stop this error from appearing without switching from the native session (i.e. file based) driver? Should I just give good practice the boot and append an @ error suppressor to session_start() in the core code of Kohana? Should I relax the error_reporting()? Thanks

    Read the article

  • Catch all javascript errors and send them to server

    - by ssaboum
    Hi everyone, i wandered if anyone had experience in handling javascript errors globally and send them from the client browser to a server. I think my point is quite clear, i want to know every exceptions, errors, compilation errors, ... that happens on the client side and send them to the server to report them. I'm mainly using mootools and head.js (for the js side) and django for the server side (not that it matters...). Thank you for your help. Regards.

    Read the article

  • Callback exception/error handling for ASP TreeView OnTreeNodePopulate?

    - by MHutchinson
    We're using an asp:TreeView configured with lazy loading. The callback method assigned for OnTreeNodePopulate throws an exception if the user has been logged out since the page was loaded. What we want to do is to direct the user to the login page. First attempt was to catch the exception on the server and try Response.Redirect(...), but that doesn't work because you can't redirect within a callback. I've tried various other approaches, including using ClientScript.RegisterStartupScript(...) but that doesn't seem to work for OnTreeNodePopulate. If there was some way we could hook into the callback event handling on the client side then it would be easy, but the TreeView doesn't seem to offer anything here. Suggestions?

    Read the article

  • What does "Only catch exceptions you can handle" really mean?

    - by KyleLib
    I'm tasked with writing an Exception Handling Strategy and Guidelines document for a .NET/C# project I'm working on. I'm having a tough go at it. There's plenty of information available for how/when to throw, catch, wrap exceptions, but I'm looking for describing what sorts of things should go on inside the catch block short of wrapping and throwing the exception. try { DoSomethingNotNice(); } catch (ExceptionICanHandle ex) { //Looking for examples of what people are doing in catch blocks //other than throw or wrapping the exception, and throwing. } Thanks in advance

    Read the article

  • How to detect interrupt handle routine of a device driver?

    - by sasayins
    Hi, I'm using Linux platform to program in embedded device. Is there any way that a kernel module can detect the interrupt handler routine of an another device driver module? Like for example, I have a kernel module(.ko), then I want this kernel module detect if a particular device driver execute its interrupt handle routine? Is this possible? Many thanks.

    Read the article

  • New HandleProcessCorruptedStateExceptions attribute in .Net 4

    - by Yaakov Davis
    I'm trying to crash my WPF application, and capture the exception using the above new .Net 4 attribute. I managed to manually crash my application by calling Environment.FailFast("crash");. (Also managed to crash it using Hans's code from here: http://stackoverflow.com/questions/2950130/how-to-simulate-a-corrupt-state-exception-in-net-4). The app calls the above crashing code when pressing on a button. Here are my exception handlers: protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; DispatcherUnhandledException += app_DispatcherUnhandledException; } [HandleProcessCorruptedStateExceptions] void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { //log.. } [HandleProcessCorruptedStateExceptions] void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e) { //log.. } [HandleProcessCorruptedStateExceptions] void app_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { //log.. } The //log... comment shown above is just for illustration; there's real logging code there. When running in VS, an exception is thrown, but it doesn't 'bubble' up to those exception handler blocks. When running as standalone (w/o debugger attached), I don't get any log, despite what I expect. Does anyone has an idea why is it so, and how to make the handling code to be executed? Many thanks, Yaakov

    Read the article

  • Matplotlib pick event order for overlapping artists

    - by Ajean
    I'm hitting a very strange issue with matplotlib pick events. I have two artists that are both pickable and are non-overlapping to begin with ("holes" and "pegs"). When I pick one of them, during the event handling I move the other one to where I just clicked (moving a "peg" into the "hole"). Then, without doing anything else, a pick event from the moved artist (the peg) is generated even though it wasn't there when the first event was generated. My only explanation for it is that somehow the event manager is still moving through artist layers when the event is processed, and therefore hits the second artist after it is moved under the cursor. So then my question is - how do pick events (or any events for that matter) iterate through overlapping artists on the canvas, and is there a way to control it? I think I would get my desired behavior if it moved from the top down always (rather than bottom up or randomly). I haven't been able to find sufficient enough documentation, and a lengthy search on SO has not revealed this exact issue. Below is a working example that illustrates the problem, with PathCollections from scatter as pegs and holes: import matplotlib.pyplot as plt import sys class peg_tester(): def __init__(self): self.fig = plt.figure(figsize=(3,1)) self.ax = self.fig.add_axes([0,0,1,1]) self.ax.set_xlim([-0.5,2.5]) self.ax.set_ylim([-0.25,0.25]) self.ax.text(-0.4, 0.15, 'One click on the hole, and I get 2 events not 1', fontsize=8) self.holes = self.ax.scatter([1], [0], color='black', picker=0) self.pegs = self.ax.scatter([0], [0], s=100, facecolor='#dd8800', edgecolor='black', picker=0) self.fig.canvas.mpl_connect('pick_event', self.handler) plt.show() def handler(self, event): if event.artist is self.holes: # If I get a hole event, then move a peg (to that hole) ... # but then I get a peg event also with no extra clicks! offs = self.pegs.get_offsets() offs[0,:] = [1,0] # Moves left peg to the middle self.pegs.set_offsets(offs) self.fig.canvas.draw() print 'picked a hole, moving left peg to center' elif event.artist is self.pegs: print 'picked a peg' sys.stdout.flush() # Necessary when in ipython qtconsole if __name__ == "__main__": pt = peg_tester() I have tried setting the zorder to make the pegs always above the holes, but that doesn't change how the pick events are generated, and particularly this funny phantom event.

    Read the article

  • Application Errors vs User Errors in PHP

    - by CogitoErgoSum
    So after much debate back and forth, I've come up with what I think may be a valid plan to handle Application/System errors vs User Errors (I.e. Validation Issues, Permission Issues etc). Application/System Errors will be handled using a custom error handler (via set_error_handler()). Depending on the severity of the error, the user may be redirected to a generic error page (I.e. Fatal Error), or the error may simply be silently logged (i.e E_WARNING). These errors are ones most likely caused by issues outside the users control (Missing file, Bad logic, etc). The second set of errors would be User Generated ones. These are the ones may not automatically trigger an error but would be considered one. In these cases i"ve decided to use the trigger_error() function and typically throw a waning or notice which would be logged silently by the error handler. After that it would be up to the developer to then redirect the user to another page or display some sort of more meaningful message to the user. This way an error of any type is always logged, but user errors still allow the developer freedom to handle it in their own ways. I.e. Redirect them back to their form with it fully repopulated and a message of what went wrong. Does anyone see anything wrong with this, or have a more intuitive way? My approach to error handling is typically everyone has their own ways but there must be a way instituted.

    Read the article

  • Is android's motion event handling accurate??

    - by Peterdk
    Bug I have a weird bug in my piano app. Sometimes keys (and thus notes) hang. I did a lot of debugging and narrowed it down to what looks like androids inaccuracy of motion event handling: DEBUG/(2091): ACTION_DOWN A4 DEBUG/(2091): KeyDown: A4 DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_UP B4 //HOW CAN THIS BE???? DEBUG/(2091): KeyUp: B4 DEBUG/(2091): Stream is null, can't stop DEBUG/(2091): Hanging Note: A4 X=240-287 EventX=292 Y=117-200 EventY=164 DEBUG/(2091): KeyUp Note: B4 X=288-335 EventX=292 Y=117-200 EventY=164 Clearly it can be seen here that out of nowhere I suddenly have an ACTION_UP for another note. Shouldn't I definitely get a ACTION_MOVE first? As shown in the end of the log, it's definitely not an error in region detection, since the ACTION_UP event is clearly in the B4 region. Logging Implementation details Every onTouchEvent() call is logged, so the log is accurate. The relevant pseudo-code for the ACTION_MOVE logging is: Key oldKey = Key.get(event.getHistoricalX(), event.getHistoricalY()); Key newKey = Key.get(event.getX(), event.getY()); Question Is this normal behaviour for Android (the jumping in coordinates)? Am I missing something?

    Read the article

  • What is best strategy to handle exceptions & errors in Rails?

    - by Nick Gorbikoff
    Hello. I was wondering if people would share their best practices / strategies on handling exceptions & errors. Now I'm not asking when to throw an exception ( it has been throroughly answered here: SO: When to throw and Exception) . And I'm not using this for my application flow - but there are legitimate exceptions that happen all the time. For example the most popular one would be ActiveRecordNotFound. What would be the best way to handle it? The DRY way? Right now I'm doing a lot of checking within my controller so if Post.find(5) returns Nil - I check for that and throw a flash message. However while this is very granular - it's a bit cumbersome in a sense that I need to check for exceptions like that in every controller, while most of them are essentially the same and have to do with record not found or related records not found - such as either Post.find(5) not found or if you are trying to display comments related to post that doesn't exist, that would throw an exception (something like Post.find(5).comments[0].created_at) I know you can do something like this in ApplicationController and overwrite it later in a particular controller/method to get more granular support, however would that be a proper way to do it? class ApplicationController < ActionController::Base rescue_from ActiveRecord::RecordInvalid do |exception| render :action => (exception.record.new_record? ? :new : :edit) end end

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >