Unexpected result with Array.sort

There seems to be a problem with the sort function when sorting the table contains several elements that are equal. I tried to illustrate this in the most simple form below:

var test1:Array = ['a', 'b', 'this,' would be '];

var test2:Array = [', 'c', 'b', 'a'];

var test3:Array = ['a', 'b', 'c', ' a'];

var test4:Array = ['a', ' a ',' b ', 'a'];

trace (test1.sort (Array.RETURNINDEXEDARRAY)); Should be 0,1,2,3 (well!)

trace (test2.sort (Array.RETURNINDEXEDARRAY)); Should be 3,2,1,0 (good!)

trace (test3.sort (Array.RETURNINDEXEDARRAY)); Must be 0,2,3,1 (evil)

trace (test4.sort (Array.RETURNINDEXEDARRAY)); Must be 0,1,3,2 (evil)

/ * Output

0,1,2,3

3,2,1,0

3,0,1,2

3,1,0,2

*/

Can anyone find a reason of incompatibility, or is this a bug in the sorting method?

test3: must be 0,3,1,2 or 3,0,1,2.  They are the same.

test4: 0,1,3,2 is the same as 3,1,0,2 is the same as 1,0,3,2 is the same as 0,3,1,2 etc.  That is to say, as long as the index 2 is the last, they still.

Oh, I see the problem.  you think flash is assign an index to the elements of the original array.

It is not the case.  the method released the list of indices in the sort order.  IE, 0,3,1,2 means the original elements of 0th and 3rd tables are first and 2nd and the 1st element is the third and the 2nd element is the last.

so, if you wanted to list the elements of original paintings using your sort order for test3, for example, you would use:

test3 [0], test3 [3], test3 [1], test3 [2] and you expect, a, b, c

Tags: Adobe Animate

Similar Questions

  • Built-in sort with Arrays.sort

    I have multidimensional array that contains a number as new arr int [10] [10] and that you want to sort according to the last column. Arrays.sort is a simple way to do it, but what happens if I don't want a real movement elements occur by Arrays.sort (arr [] []). Frankly, I'm interested in winning positions but not to grant the lines. Can I pass it arrange step because not interested in changing the original table? For the moment, I sort the table with Arrays.sort then index of table row and I fixed the position number pair. For example arr [0] has rank 1, arr [1] has the rank of 2 etc. If sorted according to the last column.

    Published by: totalnewby on May 23, 2011 22:51

    totalnewby wrote:
    I just need to know where the items would be positioned if they have been sorted. I made copy of the table at the moment and my program is successful, even if it takes a lot of time and additional memory to perform the copy because this table has billions lines in reality. If you can suggest less time-consuming solution do let me know.

    This is my standard example of how to do this sort of indirect.

     public static void main(String[] args) throws Exception
        {
            final Words words = new Words("/usr/share/dict/words");
            final List data = new ArrayList();
            for (int i = 0; i < 10000; i++)
            {
                String[] row = new String[10];
                for (int j = 0; j < row.length; j++)
                {
                    row[j] = words.getRandomWord();
                }
                data.add(row);
            }
    
            final Integer[] indirectIndex = new Integer[data.size()];
            for (int i = 0; i < indirectIndex.length; i++)
            {
                indirectIndex[i] = i;
            }
    
            final Comparator indexComparator = new Comparator()
            {
                @Override
                public int compare(Integer left, Integer right)
                {
                    int result = 0;
                    for (int i = 0; result == 0 && i < data.get(left).length; i++)
                    {
                        result = data.get(left).compareTo(data.get(right)[i]);}return result;}};
    
    Arrays.sort(indirectIndex, indexComparator);
    
    for (int i = 0; i < 100; i++){System.out.println(indirectIndex[i] + "\t" + Arrays.toString(data.get(indirectIndex[i])));}}
    
    You just need to create a Comparator for sorting the index array that uses the last entry in each row of real data array when comparing a row rather than all the row entries as I have done. 
    
  • DAQmxReadAnalogF64 gives unexpected results with 9239 of Ni - DAQmx

    Hi all

    I use a NI 9239 with a laser sensor, and I would like to acquire some pressure readings of the probe which measures the height. It works very well with Ni Max, but not in C + c++ / MFC app I am developing. I get something that looks like amplidied noise:
    1 reading scale doesn't seem fair (pressure readings I get from range - 2E9 to 2E9)
    2 changes in what the sensor is supposed to measure does not appear in my measurements at all, there is nothing other than the noise (as if I were acquires bad chain - this I double checked)
    I would like to get the same result as in Ni Max, but may not know what wrong with my code (below).

    Thanks for your help,

    Ben

    DAQmx Configure Code
    DAQmxErrChk (DAQmxCreateTask ("LaserReading", & taskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"cDAQ1Mod1/ai0","",DAQmx_Val_Diff,-10,10,DAQmx_Val_Volts,));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,,10000,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,5000));

    Starting code DAQmx
    DAQmxErrChk (DAQmxStartTask (taskHandle));

    Reading DAQmx code
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,NUM,-1,DAQmx_Val_GroupByChannel,data,5000,&read,));

    TRACE sends the readings to the debug output

    TRACE ('%d points\n acquis', read);
    for (i = 0; i<5000;>
    {
    TRACE("%d\n",data[i]);
    }

    DAQmxStopTask (taskHandle);
    DAQmxClearTask (taskHandle);

    Found the answer to this problem, the problem was in the function TRACE which data acquired to the debugger output. %D %f for the float to TRACE("%f\n",data[i values changed]) - things are great now.

    Thank you

    Ben

  • Oracle 12 c - unexpected result with the insertion of the DBA_VIEWS view

    Hello

    I try inserting the DBA_VIEWS fields in a table belonging to a common C a PDB file ##SA user:

    (a) the PDB PDBORCL using user C ##SA connection:

    SQL * more: Production of liberation 12.1.0.1.0 kills him Sep 10 16:21:39 2013

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.

    Enter the password:

    Last successful login time: kills Sep 10-2013 16:18:26 + 02:00

    Connected to:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    C##SA@pdborcl 10.09.2013 > see the con_name

    CON_NAME

    ------------------------------

    PDBORCL

    C##SA@pdborcl 10.09.2013 > see the con_id

    CON_ID

    ------------------------------

    3

    (b) I create the table user SA_VIEWS_V

    C##SA@pdborcl 10.09.2013 > select count (*) in the dba_views;

    COUNT (*)

    ----------

    6220

    1 selected line.

    C##SA@pdborcl 10.09.2013 > create table sa_views_v (owner varchar2 (128), view_name varchar2 (128));

    Table created.

    (c) the insertion in the table SA_VIEWS_V gave me only 65 rows at the same time lines of content 6220 dba_views:

    C##SA@pdborcl 10.09.2013 > INSERT INTO SA_VIEWS_V (OWNER, VIEW_NAME) SELECT MASTER, VIEW_NAME DBA_VIEWS;

    65 lines were created.

    C##SA@pdborcl 10.09.2013 > commit;

    Validation complete.

    C##SA@pdborcl 10.09.2013 > SELECT MASTER, VIEW_NAME DBA_VIEWS;

    ...

    IX

    IX

    IX

    SH

    6220 selected lines.

    (d) you will find above the executed plan of the insert and the single select statement:

    C##SA@pdborcl 10.09.2013 > select * from table (dbms_xplan.display_cursor ('aj3vkggtvv9d9'));

    PLAN_TABLE_OUTPUT

    ------------------------------------------------------------------------------------------------------------

    SQL_ID, aj3vkggtvv9d9, number of children 0

    -------------------------------------

    INSERT INTO SA_VIEWS_V (OWNER, VIEW_NAME) SELECT VIEW_NAME, MASTER OF

    DBA_VIEWS

    Hash value of plan: 1585970530

    -----------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    -----------------------------------------------------------------------------------------------------

    |   0 | INSERT STATEMENT.                  |       |       |   136 (100) |          |

    |   1.  LOAD TABLE CLASSIC |                  |       |       |            |          |

    |*  2 |   FILTER                         |                  |       |       |            |          |

    |*  3 |    HASH JOIN |                  |    65.  6045.   136 (0) | 00:00:01 |

    |*  4 |     HASH JOIN |                  |    65.  4875.   132 (0) | 00:00:01 |

    |   5.      NESTED LOOPS |                  |       |       |            |          |

    |   6.       NESTED LOOPS |                  |    65.  3315 |   131 (0) | 00:00:01 |

    |   7.        INDEX SCAN FULL | I_VIEW1 |    65.   325.     1 (0) | 00:00:01 |

    |*  8 |        INDEX RANGE SCAN | I_OBJ1 |     1.       |     1 (0) | 00:00:01 |

    |   9.       TABLE ACCESS BY INDEX ROWID | OBJ$             |     1.    46.     2 (0) | 00:00:01 |

    |  10.      INDEX SCAN FULL | I_USER2 |   131.  3144 |     1 (0) | 00:00:01 |

    |  11.     TABLE ACCESS FULL | USER$ |   131.  2358.     4 (0) | 00:00:01 |

    | * 12 |    TABLE ACCESS FULL | USER_EDITIONING$ |     1.     6.     2 (0) | 00:00:01 |

    |  13.    SEMI NESTED LOOPS.                  |     1.    29.     2 (0) | 00:00:01 |

    | * 14 |     INDEX SKIP SCAN | I_USER2 |     1.    20.     1 (0) | 00:00:01 |

    | * 15 |     INDEX RANGE SCAN | I_OBJ4 |     1.     9.     1 (0) | 00:00:01 |

    | * 16.    TABLE ACCESS FULL | USER_EDITIONING$ |     1.     6.     2 (0) | 00:00:01 |

    -----------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 filter (((IS NULL AND "O". ("TYPE #" <>88) OR BITAND ("O". ("" FLAGS ", 1048576) = 1048576 OR

    BITAND ("U". "" SPARE1»(, 16) = 0 OR (((SYS_CONTEXT ('userenv', 'current_edition_name') = ' ORA$ BASE ", AND)))"

    "U"." TYPE #"(<>2) OR ('U'." ' TYPE # '= 2 AND 'U'. "SPARE2" = TO_NUMBER (SYS_CONTEXT ('userenv ',' current_e)) "

    dition_id'))) or IS NOT NULL) AND IS NOT NULL)))

    3 - access("O".") SPARE3 '=' U '. ("" USER # ")

    4 - access("O".") "OWNER # '=' U '. ("" USER # ")

    8 - access("O".") ' OBJ # '=' V '. (' ' OBJ # ")

    12 filter (("TYPE #" =: B1 ET "UE".)) "THE USER #" =:B2))

    14 - access("U2".") TYPE # "= 2, AND"U2"." SPARE2 "= TO_NUMBER (SYS_CONTEXT ('userenv ',' current_editi))"

    on_id')))

    filter (("U2". "TYPE #"= 2, AND "U2"."" SPARE2 "= TO_NUMBER (SYS_CONTEXT ('userenv ',' current_edit))"

    ion_id')))

    15 - access("O2".") DATAOBJ #"=: B1 AND 'O2'." ' TYPE # '= 88 AND 'O2'. "OWNER #"= "U2". ("" USER # ")

    16 filter ((' EU'. "TYPE #" =: B1 AND 'EU '. "THE USER #" =:B2))

    47 selected lines.

    C##SA@pdborcl 10.09.2013 > select * from table (dbms_xplan.display_cursor ('bc4f1jh1snwdp'));

    PLAN_TABLE_OUTPUT

    -------------------------------------------------------------------------------------------------------

    SQL_ID, bc4f1jh1snwdp, number of children 0

    -------------------------------------

    SELECT THE OWNER, DBA_VIEWS NOM_DE_VUE

    Hash value of plan: 1508506130

    --------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Pstart. Pstop |

    --------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                  |       |       |     1 (100) |       |       |

    |   1.  PARTITION LIST ALL |                  | 10000 |  1289K |     0 (0) |     1.     2.

    |   2.   TABLE FIXED FULL | X$ COMVW$ 5885ef62 | 10000 |  1289K |     0 (0) |       |       |

    --------------------------------------------------------------------------------------------

    14 selected lines.

    You have an idea about this result?

    Thank you in advance,

    Arnaud.

    Arnaud,

    This has a fairly simple explanation.

    In 12cR1, there are common objects, and there are local objects. The definition of a common object is stored in the ROOT, and only a stub for the object is stored in the PDB. The definition of a local object is stored in the PDB.

    When DBA_VIEWS is questioned in a PDB file, so we must return to lines of views both as common as the result of the query. If views Commons are not returned, then several views that a client is used to see in the result of a query DBA_VIEWS to 11.2 and earlier versions not will be seen in paragraph 12.1. For example, ALL_TABLES, DBA_OBJECTS, etc.

    When DBA_VIEWS is questioned in a PDB file, then we extraction of lines for local opinions of PDB and common views of ROOT lines. The first has value ORIGIN_CON_ID equal to the ID of the container of the PDB to which you are connected, and they value ORIGIN_CON_ID equal to the ID of the ROOT container. Given that the recovery of these lines should be done in two different containers, we go through a fixed table X$ COMVW$ *.

    The gap that you are experiencing is because this fixed table based assessment is used only to SELECT and not for etc. SELECT, INSERT AS SELECT, CREATE TABLE AS.

    Let me know if that makes sense.

    Thank you

    Thomas

  • Unexpected result with select max (colmn) in anonymous block

    Hello

    The following query gives me 28 800 like sum (sal)
    SELECT SUM(salary)
    FROM employees 
        WHERE department_id =60
    O/P is :  28800
    But when I use the above query in anonymous block, it gives me 684400
    DECLARE
     v_sum_sal NUMBER;
     department_id employees.department_id%TYPE := 60;
    BEGIN
        dbms_output.put_line ('The department_id is'||department_id);
       SELECT SUM(salary)
          into v_sum_sal 
        FROM employees 
        WHERE department_id = department_id ;
       dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;
    Exit instructions above gives me 684400 as output... But the grounds are 28800

    You can me why the output differs block anonymous reference please

    Hello

    What about prefixing all your PL/SQL variables so that they do not match a column_name :

    DECLARE
     v_sum_sal NUMBER;
     v_department_id employees.department_id%TYPE := 60;
    BEGIN
        dbms_output.put_line ('The department_id is'||v_department_id);
       SELECT SUM(salary)
          into v_sum_sal
        FROM employees
        WHERE department_id = v_department_id ;
       dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;
    

    Because, with the first names, where clause was equivalent to:

    where 1=1
    
  • Unexpected behavior with the Option "record in the result.

    Hello

    I have unexpected behavior with the Option "record in the result.

    I have a few steps in the subsequence 'X', this subsequence passes a Boolean parameter. According to the value of the parameter I change the "Recorgind results" Option to report it or not. The thing is that if 'result Recorgind' set at race time I modofy by changing the value of Step.ResultRecordingOption to "Enable" and "Disable", the step is not reported until the same sous-suite 'X' is called for the second time (without changing the parameter passed).

    For example: (Preconditon: result Recorgind Option of all value sous-suite x are defined as Disable)

    1 CallSubsequenceX(Parameter: Enable)

    2 CallSubsequenceX(Parameter: Enable)

    3 CallSubsequenceX(Parameter: Disable)

    4 CallSubsequenceX(Parameter: Disable)

    Expected result:

    1. measures have been reported.

    2. measures have been reported.

    3. measures have not been reported.

    4. measures have not been reported.

    Result:

    1. measures would not same value Step.ResultRecordingOption has been changed to 'enable '. (Not Ok)

    2. measures have been reported. (Ok)

    3. measures reported same value Step.ResultRecordingOption has been changed to 'disable '. (Not Ok)

    4. measures have not been reported. (Ok)

    I use TestStand 2013 (5.1.0.226)

    Thanks in advance.

    -Josymar.

    Hi josymar_guzman,

    I just review the sequence and indeed we´re experience unexpected behavior with the Step.ResultRecordingOption callback. By a reason when you run the callback in the expression before each step section, the statement runs only until the next sequence is called, which is not what we want.

    To avoid this, you can place a statement before each step of the sequence, so you can change the State of the Option "record result" for the sequence running (and it is only the following). You can try something like this

    where the expression of the statement will be the recall "RunState.NextStep.ResultRecordingOption is YourCondition". With this, we guarantee that the results of the next step will be saved or not. I also remove the expression in the expression prior to each step section, because the condition is now on the statement before each step.

    I tried and it works fine. I´ll set the sequence that you share with me, with the changes. I hope this will help you and solve your problem.

  • Array.sort() compare strangeness function in ExtendScript

    I write this in InDesign Scripting forum, because I met the problem while he was working on a script for InDesign CC 2015, but it seems to cover all of ExtendScript.

    In my script, I use the method array.sort() with a custom comparison function to sort an array of objects with respect to one of their properties. I will introduce a version widespread in the party so that it is easier to analyze and reproduce.

    var myArray = [{
        name: "A",
        size: 20
    }, {
        name: "B",
        size: 10
    }, {
        name: "C",
        size: 30
    }, {
        name: "D",
        size: 30
    }];
    
    myArray.sort(
        function(a, b) {
            if (a.size > b.size) {
                return 1;
            }
            if (b.size > a.size) {
                return -1;
            }
            return 0;
        });
    
    
    var names = [];
    for (var i = 0; i <= myArray.length - 1; i++) {
        names.push(myArray[i].name)
    };
    names;
    

    The expected result is "B, A, C, D. B must go before A, as its size is smaller than A, while C and D should remain unchanged, because their size is equal.

    However, the result provided by ExtendScript is "B, A, D, C. For some reason, C and D become reversed.

    I believe that the source of this behavior lies with incorrect treatment of ExtendScript part returns 0 .

    To confirm that, I replaced the triage function with

    myArray.sort(
        function(a, b) {
            return 0;
        });
    

    which, according to my understanding of how the comparison functions are supposed to work, must return the entire unchanged table (regardless of the entry). But in this case ExtendScript treats as "B, C, D, A.

    I would be very grateful if someone could confirm if it is indeed a bug (or at least a dull implementation of the ECMAScript standard). Or is everything works as it should and the error on my part?

    Advice as workaround for this problem would also be very useful. Thank you!

    Thanks for that suggestion!

    Your answer made me read on different algorithms sort and their implementation in the different JavaScript engines. Apparently, ExtendScript uses what is called an unstable sorting algorithm, which is precisely the cause of a non desired behavior with values of the sort condition.

    To implement a different and stable algorithm (for example, merge sort) in your script is certainly an option, but it seemed overkill for my purposes.

    Fortunately, I was able to find another solution.

    First, add a property 'position' for each element of the array, based on its current position. For example:

    for (i = 0; i < myArray.length; i++) myArray[i].position = i;
    

    Then, simply change the latest state of the sort function so that it compares the position of each element:

    myArray.sort(function(a, b) {
        if (a.size > b.size) {
            return 1;
        }
        if (b.size > a.size) {
            return -1;
        }
        if (a.size == b.size) {
            return a.position - b.position;
        }
    });
    

    I hope this will be useful to those who might encounter the problem in the future.

  • When I subtract two numbers DBL and try to compare the result with another DBL, it fails

    I found a curious problem with subtraction and compare numbers DBL in LabVIEW (8.6). Here's how it works:

    1. subtract two numbers DBL such that the result is not incorporated. (Say, 3.2 - 3.1)

    2. compare the result with a constant/control that is on the result of the subtraction (in the example, 0.1)

    3 see the output of the comparison.

    If the result of the subtraction is an integer, the Boolean result is (as expected). If the result is not complete, the comparison fails.

    (Now, if I simply compare two floating point numbers, it works, so the issue is not with the node comparison itself, but with the data that is entered to the node). Can someone understand why this happens? It's unexpected, it's a pretty serious bug.

    It is provided with all programming languages. Numbers do not have an exact binary floating-point representation. This has been discussed endlessly. Never use the equal function with floats. You can use the function in the range and force.

  • Array.sort is unstable?

    Use Array.sort, when the compareFunction always retrun 0, it will change the order of the elements in array. (in javascript, is not)

    is the quick sorting using Array.sort, which is unstable?

    and how to fix it not change the order of the elements.

    Thanks for any help.

    Here's the test code:

    Student.As

    package
    {
              public class Student
              {
                        public function Student(name:String, age:int)
                        {
                                  this.name = name;
                                  this.age = age;
                        }
      
                        public var age:int;
      
                        public var name:String;
      
                        public function toString():String
                        {
                                  return "[name=" + name + " age=" + age + "]";
                        }
              }
    }
    
    

    Applicatoin.MXML

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                            creationComplete="application1_creationCompleteHandler(event)">
              <mx:Script>
                        <![CDATA[
                                  import mx.events.FlexEvent;
      
                                  private var ac:Array = [
                                            new Student("ST1", 21),
                                            new Student("ST2", 21),
                                            new Student("ST3", 21),
                                            new Student("ST4", 21)
                                  ];
      
                                  protected function application1_creationCompleteHandler(event:FlexEvent):void
                                  {
                                            ac.sort(function(a:Object, b:Object):int
                                            {
                                                      if (a.age > b.age)
                                                                return 1;
                                                      else if (a.age < b.age)
                                                                return -1;
                                                      return 0;
                                            });
                                            trace(ac);
                                  }
      
                        ]]>
              </mx:Script>
      
    </mx:Application>
    
    

    the result is:

    [name=ST3 age=21],[name=ST2 age=21],[name=ST1 age=21],[name=ST4 age=21]
    

    Array.sort has change the order of the elements in array

    See http://stackoverflow.com/questions/3026281/array-sort-sorting-stability-in-different-brows ers

    Array.sort is not necessary to be stable according to ECMA.  Looks like the recent browsers have implemented a stable sort, but Flash does not.

    AS3Commons claims to have a stable sort.  See http://code.google.com/p/as3-commons/source/browse/trunk/as3-commons-collections/src/main/ actionscript/org/as3commons/collections/utils/ArrayUtils.as

  • Computer started to delay the result with a click of a button, etc. by seveal seconds.

    Have aw computer laptop Dell Inspiron 1501 XP SP3. Computer started to delay the result with a click of a button, etc. by seveal seconds.  A ran the anti-virus, malware search, keylogers search and found nothing.  The delay also occurs when you use an application such as CorelDRAW, Word, WordPerfect programs, etc.  any ideas what is happening or where to look? Thank you.

    You experience this delay all the time, or they occur from time to time?

    Could complete you the following procedure to obtain information about your current system and post here, so I can be more specific in suggestions.
    0 close the programs as open as you can before the first step.
    1 copy the following line below exactly as it appears:
    Taskpad cmd /C /V > tempo & tempo notebook
    2. press on + R
    3. paste copied line run window and press enter or click Ok.
    4 copy all the information from the Notepad window. (The list can be long, you can use + a combination to select all)
    5 paste info copied to the next reply.
    6. after that you can close the Notepad window.

  • 0xC000021A {fatal system error}, the initial session process or the process of the complete system in unexpected ways with the blocking state 0 x 00000000 (0xc0000034 0x001008ac) the system has been halted

    Hello! I got this message from malware (I clicked to delete) in surfing on firefox and after awhile the explorer.exe closes with an error. I try to open the Task Manager and it says explore cannot be found!
    I rebooted and then I got this message "0xC000021A {fatal system error}, the initial session process or the process of the complete system in unexpected ways with the blocking state 0 x 00000000 (0xc0000034 0x001008ac) the system has been halted" and can't get anywhere.
    I can't even go in safe mode, the same error messages appears.

    Hi James,

    You could try the Startup Repair to see if it solves the problem:

    http://Windows.Microsoft.com/en-us/Windows-Vista/startup-repair-frequently-asked-questions

    Chris
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Help in parsing the XML result with ksoap2

    Hi, I have another problem. I used KSOAP2 to call a web service net but when I catch him to display the result with a selectionneret, it shows the following screen:

    reading on the web, I didn't find a good way to analyze the result. Could you help me with this? Thanks in advance

    Thanks, the problem here is that we use the same webservice for more devices and a web page in .NET) that's why we use this webservice. Anyway thanks for the help. I read a lot of posts and the only way is perhaps to save the XML document in the SD card

  • Showing results with one decimal two. Force the decimal.

    Hello

    Im a simple computing of writing device.

    You enter a digit, press one of the two buttons to multiply by a number, and then the result is displayed. The result is copied hide the result from the button you press on and visa versa.

    I'm having a problem to display the result with a decimal point two constant.

    I'm using strings and so do not know how to do this.

    Here is my code:

    import flash.events.MouseEvent;

    restrict entry to only numbers textfield

    txtInput.Restrict = "0-9";

    restrict the input textfield only a two-digit

    txtinput.maxChars = 6;

    event listeners

    btnW.addEventListener (MouseEvent.CLICK, WHandler);

    btnC.addEventListener (MouseEvent.CLICK, CHandler);

    btnW.addEventListener (MouseEvent.CLICK, hideC);

    btnC.addEventListener (MouseEvent.CLICK, hideW);

    functions

    function WHandler (e:MouseEvent): void

    {

    calculation of white

    var answerW:Number = Number (txtinput.text) * Number (0.90);

    txtWResult.text = answerW.toString ();

    }

    function of CHandler (e:MouseEvent): void

    {

    calculation of the color

    var answerC:Number = Number (txtinput.text) * Number (0.99).

    txtCResult.text = answerC.toString ();

    }

    function hideC (e:MouseEvent): void

    {

    Hide the result color

    txtCResult.visible = false;

    txtWResult.visible = true;

    }

    function hideW (e:MouseEvent): void

    {

    Hide the white result

    txtWResult.visible = false;

    txtCResult.visible = true;

    }

    After having had a look online I found these two resources:

    http://helpx.Adobe.com/Flash/KB/rounding-specific-decimal-places-Flash.html

    and

    http://StackOverflow.com/questions/11469321/decimals-to-one-decimal-place-in-AS3

    But I'm confused when combining these techniques with ropes.

    Any help would be greatly appreciated,

    Thanks in advance

    Mr B

    Use the toFixed() class number instead of the toString() method.  The result is a string that contains the number of decimal places you specify.

    var answerW:Number = Number (txtinput.text) * Number (0.90);

    txtWResult.text = answerW.toFixed (2);

    var answerC:Number = Number (txtinput.text) * Number (0.99).

    txtCResult.text = answerC.toFixed (2);

  • Arrays.sort

    Why did the Arrays.sort method defined as

    public static sort (Object [] a) Sub

    Instead of

    public static sorting Sub (comparable [] a)?

    user9987428 wrote:

    jverd wrote:
    In this way we can sort an array whose elements are all mutually comparable, even if the table itself is not declared as being of a Comparable type. I can't think of a specific use case where it would be useful, but that's the only reason why I can think for deliberately to make that decision.

    Dear jverd, I'm not sure that the case you are referring. I tried the following code and it gives a runtime Exception.

    The current implementation does not allow it and even though I was thinking exactly the same thing as jverd suggested, I think it is more likely that it's just an oversight.

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

Maybe you are looking for

  • Satellite 4000CDS has no BIOS!

    Hello!My laptop is a Satellite 4000CDS and I wanted to install windows again. But when I put the CD and restart the computer, nothing happens. There is even no screen that says I have to press a key to enter the BIOS, so I can't set the boot priority

  • HP Pavillion desktop questions please help :-(

    My desktop pc Pavilion 20-b013w windows 8 just stoped to work on me. It shows the hp logo and is trying to fix, but after a few minutes, it goes to the black screen... I tried to restore, recover... anything but didn't get to this screen

  • Main panel display problem

    Hello I sort of addressed this in another post, but not directly and got no response.  So let me try a very direct question.  I created an application that has no title bar and menu bar none.  The background color was chosen by my client and is not w

  • HP Pavilion 500-242ea: Ram upgrade

    Hi I have a desktop computer Pavilion 500 - 242ea 64-bit with 6 GB of ram installed 1 x 2 gb Hynix/Hyundai 1600 mhz and 1 x 4 gb Samsung 1600 mhz. I would like to increase my ram by an additional 8 GB with a 2 x 4 GB - 1600 mhz cards in empty slots,

  • Has XP but no disc, used a friends but now cannot turn on, what are my options?

    I've damaged my windows XP and I don't have a windows xp disc, so I borrowed my friends to install. Now he says that's not varified. How can I find my original varification? Is my information stored somewhere that microsoft can find so that I can act