How to force return?

Hi
can I force a function to return after specified time interval, without end of normal execution reached? (this can be useful when the function is in blocking state )....
Thanks

Hi
can I force a function to return after specified time
interval, without end of normal execution reached?
(this can be useful when the function is in blocking
state )....
Do you just want to terminate it?
Then closing the resource that it is blocked on would do the trick. Or interrupting it. As suggested above a seperate thread is normally going to be needed for this.
However that only works if is is actually blocked on a resource. If it isn't then the above will have no impact.
And in neither case would it necessarily cause a 'return' but rather an exception. You can catch the exception though and deal with it that way.
Some resources already have timeout mechanisms so you might want to consider that as well.

Similar Messages

  • How to control the force return in table cell data?

    I have some xml format files.When I import them into FrameMaker,They display as table data.but when the data is very long in table cell,I want to control the new line by myself.for example,I add some \r\n in my xml file data,then in FrameMaker,It can identify the \r\n, force return.In framemaker I don't know the actual symbol that means the newline.How Can I deal with the problem?thank you!

    Hi Russ,
    yes, but you have to agree that forcing a return in the SOURCE content is really not a wise thing to do - It would be better to break the content into multiple paragraphs or used an XSLT to determine the column width and insert your own breaks in a version of the XML for rendering in Frame. If, at a later date, your templates in Frame change to allow wider columns in your table, then you'd have to go back into the source code and change every occurrence of the c/r in the data - Yeuch! Better to transform the data once, before importing into Frame and then if the col-width changes it is a simple task to change the width in the XSLT - personally, I would make sure the EDD and DTD allows multi-lines in the table cell and then break-up the data to fit the table cell size in an XSLT before importing. Then you don't taint your source code...and it is quite easy to do this is an XSLT...

  • IDVD 08 is a bummer. How do I return to an older version?

    I had iLife 04 on my Mac for ages, but I just bought and installed iLife 08.
    Mistake!
    IDVD 08 will not open any of my old iDVD projects; it just sits there with the beachball spinning or doing nothing at all. All the old projects now have the blue and white iDVD 08 icon, but they don't open. Likewise "Open Previous Project" doesn't work.
    So, I attempted to recreate some of my old projects in iDVD 08 by dumping the Quicktime movies that were originally used to create the old iDVD 4 projects (QuickTime movies that were exported from Final Cut Express), but I can't seem to drag and drop them into iDVD's background like I could with iDVD 4. When I drag the icon of the QT movie over into iDVD's window, the + sign does not appear, indicating that it's ready to drop, and when I let go of the mouse button, the QT movie's icon returns to the folder where the file resides.
    Most of the time, when trying to open or create any project, iDVD just sits there with its beachball spinning, or does nothing at all, so that I have to force-quit it (and then I trash the .plist).
    This version of iDVD seems like a real bummer. I can't get it to do anything.
    How do I return to iDVD 4? Can I Trash iDVD 08 and then reinstall iDVD 04 from the iLife 04 DVD?
    Tom

    Very rarely do I recommend reverting to an older version of iLife once the current version is already installed. But in your own situation, perhaps this is best ..... given the fact apple's iLife'08 isn't intended for a G4. You need a G5 or better for iMovie apparently within iLife 08. iDVD's system requirements call for at least a G4 733. But I haven't seen anyone post on this iDVD forum who has the latest version of iDVD successfully running on a G4.
    Use the following app at your own risk to remove iDVD:
    http://appzapper.com/
    Good luck!

  • How to force digital input sample rate?

    Does anyone know how to force a Digital Input sample rate and/or tell Core Audio which conversion clock to use... internal or external? Apparently both things can be done from Pro Tools, but I don't have it.  My problem is locking onto an A/D converter's 48K Toslink output.  I can set 48K in 'Audio - Midi' setup and the audio is perfect, but a few seconds later  Core Audio returns to the default 44.1K.  I need to force it to stay at 48K, or clock on the signal rather than internal clock.

    Braver,
    Let me clarify a few things. First, the 6733 supports correlated digital I/O. This means that the digital operation does not have its own clock. You can correlate the digital operation with the AO clock, which will allow a digital operation up to the max AO rate. You can generate a pulse train with an onboard counter and use that as your digital clock source. Also, you can use a completely external clock source to achieve the max digital rate of 10MHz. The knowledge base, linked below, points you to a couple of examples that ship with LabVIEW. Be sure and read the documentation associated with each example.
    Knowlege Base
    As for
    the example CDI Single Point clocked by Counter (E).vi, notice how the output of...

  • Forced return, non-breaking hyphens & spaces, suppress hyphenation + XML

    Forced return (linefeed), non-breaking hyphens and spaces, suppress hyphenation.
    None of these are preserved when exporting from FrameMaker to XML, since they do not seem to be represented by a Unicode code point. My question to you is: How do you deal with those things in XML?
    The last issues (non-breaking and suppress hyphen) have recently been brought up in:
    http://forums.adobe.com/thread/450363
    http://forums.adobe.com/thread/459503
    Forced return is a common thing in many FrameMaker documents to improve readability of certain phrases.
    For export of FM to XML, there have been proposals to use a special element with a prefix just to capture the special FrameMaker symbol. It works, and may be a valid useful path in certain cases, but I think that it is a questionable way of dealing with it for several reasons:
    It is only relevant for roundtrip, since these special elements will hardly be interpreted by other XML tools, which of course limits the value of XML export.
    It is unwieldy, to say the least, to require the user to insert special elements for saying simple things that otherwise are just natural key strokes in the regular text flow, and which are not perceived as structural elements of information. Most users would think of these symbols/charactes as control characters, and there is no validation warning that says you may not use these characters/symbols.
    An element is used for formatting purposes only, whereas all other elements are used for content or structure.
    There is no automatic way of transforming an existing text that has these "symbols" into some special element when a document is structured with a conversion table.
    There is no automatic way of transforming a structured FM document to XML such that these special "symbols" get translated to some suitable XML construct.
    If the last point could be solved, i.e if all those control characters or markers could automatically be translated to a suitable XML representation, then I would consider the whole issue as solved, otherwise not.
    Even without FrameMaker, how do people deal with these things in "pure xml". For instance, when XML is used for publishing (which I know Arnis Gubins is doing), there will guaranteed be a need to control both hyphenation and line breaks. So how do you (they) do that?
    How do other vendors cope with these issues, e.g XPP?

    Lynne,
    As anyone can see, entity declarations have not really been in the domain of my expertise (understatement), but I might just learn bits and pieces...
    Thanks! I have now done some more reading in various pdfs, such as scructapps etc, but also the w3c xml spec, all of which I have "read" before, but reading is not always the same as understanding...
    I now have used the "entity approach" to make both discretionary hyphen and suppress hyphen work, so that it is represented in the XML export and round-trips just fine.
    Forced return still puzzles me somewhat though: I have a working solution for that using the same entity approach, but it will not work for text ranges (although it is a bit odd to have forced returns in text range elements). Moreover, I am not certain that it really is the best way. In reading other posts on this issue, I have seen that some people want forced returns to really be linefeeds in the xml output, with no other linefeeds, and conversely, when importing xml that are "formatted" in lines, such as code, they want to preserve that.
    One  way to achieve that is to use:
         reader line break is forced return;
         writer line break is 1000 characters;  (or more characters)
    Then it is completely symmetric (i.e works also if some other app has generated the xml with intentional line breaks. And this method is global for all elements, and it works for me.
    Another way to achieve this is to use the following, but it is only valid inside an element:
         preserve line breaks;
         writer line break is 1000 characters;
    Then it is also completely symmetric (in the above sense), and it works for me.
    The latter method has the drawback that it only works for text in the element; it is not inherited to its children.
    But if we look at only one element, what is the difference between the two methods?
    As far as I have been able to see, the results are identical! Why two methods? The first one seems more powerful and general(?)
    Scrutinizing the documentation though, it says that 'preserve line breaks' will add an attribute 'xml:space', but I can't see that in my output?
    Also, concerning the documentation for line break, it says that FM would ignore line breaks when exporting, but it does NOT do that (fortunately). Forced returns always result in linefeeds, no matter what.
    I would be thankful if these issues could be explained, or elaborated.
    Also, would you recommend against any of these methods?
    With my preferred method of using the global 'reader line break is forced return' instead of a local (or many local) 'preserve line breaks', there is of course the danger that when importing xml, it is absolutely necessary that the xml really only has line breaks where they are intended, and not generated every 80 characters or so!
    Is there anything that says it is "ugly" or "bad style" to honor line breaks, and generate long lines?
    Finally, why do we need to limit the number of characters written in one line these days? Why 80, why 1000, why not an unlimited number of characters!?
    Will software these days really crash if given a very long line (assuming that it doesn't exceed total ram memory of course)?
    Sorry about so many questions, but I can't find any answers to them in the docs I have read and searched.

  • I am college student and my professors require we use Turnitin however Turnitin does not support Firefox 4 how can I get it to work with Firefox 4 or how can I return to Firefox 3

    Turnitin will not work with firefox 4 how can I return to firefox 3 or how can I get firefox 4 and Turnitin in sync

    The Turnitin system requirements on mention Firefox 3. If it does not support Firefox 4 you can downgrade to Firefox 3.6
    To downgrade to Firefox 3.6 first uninstall Firefox 4, but do not select the option to "Remove my Firefox personal data". If you select that option it will delete your bookmarks, passwords and other user data.
    You can then install the latest version of Firefox 3.6 available from http://www.mozilla.com/en-US/firefox/all-older.html - it will automatically use your current bookmarks, passwords etc.
    To avoid possible problems with downgrading, I recommend going to your profile folder and deleting the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Deleting these files will force Firefox to rebuild the list of installed extensions, checking their compatibility, and reset toolbar customizations.
    For details of how to find your profile folder see https://support.mozilla.com/kb/Profiles

  • XML for Forced Return

    I use XSLT to create XML documents to be opened in FrameMaker and converted to structured documents. I have one element (called SyntaxPara) in which I'd like multiple lines separated by forced returns, as indicated by "{" symbol in the document (or \r in the Find/Change dialog). Anybody know what the XML coding would be to specify a forced return? I cannot seem to nail it down. I need to do this because my structured template is supporting styles used with unstructured FrameMaker, and that happens to be how they're doing it. Thanks,

    John,
    I do not know what the Kosher XML method is, but you can define an element in your EDD, say Break, which has no content or attributes. The EDD defines its formatting as character formatting and a prefix or suffix that is the return character, namely \r. Note that this requires an update to your EDD. Your XSLT would then translate the XML object that indicates a break into the element Break.
    Van

  • Just upgraded my 3GS to OS5. AoK. But audio spelling assistant is now MALE!  How can I return to the lady voice for spelling suggestions? thanks for any suggestions.

    Just upgraded my 3GS to OS5 - AoK But spelling assistant is now MALE!
    How can I return to the lady's voice for spelling  suggestions?  - should be possible?
    Thanks.

    Just to close out ... the 'supervisor' was clueless as it turns out.  Apple does NOT have a deal with UPS on handling the Mini, so the person who gave me the info was wrong.  Did he call back?  No ... he just let me go out and find out myself.
    So I called again, and this time eventually ended up with a manager, who told me that the UPS Store thing wouldn't work, but that a box would arrive and then there would be a 'forced replacement'.
    About 10 minutes later he called back and said he discovered that EVERYTHING the supervisor did was wrong ... he didn't actually properly flag for auto-replace, so I would have gone through an identical cycle again!  So he had to restart the whole process, meaning I would get TWO 'coffins', but that I would then get an auto-replacement and would see that indicated in my support email.
    I got the email, saw 'auto-replace'.  Got the box on the 28th and immediately turned it around.  Apple got the box on the 31st, and on the 1st I got emails that my Mini would arrive on the 2nd and it also had the new serial #.
    Yesterday I grab the box from FedEx and go home to check it out.  As expected, it IMMEDIATELY worked on my WiFi without issue ... and has worked perfectly since.
    So ...
    - it was NOT my home network.
    - it WAS a hardware issue with the Mini
    - Apple does NOT do proper testing on the Mini to detect what appears to be a fairly common issue.
    - non-retail customers ARE treated as second-class by support.
    This issue took FOUR WEEKS to resolve, involved FOUR shipments back & forth, and the ONLY reason it got resolved was that *I* did the troubleshooting that Apple either would not or could not do.
    For someone who has been an Apple customer for more than 30 years, this has been a sobering experience ... I quite frankly expected much better from them.

  • How can I return in a native method a Java type?

    Hi,
    i want to return in the native methode ja Java type java.awt.Dimension!
    How can I do this?
    Java code:--------------------------------------------------------------------------------
    public native java.awt.Dimension getSize()
    generating the JNI header file
    JNI header code:--------------------------------------------------------------------------------
    JNIEXPORT jobject JNICALL Java_Video_getSize(JNIEnv *, jobject)
    my c function looks like this
    code:--------------------------------------------------------------------------------
    JNIEXPORT jobject JNICALL Java_Video_getSize(JNIEnv *env, jobject obj)
    return ???????
    how can I return in C an object like jawa.awt.Dimension?
    Thx
    Ronny

    Here is my 2 cents for a way we pass data between Java and C via the Java Native Interface. This excerpt is an example of passing an int value through a locally created Integer wrapper class, which must be adapted for local use. Note that because of the wrapper, return values are not needed.
    1. Create the Java class file.
    * This class encapsulates a Java <CODE>int</CODE> primitive.
    * This class was created to allow programmers to change
    * the value of an existing integer object without being
    * forced to create a new object (as is the case with the
    * Java Integer object).
    public class LocalInteger
         private int     value;
         * Creates a LocalInteger object and initializes
         * it to <I>0</I> (the default in Java).
         public LocalInteger ()
              super ();
         * Creates a LocalInteger object and initializes
         * it using the given <I>int</I> value.
         * @param i Integer value to use in initializing
         * the object.
         public LocalInteger (int i)
              super ();
              value = i;
         * Gets the value of the object.
         * @return The value of the object.
         public int getValue ()
              return (value);
    2. Create the jni header file.
    DLL_EXTERN void jni_GetValue_from_LocalInteger(int* LocalInteger, JNIEnv *env, jobject thisLocalInteger);
    3. Create the C file.
    /*start of jni header****************************************
    *NAME/TITLE:       jni_GetValue_from_LocalInteger
    *DESCRIPTION:      This routine copies the integer value
    * from the Java LocalInteger object to the
    * C 'int' variable.
    *CALLING SEQUENCE: jni_GetValue_from_LocalInteger (LocalInteger,
    * env,
    * thisLocalInteger)
    *PARAMETERS:
    * Type Name I/O Description
    * int * LocalInteger I/O C variable
    * JNIEnv * env I JNIEnv pointer
    * jobject thisLocalInteger I Java object
    *RETURN:           N/A
    **end of header*********************************************/
    /* ********************** BEGIN CODE ********************** */
    DLL_EXPORT
    void jni_GetValue_from_LocalInteger(int* LocalInteger, JNIEnv *env, jobject thisLocalInteger)
         LocalInteger = (int) (env)->GetIntField(env, thisLocalInteger, LocalInteger_Value);

  • How to force refresh of data through browser or PDF?

    We have the dashboard set to refresh every minute.  We are pulling the data using XML from DB.  When we are in browser and clear the browser cache and then reload the .swf... the data is updated.  We haven't been able to figure out how to force the cache-clear and data refresh with either swf or pdf.
    Your help is greatly appreciated.

    Hi Jeff,
    Is the XML coming from a web page or a web server?
    If yes then you can give this a go. To stop the caching mark your web page with extra tags to say it has expired.
    HTML page example:
    <HEAD>
        < META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE" />
        < META HTTP-EQUIV="EXPIRES" CONTENT="0" />
    </HEAD>
    JSP example:
    <%
      // Stop Internet Explorer from caching the results of this page.
      // We do this so that every time Xcelsius calls this page it see the latest results.
      response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
      response.setHeader("Pragma","no-cache"); //HTTP 1.0
      response.setDateHeader ("Expires", 0); //prevents caching at the proxy server 
    %>
    Regards,
    Matt

  • How can I return my ipad 1 to pre OS5?

    how can I return my ipad 1 to pre OS5?
    Ive been reading the forums all over the place to find the solution to my ipad 1 continually crashing. it does it mainly in safari and the app store.
    Its really annoying when you're halfway through composing a long e-mail message and it just reverts back to the home screen.
    I'm perfectly happy to give up the advantages of IOs 5, because I would rather have a stable machine (like it used to be) than use the cloud and multitasking. (I don't use them anyway). I know that some of my apps might stop working but its more important to me that the basics work.
    cheers
    Andy

    You cannot downgrade the iOS.  Once you upgrade, you're stuck with it.
    Part of your problem is that your iPad is old and it probably having difficulty keeping up with the data and protocols for the newer software.  It's probably time to send a note to Santa. 

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • How do I return two values from a stored procedure into an "Execute SQL Task" within SQL Server 2008 R2

    Hi,
    How do I return two values from a
    stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
    Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
    Something like ?
    CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
    @intPeriod INT,
    @strPeriod_Length NVARCHAR(1),
    @dtStart NVARCHAR(8) OUTPUT,
    @dtEnd NVARCHAR(8) OUTPUT
    AS
    then within the SSIS component; -
    Kind Regards,
    Kieran. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
    Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
    Add a script task to check ssis variables values using,
    Msgbox(Dts.Variables("User::strExtractStartDate").Value)
    Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
    Regards, RSingh

  • How do I return an unopened refurbished iBook for a complete refund?

    I ordered a refurbished 14 inch ibook a while ago and it has been sitting in an unopened box ever since. It cost about $1050. I bought this before the new intel MacBook's came out, and now that they are out, they are much better than the ibook's. Plus the iBook 14 inch is a weird ratio.
    How would i return my unopened ibook for a complete refund and only pay like 50 bucks more for a new macbook?

    Welcome to Apple Discussions!
    It depends on the store you bought it from. Read the policies of the store you bought it from, if they are posted on the web. Your "awhile ago" doesn't tell us anything about the number of days. If you have no idea when you bought it, but bought it by credit card, you can usually call the store and ask them with your credit card number to verify when that was. Most stores I've seen have a time limit on returns. Some do not accept refurbished products back. It is best to check with the individual store.

  • I just updated iOS on my iPhone 5. What a shock!! Where is the premium look and feel I bought my iPhone for? If I wanted the lokale feel of iOS 7.0 I would have bought a much cheeper taiwanese smartphone. Please let me know how I can return to the origina

    I just updated iOS on my iPhone 5.
    What a shock!! Where is the premium look and feel I bought my iPhone for?
    If I wanted the lokale feel of iOS 7.0 I would have bought a much cheeper taiwanese smartphone.
    Please let me know how I can return to the original look and feel of the iPhone surface I bought my phone for.

    You had plenty of time to look at screenshots on the internet and read various blog posts about iOS 7.

Maybe you are looking for

  • I want to create my own playbar in flash. How to install?

    Hi, I'm running cp7. I want to write my own playbar in flash and have it show up in the skin editor so I can choose it. I created one with a .swf extension and put it in the playbar folder, but I still can't see it in the skin editor. Suggestions? Th

  • My iphone 3g wifi doesnt work and it doesnt show any networks

    my iphone 3g wifi is not working please help!! aqnd as well i cant see any networks list on it i am using 4.2.1 software on iphone

  • HT4356 What is the best printer for the iPad 2 with AirPrint?

    What HP printer has Airprint instaled?

  • Can I use a 5G with OS 10.2.8?

    The system requirements section notes you must have OS X 10.3.9. Don't I have to buy the new OS in order to move up beyond 10.2.x? And, does that mean I can't purchase a 5G iPod to use with my current computer setup? And as it is, I'm pretty apoplect

  • Policy Nat ASA 8.6(1)

    Going from a Pix 515E to an ASA 5515 and trying to mirror the configuration.  I believe I have most of it correct, but this one issue persists that I'm trying to get resolved.  There are a number of vpn tunnels that terminate on the Pix and on some o