Search Results

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

Page 59/782 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Handling expected supervisord exit codes

    - by Mulkave
    I am using supervisord inside a Docker container to manage my running processes and would like to also use it to trigger certain commands - run them once and expect them to exit with 0. Here's one example: [program:central-seed-posts] command = /usr/bin/php /var/www/app/artisan post autostart = false autorestart = false startsecs = 3 startretries = 0 exitcodes = 0 stderr_logfile=/tmp/central/posts-stderr-supervisor.log stdout_logfile=/tmp/central/posts-stdout-supervisor.log And I'm using nsenter's docker-enter with supervisorctl start central-seed-posts to trigger it but I would also like to handle a successful exit instead of supervisor telling me ERROR (abnormal termination) Does it have to do with supervisor events ?

    Read the article

  • Can we execute steps conditionally in a JMeter script?

    - by Phanindra K
    I have recorded a sequence of steps to be executed for testing my web application, in a JMeter .jmx script. (The recording tool used was BadBoy). It is possible that one of the steps might return an error response in the HTTP response content. In this case, I need the script to stop execution of that thread. However, since the error page is customized, JMeter does not recognize this as an error and proceeds to the next steps. Is there any way to check for certain keywords, for example, and decide if the response is an error?

    Read the article

  • nginx: handling 404 with error_page

    - by ytw
    Originally, I have something like this in the nginx.conf file. location ^~ /test_api { types { application/json json; } root /usr/local/www/data; rewrite "/test_api/(.*)" /api_response/test_api_$1.json break; error_page 404 /api_response/unknown_request.json; } When a requested resource is not found locally, unknown_request.json (default response) is returned correctly. Then I had to change the rewrite to point to a remote server as follows: rewrite "/test_api/(.*)" $scheme://www.somedomain.com/test_api_$1 break; It doesn't return unknown_request.json (default response) anymore even though the remote server returns a 404. Is there a way to continue to return unknown_request.json to the client when the remote server returns a 404 assuming the remote server can't be changed to return unknown_request.json? Thanks very much.

    Read the article

  • Apache: multiple domains handling

    - by cache
    So I use following schema to handle multiple sites on my apache: <VirtualHost 192.168.1.100:80> # get the server name from the Host: header UseCanonicalName Off VirtualDocumentRoot /var/www/%0/docs VirtualScriptAlias /var/www/%0/cgi-bin </VirtualHost> Therefore, if a client go to www.example.com, it will actually point to /var/www/www.example.com/doc/, which is good. However, what if the client go to example.com? It will point to /var/www/example.com/doc, which is not what we want. So my question is: is there any better schema for that? Or what should I do to fix the issue? Thanks!

    Read the article

  • returning correct multiTouch id

    - by Max
    I've spent countless hours on reading tutorials and looking at every question related to multiTouch from here and Stackoverflow. But I just cannot figure out how to do this correctly. I use a loop to get my pointerId, I dont see alot of people doing this but its the only way I've managed to get it somewhat working. I have two joysticks on my screen, one for moving and one for controlling my sprites rotation and the angle he shoots, like in Monster Shooter. Both these work fine. My problem is that when I Move my sprite at the same time as Im shooting, my touchingPoint for my movement is set to the touchingPoint of my shooting, since the x and y is higher on the touchingPoint of my shooting (moving-stick on left side of screen, shooting-stick on right side), my sprite speeds up, this creates an unwanted change in speed for my sprite. I will post my entire onTouch method here with some variable-changes to make it more understandable. Since I do not know where Im going wrong. public void update(MotionEvent event) { if (event == null && lastEvent == null) { return; } else if (event == null && lastEvent != null) { event = lastEvent; } else { lastEvent = event; } int pointerCount = event.getPointerCount(); for (int i = 0; i < pointerCount; i++) { int x = (int) event.getX(i); int y = (int) event.getY(i); int id = event.getPointerId(i); int action = event.getActionMasked(); int actionIndex = event.getActionIndex(); String actionString; switch (action) { case MotionEvent.ACTION_DOWN: actionString = "DOWN"; break; case MotionEvent.ACTION_UP: shooting=false; // when shooting is true, it shoots dragging=false; // when dragging is true, it moves actionString = "UP"; break; case MotionEvent.ACTION_POINTER_DOWN: actionString = "PNTR DOWN"; break; case MotionEvent.ACTION_POINTER_UP: shooting=false; dragging=false; actionString = "PNTR UP"; break; case MotionEvent.ACTION_CANCEL: shooting=false; dragging=false; actionString = "CANCEL"; break; case MotionEvent.ACTION_MOVE: try{ if((int) event.getX(id) > 0 && (int) event.getX(id) < touchingBox && (int) event.getY(id) > touchingBox && (int) event.getY(id) < view.getHeight()){ movingPoint.x = (int) event.getX(id); movingPoint.y = (int) event.getY(id); dragging = true; } else if((int) event.getX(id) > touchingBox && (int) event.getX(id) < view.getWidth() && (int) event.getY(id) > touchingBox && (int) event.getY(id) < view.getHeight()){ shootingPoint.x = (int) event.getX(id); shootingPoint.y = (int) event.getY(id); shooting=true; }else{ shooting=false; dragging=false; } }catch(Exception e){ } actionString = "MOVE"; break; default: actionString = ""; } Wouldnt post this much code if I wasnt at an absolute loss of what I'm doing wrong. I simply can not get a good understanding of how multiTouching works. basicly movingPoint changes for both my first and second finger. I bind it to a box, but aslong as I hold one finger within this box, it changes its value based on where my second finger touches. It moves in the right direction and nothing gives an error, the problem is the speed-change, its almost like it adds up the two touchingPoints.

    Read the article

  • Handling Hide/Show dock icon menu in AIR on OS X

    - by Alan
    I'm trying to figure out how to access the Show/Hide option that OS X automatically adds to the dock icon menu. The problem is that no matter what I do to hide my app, the dock icon menu will always show Hide and only if I click that option does it switch to Show. I want to have my app toggle visibility using the Invoke event but if a user hides the app that way and then right clicks the dock icon, they won't see Show, just Hide. Is there an event I can monitor for it? Or that I can trigger? I just want to have that menu option status be synced to whatever visibility status I set programatically. This has been driving me nuts!

    Read the article

  • .delegate equivalent of an existing .hover method in jQuery 1.4.2

    - by kim3er
    I have an event handler bound to the hover event using the .hover method, which is below: $(".nav li").hover(function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); }); It is important to note, that I require both functions within the handler to ensure synchronisation. Is it possible to rewrite the function using .delegate, as the following does not work? $(".nav").delegate("li", "hover", function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); }); Rich

    Read the article

  • Java - AWT / Swing - handling the Event Descriptor Thread

    - by waitinforatrain
    Hi, I have a question about the 'Event Descriptor Thread'. I have a Main class that is also a JFrame. It initialises the rest of the components in the code, some of them do not involve Swing and some of them do. Is it enough to simply initialise the Main class using the EDT like this?... public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new Main(); } }); } This way everything would run on the Event Dispatcher thread.

    Read the article

  • Handling events exposed on a .NET class via COM in VB6

    - by PeanutPower
    Handling events exposed on a .NET class via COM in VB6 My test .NET (class libary registered for interop in compiler settings) code: Imports System.Runtime.InteropServices <InterfaceType(ComInterfaceType.InterfaceIsIDispatch), ComVisible(True)> _ Public Interface MyEventInterface <DispId(1)> Event Exploded(ByVal Text As String) <DispId(2)> Sub PushRedButton() End Interface <ClassInterface(ClassInterfaceType.None)> _ Public Class EventTest Implements MyEventInterface Public Event Exploded(ByVal Text As String) Implements MyEventInterface.Exploded Public Sub PushRedButton() Implements MyEventInterface.PushRedButton RaiseEvent Exploded("Bang") End Sub End Class My test VB6 application winforms code (which references the above class libary): Public ct As New ComTest1.EventTest Private Sub Command1_Click() ct.add_Exploded (ExplodedHandler) ct.PushRedButton ct.remove_Exploded (ExplodedHandler) End Sub Private Sub ExplodedHandler(ByVal Text As String) MsgBox Text End Sub Specifially I'm not sure how to set up the handler in VB6 the compile error I get is "Argument not optional" on this line in the VB6: ct.add_Exploded (ExplodedHandler)

    Read the article

  • Prototype JS swallows errors in dom:loaded, and ajax callbacks?

    - by WishCow
    I can't figure out why prototype suppressess the error messages in the dom:loaded event, and in AJAX handlers. Given the following piece of HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Conforming XHTML 1.1 Template</title> <script type="text/javascript" src="prototype.js"></script> <script type="text/javascript"> document.observe('dom:loaded', function() { console.log('domready'); console.log(idontexist); }); </script> </head> <body> </body> </html> The domready event fires, I see the log in the console, but there is no indication of any errors whatsoever. If you move the console.log(idontexist); line out of the handler, you get the idontexist is not defined error in the console. I find it a little weird, that in other event handlers, like 'click', you get the error message, it seems that it's only the dom:loaded that has this problem. The same goes for AJAX handlers: new Ajax.Request('/', { method: 'get', onComplete: function(r) { console.log('xhr complete'); alert(youwontseeme); } }); You won't see any errors. This is with prototype.js 1.6.1, and I can't find any indication of this behavior in the docs, nor a way to enable error reporting in these handlers. I have tried stepping through the code with FireBug's debugger, and it seems to jump to a function on line 53 named K, when it encounters the missing variable in the dom:loaded handler: K: function(x) { return x } But how? Why? When? I can't see any try/catch block there, how does the program flow end up there? I know that I can make the errors visible by packing my dom:ready handler(s) in try/catch blocks, but that's not a very comfortable option. Same goes for registering a global onException handler for the AJAX calls. Why does it even suppress the errors? Did someone encounter this before?

    Read the article

  • .delegate equivalent of an existing .live method in jQuery 1.4.2

    - by kim3er
    I have an event handler bound to the hover event using the .live method, which is below: $(".nav li").hover(function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); }); It is important to note, that I require both functions within the handler to ensure synchronisation. Is it possible to rewrite the function using .delegate, as the following does not work? $(".nav").delegate("li", "hover", function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); }); Rich

    Read the article

  • Exceptions and Access Violations in Paint events in Windows

    - by Patrick
    After executing some new code, my C++ application started to behave strange (incorrect or incomplete screen updates, sometimes no screen updates at all). After a while we found out that the new code is causing an Access Violation. Strange enough, the application simply keeps on running (but with the incorrect screen updates). At first we thought the problem was caused by a "try-catch(...)" construction (put there by an overactive ex-colleague), but several hours later (carefully inspecting the call stacks, adding many breakpoints, ...) we found out that if there's an Access Violation in a paint event, Windows catches it, and simply continues running the application. Is this normal behavior? Is it normal that Windows catches exceptions/errors during a paint event? Is there a way to disable this? (if not, it would mean that we have to always run in the debugger with all exceptions enabled while testing our code). Patrick

    Read the article

  • Grails Duplicate Exception handling

    - by Srinath
    Hi, How to catch duplicate key exceptions in Grails . when trying to save existing integer for a unique column constraint, the error is generating while saving/updating a record . Also used try{ object.save(flush:true) }catch(org.springframework. dao.DataIntegrityViolationException e){ println e.message }catch(org.hibernate.exception.ConstraintViolationException ex){ println e.message }catch(Exception e){ println e.message } But unable to catch this issue . 23:41:13,265 ERROR [JDBCExceptionReporter:101] Duplicate entry '1' for key 2 23:41:13,281 ERROR [AbstractFlushingEventListener:324] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) Could you please share the solution to solve this .

    Read the article

  • Onclick not firing

    - by user320588
    I have a set of buttons on my master page (I have attached the code below) but no onclick event is being raised. I pulled the final page source and no onclick event was present. As you can see I tried a few different approaches to solve the problem. I am looking for a normal postback to the server but I am getting nothing when I click any of these buttons. What am I not doing? --Master --Master Code Behind Protected Sub Button_Command(ByVal sender As Object, ByVal e As CommandEventArgs) Handles btnCancel.Command, btnClear.Command Session("ButtonClicked") = e.CommandArgument End Sub Protected Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click, btnSubmit.Click Session("ButtonClicked") = CType(sender, Button).CommandArgument End Sub --Page Source

    Read the article

  • Event handling for keyboard strokes

    - by david
    Hey, I'm trying to get familiar with the whole keyboard event detection thing. Here's my sample code. <fx:Script> <![CDATA[ import flash.events.KeyboardEvent; import mx.controls.Alert; private function init():void{ addEventListener(KeyboardEvent.KEY_DOWN,reportKeyDown); } private function reportKeyDown(event:KeyboardEvent):void { Alert.show("a key was pressed"); } ]]> </fx:Script> As you can see, I'm at stage 0 of playing around with it, but it won't work. Anyone has any idea what I should be doing instead? Thanks

    Read the article

  • Handling Dialogs in WPF with MVVM

    - by Ray Booysen
    In the MVVM pattern for WPF, handling dialogs is one of the more complex operations. As your view model does not know anything about the view, dialog communication can be interesting. I can expose an ICommand that when the view invokes it, a dialog can appear. Does anyone know of a good way to handle results from dialogs? I am speaking about windows dialogs such as MessageBox. One of the ways we did this was have an event on the viewmodel that the view would subscribe to when a dialog was required. public event EventHandler<MyDeleteArgs> RequiresDeleteDialog; This is OK, but it means that the view requires code which is something I would like to stay away from.

    Read the article

  • Is there a browser-agnostic way to detect client-side script errors with Watin?

    - by Michael
    We're using WatiN to test our web portals. During the course of an E2E test, we'll occasionally see client-side script errors on the IE status bar. I'd like to chain a handler onto the script error event and record the error for later analysis and bug filing. Problem is, I don't know that there's a global script error event or how to chain into it. And if there's not a browser-agnostic way to accomplish this, I can create MyIE and MyFF subclasses but then this becomes two browser-specific questions. In essence, I'm thinking of something like this entirely made-up call: browser.ScriptEngine.SetCustomErrorHandler(LogScriptingError); ... where LogScriptErrors is my code that does the obvious. Many of our client-side scripting errors don't necessarily prevent the test from continuing (a pretty UI element didn't animate, for example, but the underlying form is still submittable), so I'd like to log the error and forge ahead in most cases.

    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

  • 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

  • Problem with handling click event of bitmap

    - by shaina
    i am using navigationClick method to handle click event of Bitmap images & Buttons it works fine when i dont use VerticalFieldManger . But when i adjust positions of field using this field manager then it doesnt capture click event of all controls just on capture Index(0) click which i think is verticalFieldmanager not other (Bitmaps & Buttons fields) Plzzzzzz help how to resolve it code is protected boolean navigationClick(int status, int time) { Field field = this.getFieldWithFocus(); if(field.getIndex()==0) { Dialog.alert("Index 0 (bitmaP) clicked"); } if(field.getIndex()==1) { Dialog.alert("Index 1(Button 1) clicked"); } if(field.getIndex()==2) { Dialog.alert("Index 2 (Button2) Clicked"); } if(field.getIndex()==3) { Dialog.alert("Index 3(bitmap2) Clicked"); } }

    Read the article

  • Programmatic binding of accelerators in wxPython

    - by Inductiveload
    I am trying to programmatically create and bind a table of accelerators in wxPython in a loop so that I don't need to worry about getting and assigning new IDs to each accelerators (and with a view to inhaling the handler list from some external resource, rather than hard-coding them). I also pass in some arguments to the handler via a lambda since a lot of my handlers will be the same but with different parameters (move, zoom, etc). The class is subclassed from wx.Frame and setup_accelerators() is called during initialisation. def setup_accelerators(self): bindings = [ (wx.ACCEL_CTRL, wx.WXK_UP, self.on_move, 'up'), (wx.ACCEL_CTRL, wx.WXK_DOWN, self.on_move, 'down'), (wx.ACCEL_CTRL, wx.WXK_LEFT, self.on_move, 'left'), (wx.ACCEL_CTRL, wx.WXK_RIGHT, self.on_move, 'right'), ] accelEntries = [] for binding in bindings: eventId = wx.NewId() accelEntries.append( (binding[0], binding[1], eventId) ) self.Bind(wx.EVT_MENU, lambda event: binding[2](event, binding[3]), id=eventId) accelTable = wx.AcceleratorTable(accelEntries) self.SetAcceleratorTable(accelTable) def on_move(self, e, direction): print direction However, this appears to bind all the accelerators to the last entry, so that Ctrl+Up prints "right", as do all the other three. How to correctly bind multiple handlers in this way?

    Read the article

  • ASP.NET UserControl OnError

    - by michl86
    UserControls in ASP.NET (4.0) inherit from System.Web.UI.UserControl. VisualStudio intellisense suggest OnError as valid override of TemplateControl. At runtime .NET ignores this error handling. Only the OnError at Page-Level gets invoked. Did i miss anything or is there a design issue? public partial class Sample : System.Web.UI.UserControl { protected override void OnError(EventArgs e) { // Never reach ;o) base.OnError(e); } }

    Read the article

  • Suppress unhandled exception dialog?

    - by Nick Brooks
    I'm handling all of my unhanded exception in the code but whenever one happens (not during debugging) I get my error window and as soon as it closes "Unhandled application exception has occurred in your application" window pops up. How do I suppress it? PS : I am not using ASP.NET , I'm using Windows Forms

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >