Search Results

Search found 4269 results on 171 pages for 'handler mappings'.

Page 10/171 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • pthread_join from a signal handler

    - by liv2hak
    I have a capture program which in addition do capturing data and writing it into a file also prints some statistics.The function that prints the statistics static void* report(void) { /*Print statistics*/ } is called roughly every second using an ALARM that expires every second.So The program is like void capture_program() { pthread_t report_thread while(!exit_now) { if(pthread_create(&report_thread,NULL,report,NULL)){ fprintf(stderr,"Error creating reporting thread! \n"); } /* Capturing code -------------- -------------- */ if(doreport) usleep(5); } } void *report(void *param) { while(true) { if(doreport) { doreport = 0 //access some register from hardware usleep(5) } } } The expiry of the timer sets the doreport flag.If this flag is set report() is called which clears the flag.I am using usleep to alternate between two threads in the program.This seems to work fine. I also have a signal handler to handle SIGINT (i.e CTRL+C) static void anysig(int sig) { if (sig != SIGINT) dagutil_set_signal_handler(SIG_DFL); /* Tell the main loop to exit */ exit_now = 1; return; } My question: 1) Is it safe to call pthread_join from inside the signal handler? 2) Should I use exit_now flag for the report thread as well?

    Read the article

  • Cstom handler on IIS 7.5 doesn't work

    - by Amit
    Hi, I am new to IIS 7.5. I have an application in asp.net 2.0, which has its own custom URL rewriting mechanism. All the requests on the browser with .htm will be mapped to .aspx. It works fine on IIS 6, but somehow I could not get it working on IIS 7.5. On IIS 6, I go to Application PropertiesConfigurationMappings and add a new extension .htm with the executable as aspnet_isapi.dll On IIS 7.5 i added a handler mapping, with path as .htm and executable as aspnet_ispai.dll But the request does not even come to global.asax. If i try the URL with .aspx extension, pages load properly. Any idea how to set up custom mappings in iis 7.5?

    Read the article

  • Clear/Remove JavaScript Event Handler

    - by Jordan Terrell
    Greetings all - Given the following HTML fragment: <form id="aspnetForm" onsubmit="alert('On Submit Run!'); return true;"> I need to remove/clear the handler for the onsubmit event and register my own using jQuery or any other flavor of JavaScript usage. Anyone know how to do this? Thanks - Jordan

    Read the article

  • Paypal IPN Handler for Cart

    - by kimmothy16
    Hey everyone! I'm using a Paypal add to cart button for a simple ecommerce website. I had a Paypal IPN handler written in PHP that was successfully working for 'Buy it Now' buttons and purchasing one item at a time. I would run a database query each time to update the store's inventory to reflect the purchase. Now I'm upgrading this store to a 'cart' version so people could check out with multiple items at a time. Would anyone be able to tell me, in general, how my IPN handler would need to be altered to accommodate this? I'm unsure of what a response from Paypal looks like for a cart purchase as opposed to a buy it now purchase. Thanks, any help or examples of working IPN cart scripts would be very appreciated! My current code is below.. // Paypal POSTs HTML FORM variables to this page // we must post all the variables back to paypal exactly unchanged and add an extra parameter cmd with value _notify-validate // initialise a variable with the requried cmd parameter $req = 'cmd=_notify-validate'; // go through each of the POSTed vars and add them to the variable foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; // In a live application send it back to www.paypal.com // but during development you will want to uswe the paypal sandbox // comment out one of the following lines $fp = fsockopen ('www.sandbox.paypal.com', 80, $errno, $errstr, 30); //$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // or use port 443 for an SSL connection //$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { $item_name = stripslashes($_POST['item_name']); $item_number = $_POST['item_number']; $item_id = $_POST['custom']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; //full amount of payment. payment_gross in US $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; //unique transaction id $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $size = $_POST['option_selection1']; $item_id = $_POST['item_id']; $business = $_POST['business']; if ($payment_status == 'Completed') { // UPDATE THE DATABASE }

    Read the article

  • Cruisecontrol.NET & IIS7 Static File Handler Problem

    - by Mr. Flibble
    I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error: HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler. I'm a bit lost in IIS7 so it could be something pretty straightforward. They (cc.net) do some funny stuff with http handlers in the web.config which may be related to the problem: Anyone have any pointers?

    Read the article

  • Custom Event Handler

    - by Dremation
    I have a function that I'm using while(true) to repeatedly scan memory addresses of an application to detect change. I sleep the thread 1 second between iterations and this helps performance. However, is there a way to create a custom event handler to do away with the loops?

    Read the article

  • Handler vs AsyncTask

    - by Steve
    I'm confused as to when one would choose AsyncTask over a Handler. Say I have some code I want to run every n seconds which will update the UI. Why would I choose one over the other?

    Read the article

  • THE FASTEST Smarty Cache Handler

    - by rob.effect
    Does anyone know if there is an overview of the performance of different cache handlers for smarty? I compared smarty file cache with a memcache handler, but it seemed memcache has a negative impact on performance. I figured there would be a faster way to cache than through the filesystem... am I wrong?

    Read the article

  • Default .NET exception handler

    - by ajs410
    So the other day my C# application crashed. Usually, with a .NET application, if you have an unhandled exception you get a nice error message with a stack trace. However, this time, I got a different dialog that just told me there was an error and offered to attach a Debugger, but there was no stack trace in the dialog and the machine it was running on had no debugger installed. What gives? Why don't I see the default .NET exception handler?

    Read the article

  • Passing window handler for the SFML

    - by Ockonal
    Hello, I'm using SFML Input system for my own application. Here is my code: size_t windowHnd = %MY_WINDOW_HANDLER%; sf::Window MyWindow(windowHnd); const sf::Input& MyInput = MyWindow.GetInput(); cannot convert ‘sf::Window’ to ‘size_t’ in assignment In official documentation I found sf::Window constructor signature: WindowHandle Handle What is the correct way to pass window handler for the SFML?

    Read the article

  • view handler design pattern

    - by Mark Roberts
    I'm trying to figure out the origin of the view handler design pattern in software engineering. Many of the design patterns in software engineering were inspired by things which pre-date computers, and I was wondering if anybody had any insights on the origin of this particular pattern.

    Read the article

  • Radio button inside anchor element is reset after jQuery click handler

    - by GrievousAngel
    I have a situation where an element, of type radio, is contained in an element. The anchor element has a href but I want to override that behaviour by adding a jQuery 'click' handler to the element. The click handler makes the radio button inside it the selected one within the group. This all works when the anchor is clicked, however, when the radio button is clicked it appears that jQuery resets the selected radio to the previously selected one! Here is a the simplified page that duplicates the issue: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#a1").click(function(event) { anchorClicked("a1"); return false; }); $("#a2").click(function(event) { anchorClicked("a2"); return false; }); }); function anchorClicked(anchorId) { $('#' + anchorId + ' input:radio').attr("checked", true); alert("Look at what is selected and what happens after the event when this dialog is closed!"); } </script> </head> <body> <form> <ul> <li id="li1"> <a id="a1" href="javascript:alert('default functionality')"> <input value="1" name="rb" type="radio" id="rb1"> <span>Details 1</span> </a> </li> <li id="li2"> <a id="a2" href="javascript:alert('default functionality')"> <input value="2" name="rb" type="radio" id="rb2"> <span>Details 2</span> </a> </li> </ul> </form> </body> Does anyone have any idea how I can prevent jQuery for resetting the radio button?

    Read the article

  • Image Handler for Sharepoint Not Working

    - by Peter
    My ImageHandler.ashx is not working when the webpart is calling it. any ideas on what is the correct way on calling or adding a handler in sharepoint? Thanks in advance Here My ImageHandler.ashx code byte[] buffer = (byte[])image.ImageData; context.Response.ContentType = "image/jpeg"; context.Response.OutputStream.Write(buffer, 0, buffer.Length); In my webpart imgcontrol.ImageUrl = "ImageHandler.aspx?id=1";

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >