Little help with EL: concat static string and databound number

Hi OTN,
I'm a bit stuck with a simple - as I thought - case: concatenating static string and databound number in EL:
I have a deffered expression like:
#{1 != 2 ? ('Number is ' bindings.SomeNumber.inputValue) : 'no number'}
1 and 2 are databound values too but the question is about showing "Number is 5" where 5 is a SomeNumber.
Expression editor shows error on 'Number is'. And the error dissapperars if I remove "bindings.SomeNumber.inputValue".
How can I concatenate them?
Thanks.

Another option for you is to write that formatting logic in a static utility classes that takes parameters to return strings.
Ex.:
*/WEB-INF/utils.tld:*
<taglib xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1" xmlns="http://java.sun.com/xml/ns/javaee">
  <description>utils</description>
  <display-name>utils</display-name>
  <tlib-version>1.0</tlib-version>
  <short-name>utils</short-name>
  <uri>http://biz.com/utils</uri>
  <function>
     <name>getFormattedNumber</name>
     <function-class>com.mybiz.FormatUtils</function-class>
     <function-signature>java.lang.String getFormattedNumber(oracle.jbo.domain.Number)</function-signature>
  </function>
</taglib>And then you use them in your EL expression like this:
page.jspx:_
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:utils="http://biz.com/utils">
  <af:outputText value="#{utils:getFormattedNumber(bindings.Number.inputValue)}"/>
</jsp:root>Better to have many options isn't it?

Similar Messages

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • Need a little Help with my new xfi titanium

    +Need a little Help with my new xfi titanium< A few questions here.
    st question? Im using opt out port on the xfi ti. card and using digital li've on a windows 7 64 bit system,? I would like to know why when i use 5. or 7. and i check to make sure each speakear is working the rear speakers wont sound off but the sr and sl will in replace of the rear speakers. I did a test tone on my sony amp and the speaker are wired correctly becasue the rear speakers and the surrond? left and right sound off when they suppose too. Also when i try to click on? the sl and sr in the sound blaster control panel they dont work but if i click on the rear speakers in the control panel the sl and sr sound off. Do anyone know how i can fix this? So i would like to know why my sl and sr act like rears when they are not?
    2nd question? How do i control the volume from my keyboard or from windows period when using opt out i was able to do so with my on board? sound max audio using spidf? Now i can only control the audio using the sony receiver.
    Thank you for any help..

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • Need a little help with syncing my iPod.

    I got a new macbook pro for cristmas and a few cds. After i tried to sync my ipod to itunes i put a symbol next to each song that i got from other cds saying that they were downloading but they werent. Also the cds i downloaded to my ipod for the first time didnt appear at all. Need help.

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.01 Updates on Iphone 4?

    Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.06 Updates on Iphone 4?
    I have tried the following all ready:
    Resetting Phone
    Resetting Settings on phone
    Change Headsets to speakers
    Reinstalled Phone
    Updated to IOS 7.1
    No of the above has resolved the issue does anyone have any ideas?

    Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.06 Updates on Iphone 4?
    I have tried the following all ready:
    Resetting Phone
    Resetting Settings on phone
    Change Headsets to speakers
    Reinstalled Phone
    Updated to IOS 7.1
    No of the above has resolved the issue does anyone have any ideas?

  • Crystal 2011 linking table with a String and a Number

    Hello,
    I am able to retrieve the data I want with the following  SQL Query in SQL: If I try to create it in Crystal 2011 APPLRUNN is a string and CNTBTCH is a number. Is there a way I can link these two fields if one is a string and the other is a number ?
    SELECT   
    ENADV.APPLRUNN, ENPBD.CNTBTCH,
    ENPBD.DOCNBR
    FROM       
    ENADV INNER JOIN
    ENPBD ON ENADV.APPLRUNN = ENPBD.CNTBTCH
    Thanks,
    Debbie

    Hi Debbie,
    You cannot linking  table with a string and a number. I have given a example query:
    SELECT   
    ENADV.APPLRUNN, ENPBD.CNTBTCH,
    ENPBD.DOCNBR
    FROM       
    ENADV INNER JOIN
    ENPBD ON
    ENADV.APPLRUNN = ENPBD.APPLRUNN  or ENADV.CNTBTCH = ENPBD.CNTBTCH
    I modify last sentense because one table primary key is equal to another table Foreign key i.e
    one table ID field = another table ID field or one table NAME field = another table Name field.
    Please understand my intenction and check linking fields in tables.
    Thanks,
    DJ

  • Hi i would like help with:  When I draw circle and add stroke I can not see stroke  I use Photoshop CS 5

    Hi i would like help with:
    When I draw circle and add stroke I can not see stroke
    I use Photoshop CS 5

    Make sure the stroke is set to a color and not to the symbol that appears here for Fill

  • Configuration of Cisco WLC 2504 with Local LAN static IP and DHCP

    I want to configure Cisco WLC 2504 with Local LAN static IP and WLC 2504 with DHCP so that APs can be connect with controller.
    Currently i am using WLC 2504 with DHCP so can anyone suggest how to do that..

    Hi Sandeep
    The info is correct, if we're using code below 7.3.101.0.
    This issue is fixed via the below bug id.
    CSCto01390 Unable to ping AP's directly connected to a 2500 controller
    check the fix that is updated on 7.4, 7.5 RNE.
    http://www.cisco.com/en/US/docs/wireless/controller/release/notes/crn75.html
    Note
    Directly connected APs are supported only in Local mode.
    http://www.cisco.com/en/US/prod/collateral/wireless/ps6302/ps8322/ps11630/data_sheet_c78-645111.html
    For quick and easy deployment Access Points can be connected directly to 2504 Wireless LAN Controller via two PoE (Power over Ethernet) ports
    Thanks
    Saravanan

  • I have an old version of InDesign CS5, have not used in a while..about a year.  It will not load nor allow me to uninstall and reinstall, please help.  I have original discs and serial number.  How can I fix this?

      I have an old version of InDesign CS5, have not used in a while..about a year.  It will not load nor allow me to uninstall and reinstall, please help.  I have original discs and serial number.  How can I fix this?

    CS Cleaner Tool for installation problems | CCM, CS6, CS5.5, CS5, CS4, CS3

  • A little help with tokenizing a string

    Have most of this working and i will add the code to the end of the for you all to look at.
    Essentially what i am trying to do is tokenize a string that looks like:
    program int ABC, D;
         begin read ABC; read D;
              while (ABC != D) begin
                                       if (ABC > D) then ABC = ABC - D;
                                       else D = D - ABC;
                                  end;
                             end;
              write D;
         endMy tokeizing stuff works just fine for simpler version of this but it screws up a little when it gets to the "special symbols" that are a combination of more then one special token. The special symbols are:
    ; , = ! [ ] && or ( ) + - * != == < > <= >=Now i obviously have to look for those as tokenizing points, but the problem comes when i get to double ones like &&, or, !=, etc.
    I was wondering if there was a way to make it look for the combination != instead of just the ! and then the =.
    If there is not an easy way to do it what would be the best and easiest way to go about parsing that string into tokens? I am kinda leaning towards string.split but am not quite sure on how to set it up. some examples or pointers would be welcome!!
    Thanks and here is the code of the relevant part:
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    import java.io.*;
    * @author Kyle Hiltner
    public class KHTokenizer implements KHTokenizerInterface
         private String current_token; //used to specify current token
         private int token_count=0; //used to keep track of which token is being asked for
         private ArrayList<String> file = new ArrayList<String>(); //stores the parsed input file
          * Creates a new KHTokenizer with the name of the file as input
          * @param inputFileName the specified file to be read from
          * @throws IOException
         KHTokenizer(String inputFileName) throws IOException
              FileReader freader = new FileReader(inputFileName); //create a FileReader for reading
              BufferedReader inputFile = new BufferedReader(freader); //pass that FileReader to a BufferedReader
              String theFile = Create_String_From_File(inputFile); //create a space separated string for easier tokenizing
              StringTokenizer tokenized_input_file = new StringTokenizer(theFile, ";=,()[] ", true); //tokenize the string using ;, =, and " " as delimiters
              String_Tokenizer(tokenized_input_file, file); //create the array by adding tokens
              this.current_token = file.get(this.token_count); //set the current token to the first in the array
         //----Private Operations----//
          * Determines if the specified word is a special Reserved word
          * @param reserved_word the current token
          * @return true if and only if the reserved_word is a Reserved Word
         private static Boolean Is_Reserved_Word(String reserved_word)
              //determine is reserved_word is one the established Reserved Words
              return ((reserved_word.equals("program")) || (reserved_word.equals("begin")) ||
                        (reserved_word.equals("end")) || (reserved_word.equals("int")) ||
                        (reserved_word.equals("if")) || (reserved_word.equals("then")) ||
                        (reserved_word.equals("else")) || (reserved_word.equals("while")) ||
                        (reserved_word.equals("read")) || (reserved_word.equals("write")));
          * Determines if the specified word is a Special Symbol
          * @param special_symbol the current token
          * @return true if and only if the special_symbol is a Special Symbol
         private static Boolean Is_Special_Symbol(String special_symbol)
              //determines if special_symbol is one of the established Special Symbols
              return ((special_symbol.equals(";")) || (special_symbol.equals(",")) ||
                        (special_symbol.equals("=")) || (special_symbol.equals("!")) ||
                        (special_symbol.equals("[")) || (special_symbol.equals("]")) ||
                        (special_symbol.equals("&&")) || (special_symbol.equals("or")) ||
                        (special_symbol.equals("(")) || (special_symbol.equals(")")) ||
                        (special_symbol.equals("+")) || (special_symbol.equals("-")) ||
                        (special_symbol.equals("*")) || (special_symbol.equals("!=")) ||
                        (special_symbol.equals("==")) || (special_symbol.equals("<")) ||
                        (special_symbol.equals(">")) || (special_symbol.equals("<=")) ||
                        (special_symbol.equals(">=")));
          * Determines if the specified token is an integer
          * @param integer_token the current token to be converted to an integer
          * @return true is and only if integer_token is an integer
         private static Boolean Is_Integer(String integer_token)
              Boolean is_integer=false; //set up boolean for check
              //try to convert the specified string to an integer
              try
                   int integer_token_value = Integer.parseInt(integer_token); //convert the string to an integer
                   is_integer = true; //set is_integer to true
              catch(NumberFormatException e) //if unable to parse the string to an integer set is_integer to false
                   is_integer = false; //set is_integer to false
              return is_integer; //return the integer
          * Determines if the specified token is an Identifier
          * @param identifier_token the current token
          * @return true if and only if the identifier_token is an identifier
         private static Boolean Is_Identifier(String identifier_token)
              //rule out that it is a Reserved Word, Special Symbol, or integer so then it must be an Identifier; so return true or false
              return ((!Is_Reserved_Word(identifier_token)) && (!Is_Special_Symbol(identifier_token)) && (!Is_Integer(identifier_token)));
          * Determines which value to assign to the specified token
          * @param which_reserved_word_token the current token
          * @return token_value the integer value relating to the Reserved Word token
         private static int Which_Reserved_Word(String which_reserved_word_token)
              int token_value=0; //set initial token_value
              //run through and check which Reserved word it is and then set it to the correct value
              if(which_reserved_word_token.equals("program"))
                   token_value = ReservedWords.PROGRAM.ordinal()+1;
              else if(which_reserved_word_token.equals("begin"))
                   token_value = ReservedWords.BEGIN.ordinal()+1;
              else if(which_reserved_word_token.equals("end"))
                   token_value = ReservedWords.END.ordinal()+1;
              else if(which_reserved_word_token.equals("int"))
                   token_value = ReservedWords.INT.ordinal()+1;
              else if(which_reserved_word_token.equals("if"))
                   token_value = ReservedWords.IF.ordinal()+1;
              else if(which_reserved_word_token.equals("then"))
                   token_value = ReservedWords.THEN.ordinal()+1;
              else if(which_reserved_word_token.equals("else"))
                   token_value = ReservedWords.ELSE.ordinal()+1;
              else if(which_reserved_word_token.equals("while"))
                   token_value = ReservedWords.WHILE.ordinal()+1;
              else if(which_reserved_word_token.equals("read"))
                   token_value = ReservedWords.READ.ordinal()+1;
              else
                   token_value = ReservedWords.WRITE.ordinal()+1;
              return token_value; //return the token_value
          * Determines which value to assign to the specified token
          * @param which_special_symbol_token the current token
          * @return special_symbol_token_value the integer value relating to the Special Symbol token
         private static int Which_Special_Symbol(String which_special_symbol_token)
              int special_symbol_token_value=0; //set initial value
              //check to figure out which Special Symbol it is and assign the correct value
              if(which_special_symbol_token.equals(";"))
                   special_symbol_token_value = SpecialSymbols.SEMICOLON.ordinal()+11;
              else if(which_special_symbol_token.equals(","))
                   special_symbol_token_value = SpecialSymbols.COMMA.ordinal()+11;
              else if(which_special_symbol_token.equals("="))
                   special_symbol_token_value = SpecialSymbols.EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("!"))
                   special_symbol_token_value = SpecialSymbols.EXCLAMATION_MARK.ordinal()+11;
              else if(which_special_symbol_token.equals("["))
                   special_symbol_token_value = SpecialSymbols.LEFT_BRACKET.ordinal()+11;
              else if(which_special_symbol_token.equals("]"))
                   special_symbol_token_value = SpecialSymbols.RIGHT_BRACKET.ordinal()+11;
              else if(which_special_symbol_token.equals("&&"))
                   special_symbol_token_value = SpecialSymbols.AND.ordinal()+11;
              else if(which_special_symbol_token.equals("or"))
                   special_symbol_token_value = SpecialSymbols.OR.ordinal()+11;
              else if(which_special_symbol_token.equals("("))
                   special_symbol_token_value = SpecialSymbols.LEFT_PARENTHESIS.ordinal()+11;
              else if(which_special_symbol_token.equals(")"))
                   special_symbol_token_value = SpecialSymbols.RIGHT_PARENTHESIS.ordinal()+11;
              else if(which_special_symbol_token.equals("+"))
                   special_symbol_token_value = SpecialSymbols.PLUS.ordinal()+11;
              else if(which_special_symbol_token.equals("-"))
                   special_symbol_token_value = SpecialSymbols.MINUS.ordinal()+11;
              else if(which_special_symbol_token.equals("*"))
                   special_symbol_token_value = SpecialSymbols.MULTIPLY.ordinal()+11;
              else if(which_special_symbol_token.equals("!="))
                   special_symbol_token_value = SpecialSymbols.NOT_EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("=="))
                   special_symbol_token_value = SpecialSymbols.EQUALS_EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("<"))
                   special_symbol_token_value = SpecialSymbols.LESS_THAN.ordinal()+11;
              else if(which_special_symbol_token.equals(">"))
                   special_symbol_token_value = SpecialSymbols.GREATER_THAN.ordinal()+11;
              else if(which_special_symbol_token.equals("<="))
                   special_symbol_token_value = SpecialSymbols.LESS_THAN_OR_EQUAL_TO.ordinal()+11;
              else
                   special_symbol_token_value = SpecialSymbols.GREATER_THAN_OR_EQUAL_TO.ordinal()+11;
              return special_symbol_token_value; //return the correct value
          * Creates the string separated by white spaces to be read by the String Tokenizer
          * @param input_file the stream to be converted into a string
          * @return theFile the inputFile converted to a string
          * @throws IOException
         private static String Create_String_From_File(BufferedReader input_file) throws IOException
              String theFile="", keepReadingFromFile=""; //set initial value of the strings
              //run through the stream and create a file
              while(keepReadingFromFile != null)
                   keepReadingFromFile = input_file.readLine(); //read one line at a time
                   //if the line is null stop and break
                   if(keepReadingFromFile == null)
                        break;
                   else //keep reading from the file and make it into a string
                        theFile = theFile + keepReadingFromFile;
              theFile = theFile.replaceAll("\\t", " "); //remove any tabs from the string and replace with spaces so it is easier to Tokenize
              return theFile; //return the newly created string
          * Creates the array of tokens but tokenizing based on the given parameters
          * @param theInputFile
          * @param file to store the individual tokens in
         private void String_Tokenizer(StringTokenizer theInputFile, ArrayList<String> file)
              String token=""; //set up the intial token
              //keep reading with there is still more in the token stream
              while (theInputFile.hasMoreTokens())
                   token = theInputFile.nextToken(); //set token to the next token
                   //if the token is not a white sapce then add it to the array
                   if(!token.equals(" "))
                        file.add(token); //add token to the array
              file.add("nill"); //add a final spot to designate the end of the file
         //----Public Operations-----//
          * Returns the integer value of the current token
          * @return the integer value of the current token
         public int getToken()
              int token_number=0; //set initial value
              //determine if the current token is a Reserved Word, Special Symbol, Identifier, or nill (for end of file)
              if(Is_Reserved_Word(this.current_token))
                   token_number = Which_Reserved_Word(this.current_token); //determine the correct value for the Reserved Word
              else if(Is_Special_Symbol(this.current_token))
                   token_number = Which_Special_Symbol(this.current_token); //determine the correct value for the Special Symbol
              else if(Is_Integer(this.current_token))
                   token_number = 30; //the current token is an integer so set it to 30
              else if(this.current_token.equals("nill"))
                   token_number = 32; //the current token is nill so set it to 32
              else//(Is_Identifier(this.current_token))
                   token_number = 31; //the token is an identifer so set it to 31
              return token_number; //return the token_number
          * Sets the current token as the next one in line
         public void skipToken()
              //keep getting the next token as long as token_count is less then the size of the array
              if(this.token_count < file.size()-1)
                   this.token_count++; //increase token_count
                   this.current_token = file.get(token_count); // get the new token
          * This method can only be called to convert an integer in string form to its integer value.
          * If called on an non integer token an error is printed to the screen and execution of the Tokenizer is stopped.
          * @return integer value of the specified token assuming the token is an integer
         public int intVal()
              int integer_token_value=0; //set the initial value
              //if true is returned then go ahead and convert
              if(Is_Integer(this.current_token))
                   integer_token_value = Integer.parseInt(this.current_token); //parse the current_token string and get an integer value
              else // print he error message and exit Tokenizing
                   System.out.print("You called intVal() on a non-integer token. You tryed to convert the " );
                   if(Is_Reserved_Word(this.current_token))
                        System.out.print("reserved word " + "\"" + this.current_token +"\"" + " to an integer");
                   else if(Is_Special_Symbol(this.current_token))
                        System.out.print("special symbol " + "\"" + this.current_token +"\"" + " to an integer");
                   else
                        System.out.print("identifier " + "\"" + this.current_token +"\"" + " to an integer");
                   System.exit(1); //exit the system and quit tokenizing
              return integer_token_value; //return the current_token integer value
          * Returns a string if and only if the token is of the id type.
          * @return the name of the id token
         public String idName()
              String id_token_name=""; //setup the initial value
              //if the current_token is an Identifer then set it so and return it.
              if(Is_Identifier(this.current_token))
                   id_token_name = this.current_token;
              else // print message and quit tokenizing
                   System.out.print("You called idName() on ");
                   if(Is_Reserved_Word(this.current_token))
                        System.out.print("a reserved word, ");
                   else if(Is_Special_Symbol(this.current_token))
                        System.out.print("a special symbol, ");
                   else
                        System.out.print("an integer, ");
                   System.out.println("which is not an identifier token.");
                   System.exit(1); //exit and quit tokenizing
              return id_token_name; //return the id_token_name if possible
    }left some stuff out

    volunteers are supposed to read all that? and no tea and crumpets?
    Seriously though, we don't want to see all of your code, we don't even want to see most of your code, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]

  • Help with parsing a text string in address book and moving it to 'related person' field

    I am wanting to make a little applescript that will go thru my contacts and find data in the NOTES field and parse it slightly and move it to another field.  (sorry if parsing isn't the right word here)
    The data to be found is a GPS coordinate with this EXACT format:
    <Lat:12.345678><Lon:-12.345678>
    ...the only thing different from this example is the digits, and the number of digits.
    What I want to end up doing is deleting this data from the NOTES field, but leaving any other data, (this part sounds difficult to do to, to me!)
    And moving it to a related person field with the label gps, and the coordinate now reading exactly:
    12.345678,-12.345678
    (FYI, you can copy/paste a coordinate like this very fast into the maps app on iPhone and locate it instantly)
    Thanks for the help on this
    If this is too complicated I can break up the process into steps.  I know how to do some of it, but not sure about the parsing, and then delete just part of the notes field...
    Thanks!

    Hi,
    This script work here, try it :
    tell application "Address Book"
        repeat with thisContact in (get people)
            set tNote to note of thisContact
            if tNote is not missing value and "<Lat:" is in tNote and "<Lon:" is in tNote then
                set {GPS_value, newNote} to my getGPS_coordinate(tNote)
                if newNote is not "" then -- no error
                    set gpsField to (related names of thisContact whose its label = "gps")
                    if gpsField is not {} then
                        set value of (item 1 of gpsField) to GPS_value
                    else -- field "gps" is empty
                        make new related name at end of related names of thisContact with properties {label:"gps", value:GPS_value}
                    end if
                    set note of thisContact to newNote
                end if
            end if
        end repeat
        save
    end tell
    on getGPS_coordinate(this_note)
        set oldTid to text item delimiters
        set {tLat, tLon, newNote} to {"", "", ""}
        try
            set text item delimiters to "<Lat:"
            set tLat to text item 2 of this_note
            set text item delimiters to "<Lon:"
            set tLon to text item 2 of this_note
            set text item delimiters to ">"
            set {tLat, tLon} to {text item 1 of tLat, text item 1 of tLon} -- get values (lat... and long...)
            set text item delimiters to "<Lat:" & tLat & "><Lon:" & tLon & ">"
            set this_note to text items of this_note
            set text item delimiters to " "
            set newNote to this_note as string -- delete GPS coordinate in this note
        end try
        set text item delimiters to oldTid
        return {tLat & "," & tLon, newNote}
    end getGPS_coordinate

  • Need a little help with Slimbox (Lightbox clone) and Spry data sets

    Hello guys!
    First of all let me say that I'm not a programmer in any way,
    shape or form, and somehow I managed to build me a dynamic
    thumbnail gallery that reads data from an XML file and displays it
    on my webpage using a Spry data set and a slider widget (yay!)
    This is of course only thanks to the many great examples
    provided by the Adobe Spry team, and me being stubborn enough to
    keep at it, even though I don't really understand what I'm doing :D
    But I got to this point where I have basically everything
    working, except that I can't get the Slimbox (Lightbox clone)
    script to work with the Spry-generated thumbnail gallery.
    From what I could understand from other threads on this
    forum, is that I need to add an observer somewhere, only that I'm
    not sure where and how (those threads are pretty old and the
    examples aren't available anymore).
    I'm sure you guys know what I'm talking about, anyway, here's
    what I got so far:
    http://www.riotdesign.com.ar/misc/gallery/test1.html
    I have the thumbnail gallery populated from the external XML
    file, a basic page navigation using the Sliding Panels widget, and
    the Slimbox script which works only on the static test image.
    Okay I guess that's it for now, sorry for the long post and
    of course any help with this will be GREATLY appreciated :)
    Thanks & bye!

    Kev,
    Where exactly does the .evalScripts = true; text need to go?
    Does it go in the href call?
    <a href="ManageNotes.asp" title="Manage Notes" onClick="this.blur();
    Modalbox.show(this.href, {title: 'Manage Notes', width: 575}); return false;">View your notes.</a>
    Thanks for any assistance.
    J Bishop

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

  • Little help with keyframes and Armorbot

    armor bot ranks software gives you an actionscript that sends
    the score you want directly online, I have successfully finished it
    but in the game if i enter a number like 200 and a name like "yair"
    it works out just fine but when i put a variable like tt that is
    connected to a number it doesnt work. Here is the Code do you think
    you can help. Im guessing tt is time because i made this game with
    a partner
    The First keyframe has the code from my game in it then the
    next keyframe has the armorbot code:
    stop ();
    sintro.stop();
    t = Math.round(_global.totaltime * 10) / 10 + " units";
    tt.text = t;
    ct.text = _global.totalclickcount;
    _global.puNUM = 1;
    par = 1;
    clickcount = 0;
    N = 30;
    hs = 3;
    ci._visible = 0;
    flr = floor._y;
    kuid = false;
    xv = 0;
    yv = 20;
    g = 1.010000E+000;
    xd = 0;
    go = true;
    boost = 1;
    _global.score = 0;
    ballx = ball._x;
    bally = ball._y;
    d = 9.700000E-001;
    bbu = 5;
    bu = 20;
    bhu = 23;
    hb2l = 10;
    hb2r = 10;
    vb2t = 3;
    vb2b = 10;
    var B = new flash.filters.BlurFilter(0, 0, 2);
    var bupA = new Array();
    Heres the code on the button to the next keyframe:
    on (press) {
    nextFrame();
    And Here is the ArmorbotCode take note of the t's:
    //Send Highscore AS2.0 // Armor Bot Rankz
    import ab3.rankz.*;
    function __rankz_send__(par1,par2,par3,par4){
    par227 = new LoadVars();
    par228 = new LoadVars();
    par227.flashkey = par2;
    par227.SU0249 = par1;
    par227.bmFtZTE = Armor_Bot_30_En_AS1.Encode(par3);
    par227.c2NvcmUx =
    Armor_Bot_30_En_AS1.Encode(par4+"j%e%a%n%s");
    par227.flashkey = par227.flashkey.split("=").join("");
    par227.SU0249 = par227.SU0249.split("=").join("");
    par228.onLoad = function(success){
    if(success){
    trace(par228.msg);
    }else{
    trace(par228.loaded);
    par227.sendAndLoad("
    http://rankz.armorbot.com/submit/",par228,"POST");
    bXlnYW1lX25hbWVfdmFyaWFibGU = "Yair";//replace
    my_name1_variable with your name variable (1)
    bXlnYW1lX3Njb3JlX3ZhcmlhYmxl =
    tt;//replace my_score1_variable with your score1 variable
    __rankz_send__("MzEyOGolZSVhJW4lcw==", "SnBrUk9ibEo=",
    bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
    //Send Highscore AS2.0 END

    didittoday wrote:
    No errors are thrown, but...
    words is a String array containing 58,112 words,
    my computer hits 100% usage, bogs down and I have to press crtl+alt+del to bring up my task manager (which in itself takes like 10 mins) and my javaw.exe shows CPU 100. I guessing it is the startsWith() call, not sure.
    If I am correct in my thinking then I will just tear each word apart and check the contents myself.You basically are checking the contents yourself. It's not clear what you're thinking. I can pretty much guarantee that if you rewrite startsWith(), then you will not improve the performance of your program at all and will probably just make it worse.
    But this is where my question comes in, am I correct in my thinking or am I using the vector wrong? The answers are probably no, you're not correct in your thinking, and yes, you're using the vector wrong. But you haven't exactly said what you're thinking.
    The vector isn't particularly relevant, at least in terms of the search. The real problem is that you have an ordered (reportedly) array of string and for some reason you're searching through it sequentially. You should use a binary search to find the matching strings. See java.util.Arrays.binarySearch.
    Now, this is probably wrong:
         // get data from vector into a string array
         int size = searchResults.capacity();
         String[] returnArray = new String[size];
         searchResults.toArray(returnArray);Vector.capacity returns how much the vector can hold, not how much it's actually holding. So you're passing toArray an array much larger than it actually needs, most likely. I have no idea what the behavior of toArray is in those circumstances but it's probably not good. You probably meant to do something more like:
    return searchResults.toArray(new String[searchResults.size()]);Another problem is that you're using a Vector, and not a LinkedList.

Maybe you are looking for

  • How to export a PDF to a word document? at the moment it came up with "The encoding (CMap) specified by a font is missing ????? what can I do?  thanks

    How to export a PDF to a word document? at the moment it came up with "The encoding (CMap) specified by a font is missing ????? what can I do?  thanks

  • Import from Canon HF200 stalls

    When importing 1080i clips, 30 sec. clips behave normally, but 10-11 minute clips start normally then freeze with about 15% imported. The program (iMovie) quits responding and has to be force quit. If the import is stopped before the freeze, nothing

  • Set enter key always on search button

    hi  , there are three submit button:'return home'\'search'\'clear' i want the the point is always in 'search' button.  but now if you click anywhere , it points to 'return home' submit button. please help me thanks.

  • Wrong Digital Signature

    Hi,        I have SAP B1 2004 &  I developed the addon using VS 2005.While tries to attach the addon in Addon administration it gives me wrong digital signature. The addon was successfully installed in SAP B12005 But it gives me error in SAP B12004.P

  • Fs7 standard profile vs slog

    Hello all. I currently own an FS700. I'm upgrading to the FS7. I have looked into color grading with S-Log, etc and realized that I would be more comfortable with just using the standard setting on the camera. I'm curious on what the dynamic range wo