What function does this code do?

((l = html.indexOf("<META")) != -1)

I guess your question is not directed at the indexOf method of the String object, which returns the position of the String passed to the method within the String on which the methode is executed, with 0 being the position of the first character in a String and a negativ value indicating, that the String passed is not included at all.
Rather your question is regarding the
((l=html.indexOf("...."))!=-1)
This is a construct you will find fairly often in java .
The = operator assigns the value returned by html.indexOf("...") to the variable l . The term (l=html.indexOf("....")) itself returns the value of l (that is the point that you were asking for). This value is then compared with != (meaning not equal) to -1.
This is often used in conditions (and loops) to retrieve the value of something assign it to a variable (which can be used later on) and compare it to something else.

Similar Messages

  • What files does this code need?

    I am trying to use this code from Java Examples In A Nutshell.
    It is a short program that involves reading one and writing to another (I think!) The way I understand things is that there has to be two files for the program to be able to run, from_file & to_file . I have attempted to creat two txt files and saved them as these names in the same folder as the app. The code complies as you would expect, when I try to run it I get Usage: FileCopy <source> <destination> and the app never runs. I suspect I have not created the external files properly. If you can see where I have gone wrong let me know, layman's terms please, Dave.

    When running the compiled "FileCopy.class" with java command you must enter the names of files, i.e.;
    java FileCopy "from_file" "to_file"
    in the command line.
    In this case args[0] is "from_file" and args[1] is "to_file."

  • What function does this...

    How would i go about coverting '.750' to '75.0' ? What function do i use here?
    My guess si to_char but how would i apply that here?
    Edited by: user652714 on Apr 3, 2009 7:44 AM

    And a final (?) solution, using the necessary datatype conversions and being language independent. For example, in the Netherlands the decimal symbol is a comma, not a point.
    SQL> select to_char
      2         ( 100 * to_number('.750','999D000','nls_numeric_characters=''.,''')
      3         , '99999D0'
      4         , 'nls_numeric_characters=''.,'''
      5         )
      6    from dual
      7  /
    TO_CHAR(
        75.0
    1 rij is geselecteerd.Regards,
    Rob.

  • What files does this code need part II?

    This is a continuation of a question asked earlier today http://forum.java.sun.com/thread.jsp?forum=54&thread=321833 . I now have been able to run this app & it seems okay. But I am confused as I expected the to_file to be overwritten by the from_file.
    However when I check text files they appear to be the same as they were at first. Why? Dave.

    Try again after deleting the "to_file" or use another name for the output file.

  • I have just tried to sync my iphone. Error message saying it cannot be synced has popped up quoting error code (-50). I have just removed old iphone backups from itunes but was very careful to not delete the current one. What does this code mean?

    Hi there,
    I have just tried to sync my iphone.
    Worryingly an error message saying it cannot be synced has popped up quoting error code (-50)
    I have just removed old iphone backups from itunes but was very careful to not delete the current one
    What does this code mean?

    http://support.apple.com/kb/TS1583

  • What does " this code must be redeemed in the Australian storefront " mean? And how can I fix it?

    What does " this code must be redeemed in the Australian storefront " mean? And can I fix it?

    All iTunes gifts and gift cards are country-specific, they can only be redeemed and used in their country of issue. Are you in Australia with an Australian billing address on your account ? If you are then try going to the bottom of the Featured tab in the App Store app on your iPad and tap on your account id, tap on 'View Apple ID' on the popup and log into your account, and then select the Country/Region section and select Australia.
    If you are not in Australia then you won't be able to use it.

  • Which function does this?.

    I have to do something like this......
    How will i pass values to second query like this...
    where empid in (1001,1002,1003,1005)
    Which function does this....?. Please help me.
    lost track of features of functions......done this 100 times
    before....now not working.
    Please help me ASAP. Thanks in advance.
    <cfquery name="id_sel" datasource="#edsn#">
    select empid
    from employee
    where age < 50
    </cfquery>
    <cfquery name="course_sel_q" datasource="#edsn#">
    select benefit_desc
    from benefits
    where empid in (<cfloop query="id_sel" startrow="1"
    endrow="#id_sel.recordcount#">
    #valueList(id_sel.empid,",")#</cfloop>)
    order by empid
    </cfquery>

    quote:
    Originally posted by:
    jdeline
    You're making it too complicated. See code below. It creates
    a comma-delimited list for use in your WHERE clause.
    Edit: fixed bad ValueList)( ).
    Too complicated? It's a simple join for goodness sakes. It's
    also more efficient because it only uses one trip to the database
    to get the data.

  • To what class does this method belong?

    If one sees in the documentation something like
    - (retType *) text1:(Type1 *)aType1 text2:(Type2 *)aType2;
    then to what class does this method belong? I do not see in the Objective-C documentation any way that one can tell without the 'context' in which the method is declared or defined. This makes reading the documentation very difficult (for me). What you see is not what you get. There is stuff missing.
    In my world there is no difficulty in determining the class to which a method belongs. It is stated explicitly in the method name. For example:
    PROCEDURE (self: MyClass) methodName (arg1: Type1; arg2: Type2);
    and one sees that 'methodName' belongs to 'MyClass'.
    In Objective-C how does one know the class to which a method belongs? Is it only determined by context, that is, by the fact that it is within the @implementation section or that it is within the @interface section? If that is the case then I would think that in documentation one should always be required to assert something like:
    <<MyClass>> -(retType *) text1:(Type1 *)aType1 ...
    -Doug Danforth

    PeeJay2,
    I think I now have the distinctions needed but still have a question about what you said. But first here is my current understanding. A "method" is by definition bound to *at least* one class whereas a "message" need not be bound to any class. Hence one can send any message to any class and it will either be handled or ignored. A message looks like a method signature (and maybe one but is not constrained to be one).
    The difference between C++ and Objective-C is that in C++ method calls are not messages sent to a receiver. They are just calls of the method for the dynamically bound object. That method must be syntactically correct at compile time whereas messages need not be syntactically correct for any receiver. At least that is my current understanding.
    Now my question. You state that "casting the receiver of a message will in no way alter the flow of the code". I attempted to test this with a simple program but ran into a problem (see my new posting "Multiple classes in one file?").
    Assume the following
    @class Child : Parent
    Child *child = [[Child alloc] init];
    Parent *parent = [[Parent alloc] init];
    Parent *bar;
    bar = child;
    [bar doSomething]; // (C) call to child's doSomething method?
    [(Parent *)bar doSomething]; // (P) call to parent's doSomething method?
    You comment seems to say that both case (C) and (P) give the same result. If they do then which result is it the parent's or the child's method (assuming that the child has indeed reimplemented the parent's method)? Have I understood you correctly?
    -Doug Danforth

  • I'm trying to sync/back-up apps on my iPhone 3G and iTunes keeps telling me it can't complete the operation because "the apps on my iPhone cannot be determined." What the **** does this mean?!

    I'm trying to sync/back-up apps on my iPhone 3G and iTunes keeps telling me it can't complete the operation because "the apps on my iPhone cannot be determined." What the **** does this mean?!

    Same problem. Wish I knew.
    When I tried to Restore, I got an Error 13xx and it won't even do that.
    not a happy camper if a phone this expensive stops working in 2 years.

  • Consolidate Masters - what exactly does this do?

    Hi all
    I am a relativity new aperture user. every time i import images from my camera, they have the little arrow in the bottom corner to show they are referenced files.
    I can fix this by clicking file>consolidate masters and choose to move or copy them.
    Forgive the basic-ness of this question, but what exactly does this do? And why can't i import them so they are not referenced files?
    thanks again for your help

    I suggest you read the manual for this sort of questions, but anyway, here's a quick answer:
    -consolidate masters moves or copies your images to somewhere withing your library, making them managed instead of referenced.
    -the import dialog, when you connect a card has the option to copy the files to anywhere on your disk, to pictures or to the library (making them managed, and thus not showing the little arrow).
    For the advantages and disadvantages of either, check this forum or again, the manual.
    j

  • HT201210 My iPhone became wet at the beach.  I put it in rice for 4 days.  When I connect to itunes, it says the phone must be restored.  It starts and then gives either the error 2001, or 2006.  What exactly does this mean, and is it worth getting repair

    My iPhone became wet at the beach.  I put it in rice for 4 days.  When I connect to itunes, it says the phone must be restored.  It starts and then gives either the error 2001, or 2006.  What exactly does this mean, and is it worth getting repaired?
    Thank you...

    http://support.apple.com/kb/TS1275
    Water damage isn't covered by warranty, but you could always purchase a refurbished device from Apple. 

  • HT2534 what country does this work for? no such caption as none on the paying option

    what country does this work for? no such caption as none on the paying option

    As far as I am aware it works for all countries. You are following the instructions on that page exactly e.g. it's a new account that you are trying to create and you are selecting a free app in the store and clicking on 'create Apple id' when 'buying' it ?

  • Contest: Guess whats wrong with this code!

    Can you guess whats wrong with this code snippet? Perhaps its too easy...
    private void clearDefaultTableModel( DefaultTableModel dtm) {    
            int  rowCount  = dtm.getRowCount();
            for(int i =0;  i < rowCount; i++) {
                dtm.removeRow(i);  
        }- Karl XII

    Can you guess whats wrong with this code snippet?
    Perhaps its too easy...
    private void clearDefaultTableModel(
    DefaultTableModel dtm) {    
    int  rowCount  = dtm.getRowCount();
    for(int i =0;  i < rowCount; i++) {
    dtm.removeRow(i);  
    it should be
    private void clearDefaultTableModel(DefaultTableModel dtm) {    
       int  rowCount  = dtm.getRowCount();
       for(int i =0;  i < rowCount; i++) {
         dtm.removeRow(0);  
    }or another way
    private void clearDefaultTableModel(DefaultTableModel dtm) {    
      while(dtm.getRowCount()>0){
         dtm.removeRow(0);  

  • Please explain what does this code does exactly

    Can any one explain me what does the below code does.
    This is the code written in one of the BADI (ME_PO_PRICING_CUST) .This badi will be triggered when a sales order delivery address is changed and while saving it this will be triggered. Over all what i come to know is they re trigerring a new version in this code. Can anyone explain me what exactly they are doing in this.Thanks...
    METHOD IF_EX_ME_PO_PRICING_CUST~PROCESS_KOMK.
      FIELD-SYMBOLS: <EKKO> TYPE ANY,
                     <PROCSTAT> TYPE MEPROCSTATE,
                     <FRGKE> TYPE FRGKE,
                     <YNAST> TYPE TABLE,
                     <WA_YNAST> TYPE NAST.
      IM_EKKO-PROCSTAT = 02.
    *break-point.
      ASSIGN ('(SAPLMEPO)EKKO') TO <EKKO>.
      ASSIGN ('(SAPLMEPO)YNAST[]') TO <YNAST>.
      IF <EKKO> IS ASSIGNED.
        ASSIGN COMPONENT 'PROCSTAT' OF STRUCTURE <EKKO> TO <PROCSTAT>.
        ASSIGN COMPONENT 'FRGKE' OF STRUCTURE <EKKO> TO <FRGKE>.
        IF <FRGKE> = 'R'.
          <PROCSTAT> = '02'.
        ENDIF.
      ENDIF.
      IF <YNAST> IS ASSIGNED.
        IF <FRGKE> = 'R'.
          LOOP AT <YNAST> ASSIGNING <WA_YNAST>.
            <WA_YNAST>-AKTIV = 'X'.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDMETHOD.

    r_htkl must be a range table. check the declaration part of it.
    p_htkl is a parameter on selection screen i hope.
    so, there are four fields on a range table.(range table are similar to your select options)
    1. SIGN ( I or E  - Inclusive or Exculsive)
    2. OPTION(options like EQ = euqal, BT = Between, CP = contains pattern etc)
    3. LOW (value)
    4. HIGH (value)
    so..
    IF NOT p_htkl IS INITIAL. " checks if some thing is being passed to the parameter
    r_htkl-sign='I'. " give the sign a value I i.e it make inclusive sign
    r_htkl-option='EQ'. " EQ to option means you value will be checked for a equal to condition
    r_htkl-low=p_htkl. " the low field in now assigned the same value of the parameter p_hktl
    APPEND r_htkl. " the range table is appended.
    endif.
    so this range table can be used in select statements as :
    select * from abcd into gt where xyz in r_hktl. ==> this will check for a EQ condition with value in r_hktl-low in database or
    in if statements like : if abc in r_hktl. ==> this will check the EQ condition of abc with the r_hktl-low.
    Had it been
    r_htkl-sign='E'.
    then the condition is same but with a NOT.. that means NOT EQ or NOT BT etc.
    as exclusive of the option.
    etc.
    hope this is clear.
    AND PLEASE CLOSE THE OTHER THREAD (duplicate)

  • What does this code do? Causing xtra space below Flash

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="538" height="146" id="FlashID4" title="debt solutions">
    I have spaces below every SWF file. But when I remove this - it goes away. (Shows up in FireFox)
    What will happen with this deleted? I don't SEE any visual difference, but not sure what functionality it provides. As always, THanks!

    Hi
    This is the active-x code required for the flash player in IE, removing it will stop the flash working in the IE browser.
    PZ

Maybe you are looking for

  • Adjust brightness on Desktop HP x20LED

    Cannot change brightness setting on monitor,  HP x20LED, On pressing the menu button on front, a small window appears which shows a brightness slider but cant get into the window with cursor to adjust it. There are also manual + and – buttons on fron

  • MS-6970 Bluetooth Dongle

    Hi How do I find out what vendor and product id this stick has? I need those id's to use the donlge with labview. Bye

  • XY Graph Pains

    I took this code from an example.  I hooked up my two data sources and this is what I get.  What now?  The example does NOT use dynamic data sources.  Is this the issue?  Solved! Go to Solution. Attachments: Broken LabView.JPG ‏51 KB

  • Methods of installing tiger...

    So I just picked up a 667 tibook from a friend. My ibook died, logic board problem and this one was sitting around so she gave it to me. I'm trying to do a fresh install of tiger and all I have are the tiger CD's, the four discs. The problem is, the

  • Create Idoc from program

    Hello Friends. I want to create a inbound IDOc from program which has delivery items for IDOC type DESADV01. How can I create an IDOC from program? Regards, RH