Iteration through array of complex data on different properties object

I'm not sure that my title is correct.

Is there any library 3 rd-party on AS3.0 (such as the STL in C++), for this:

I have set my class and use its objects as an associative array, for example:

Enterprise-class {}

var public name;

public var logo;

var public address;

telnumber public var;

}

And a kind of data structure class (say, list) allows you to store some objects of type company. And then I set my own comparison function and research on this list category (that is, replace the default); in my role, I could specify what attribute (name or address or phone number) to perform research, and how it would be done.

Could someone help? Thanks in advance.

@Ken: "this is a standard class/method, you don't need to extend or to use the custom class.

Well, theoretically it is always better to have a data type in instead of using the generic object. The practice is another story...

Here's a simplified example of how Array.filter () can be used with a custom - data type in this case it filter instances of values based on the property value, well, value.

Place the two classes in the same file and make ValueSort a document class:

package
{
    import flash.display.Sprite;

    public class ValueSort extends Sprite
    {
        private var array:Array;
        private var searchValue:int = 0;

        public function ValueSort()
        {
            init();
        }

        private function init():void
        {
            array = [];
            for (var i:int = 0; i < 10; i++)
            {
                array.push(new Values(i));
            }
            trace("before filter");
            traceArray(array);
            searchValue = 4;
            var searchResult:Array = array.filter(filter);
            trace("after filter");
            traceArray(searchResult);
            searchValue = 7;
            searchResult = array.filter(filter);
            trace("after filter 1");
            traceArray(searchResult);
        }

        private function traceArray(arr:Array):void
        {
            for each (var value:Values in arr)
            {
                trace(value.value);
            }
        }

        private function filter(element:Values, index:int, arr:Array):Boolean
        {
            return Values(element).value > searchValue;
        }

    }

}
package
{

    public class Values
    {
        public var value:int = 0;

        public function Values(v:int)
        {
            value = v;
        }

    }

}

Tags: Adobe Animate

Similar Questions

  • How to filter through a set of data based on user input

    Hi all

    I'm trying to filter through a set of data, purchase only the files that meet the requirements of users.

    I ask the user to enter three different values, one for a frequency to start another for a frequency of end and also the value of the rated power.

    The way I am filtering from now thanks to this data set is using a function called the regular expression function as well as the analysis of string function to break up the name of file and data digital take-away, then compare these data on the entries of users.

    These values that meet the conditional statement will be sent to a ring of results for a user to go through.

    For now, I filled it is not as much functionality in this method, the user must be very careful in the way which he or she saves files and my program may work correctly.

    I am ataching a photo of this part of the program.

    Thanks for the help.

    I think that my second statement should check on a white paper OR PDM.  Have you noticed the color?  This is a clickable link.  If you read the material here, it should clear up confusion in the first part of my post.

    I have a colleague who, like you, encodes the parameters of the study of the (very long) string of the name of the file.  I always shout at him about it, because it requires him (because you are considering do) build routines for (a) analyzes the names (to retrieve the information hidden in them), (b) to organize the data in a form of "LabVIEW Database" and then (c) figure out how (in LabVIEW) for write "queries" on this database.  More file names are not particularly easy for a human to read, are extremely long and invite more mischief (have you thought about putting your files in folders which are similarly 'file-information-coded'?  Becomes even more messy more fast).

    You might think Oh, "it's too late to make a change, I have already all of these data", but what good is it if you can't analyze easily, group them, sort, etc. ?

    Bob Schor

  • Import data from different DBs to HFM Application using FDQM

    Hi gurus

    1. how to import data from different databases to HFM Application using FDQM?
    Do we need to write scripts for integration in FDQM, or is there an alternative method, we need to do?

    concerning
    Dev

    Data import is long to explain,

    To be more precise,
    1. you would establish a connection with your source systems and destination where you pull the data.
    You can do this by registering adapters of integration for send_break_action source machines
    2. you would then upward some formats for importing, maps and tables of control.
    Please go through the Administrator's guide,

    One of the experts will help you better understand.

    Kind regards

    David Martin

  • Consume a web service from ASP which responds with complex data types...

    Here's my problem - I'm trying to consume a web service from a provider that uses complex data types.

    The starting of the WSDL part looks like this (I have not included all) - named have been changed to protect the innocent:

    " < wsdl:definitions targetNamespace = ' http://domain_name ">
    WSDL: < types >
    " < s:schema elementFormDefault ="qualified"targetNamespace =" http://domain_name ">
    < s:element name = "Authentication" >
    < s:complexType >
    < s:sequence >
    < s:element minOccurs = "0" maxOccurs = "1" name = "User name" type = "s:string" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Password" type = "s:string" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Token" / >
    < / s:sequence >
    < / s:complexType >
    < / s:element >
    < s:element name = "AuthenticateResponse" >
    < s:complexType >
    < s:sequence >
    < s:element minOccurs = "1" maxOccurs = "1" name = "AuthOK" type = "s:int" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Token" / >
    < / s:sequence >
    < / s:complexType >
    < / s:element >

    Since it is a return, with a sequence of complexType, I expect an array or a structure returned, but instead I just get the value of "AuthOK" and no way to get something else.

    Here are the ways I tried to call it:

    < cfscript >

    WS = createObject ("WebService", "https://WSDL_URL");

    WS_ret = WS. Authentication (name of user = "username", password = "password", token = "");

    < / cfscript >

    < cfdump var = "" #WS_ret # "/ >"

    < cfinvoke webservice = "WSDL_URL" method = "Authentication" returnVariable = "WS_ret" >

    < name cfinvokeargument = "userID" value = "7253320" / >
    < cfinvokeargument name = "password" value = "ctpjxs3" / >
    < name cfinvokeargument = "SecurityToken" value = "" / > "

    < / cfinvoke >

    < cfdump var = "" #WS_ret # "/ >"

    Any ideas how I can get the other variables in the sequence? I have other calls after that have a greater amount of variables, and as such I can't use without being about to get more than the

    You can try using the function GetSOAPResponse to review the XML code you receive.

    'GetSOAPResponse '.

    http://livedocs.Adobe.com/ColdFusion/8/htmldocs/help.HTML?content=functions_e-g_59.html#50 54378

    "Troubleshooting SOAP requests and responses.

    http://livedocs.Adobe.com/ColdFusion/8/htmldocs/help.HTML?content=webservices_27.html#1222 070

    As for the question of docs, I suspect mediocre edition is at fault.  I assume that the web service is supposed to have an echoStruct method but this is unclear.

  • Types of complex data in CVI2015

    Hello...

    The CVI2013 compiler (not the variable view) supported the use of complex data types, see, e.g., here.

    CVI2015 now gives an error: complex types are not supported - if the build fails.

    What should I do? (the compilation that compilation with the C99 extensions option is enabled)


  • Import ASCII dates with different format

    Hello

    I need to import data from a CSV of ASCII.

    The problem is the date format in this particular data file (.csv)

    The date format for day< 10="" and="" month="" from="" jan="" to="" sep="">

    AAAA/_M/_Dthe character '_' is a simple space, not an underscore literally

    The format of the date days > = 10 and Jan to Sep month is:

    _M/JJ/AAAA

    The format of the date days > = 10 and months of Oct to dec is:

    YYYY/MM/DD

    The date format for day< 10="" and="" months="" from="" oct="" to="" dec="">

    YYYY/MM/_D

    Possible solution:

    I already create a routine that recognizes the date in the title and one of the 4 (.stp) filter uses for data processing. These are the works.

    Next problem:

    The days are separated into 2 files, a file from 09:00 to 21:00 one day and the other from 21:00 to 09:00 on the following day. It's the way I've lost data when the day changes from 9th to the 10th of each month and the month change of Sept Oct and Dec to Jan.

    I just need to delete the blankspace unconfortable before the changes of dates 2-digit, but I do not know how to deal with the before CSV imported to tiara (10.2).

    My other idea is to recognize this file and any double (once with each please) but I need to exactly position the import is not the problem with the data of novalue. (Until know I got complicated for a simple mistake of blankspace).

    I hope that you have ideas...

    Thanks in advance...

    I don't know if I understand that measures are not clear. Here's what I think you want to do:

    (1) load data from different files in DIAdem

    To do this, you must use "DataFileLoad("E:\Customer_Requests\caracasnet\log(111231).csv","caracasnet_log","Load") call.

    You call DataFileLoad for each of the files.

    (2) you want to concatenate the groups.
    This should be no different than what you've done up to now

    (3) you want to store the data in a file (TDM).
    To do this, you must call DataFileSave (...)

    Let me know if you have any other questions...

  • Creation of complex data signals

    Hello

    I have 2-channel audio that contains the parts real and complex of an I / Q wave. I'm trying this demodulation using block MSK modulation toolkit, but I have trouble accessing the i / Q stream in the right type. The MSK block requires a complex waveform input, but after the construction of this waveform complex, I discovered that he really had to a 'Waveform.ctl of complex data.

    How can I get my data in the right format? I can't find a block which generates this 'Waveform.ctl complex data.

    I have attached a picture of the situation.

    Best regards

    Jan

    Try this

    Right-click on the entry of complex waveform of this Subvi node MT demodulate MSK. Click on 'Create' > 'Constant '. Now remove the wire between the newly created constant and the Subvi. Adds a set of cluster name. Wire the constant in the top of the boot of cluster name. Left click and pull on the bottom of the boot of cluster name until 3 entries appear. Click with the right button on each entry and use the item select to get the entries you need.

  • Convert a U8 array to a data type of LabView

    In my code, the entrance is a fixed-length U8 array reflecting the data in memory, I need to convert it to a predefined data type. For example, the first 2 elements U8 in the arrary must comvert a U16, then 4 U8 U32 data elements data. I wonder if there is an easy way to do this kind of conversion.

    Type casting Man and his trusty Sidekick Unflatten chain are itching for action.

    Use Unflatten chain if you have problems with "endianness".

  • For the complex data type, how to generate the Dll with compatible interface to C/C++

    Hello

    I used the Labview FPGA module to develop test equipment. Now, I need to write a driver that is to be a Dll with compatible interface to C/C++ for this equipment. So that my client who is familiar with C/C++ can call the driver without any study on labview. But I had a few problem on how to convert labview for C/C++ data complex data type. To clearly explain to my question, I have attached a simple example. (see attachment) I try to generate a Dll for the attached example VI and get the the function prototype at the head of the files as below:

    ' void OpenFpgaReference (LStrHandle * RIODevice, TD1 * errorIn, LVRefNum * FPGAVIReferenceOut, TD1 * errorOut).

    As you have known, the type of data "LStrHandle * RIODevice" and "LVRefNum * FPGAVIReferenceOut" Labview data format are. C/C++ do not have this kind of data type and can not reconige it. As a result, I can't call the Dll of C/C++ programming language. How to convert these two data type of labview for the C/C++ compatible data format, and then build the Dll? Anyone know about this?

    The answer is really apprecaited! Thank you in advanced.

    Ivan.Chen wrote:

    As I found in the following article:

    http://digital.NI.com/public.nsf/WebSearch/FB001AA027C8998386256AAD006C142D?OpenDocument

    LVRefNum is the name of resource of LabVIEW VISA or refnum, and "it is impossible to convert LabVIEW VISA name of resource or refnum VISession valid ID."
    This means that external code modules can not access & control the session VISA which is open by labview. But for my purposes, I will not attempt to access this VISA extenal code(C/C++) session. I just hope that save this session VISA in the external code once I opened it in Labview dll; and pass it to the labview dll when needed. While I have not need to login again when I need to control the device. Is it possible to do?

    A LVRefNum is really just a single int32 value. Its meaning is useless for other environments than those who created it so that you Michael not any what in C/C++ caller but pass it back to other functions in your DLL, but this often isn't a problem at all.

    You can take the following statement of the LabVIEW extcode.h headers and add them to your delabviewed header files to make it work in such a way.

    #define Private (T) typedef struct T # _t {void * p ;} * T}

    Private (LVRefNum);

    The LStrHandle you must set a standard C string instead in your export DLL and document what is the size of the string buffer should have if it is an output parameter.

    TD1 error clusters should also be divided into their parameters (C compatible) separate for all items or just to the left of suite entirely.

    Rolf Kalbermatter

  • How to record a little complex data in json?

    Hi all

    I want to use json to store complex data a bit. I checked the sample application code. It's too simple.

    The data are as follows:

    {

    'day': 'ddd ',.

    'type': 'xxx ',.

    'name': "qqq"

    "amandine":]

    {'name': 'sss', 'set': 'ddd', 'time': 'ddd'},

    {'name': 'eee', 'set': 'fff', 'time': 'fff'},

    {'name': 'qqq', 'set': 'ggg', 'time': 'ggg'},

    {'name': 'aaa', 'set': 'vvv', 'time': 'vvv'},

    {'name': 'zzz', 'set': 'ccc', 'time': "ccc"}

    ]

    }

    I am confused with QVaraintMap, QVariantList and QVariant and don't know how to use them properly.

    PS: I'm new to json. I used to use MySQL in my work.

    Thank you.

    brad_qqq

    The simplest approach is the following:

    JSON object (something wrapped in {}) will be a QVariantMap

    List of JSON (something wrapped in []) will be a QVariantList

    Everything else (numbers, strings, boolean, etc.) will be a QVariant

    Everything will be a QVariant when initially mapped out, and you must check the types with canConvert (Type) and use the methods toXXXX, that all return values (http://qt-project.org/doc/qt-4.8/qvariant.html) to get the respective types and use the data.

  • Ksoap2 complex data types

    I'm moving the xml as a parameter in a Web service, however it doesn't seem to work.

    The Web service is a service of .net, the required parameters is a group of data.  It is built in xml that I put in a string and then add it as a parameter to aid,

    SoapObject rpc = new SoapObject(serviceNamespace, _soapAction);rpc.addProperty("paramname", xml);
    

    I have no problem to send the basic parameter types, the type complex seems to be incorrect.  Someone else has managed to use complex data types when communicating with a web service using Ksoap2?

    Use SoapSerializationEnvelope addMapping with namespace, the name of the class (as in the wsdl document) and class (getClass() or .class) itself.

  • How to read the data with different XML schemas within the unique connection?

    • I have Oracle database 11g
    • I access it via JDBC: Slim, version 11.2.0.3, same as xdb.
    • I have several tables, each has an XMLType column, all based on patterns.
    • There are three XML schemas different registered in the DB
    • Maybe I need to read the XML data in multiple tables.
    • If all the XMLTypes have the same XML schema, there is no problem,
    • If patterns are different, the second reading will throw BindXMLException.
    • If I reset the connection between the readings of the XMLType column with different schemas, it works.

    The question is: How can I configure the driver, or the connection to be able to read the data with different XML schemas without resetting the connection (which is expensive).

    Code to get data from XMLType is the implementation of case study:

     1   ResultSet resultSet = statement.executeQuery( sql ) ; 
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as BLOB. Like this:

     1    final Statement statement = connection.createStatement() ;  2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;  3   ResultSet resultSet = statement.executeQuery( sql ) ;  4   String result = null ;  5    while(resultSet.next()) {  6   Blob blob = resultSet.getBlob( 1 );  7   InputStream inputStream = blob.getBinaryStream();  8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();  9   inputStream.close(); 10   blob.free(); 11   } 12   resultSet.close(); 13   statement.close(); 14  15   System.out.println( result ); 16    return result ; 17
    

    Then it works. Still, can't get it work with XMLType in resultset. On the customer XML unwrapping explodes trying to pass to another XML schema. JDBC/XDB problem?

  • Error renaming dates to an associative array of type date

    Hi all

    I am facing issue while assigning dates in an associative array of type date:

    Oracle version:

    SQL > select * from v version $;

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    AMT for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    Stored procedure, I try to write is as follows

    1. create or replace procedure (jp1)
    2. p_start_date default date trunc(sysdate,'MM')
    3. p_end_date date default trunc (sysdate)
    4. )
    5. is
    6. number of l_no_of_days;
    7. type t_date_id is table of date
    8. index by pls_integer;
    9. l_date_id_arr t_date_id;
    10. Start
    11. l_no_of_days: = p_end_date - p_start_date;
    12. for i from 0
    13. .. l_no_of_days - 1
    14. loop
    15. l_date_id_arr: = p_start_date + i;
    16. dbms_output.put_line (p_start_date + i);
    17. end loop;
    18. end;
    19. /

    I get error on line 14 when compiling it. and the error message is as follows:

    JP1 PROCEDURAL errors:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    14/5 PL/SQL: statement ignored
    14/22 PLS-00382: expression is of the wrong type

    While studying this, I tried the value of (p_start_date + i) using dbms_output.put_line and the output is so date itself.

    1. create or replace procedure (jp1)
    2. p_start_date default date trunc(sysdate,'MM')
    3. p_end_date date default trunc (sysdate)
    4. )
    5. is
    6. number of l_no_of_days;
    7. type t_date_id is table of date
    8. index by pls_integer;
    9. l_date_id_arr t_date_id;
    10. Start
    11. l_no_of_days: = p_end_date - p_start_date;
    12. for i from 0... l_no_of_days-1

    13. loop
    14. -l_date_id_arr: = p_start_date + i;
    15. dbms_output.put_line (p_start_date + i);
    16. end loop;
    17. end;
    18. /

    output of the

    1. exec jp1

    is as follows:

    1ST DECEMBER 13

    2 DECEMBER 13

    3 DECEMBER 13

    DECEMBER 4, 13

    5 DECEMBER 13

    DECEMBER 6, 13

    7 DECEMBER 13

    DECEMBER 8, 13

    9 DECEMBER 13

    DECEMBER 10, 13

    DECEMBER 11, 13

    DECEMBER 12, 13

    13 DECEMBER 13

    14 DECEMBER 13

    15 DECEMBER 13

    16 DECEMBER 13

    17 DECEMBER 13

    18 DECEMBER 13

    I see the release date itself. so why he throws error while the same assignment to an associative array of type date.

    I tried Google too for the same but without success.

    Any help is appreciated in this regard not or any pointer another thread on the internet or in this forum.

    Thanks in advance

    Jagdeep Seven

    Read associative arrays:

    1. create or replace procedure (jp1)
    2. p_start_date default date trunc(sysdate,'MM')
    3. p_end_date date default trunc (sysdate)
    4. ) is
    5. number of l_no_of_days;
    6. type t_date_id is table of date
    7. index by pls_integer;
    8. l_date_id_arr t_date_id;
    9. Start
    10. l_no_of_days: = p_end_date - p_start_date;
    11. because me in 0.l_no_of_days - 1
    12. loop
    13. l_date_id_arr (I): = p_start_date + i;
    14. dbms_output.put_line (p_start_date + i);
    15. end loop;
    16. end;

    ----

    Ramin Hashimzade

  • How to display rows of data in different columns?

    I'm new to SQL and currently, that's what I try to do:

    Display multiple lines of data in different columns in the same row

    I have a table like this:

    CREATE TABLE TRIPLEG)

    T # NUMBER (10) NOT NULL,

    STEP # NUMBER (2) NOT NULL,

    DEPARTURE VARCHAR (30) NOT NULL,

    VARCHAR (30) DESTINATION NOT NULL,.

    CONSTRAINT TRIPLEG_PKEY PRIMARY KEY (T #, LEG #).

    TRIPLEG_UNIQUE UNIQUE CONSTRAINT (T #, DEPARTURE, DESTINATION).

    CONSTRAINT TRIPLEG_FKEY1 FOREIGN KEY (T #) REFERENCES TRIP(T#));

    INSERT INTO TRIPLEG VALUES (1, 1, 'Sydney', 'Melbourne');

    INSERT INTO TRIPLEG VALUES (1, 2, 'Melbourne', 'Adélaïde');

    The result should be something like this:

    > T # | ORIGIN | DESTINATION1 |  DESTINATION2

    > 1 | SYDNEY | MELBORUNE | ADELAIDE

    The request must include the ' COUNT(T#) < 3' since I only need to display the records of less than 3. How can I get the results I want to use relational views?

    Thank you!!!

    I replaced the syntax "where" with the syntax 'account '. The reason why I do this is because I want to only display records with a number of travel of less than 3. By defining where the legs #.<=3, the="" result="" will="" be="" all="" the="" records="" of="" the="" tripleg="" table="" since="" each="" record="" could="" also="" have="" leg#="" is="">

    The answer is:

    with t as (SELECT t #,)

    REGEXP_REPLACE)

    LISTAGG (start |) '->' || destination, ' ')

    THE Group (ORDER BY t #, leg #).

    '([^ ]+) \1+',

    "\1") str

    OF tripleg

    HAVING COUNT (T #)<>

    GROUP BY t #)

    Select T #, regexp_substr (str, ' [^->] +', 1, 1) departure

    , regexp_substr (str, ' [^->] +', 1, 2) destination_1

    , regexp_substr (str, ' [^->] +' 1, 3) destination_2

    , regexp_substr (str, ' [^->] +' 1, 4) destination_3

    Thanks to Marty and knani!

  • Working with complex data types in web services...

    Hi all
    I have created a Web service and created an interface for this in the ADF. Now that my web service returns a complex data type, I followed the steps in this article "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" and it works very well, my results are also displayed. But the only problem is that I get a warning "Houston-25009: cannot create an object of type: java.util.calendar value: 2008-09 - 23 T 23: 51:30.000 + 05:30 ' and if I can replace all the java.util.Date oracle.jbo.domain.Date then I get a warning" Houston-25009: failed to create an object of type: oracle.jbo.domain.Date with the value: 2008-09 - 23 T 23: 51:30.000 + 05:30. Now I am unable to understand this, but I think it's a problem of data type mapping, but do not know how to remedy this.

    Everyone knows the wayout?

    Concerning
    Lokesh

    Hi Lokesh,
    I have been troubled by the same question in the past. The problem is that the entrants is a format for dateTime xml adf trying to analyze the underlying java object. Java.util.Calendar, java.util.Date, or oracle.jbo.domain.Date to get a date in adf when scanning automatically your incoming xml file. See this thread on the forum for more information jdeveloper Re: how to deal with xsd: DateTime to webservice in ADF? The answer that gives Frank Nimphius is correct but I used option 1 option 2 should also work.

    Kind regards
    André

Maybe you are looking for