Search Results

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

Page 34/211 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • VI/VIM file handling

    - by Abhimanyu
    Nowa days I'm working with the Vi editor with the positive approach that you can do most things using it - unlike other editors. I came across one problem: Let's assume I have open a folder with vi <folder name> so it opens the folder in Vi and lists the files in that folder. I select a file and read the content, then I want to go back to the previous view which has filenames listed so it is easy to choose another file. But don't know how to achieve this. I'm hoping some method should be there to achieve this.

    Read the article

  • How to get the clicked element in a dynamically built JQuery Treeview?

    - by Alexander
    I have a product database with several product categories. Each category has a number of sub-categories, which has sub-sub-categories, which has... Well, quite some levels deep. The tree is too huge to load at once, so I need to built it dynamically as users select specific product categories. Here's a snapshot of the product tree. Initially, only the first level is loaded. The second level (Cat. 1.1 and cat. 1.2) is added when the user clicks on cat. 1: <ul id="navigation"> <li id="625212">Product cat. 1 <ul> <li id="625213">Product cat. 1.1 <ul></ul> </li> <li id="625109">Product cat. 1.2 <ul></ul> </li> </ul> </li> <li id="624990">Product cat. 2 <ul></ul> </li> </ul> I intend to extend the tree as users click on specific product categories. I can get the list of sub-categories from a URL that takes the parent product category ID as input and outputs HTML in the format needed by treeview. I cannot use PHP and have to make this work with the .click() event. Here's the code that I have: $(document).ready(function(){ function doSomethingWithData(htmldata, id) { var branches = $(htmldata).appendTo("#navigation #"+id+" ul"); $("#navigation").treeview({ add: branches }); } $("#navigation").treeview({ collapsed: true, unique: true, persist: "location" }); $("#navigation li[id]").click(function() { var id=$(this).attr("id"); if ($("#"+$(this).attr("id")+" ul li").size()==0) { $.get('someurl?id='+$(this).attr("id"), function(data) { doSomethingWithData(data, id); } ) } }); }); The problem I'm having is with the click-event. When clicking on cat 1.1. to extend it one level deeper, it still returns the ID of the top level product category. How can I change the click events so that it will return the ID of the clicked <LI> instead of the top one? If the product category does not have any sub-categories, how can I remove the <UL></UL> and thus inidcating that the tree cannot be expanded any further?

    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

  • builtin iphone popups handling

    - by Filthy Night
    Good Day! I have a question regarding iphone development. i am building an app for iphone which uses gps, i can tackle the gps from my app via alert that whether user wants to use gps or not. as you know when it will try to use gps, iphone's built in gps will ask as well whether to allow it to use or not. so here is my question that how can i know that user clicked the iphone's built in pop up because i am showing "Gps not working" alert on failure. so how can i let alert popup when only gps is not working and not when the user clicks "he does not want to use gps"

    Read the article

  • How to avoid an HttpException due to timeout

    - by Dan
    I'm working on a website powered by .NET asp/C# code. The clients require that sessions have a 25 minute timeout. However, sometimes the site is used, and a user stays connected for long periods of time (longer than 25 mins). Session_End is triggered: protected void Session_End(Object sender, EventArgs e) { Hashtable trackingInformaiton = (Hashtable)Application["trackingInformation"]; trackingInformaiton.Remove(Session["trackingID"]); } The user returns some time later, but when they interact with the website, they get an error, and we get this email notification: User: Unauthenticated User Error: System.Web.HttpException Description: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request... The telling part of the stack trace is System.Web.UI.Control.AddedControl. Apparently, the server has thrown away the session data, and is sending new data, but the client is trying to deal with old data. Hence the error that "the control tree into which viewstate is being loaded [doesn't] match the control tree that was used to save the viewstate during the prevoius request." So here's the question. How can I force instruct the user's browser to redirect to a "you're logged out" screen when the connection times out? (Is it something I should add to the Session_End method?)

    Read the article

  • Getting a parse error when trying to send email using Zend Mail? Why?

    - by Ali
    Hi guys for some weird reason I'm unable to send email using zend mail :( - I keep getting the following error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /home/fltdata/domains/fltdata.com/public_html/admin/g-app/includes/mailer.php on line 77 Below is my code: if($_POST): $fields = array('to', 'cc', 'bcc', 'subject', 'body'); $req_fields = array('to', 'subject', 'body'); foreach($fields as $vv) { if( ($_POST[$vv]=='')&&(in_array($vv, $req_fields)) ): $errors[$vv] = strtoupper($vv.' is required'); else: $$vv = $_POST[$vv]; endif; } if(count($errors)==0): $to = explode(',', $_POST['to']); $cc = explode(',', $_POST['cc']); $bcc = explode(',', $_POST['bcc']); //check if the emails are valid foreach($to as $one_email) { if(!is_valid_email($one_email)): $errors['to'].= $one_email.' is not a valid email<br/>'; endif; } foreach($cc as $one_email) { if(!is_valid_email($one_email)): $errors['cc'].= $one_email.' is not a valid email<br/>'; endif; } foreach($bcc as $one_email) { if(!is_valid_email($one_email)): $errors['bcc'].= $one_email.' is not a valid email<br/>'; endif; } endif; if(count($errors)==0): $config = array( 'auth' => 'login', 'username' =>$current_dept->email, 'password' => $current_dept->email_psd ); $transport = new Zend_Mail_Transport_Smtp($current_dept->outgoing_server, $config); Zend_Mail::setDefaultFrom($current_dept->email, _get_session('name')); Zend_Mail::setDefaultReplyTo($current_dept->email); $mail = new Zend_Mail(); $mail->addTo($to); if(count($cc)>0) $mail->addCc($cc); if(count($bcc)>0) $mail->addBcc($bcc); $mail->setSubject($subject); $mail->setBodyText($body); try{ ($mail->send($transport)); } catch($e){ // this is line 77 but wheres the error? echo 'OUCH'; } endif; endif; The line which the parser states only has a catch statement - wheres the error here please help

    Read the article

  • Custom SSL handling stopped working on Android 2.2 FroYo

    - by Eric
    For my app, Transdroid, I am connecting to remote servers via HTTP and optionally securely via HTTPS. For these HTTPS connections with the HttpClient I am using a custom SSL socket factory implementation to make sure self-signed certificates are working. Basically, I accept everything and ignore every checking of any certificate. This has been working fine for some time now, but it no longer work for Android 2.2 FroYo. When trying to connect, it will return an exception: java.io.IOException: SSL handshake failure: I/O error during system call, Broken pipe Here is how I initialize the HttpClient: SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", (trustAll ? new FakeSocketFactory() : SSLSocketFactory.getSocketFactory()), 443)); client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams); I make use of a FakeSocketFactory and FakeTrustManager, of which the source can be found here: http://code.google.com/p/transdroid/source/browse/#svn/trunk/src/org/transdroid/util Again, I don't understand why it suddenly stopped work, or even what the error 'Broken pipe' means. I have seen messages on Twitter that Seesmic and Twidroid fail with SSL enabled on FroYo as well, but am unsure if it's related. Thanks for any directions/help!

    Read the article

  • Call a non static methode in a static SQLiteDatabase class

    - by Fevos
    i want to display a msg to the user (msg box or Toast) when exception happend in a static SQLite Database class that i use. the proplem is that i cant call a non static methode in a static class , how can i handle this. this is the class private static SQLiteDatabase getDatabase(Context aContext) { and i want to add something like this in the class when exception happen but context genertae the problem of reference to non static in static class. Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show();

    Read the article

  • Access Error when running windows program

    - by JPJedi
    I have a windows form application that uses microsoft access for the database on the backend. When I run that application I get an error that says access is not installed on the computer. I thought that if I included the reference that it will be included with what I release so the user would not have to have access installed. How do I include the Access Runtime to be distributed/installed when my application is installed?

    Read the article

  • How to tell Java SAX Parser to ignore invalid character references?

    - by Epaga
    When trying to parse incorrect XML with a character reference such as &#x1, Java's SAX Parser dies a horrible death with a fatal error such as org.xml.sax.SAXParseException: Character reference "&#x1" is an invalid XML character. Is there any way around this? Will I have to clean up the XML file before I hand it off to the SAX Parser? If so, is there an elegant way of going about this?

    Read the article

  • how to catch ajax query post error?

    - by TTCG
    I would like to catch the error and show the appropriate message if the ajax request fails. My code is like the following, but I could not manage to catch the failure ajax request. function getAjaxData(id) { $.post("status.ajax.php", {deviceId : id}, function(data){ var tab1; if (data.length>0) { tab1 = data; } else { tab1 = "Error in Ajax"; } return tab1; }); } I found out that, "Error in Ajax" is never executed when the Ajax request failed. How to handle the ajax error and show the appropriate message if it fails? Thanks very much.

    Read the article

  • MPI signal handling

    - by Seth Johnson
    When using mpirun, is it possible to catch signals (for example, the SIGINT generated by ^C) in the code being run? For example, I'm running a parallelized python code. I can except KeyboardInterrupt to catch those errors when running python blah.py by itself, but I can't when doing mpirun -np 1 python blah.py. Does anyone have a suggestion? Even finding how to catch signals in a C or C++ compiled program would be a helpful start. If I send a signal to the spawned Python processes, they can handle the signals properly; however, signals sent to the parent orterun process (i.e. from exceeding wall time on a cluster, or pressing control-C in a terminal) will kill everything immediately.

    Read the article

  • Handling file renames in git

    - by Greg K
    I'd read that when renaming files in git, you should commit any changes, perform your rename and then stage your renamed file. Git will recognise the file from the contents, rather than seeing it as a new untracked file, and keep the change history. However, doing just this tonight I ended up reverting to git mv. > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # Rename my stylesheet in Finder from iphone.css to mobile.css > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # # Changed but not updated: # (use "git add/rm <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # deleted: css/iphone.css # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # css/mobile.css So git now thinks I've deleted one CSS file, and added a new one. Not what I want, lets undo the rename and let git do the work. > $ git reset HEAD . Unstaged changes after reset: M css/iphone.css M index.html Back to where I began. > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # Lets use git mv instead. > $ git mv css/iphone.css css/mobile.css > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # renamed: css/iphone.css -> css/mobile.css # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: index.html # Looks like we're good. So why didn't git recognise the rename the first time around when I used Finder?

    Read the article

  • Inline-editing: onBlur prevents onClick from being triggered (jQuery)

    - by codethief
    Hello StackOverflow community! I'm currently working on my own jQuery plugin for inline-editing as those that already exist don't fit my needs. Anyway, I'd like to give the user the following (boolean) options concerning the way editing is supposed to work: submit_button reset_on_blur Let's say the user would like to have a submit button (submit_button = true) and wants the inline input element to be removed as soon as it loses focus (reset_on_blur = true). This leads to an onClick handler being registered for the button and an onBlur handler being registered for the input element. Every time the user clicks the button, however, the onBlur handler is also triggered and results in the edit mode being left, i.e. before the onClick event occurs. This makes submitting impossible. FYI, the HTML in edit mode looks like this: <td><input type="text" class="ie-input" value="Current value" /><div class="ie-content-backup" style="display: none;">Backup Value</div><input type="submit" class="ie-button-submit" value="Save" /></td> So, is there any way I could check in the onBlur handler if the focus was lost while activating the submit button, so that edit mode isn't left before the submit button's onClick event is triggered? I've also tried to register a $('body').click() handler to simulate blur and to be able to trace back which element has been clicked, but that didn't work either and resulted in rather strange bugs: $('html').click(function(e) { // body doesn't span over full page height, use html instead // Don't reset if the submit button, the input element itself or the element to be edited inline was clicked. if(!$(e.target).hasClass('ie-button-submit') && !$(e.target).hasClass('ie-input') && $(e.target).get(0) != element.get(0)) { cancel(element); } }); jEditable uses the following piece of code. I don't like this approach, though, because of the delay. Let alone I don't even understand why this works. ;) input.blur(function(e) { /* prevent canceling if submit was clicked */ t = setTimeout(function() { reset.apply(form, [settings, self]); }, 500); }); Thanks in advance!

    Read the article

  • Handling empty UITableView in UITableViewController

    - by Travis
    I have a UITableViewController that is populated with some data. If the data comes back empty, obviously the table is empty. What is the appropriate method to use to handle this case and put up something like a UILabel with "No Data Available". I have been using - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section but it's proven a bit cumbersome and I'm not longer confident it's the best place to do this.

    Read the article

  • JAXB boolean handling oddities and JSF

    - by finrod
    There is a known bug in JAXB: https://jaxb.dev.java.net/issues/show_bug.cgi?id=733 JAXB does not properly generate boolean field getters and setters, this bug is left unfixed for backwards compatibility. A JAXB plugin exists and will ensure that the following getters and setters for boolean fields are generated: setXXX(Boolean value) is generated getXXX() is generated If the boolean attribute specifies default value in the XSD, then getXXX() returns boolean, If the boolean attribute does not specify default in the XSD, then getXXX() returns Boolean. Problem: trying to edit/view the XXX field in a JSF component (such as checkbox) does not work - the component is disabled. I have not traced this in depth but the assumption (backed by the workaround below) is that JSF EL resolver (or whathaveyou) looks for Boolean getXXX() method and since it does not find it, the component is disabled. Workaround: If I change the getXXX() method to always return Boolean, then everything goes. Questions: What are your ideas to address this problem? Have I missed some customization for the boolean-getter JAXB plugin? Is it possible (does it make sense) to alter JSF resolver (or whathaveyou) so that if Boolean getXXX() is not found, it will fall back to boolean getXXX()? I would prefer not to manually intervene and change all the generated getXXX() methods to return Boolean instead of boolean.

    Read the article

  • Handling hundreds of actions in Struts2

    - by Roberto
    Hi all, I've inherited a struts 1 web application where, in order to reduce the number of Action classes (I guess this is the reason), lots of actions are mapped inside a single Action class, like: public XXXAction() throws Exception{ actions = new Hashtable(); actions.put("/XXX/main/load", new Integer(0)); actions.put("/XXX/main/save", new Integer(1)); ...... } public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { try { switch (((Integer) actions.get(action)).intValue()) { case 0: loadXXXMain(); break; case 1: ....... and so on (in some Action classes I have almost one hundred of these small actions). Now I'm looking at migrate to struts2 and I would like to have a cleaner and better solution to handle this, maybe without having a single Action class for each of these small classes. What do you suggest? I don't like this solution, but I don't like having hundreds of Action classes.... Thanks! Roberto

    Read the article

  • MouseLeave event in Silverlight 3 PopUp control

    - by AKa
    I want use PopUp (System.Windows.Controls.Primitives.PopUp) control to show some context menu. After mouse leaves, should automatically close. But eventhandler for MouseLeave is never executed. Why? SAMPLE: void DocumentLibrary_Loaded(object sender, RoutedEventArgs e) { DocumentLibraryDialog documentLibraryDialog = new DocumentLibraryDialog(); _popUpDocumentLibraryDialog = new Popup(); _popUpDocumentLibraryDialog.Width = 70; _popUpDocumentLibraryDialog.Height = 20; _popUpDocumentLibraryDialog.MouseLeave += new MouseEventHandler(_popUpDocumentLibraryDialog_MouseLeave); _popUpDocumentLibraryDialog.Child = documentLibraryDialog; } void _popUpDocumentLibraryDialog_MouseLeave(object sender, MouseEventArgs e) { Popup currentPopUp = (Popup)sender; if (currentPopUp.IsOpen) (currentPopUp.IsOpen) = false; } Regards Anton Kalcik

    Read the article

  • Best way to implement try catch in php4

    - by rgz
    What is the closest you can get to a try-catch block in php4? I'm in the middle of a callback during an xmlrpc request and it's required to return a specifically structured array no matter what. I have to error check all accesses to external resources, resulting in a deep stack of nested if-else blocks, ugly.

    Read the article

  • Handling database failover for Rails applications on FreeBSD

    - by bianster
    I'm working on implementing database (Postgresql) failover for a Rails app that runs with Passenger/FreeBSD. Due to certain constraints regarding the server OS, it's necessary to continue using FreeBSD (as opposed to say, Ubuntu). I'm finding it to be quite a challenge to have failover handled within the Rails application, by way of a customised database adapter due to the fact that this application will be load-balanced between several webservers, and the multiple Rails processes that Passenger spawned in each webserver. I previously looked at setting up Pacemaker/Corosync to manage database server failover on a common IP but unfortunately I wasn't able to get past building the packages on FreeBSD. It does work rather well on Ubuntu 10.04 but I'm not likely to be able to use Ubuntu due to the OS constraints. I'm considering a custom witness daemon that simply pings the primary DB server, and this witness daemon switches all the webservers to the standby DB server when the primary becomes uncontactable (permanently/temporarily), to avoid split-brain. Though I would really like to know if there is a way to get Pacemaker(or something similar) to do the switch on FreeBSD.

    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

  • handling multiple Aspects in AspectJ

    - by rajank
    I have a query, when im using multiple Aspects in my aop.xml. here's the problem. i have defined some <include> and <exclude> in my <weaver>. i have 3 aspects in my aop file. i need to define a specific <include> and <exclude> for each aspects. how it is possible. Thanks in advance.

    Read the article

  • Handling multiple sessions for same user credentials and avoiding new browser window opening in my w

    - by Kabeer
    Hello. I want to handle following scenarios in my new web application. If multiple users log into the application with same credentials, the application should deny access. Since I have out of process session store, I would be able to make out when this situation happens. So I can deny all requests after first successful attempt. This will however not work if the user instead of logging out of the application, closes the browser. The session will continue to reflect in the store for the period of timeout value. If a user attempts to open a new browser windows (Ctrl+N), the application should defeat this attempt. Every new page can potentially fiddle with cookies. I want to therefore deny the users the ability to open new window.

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >