Working of  SUMPRODUCT(array1,array2,array3, ...)

Dear All,
I need to Implement equivalent functionality of SUMPRODUCT(array1,array2,array3, ...) of excel .in
oracle
Please Try to Provide Some Hint.
Thanks
I Value Your Time And Efforts
Edited by: user13474542 on Dec 21, 2010 2:25 AM
Edited by: user13474542 on Dec 21, 2010 2:26 AM

INDIRECT is your friend here.
B2 contains the SUMPRODUCT formula:
=SUMPRODUCT(D2:D10,E2:E10)
B3 contains the same formula, using INDIRECT to construct the two ranges from the contents of cells B1 and C1:
=SUMPRODUCT(INDIRECT(""&B1),INDIRECT(""&C1))
Details on INDIRECT (and the other functions supported in Numbers), along with at least one example for each function, may be found in the iWork Formulas and Functions User Guide, which can be downloaded via the Help menu in Numbers '09.
Also available in the same location is a download link for the Numbers '09 User Guide, a more general guide to the features of Numbers. The first few chapters are strongly recommended as required reading for anyone new to Numbers, and especially to those migrating from another spreadsheet application; the rest may be browsed or devoured when there's a need to know about a specific topic.
Regards,
Barry

Similar Messages

  • Array1 =Array2

    I have a very simple question.
    I have 2 array of objects.
    I do this :
    array1 = array2;
    Strange thing happens when I set a value to array2[1], the array1[1] will also be updated with the same value automatically.
    Why does this happen and how to resolve it.
    Please help.
    Thanks

    by array1=array2, you are assigning two reference pointer to the same object, so when you update array1, it will also update array2
    do something like
    int array2 [] = new int [SIZE];
    for (int i=0;i<array1.length;i++)
    array2[i] = array1;
    if you are using primitive type array
    for reference, you have to make a clone of it and cast it back to your object
    array2[i] = (Your object) array1[i].clone();
    Jacinle
    I have a very simple question.
    I have 2 array of objects.
    I do this :
    array1 = array2;
    Strange thing happens when I set a value to array2[1],
    the array1[1] will also be updated with the same value
    automatically.
    Why does this happen and how to resolve it.
    Please help.
    Thanks

  • SUMPRODUCT dynamic range

    I wanted to do some number cruching in Numbers with quite a few formulas like (SUMPRODUCT(array1, array2) + SUMPRODUCT(array3, array4)) / SUM(array5) for every worksheet, which is fine except that I've got some ten worksheets. And each worksheet is a bit different in terms of array sizes and locations.
    It'd be more efficient (and less error-prone) if I could get to write generic formulas and let each worksheet derive the final 'array's by referring to values stored in certain cells. Basically make it table-driven formulas if you know what I mean.
    Unfortunately Numbers returns error for say SUMPRODUCT(B2), where the B2 cell has a string like "D10:D144, R10:R144". So it appears Numbers won't happily take Text value for Range value.
    I've checked some online forum. Some mentioned using INDIRECT or INDEX, and my trial result still returned error. Others mentioned table names or VB object attributes (which sound like Excel-only).
    Wondering if anyone ran into similar situation and got answers? It'd be great to be able to learn and move on and not getting stuck here.

    INDIRECT is your friend here.
    B2 contains the SUMPRODUCT formula:
    =SUMPRODUCT(D2:D10,E2:E10)
    B3 contains the same formula, using INDIRECT to construct the two ranges from the contents of cells B1 and C1:
    =SUMPRODUCT(INDIRECT(""&B1),INDIRECT(""&C1))
    Details on INDIRECT (and the other functions supported in Numbers), along with at least one example for each function, may be found in the iWork Formulas and Functions User Guide, which can be downloaded via the Help menu in Numbers '09.
    Also available in the same location is a download link for the Numbers '09 User Guide, a more general guide to the features of Numbers. The first few chapters are strongly recommended as required reading for anyone new to Numbers, and especially to those migrating from another spreadsheet application; the rest may be browsed or devoured when there's a need to know about a specific topic.
    Regards,
    Barry

  • How can I create arrays through the same recursive process?

    Hello again!
    I want to create some arrays with names like array1, array2, array3 etc
    through the same for loop.
    Do you know how this can be done? Thanks!
    for (int i = 0; i < 32; i++) {
    byte[] array???=new byte[400];
    }

    I want to create some arrays with names like array1,
    array2, array3 etc
    through the same for loop.
    Do you know how this can be done? Thanks!
    for (int i = 0; i < 32; i++) {
    byte[] array???=new byte[400]; You cannot create new names during runtime (array1, array2 are names).
    You can create a map that associates Strings with byte arrays though:Map<String, byte[]>  map= new HashMap<String, byte[]>();
    for (int i= 0; i < 32; i++)
       map.put("array"+i, new byte[400]);
    // get array associated with array26:
    int j= 26;
    byte[] oneOfTheArrays= map.get("array"+j);kind regards,
    Jos

  • [PS] Multiple array´s split and merge

    Is it possible to: when you have 3 array's split the value's after the comma and then from each array merge every 1st value with 1st, 2 with 2 and so on.
    I know you can use split to split up an array, but i have no clue how to merge it like i want.
    example:
    array 1 :
    1,7,5,0,9,1
    array 2 :
    dog,cow,cat,horse,man,girl
    array 3 :
    short,big,little,huge,long,small
    output 1 :
    1 dog short
    output 2 :
    7 cow big
    output 3 :
    5 cat little
    or even better is that it gonna be variable
    $array1 :
     1,7,5,0,9,1
    $array2 :
     dog,cow,cat,horse,man,girl
    $array3 :
     short,big,little,huge,long,small
    output 1 :  $array1 $array2 $array3
    output 1 :
     1 dog short
    output 2 :  $array1 $array2 $array3
    output 2 :
     7 cow big
    output 3 :  $array1 $array2 $array3
    output 3 :
     5 cat little
    Sincerely,
    Jeroen 

    hi Jeroen,
    sure you can do that. Simply iterate over each index of the arrays:
    $int = 0
    While ($int -lt $array1.Length)
    ($array1[$int] + " " + $array2[$int] + " " + $array3[$int])
    $int++
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Java Array help

    I am interested in learning if there is a way at runtime to have the user enter a certain integer number and have the program create Arrays of that given number
    ex. input from user is 4
    program creates ten different Arrays
    array1[ ]
    array2[ ]
    array3[ ]
    array4[ ]

    ack correction: that ten was a typo originally i was goin to make the input 10 instead of four but i figured too much typing to type out all 10 arrays in the example so i made it four lol sorry!!!
    well i a program coded in java asks a user to enter an interger value and the program then creates during runtime those 10 different arrays
    The input could be any number however so if the user were to enter "4" as input the program would create arrays with names:
    array1[ ]
    array2[ ]
    array3[ ]
    array4[ ]
    really my question is how can i increment the numeral digit on each array name. Such as making a FOR loop with varible i=0 that increments "i" and creates a new array for that new increment until the users number is encountered at which time the loop will end and so will the creation of new arrays
    Message was edited by:
    matrix_choices

  • How I should make it to use memory efficient?

    Hello All
    I have the following problem:
    Thse structure is like this:
    Array1(cluster1)
    Clusetr1: numeric1, Array2, Array3
    Array2(cluster2)
    cluster2:numeric2, array3(two vectors)
    Array3(cluster3)
    cluster3two vectors)
    As you can see it is a meassy stuff, and also the memory utilisation and efficiency is very poor. It is enough that I add some of the elements in one of the vector in array3 and all the structure must be copied to another place in memory.
    I was thinking of having something like:
    Array1(references to Cluster1)
    CLuster1: numeric1, Array2(references to cluster2), Array3(references to cluster3)
    Than
    addying a new elementwill cause only addying another reference in the given array.
    I am not sure if I make it clear, but if not, where I can read about the tips of managing the complicated structures including the arrays of clusters of arrays, etc.
    Thanks in advance
    Pawel

    > "... move to something
    > where you use an array of integers to "point" to elements stored in
    > another array. "
    >
    Sorry I didn't go into more detail, but I wasn't sure this would help.
    The technique I mentioned has to do with building parallel arrays to
    hold different elements of a struct, or building a parallel array that
    gives you quicker searches of a complex datatype. For example, if you
    have an array of personel info with names, ages, social security
    numbers, etc. You sometimes want to find someone by name, sometimes by
    social, and perhaps the array is originally given to you in age sorted
    order.
    This would mean that everytime you try to find someone by name, you
    can't use a binary search or even stop when you pass the name and know
    they aren't in the array. You have to look at every element. The
    technique would be to build two parallel lookup arrays. The string
    sorted array would simply be an array of the integers 0 through N-1,
    ordered so that the first element contains the index of the first
    element by string. The second element contains the index of the second,
    and so on. So now you have essentially pointers from the index array to
    the storage array. You build another to keep order by social, and as
    many others as you like. These of course have to be updated when a new
    record is added, so there is a cost, but for database types of access to
    a largly static data set, this can help a lot on efficiency.
    The other point where this helps is when there is lots of redundancy in
    the info stored in the main array. As an example, lets say you are
    storing cartesian points to describe 3D shapes. One way would simply be
    to have arrays of faces, each face having an array of 3D vertices. This
    works, but you aren't taking advantage of the fact that each vertex is
    typically shared by three or more faces. In our structure it is
    duplicated again and again, and actually makes it difficult to reshape a
    3D shape.
    A better structure, using the index technique is to build an array of
    faces, each face has an array of vertex indices. The shape also has an
    array of vertices, in no particular order, but the face vertices can now
    "point" to any vertex and the faces now share it.
    To test it, put a cube in the structures. The cube has six faces and
    only eight points. In the first structure, there are six face arrays,
    each with four 3D points for a total of 24 3D coords. The second has
    six faces, each with four integer indices and the shape has a second
    array of eight coordinates. It doesn't duplicate information making it
    easier to update, it uses less storage, and it is quicker to access for
    many operations.
    > As I see it, that would not solve my problems with the memory
    > alocation in case of change the array size. The system will still need
    > to enlarge every and single element of the array I am changing for
    > every element in the top level array, I guess.
    >
    When an array grows, that array may need to be moved in memory, since
    arrays are stored in contiguous memory. If it is an array of one
    million I8s, and you add one more byte, the 1M elements may need to move
    so that the additional element can be stored with them. By contrast, an
    array of 1,000 arrays of I8s, stores the same info. When adding a new
    element, to one of the 1000 element arrays, the other 999,000 elements
    do not need to move. Adding a new array to the 1000 already there means
    that the array of 1000 array references may move, but none of the I8
    elements will be moved.
    If you want more help, please describe more about what is in the array,
    to see if there is redundant storage that the first technique may help
    with, and describe how you will access it. Will you do more inserts,
    more deletes, or more accesses? These are the things that affect the
    efficiency of various data structures.
    Greg McKaskle

  • Sort algorithm: how can I sort two arrays according to one

    I have two parallel arrays, similar to this:
    var array1 = [4, 3, 1, 5, 2];
    var array2 = ["four", "three", "one", "five", "two"];
    I want to sort the first array, and have the second array follow the same sort as the first. Any advice for a good algorithm would be appreciated.
    Rick Quatro

    Hi Rick,
    frameexpert wrote:
    Technically, there was no correct answer because the problem could be solved in multiple ways,
    I don't think you're right about not marking the question as correct just because there are multiple ways of solving it.
    People search the forums for solutions and threads that are not marked as correct are somewhat relegated.
    It wouldn't hurt to make bduffy232's day or even mark your own solution as correct which is more the less the same as the one on the link from KuddRoww and more the less the way I would have done it but see the difference in the results in the table at the bottom of this post.
    I actually think that technically there can be multiple correct answers even though you can only  one can be marked.
    One other small point if you use the advance editor on the forum you can have you code formatted makes it much easier to read.
    Anyway here's my half pence worth on the scripting front.
    Your question was how to sort one array according to another, which I understand to mean that you want the originals arrays reordered
    Yours and bduffy232's scripts do that properly the others don't. Jongware's first script is easy to fix up this problem by adding to the end of his script.
    for (i = 0; i<Math.min(array1.length, array2.length); i++)
    array1[i] = array3[i][0];
    array2[i] = array3[i][1];
    alert(array1+"\r"+array2)
    Now in order of appearance
    Jongware said:
    .. I wonder why this does not work .. Perhaps my logic is flawed?
    Hi Jongware
    I tried your  (2nd) script twice and on both occurrences it crashed my ESTK
    From what I  understand (not said with much confidence) the flaw in your logic is you are passing your arrays values to be sorted array1[?] and array2[?+1] to the sort function as 'a' and 'b' but and then refer to the array array1[a].
    So let's examine a bit of the code
    var array1 = [4, 3, 1, 5, 2];
    array3.sort (function(a,b) {
    var swap, diff = array1[a] - array1[b];
    When run this is the equivalent of saying (for the first run of the sort loop)
    diff = array1[4] - array1[3]
    i.e.     diff = 2 - 5
    i.e.     diff = -3
    What you wanted to do was
    diff = a - b
            = 4 -3
    That's the way I see it.
    Hi Marc
    Change the first two lines of your first script to:
    var array1 = [40, 7, 1, 5, 2];
    var array2 = ["forty", "seven", "one", "five", "two"];
    Then run the script
    Now for my offering.
    The fancy script
    This script is not limited to a specific number of arrays.
    after creating the arrays one creates an array of the arrays, specifies the number of the array that one wants to sort by and calls the function.
    like this:
    sortArraysInSync([a1,a2,a3,a4,a5], 1);
    The arrays a1, a2, a3, ..... will get sorted according to the numeric or alphabetical order of the array specified in the 2nd parameter.
    One could easily (I think) change the sort function to first sort by array x and then by array y etc.
    // Advanced Sort Variable Numbers of  Arrays in Sync Script by Trevor
    // http://forums.adobe.com/thread/1062126?tstart=0
    var   a1 = [2, 5, 10, 7, 100, 5, .5, 0]
            a2 = ['two', 'five', 'ten', 'seven', 'one hundred', 'five', 'one half', 'zero'],
            a3 = [ 'deux', 'cinq', 'dix', 'sept', 'cent', 'cinq', 'un demi', 'zéro' ],
            a4 = [ 'twee', 'vijf', 'tien', 'zeven', 'honderd', 'vijf', 'helft', 'nul' ],
            a5 = [ 'tsvey ', 'finef', 'tzien', 'zibn', 'eyn honderd', 'finef', 'eyn halb', 'nul' ];
    alert("\tIndividual Arrays Before Sort\r"+a1+"\r"+a2+"\r"+a3+"\r"+a4+"\r"+a5);
    sortArraysInSync([a1,a2,a3,a4,a5], 1);
    alert("\tIndividual Arrays After Sort\r"+a1+"\r"+a2+"\r"+a3+"\r"+a4+"\r"+a5);
    function sortArraysInSync (myArrays, s /* number or the array to sort by (starting from 1) */)
        arr = []; var l1 = ll1 = myArrays[0].length, i = ll2 = myArrays.length;
        s--;
        while(l1--)
                arr[l1]={}           
                i = myArrays.length;
                while(i--) eval("arr["+l1+"].key"+i+" = myArrays[i][l1]");
        arr.sort(mySort);
        while (ll1--) for (i=0; i<myArrays.length;i++) eval ("myArrays[i][ll1] = arr[ll1].key"+i);
        alert("\tFunction Array After Sort\r"+myArrays.join("\r"))
    function mySort(a, b)
            if (eval("isNumber(a.key"+s+") || isNumber(b.key"+s+")")) return eval("a.key"+s+"- b.key"+s+"");
            else if (eval("a.key"+s+".toLowerCase() > b.key"+s+".toLowerCase()")) return 1 else return -1;
    function isNumber(n) {return !isNaN(parseFloat(n)) && isFinite(n)}; // isNumber function from http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric/1830844#1830844
    For the simple 2 array sort I would have done as I said much the same as your one:
    // Simple Sort Arrays in Sync Script by Trevor
    // http://forums.adobe.com/thread/1062126?tstart=0
    var   a1 = ['two', 'five', 'ten', 'seven', 'one hundred', 'five', 'one half', 'zero'],
            a2 = [2, 5, 10, 7, 100, 5, .5, 0]
    alert("Individual Arrays Before Sort\r"+a1+"\r"+a2);
    sortArraysInSync(a1,a2);
    alert("Individual Arrays After Sort\r"+a1+"\r"+a2);
    function sortArraysInSync (x, y)
        var arr = [], l1 = l2 = Math.min(y.length, x.length);
        while (l1--) arr.push({name: x[l1], number: y[l1]});
        arr.sort(function(a, b) { return a.number - b.number; });
        while (l2--)
            x[l2] = arr[l2].name;
            y[l2] = arr[l2].number;
    I did a speed test by putting 2 3000 item arrays into my, your dbuffies and Jongware script and timing them.
    These were the results.
    Test done with alerts removed with program set to real time priority and alerts removed.
    These were the arrays and timing method
    var   a1 = ['zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two', 'zero', 'one half', 'five', 'one hundred', 'seven', 'ten', 'five', 'two'],
            a2 = [, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2, 0, 0.5, 5, 100, 7, 10, 5, 2];
    sdate = new Date();
    startTime = sdate.getTime();
    sortArraysInSync([a1,a2],2); // each scipt to its own.
    edate = new Date();
    endTime = edate.getTime();
    totalTime = (endTime-startTime)/1000;
    alert("Individual Arrays After Sort\r"+totalTime+"\r"+a1+"\r"+a2);
    Script
    Seconds taken to sort 2 Arrays 3000 items each
    Comments
    Trevor's Simple Script
    1.3
    Rick's (Frameexpert) Script
    12.3
    Trevor's Fancy Script
    33
    Bduffy's Script
    68
    Jongware's Script
    Crashed, don't know why?
    Don't forget to pick the correct answer.
    My 'fancy' script is slowed down considerably because of thoses evil  evals. Does anyone have a solution for this?
    Regards
    Trevor

  • Trouble with sending huge arrays via DataSocket​s.

    Hi,
    I am having trouble sending huge arrays via Data Sockets from my main vi on the server PC to the vi on the client PC.
    To further elaborate, in my main vi program I have created 3 arrays called Array1, Array2 and Array3 on my front Panel. By right clicking the mouse on each set of array and from the pop-up menu I selected Data Operations-> DataSocket Connection and I entered dstp://localhost/Array1 and clicked on Publish to broadcast the data from Array1. Similarly, I did the same for Array2 and Array3.
    Now, in my client vi program I have created three arrays on my front Panel to read (Subscribe) the data from the three arrays broadcasted via DataSockets from the server’s main vi program. To subsc
    ribe the data I did the similar process above and clicked on Subscribe to read the data (of course the IP address of the client PC will be different then the server PC so enter the hosts IP address). Once the data is received in the client arrays, I am using LV2 globals so that I can use these arrays on other sub-vi’s locally (instead of having each sub-vi get data from the server directly).
    I succeeded in doing this with two arrays, however when I added the third array the DataSockets would not work consistently. For example the refresh rate would get slower at times and sometimes 2 out of the 3 arrays would update. I don’t know if I have exceeded the limit on how much data DataSockets can broadcast, but I need to have some mechanism to broadcast 6 arrays (approx. 10000 elements for each array) of double digits precision.
    Has anyone come across this issue? Is there another way of broadcasting data more efficiently then DataSockets?
    I would appreciate any
    help that I can get.
    I have attached the files for this program in the zip file.
    First run the Server main program, testServeMainVI.vi, and then the client program, testClientMainVI.vi.
    Thanks
    Nish
    Attachments:
    beta2.zip ‏70 KB

    DataSocket can be a lossy communication. I like the advice to flatten the data to a string, but another option would be to buffer the communcation. The problem might be that the data is being overwritten on the server faster than it is being read. There is an example of buffered datasocket on NI web page: http://venus.ni.com/stage/we/niepd_web_display.DIS​PLAY_EPD4?p_guid=BA3F9DFED17F62C3E034080020E74861&​p_node=DZ52000_US&p_submitted=N&p_rank=&p_answer=&​p_source=Internal
    Also, I have played with the new built in buffered datasocket in LabVIEW 7.0. It is pretty slick. If buffers the data both on the server and the client side.

  • Strange Compiler Error

    Hi, I was wondering if you could help me out with a little problem that I've encountred. When I compile my project, I get the following errors:
    Errors:
    C:\Program Files\Xinox Software\JCreatorV3 LE\MyProjects\MatrixAddition\MatrixAddition.java:23: illegal start of type
            while(exit == false) {
            ^
    C:\Program Files\Xinox Software\JCreatorV3 LE\MyProjects\MatrixAddition\MatrixAddition.java:120: <identifier> expected
    ^
    2 errorsRadReader class:
    import java.io.*;
    import java.lang.*;
    // Use to throw exceptions
    class RadReaderException extends RuntimeException { 
         RadReaderException(Throwable cause) {   
              super(cause); 
    public class RadReader {       
         public static int readInt(String prompt) {          
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get string input
              int integer = 0;
              String input = "";
              try {
                   input = bfRdr.readLine();
              catch(IOException e) {
                   throw new RadReaderException(e);
              // Convert to int
              try {
                   integer = Integer.parseInt(input);
              catch(NumberFormatException e) {
                   throw new RadReaderException(e);
              // Return integer
              return integer;
         public static float readFloat(String prompt) {          
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get string input
              float floatingPt = 0;
              String input = "";
              try {
                   input = bfRdr.readLine();
              catch(IOException e) {
                   throw new RadReaderException(e);
              // Convert to float
              try {
                   floatingPt = Float.parseFloat(input);
              catch(NumberFormatException e) {
                   throw new RadReaderException(e);
              // Return floatingPt
              return floatingPt;
         public static double readDouble(String prompt) {          
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get string input
              double dble = 0;
              String input = "";
              try {
                   input = bfRdr.readLine();
              catch(IOException e) {
                   throw new RadReaderException(e);
              // Convert to double
              try {
                   dble = Double.parseDouble(input);
              catch(NumberFormatException e) {
                   throw new RadReaderException(e);
              // Return dble
              return dble;
         public static char readChar(String prompt) {          
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get char
              char character = '?';
              try {
                   character = (char)bfRdr.read();
              catch(IOException e) {
                   throw new RadReaderException(e);
              // Return true if method worked
              return character;
         public static char[] readCharArray(String prompt, int length) {
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get char[]
              char[] array = new char[length];
              try {
                   bfRdr.read(array, 0, array.length);
              catch(IOException e) {
                   throw new RadReaderException(e);
              // Return true if method worked
              return array;
         public static String readString(String prompt) {        
         BufferedReader bfRdr = new BufferedReader(new InputStreamReader(System.in));     
              // Print the prompt
              if(prompt != "") {
                   System.out.print(prompt);
              // Get string input
              String string = "";
              try {
                   string = bfRdr.readLine();
              catch(IOException e) {
                   throw new RadReaderException(e);     
              // Return true if method works
              return string;
    }Main(Matrix Addition):
    public class MatrixAddition {
         // Radreader object
         RadReader reader = new Radreader();
         // Instantiate arrays
         int[][] array1 = new int[3][2];
         int[][] array2 = new int[3][2];
         int[][] array3 = new int[3][2];
         // Boolean control variables
         boolean exit = false;
         // Begin while loop
         while(exit == false) {
              // Get user input
              for(int row = 0; row < array1.length; row++) {
                   for(int column = 0; column < array1[0].length; column++) {
                        // local storage
                        int element = 0;
                        // Query for input
                        element = reader.readInt("Please enter the value of the " +
                                                       "element at row " + row + " and " +
                                                       "column " + column + ":");
                        // Set input to array1
                        array1[row][column] = element;
              // Get user input
              for(int row = 0; row < array2.length; row++) {
                   for(int column = 0; column < array2[0].length; column++) {
                        // local storage
                        int element = 0;
                        // Query for input
                        element = reader.readInt("Please enter the value of the " +
                                                       "element at row " + row + " and " +
                                                       "column " + column + ":");
                        // Set input to array1
                        array2[row][column] = element;
              // Add arrays
              for(int row = 0; row < array3.length; row++) {
                   for(int column = 0; column < array3[0].length; column++) {
                        // Set input to array1
                        array3[row][column] = array1[row][column] +array2[row][column];
              // Print arrays
              System.out.println("Array 1");
              for(int row = 0; row < array1.length; row++) {
                   for(int column = 0; column < array1[0].length; column++) {
                        System.out.print(array1[row][column] + " ");
                   System.out.println();
              System.out.println();
              System.out.println("Plus");
              System.out.println();
              System.out.println("Array 2");
              for(int row = 0; row < array2.length; row++) {
                   for(int column = 0; column < array2[0].length; column++) {
                        System.out.print(array2[row][column] + " ");
                   System.out.println();
              System.out.println();
              System.out.println("Equals");
              System.out.println();
              for(int row = 0; row < array3.length; row++) {
                   for(int column = 0; column < array3[0].length; column++) {
                        System.out.print(array3[row][column] + " ");
                   System.out.println();
              // Check for exit flag
              char exitFlag = reader.readChar("Quit?(y/n) ");
              if(exitFlag == 'y' || exitFlag == 'Y') {
                   exit = true;
              System.out.println();          
    }Please advize me on how to fix my code.
    Thanks!

    Nothing strange. You can only write a statement (such as a while-loop) inside a block. You can only write a block inside a method declaration or initializer.
    Your problem is that you put the while-loop straight inside a class declaration. You should put it inside a method instead.

  • Add element in array

    Hi,
    I have one String array.
    I need to create another String array with the content of 1st array and additional 1st element in the 2nd array with "Product" text.
    2nd array[0] = Product;
    How do i do it
    Thanks

    String[] array1 = {"1", "2", "3"};
    String[] array2 = {"4", "5"};
    String[] array3 = new String[array1.length+array2.length];
    System.arraycopy(array1, 0, array3, 0, array1.length);
    System.arraycopy(array2, 0, array3, array1.length, array2.length);
    here, the array3 will have all the elements in order ie, 1,2,3,4,5.
    In case you need to use array2, assign array3 to array2 ie, array2 = array3
    Hope that helps.
    Regards,
    Sumant

  • Add selection as add and intersect commands combined

    Hello, I want to add selection to a selection so it acts as the two commands combined: add command and intersect command. Where parts of a selection intersect i want to act it as the add command - it simply adds selection to a selection. Where it does not intersect, i want it to act as the intersect command - it deletes the part of the selection that doesnt intersect. Can this be scripted?

    By the way: The Script would only provide the expected result if the second Selection is one contiguous area.
    Edit: This should also handle discontinuous segments for the second Selection.
    // store selection on first run, on second run add overlapping parts of the sstored selection to the new selection;
    // 2014, use at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    activeDocument.suspendHistory("something with selections", "main()");
    ////// the stuff //////
    function main () {
    var myDocument = app.activeDocument;
    var theChannelName = "removeThisChannelLaterOn";
    if (hasSelection() == true) {
    // if channel exists;
    try {
    var theChannel = myDocument.channels.getByName(theChannelName);
    // store the selection;
    var theOtherChannel = myDocument.channels.add();
    myDocument.selection.store(theOtherChannel);
    theOtherChannel.name = theChannelName+"Too";
    // fill;
    myDocument.activeChannels = [theChannel];
    var theColor = new SolidColor();
    theColor.rgb.red = 255;
    theColor.rgb.green = 255;
    theColor.rgb.blue = 255;
    myDocument.selection.fill(theColor);
    // get path information;
    var path1 = workPathFromChannel (myDocument, theChannel);
    var path2 = workPathFromChannel (myDocument, theOtherChannel);
    // check for identical point;
    var theCheck = checkForIdenticalPoints (path1, path2);
    if (theCheck != false) {
    var thePath = createPath2012(theCheck, "removeThisPathLaterOn");
    // load;
    thePath.makeSelection(0, false, SelectionType.REPLACE);
    myDocument.selection.expand(1);
    myDocument.selection.load(theChannel, SelectionType.INTERSECT, false)
    // clean up;
    thePath.remove();
    // clean up;
    theChannel.remove();
    theOtherChannel.remove();
    // if channel does not exist;
    catch (e) {
    // store the selection;
    var theMask = myDocument.channels.add();
    myDocument.selection.store(theMask);
    theMask.name = theChannelName;
    compositeChannels ();
    showChannel (theChannelName);
    myDocument.selection.deselect();
    ////// get work path  info from channel //////
    function workPathFromChannel (myDocument, theChannel) {
    // load;
    myDocument.selection.load(theChannel, SelectionType.REPLACE);
    // use threshold to heighten non black pixels;
    myDocument.quickMaskMode = true;
    myDocument.activeLayer.threshold(1);
    myDocument.quickMaskMode = false;
    // create work path;
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
        var desc16 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref12 = new ActionReference();
            var idPath = charIDToTypeID( "Path" );
            ref12.putClass( idPath );
        desc16.putReference( idnull, ref12 );
        var idFrom = charIDToTypeID( "From" );
            var ref13 = new ActionReference();
            var idcsel = charIDToTypeID( "csel" );
            var idfsel = charIDToTypeID( "fsel" );
            ref13.putProperty( idcsel, idfsel );
        desc16.putReference( idFrom, ref13 );
        var idTlrn = charIDToTypeID( "Tlrn" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc16.putUnitDouble( idTlrn, idPxl, 1.000000 );
    executeAction( idMk, desc16, DialogModes.NO );
    // get information;
    var theArray = collectPathInfoFromDesc2012 (myDocument, myDocument.pathItems[myDocument.pathItems.length - 1]);
    return theArray
    ////// check for selection //////
    function hasSelection(){
    var ref10 = new ActionReference();
    ref10.putEnumerated( charIDToTypeID( "Dcmn" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
    var docDesc = executeActionGet(ref10);
    return docDesc.hasKey(stringIDToTypeID("selection"));
    ////// go to composite channels //////
    function compositeChannels () {
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
        var desc2 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref2 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" ); 
    switch (activeDocument.mode) {
        case DocumentMode.RGB:
            var idComposite = charIDToTypeID( "RGB " );
            break;
        case DocumentMode.CMYK:
            var idComposite = charIDToTypeID( "CMYK" );
            break;
        case DocumentMode.LAB:
            var idComposite = charIDToTypeID( "Lab " );
            break;
        case DocumentMode.GRAYSCALE:
            var idComposite = charIDToTypeID( "Blck" );
            break;
            ref2.putEnumerated( idChnl, idChnl, idComposite );
        desc2.putReference( idnull, ref2 );
    executeAction( idslct, desc2, DialogModes.NO );
    ////// chow channel of name //////
    function showChannel (theName) {
    // =======================================================
    var idShw = charIDToTypeID( "Shw " );
        var desc3 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var list1 = new ActionList();
                var ref3 = new ActionReference();
                var idChnl = charIDToTypeID( "Chnl" );
                ref3.putName( idChnl, theName );
            list1.putReference( ref3 );
        desc3.putList( idnull, list1 );
    executeAction( idShw, desc3, DialogModes.NO );
    ////// collect path info from actiondescriptor, smooth added //////
    function collectPathInfoFromDesc2012 (myDocument, thePath) {
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.POINTS;
    // based of functions from xbytor’s stdlib;
    var ref = new ActionReference();
    for (var l = 0; l < myDocument.pathItems.length; l++) {
      var thisPath = myDocument.pathItems[l];
      if (thisPath == thePath && thisPath.name == "Work Path") {
      ref.putProperty(cTID("Path"), cTID("WrPt"));
      if (thisPath == thePath && thisPath.name != "Work Path" && thisPath.kind != PathKind.VECTORMASK) {
      ref.putIndex(cTID("Path"), l + 1);
      if (thisPath == thePath && thisPath.kind == PathKind.VECTORMASK) {
            var idPath = charIDToTypeID( "Path" );
            var idPath = charIDToTypeID( "Path" );
            var idvectorMask = stringIDToTypeID( "vectorMask" );
            ref.putEnumerated( idPath, idPath, idvectorMask );
    var desc = app.executeActionGet(ref);
    var pname = desc.getString(cTID('PthN'));
    // create new array;
    var theArray = new Array;
    var pathComponents = desc.getObjectValue(cTID("PthC")).getList(sTID('pathComponents'));
    // for subpathitems;
    for (var m = 0; m < pathComponents.count; m++) {
      var listKey = pathComponents.getObjectValue(m).getList(sTID("subpathListKey"));
      var operation1 = pathComponents.getObjectValue(m).getEnumerationValue(sTID("shapeOperation"));
      switch (operation1) {
      case 1097098272:
      var operation = 1097098272 //cTID('Add ');
      break;
      case 1398961266:
      var operation = 1398961266 //cTID('Sbtr');
      break;
      case 1231975538:
      var operation = 1231975538 //cTID('Intr');
      break;
      default:
    // case 1102:
      var operation = sTID('xor') //ShapeOperation.SHAPEXOR;
      break;
    // for subpathitem’s count;
      for (var n = 0; n < listKey.count; n++) {
      theArray.push(new Array);
      var points = listKey.getObjectValue(n).getList(sTID('points'));
      try {var closed = listKey.getObjectValue(n).getBoolean(sTID("closedSubpath"))}
      catch (e) {var closed = false};
    // for subpathitem’s segment’s number of points;
      for (var o = 0; o < points.count; o++) {
      var anchorObj = points.getObjectValue(o).getObjectValue(sTID("anchor"));
      var anchor = [anchorObj.getUnitDoubleValue(sTID('horizontal')), anchorObj.getUnitDoubleValue(sTID('vertical'))];
      var thisPoint = [anchor];
      try {
      var left = points.getObjectValue(o).getObjectValue(cTID("Fwd "));
      var leftDirection = [left.getUnitDoubleValue(sTID('horizontal')), left.getUnitDoubleValue(sTID('vertical'))];
      thisPoint.push(leftDirection)
      catch (e) {
      thisPoint.push(anchor)
      try {
      var right = points.getObjectValue(o).getObjectValue(cTID("Bwd "));
      var rightDirection = [right.getUnitDoubleValue(sTID('horizontal')), right.getUnitDoubleValue(sTID('vertical'))];
      thisPoint.push(rightDirection)
      catch (e) {
      thisPoint.push(anchor)
      try {
      var smoothOr = points.getObjectValue(o).getBoolean(cTID("Smoo"));
      thisPoint.push(smoothOr)
      catch (e) {thisPoint.push(false)};
      theArray[theArray.length - 1].push(thisPoint);
      theArray[theArray.length - 1].push(closed);
      theArray[theArray.length - 1].push(operation);
    // by xbytor, thanks to him;
    function cTID (s) { return cTID[s] || cTID[s] = app.charIDToTypeID(s); };
    function sTID (s) { return sTID[s] || sTID[s] = app.stringIDToTypeID(s); };
    // reset;
    app.preferences.rulerUnits = originalRulerUnits;
    return theArray;
    ////// create a path from collectPathInfoFromDesc2012-array //////
    function createPath2012(theArray, thePathsName) {
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.POINTS;
    // thanks to xbytor;
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putProperty(cTID('Path'), cTID('WrPt'));
        desc1.putReference(sTID('null'), ref1);
        var list1 = new ActionList();
    for (var m = 0; m < theArray.length; m++) {
      var thisSubPath = theArray[m];
        var desc2 = new ActionDescriptor();
        desc2.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), thisSubPath[thisSubPath.length - 1]);
        var list2 = new ActionList();
        var desc3 = new ActionDescriptor();
        desc3.putBoolean(cTID('Clsp'), thisSubPath[thisSubPath.length - 2]);
        var list3 = new ActionList();
    for (var n = 0; n < thisSubPath.length - 2; n++) {
      var thisPoint = thisSubPath[n];
        var desc4 = new ActionDescriptor();
        var desc5 = new ActionDescriptor();
        desc5.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[0][0]);
        desc5.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[0][1]);
        desc4.putObject(cTID('Anch'), cTID('Pnt '), desc5);
        var desc6 = new ActionDescriptor();
        desc6.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[1][0]);
        desc6.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[1][1]);
        desc4.putObject(cTID('Fwd '), cTID('Pnt '), desc6);
        var desc7 = new ActionDescriptor();
        desc7.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[2][0]);
        desc7.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[2][1]);
        desc4.putObject(cTID('Bwd '), cTID('Pnt '), desc7);
        desc4.putBoolean(cTID('Smoo'), thisPoint[3]);
        list3.putObject(cTID('Pthp'), desc4);
        desc3.putList(cTID('Pts '), list3);
        list2.putObject(cTID('Sbpl'), desc3);
        desc2.putList(cTID('SbpL'), list2);
        list1.putObject(cTID('PaCm'), desc2);
        desc1.putList(cTID('T   '), list1);
        executeAction(cTID('setd'), desc1, DialogModes.NO);
    if (hasVectorMask() == false) {
    if (thePathsName != undefined) {app.activeDocument.pathItems[app.activeDocument.pathItems.length - 1].name = thePathsName};
    var myPathItem = app.activeDocument.pathItems[app.activeDocument.pathItems.length - 1];
    else {
    if (thePathsName != undefined) {app.activeDocument.pathItems[app.activeDocument.pathItems.length - 2].name = thePathsName};
    var myPathItem = app.activeDocument.pathItems[app.activeDocument.pathItems.length - 2];
    app.preferences.rulerUnits = originalRulerUnits;
    return myPathItem
    // from »Flatten All Masks.jsx« by jeffrey tranberry;
    // Function: hasVectorMask
    // Usage: see if there is a vector layer mask
    // Input: <none> Must have an open document
    // Return: true if there is a vector mask
    function hasVectorMask() {
      var hasVectorMask = false;
      try {
      var ref = new ActionReference();
      var keyVectorMaskEnabled = app.stringIDToTypeID( 'vectorMask' );
      var keyKind = app.charIDToTypeID( 'Knd ' );
      ref.putEnumerated( app.charIDToTypeID( 'Path' ), app.charIDToTypeID( 'Ordn' ), keyVectorMaskEnabled );
      var desc = executeActionGet( ref );
      if ( desc.hasKey( keyKind ) ) {
      var kindValue = desc.getEnumerationValue( keyKind );
      if (kindValue == keyVectorMaskEnabled) {
      hasVectorMask = true;
      }catch(e) {
      hasVectorMask = false;
      return hasVectorMask;
    ////// check for identical pathpoints //////
    function checkForIdenticalPoints (array1, array2) {
    var theReturn = new Array;
    // the subpathitems;
    for (var m = 0; m < array1.length; m++) {
    var firstCheck = false;
    var thisSub = array1[m];
    var someReturn = compareSubPathWithPath (thisSub, array2);
    if (someReturn != undefined) {theReturn.push(someReturn)};
    ////// return subpathitem if ine point is idetical //////
    function compareSubPathWithPath (thisSub, array2) {
    // the other subpathitems;
    for (var n = 0; n < array2.length; n++) {
    var thisOtherSub = array2[n];
    // the points;
    for (var o = 0; o < thisSub.length - 2; o++) {
    var thisPoint = thisSub[o][0];
    // other point:
    for (var p = 0; p < thisOtherSub.length - 2; p++) {
    var otherPoint = thisOtherSub[p][0];
    // terminate if one identical pont is found;
    if (thisPoint[0] == otherPoint[0] && thisPoint[1] == otherPoint[1]) {return thisSub}
    if (theReturn.length > 0) {return theReturn}
    else {return false}

  • How can I use a variable as an array's name?

    Ok I have several arrays in my code (lets call them "array1", "array2" etc) and I want to load them based on the users input. So if the user enters array1, I want the first array to be loaded, and the same with the other arrays.
    I tried saving the user's input on a string variable called ARRAY_NAME, so that each time the user enters a different array name, the corresponding array is loaded. Something like this:
      ARRAY_NAME[c1][c2]; but I get this error:
    array required, but java.lang.String found
              ARRAY_NAME[c1][c2];
    ___________^
    Can you please tell me what is the correct way of doing it?
    Thanx!

    The short answer is you can't. An object name can't be
    variable and must be known at compile time. But you
    could associate the user input name with a particular
    array, for example, using a HashMap with the user name
    as the key to an array. However, you'd need to use a
    container class (Vector, ArrayList, etc.) rather than
    a raw array, because containers only take class
    instances as elements.Maps can't deal with primitives, that is true. However, arrays are full scale objects, so they can be put into maps.
    Also, my code had a bug in it. Try this:
    int userIndex = getUserIndex();
    String userInput = getUserInput();
    Field array = getClass().getDeclaredField(userInput);
    Object item = Array.get(array.get(this), userIndex);

  • Transfering elements to new array and doubling values.

    Hi my problem is that I need to ask a user to enter 5 integers that stores them in an array. Transfer them to a new array by doubling the values when trasferred.
    Please help I have 3 errors.
    class arrays
         public static void main (String[] args)
              int numbers[] = new int [5];
              byte array1Size = 0;
              int input = 0;
              char goon = 'y';
                   //create and initialise an array of 5 integers
                   int array1[] = new int [5];
                   // loop and fill each element
                   for (int x = 0; x < array1.length; x++)
                        System.out.println("Enter a number: ");
                        array1[x] = EasyIn.getInt();
                        // Filling array
                        if (array1Size >= array1.length)
                             //Make a new array doubling the values od the integers
                             int array2 [] = new int [2 * array1.length]; // 10 integers
                             //Copying integers
                             System.arrayCopy (array1, 0, array2, 0, array1.length);
                             //Make old reference point to new array
                             array1 = array2;
                        else
                             //normal
                             do
                                  System.out.print("Enter an integer: ");
                                  input = EasyIn.getInt();
                                  anotherArray[anotherArraySize] = input;
                                  anotherArraySize++;
                                  System.out.print ("Another number? Enter Y or N: ");
                                  goon = EasyIn.getChar();
                             }     while(goon = = 'y' | goon = = 'Y');
    the errros >>>
    G:\Java\Practical 7\Practical74.java:33: '.class' expected
                             int array2 [] = new int [2 * array1.length]; // 10 integers
    ^
    G:\Java\Practical 7\Practical74.java:33: not a statement
                             int array2 [] = new int [2 * array1.length]; // 10 integers
    ^
    G:\Java\Practical 7\Practical74.java:41: 'else' without 'if'
                        else
    ^
    3 errors
    Tool completed with exit code 1
    Thanks

    Hi,
    it seems you forgot the curly braces in the if-else statement:
    if (array1Size >= array1.length){
    //Make a new array doubling the values od the integers
    int array2 [] = new int [2 * array1.length]; // 10 integers
    //Copying integers
    System.arrayCopy (array1, 0, array2, 0, array1.length);
    //Make old reference point to new array
    array1 = array2;
    else{
    //normal
    do
    System.out.print("Enter an integer: ");
    input = EasyIn.getInt();
    anotherArray[anotherArraySize] = input;
    anotherArraySize++;
    System.out.print ("Another number? Enter Y or N: ");
    goon = EasyIn.getChar();
    } while(goon = = 'y' | goon = = 'Y');
    }

  • Problem with Webdynpro Tables and Scatter-chart

    I have a Webservice who returns two one-dimensional arrays. I want to know how to fill one table with these arrays. And how to get this data displayed in an two dimensional scatter-chart as x and y Values.

    Create a context node "Rows", cardinality 0:N, add attributes A, B (type as needed e.g. "string").
    Fill the node with the content of your arrays array1, array2 (assuming both arrays have same length):
    for (int j = 0; j < array1.length; ++j)
      IRowElement row = wdContext.nodeRows().createRowsElement();
      wdContext.nodeRows().addElement(row);
      row.setA(array1[j]);
      row.setB(array2[j]);
    Display in a Table: Create a Table T, add columns CA / CB, add to each a TextView as cell editor. Bind cell editor's property "text" to attribute A / B.
    For display in BusinessGraphics element, read the documentation at
    http://help.sap.com/saphelp_nw04/helpdata/en/e5/08b6eb35637a44830b9e6df22987aa/content.htm
    Armin

Maybe you are looking for

  • WebRowSet properties for Oracle 10g XML

    //I am writing data into a database //Clob field then useing a WebRowSet writing //it as XML to the clob ResultSet rs = statement.executeQuery(); WebRowSet webRowSet = new WebRowSetImpl(); webRowSet.setCommand(sql); webRowSet.populate(rs); // First a

  • Jinitiator 1.3.1.9 Install problems

    I am running 9iDS 9.02. Forms is installed and run from all but one user. When that user installs Jinitiator he gets the following error message: An installable virtual device driver failed dll initialization. The user is running IE 6.0 on Windows 20

  • Output to Postscript using PDF Library SDK

    I'm pretty sure I read that the PDF Library supports exporting to Postscript, but I'm having a hard time finding how to do that in the documentation. Can someone tell me which document (AND IT'S PAGE NUMBER) that explains how to take a PDF and conver

  • Problems after installing Security Update 2008-02

    I have a PPC G4 (1.65GHz/512 MB RAM), patched to 10.4.11. Before running the 2008-02 patch yesterday, I cloned my system to an external drive, ran Onyx (run all maintenance scripts/delete caches/repair permissions). I also uninstalled Miro 1.1 (inten

  • Failed to start deployable object

    Hello friends! I get the following error very often after migrating from 7.1 sp5 to 7.1.1 Ehp1 sp4 NWDS. (Never faced this issue in 7.1 sp5 NWDS.) "Application error occured during the request processing com.sap.tc.webdynpro.services.sal.core.Dispatc