form the most effective of condtional for many of | » s ?

Hello

I have an if statement that checks file extensions.

He continues the code if file extensions filled one of the about 20 kinds:

so

If (ext == 'mpeg' | ext == 'mp3' |.. .etc)

I noticed that when checking of file names 4000, there is an increase in the time between having 50 only 2 | options and 20.  It is not a problem to 4000 files, but if checking ten times that, it's just increased in time.

I was wondering what is the most effective way to do this?  Is a table, a better way to go?

Thanks for your help.

Shaun

Store extensions in a table and use the Array.IndexOf method.  If the extension exists the method returns the index of it, if not the methods return-1.

If (extArray.IndexOf (ext) >-1) {}

the extensin is in the table

}

Tags: Adobe Animate

Similar Questions

  • The most effective way to log data and read simultaneously (DAQmx, PDM) high data rates

    Hello
     
    I want to acquire the data of several Modules cDAQ using several chassis to
    high data rates (100 k samples per second if possible). Let's say the measurement time is 10 minutes and we got a large number of channels (40 for example). The measured data is written to a PDM file. I guess, the memory or the HARD disk speed is the limits. For the user, there must be a possibility to view the selection of channels in a graph during the measurement.

    My question: what is the best and most effective way to save and read data at the same time?

    First of all, I use an architecture of producer-consumer and I don't want to write and display the data in the same loop. I expect two possibilities:

    [1] to use the 'DAQmx configure logging.vi' with the operation 'journal and read' to write the data to a PDM file. To display the data in a second loop, I would create a DVR samples documented and 'sent' the DVR for the second loop, where the data will be displayed in a graph (data value reference). This method has the disadvantage that the data of all channels is copied into memory. Correct me if I'm wrong.

    [2] use 'DAQmx configure logging.vi', but only with the "journal" operation to write the data to a PDM file. To view the selected data, I had read a number of samples of the TDMS file in the second loop (I'm currently writing the TDMS file). In this case, I have only one copy data from the selected channels (not), but there will be more HARD drive accesses necessary.

    What is the most effective and efficient solution in this case?

    Are there ways to connect and read data with high frequencies of sampling?

    Thank you for your help.

    You say that the measurement time is 10 minutes. If you have 40 channels and you enjoy all CHs at 100 kHz, it is quite a number of values.

    In this case, I always try to approach under the conditions of use. If a measure is only 10 minutes, I just connect all PDM data and create a graphic module that could be in the same loop of consumers where connect you the data. You can always work on the raw data files big offline afterwards, the extraction of all the information you need (have a look at the product called NI DIAdem: http://www.ni.com/diadem/)

    The main issue is that the user needs to see in the graph (or perhaps a chart can be useful too). Lets say that the graph is 1024 pixels wide. It makes no sense to show multiple data to 1024 points, Yes? Every second will produce you 100 data points k per channel. What is the useful information, which should see your username? It depends on the application. In similar cases, I usually use some kind of data reduction method: I use a moving average (Point by point Mean.VI for example) with a size of the interval of 100. This way you get 100 data points of 1000 per channel every second. If you feed your graph every second with these average values, it will be able to data points in 1024 of the store (as a default) by channel (curve), which is a little more than 10 minutes, so that the user will see the entire measurement.

    So it depends on the frequency at which you send data to the consumer. For example, collect you values 1024 by iteration of the producer and send it to the consumer. Here you can make a normal means calc or a bearing (according to your needs) and he draw a graphic. This way your chart will display only the values of the last 10 seconds...

    Once I programmed some kind of module where I use a chart and not a graph, and the user can specify the interval of the absolute timestamp that is traced. If the data size is larger than the size of the chart in pixels, the module performs an average calculation in order to reduce the number of data points. Of course, if you need to see the raw data, you can specify an interval that is small. It all depends on how you program zoom functions, etc... In my case I hade a rate of 1 Hz, so I just kept all data in RAM limiting the berries to keep 24 hours of data, so that technicians could monitor the system. In your case, given the enormous amount of data, only a file read/write approach can work, if you really need access to all of the RAW data on the fly. But I hope that the values of working capital means will be enough?

  • The most effective way to retrieve a number of virtual machines in an org?

    Hi all, what is the most effective way to retrieve a MV of County in an org. I am currently recovering all CDV in an org, then all the vApps, then all of the virtual machines and pushing them into a table, then do a vms.length on the table filled by all virtual machines.

    It takes a horrible time, and there MUST be a better way.

    Open to any suggestion. Thank you

    Good, as administrator of the organization then: (I have not tried as a normal user account)

    var vdcs = new Array();
    var orgVMCount = 0;
    var vcdHost = org.getHost();
    
    var queryService = vcdHost.getQueryService();
    var expression = new VclExpression(VclQueryOrgVdcField.ORGNAME, org.name, VclExpressionType.EQUALS);
    var filter = new VclFilter(expression);
    var params = new VclQueryParams();
    params.setFilter(filter);
    
    var resultSet = queryService.queryRecords(VclQueryRecordType.ORGVDC,params);
    while (resultSet != null) {
    
        var records = resultSet.getRecords(new VclQueryResultOrgVdcRecord);
        for each (var record in records) {
            var vdcVMCount = getVdcVMCount(record.href, vcdHost);
            System.log("VDC "+record.name+" VM Count: "+vdcVMCount);
        }
        orgVMCount += vdcVMCount;
        resultSet = resultSet.getNextPage();
    }
    System.log("Total Organization VM Count: "+ orgVMCount);
    
    function getVdcVMCount(vdcHref, host){
        var vmCount = 0;
    
        var qs = host.getQueryService();
        var exp = new VclExpression(VclQueryVMField.VDC, vdcHref, VclExpressionType.EQUALS);
        var exp2 = new VclExpression(VclQueryVMField.ISVAPPTEMPLATE, false, VclExpressionType.EQUALS);
        var exps = new Array(exp,exp2);
    
        var expFilter = new VclFilter(exps,VclFilterType.AND);
        var queryParams = new VclQueryParams();
        var vmArray = new Array();
        queryParams.setFilter(expFilter);
        var rs = qs.queryRecords(VclQueryRecordType.VM,queryParams);
        while (rs != null){
            var vmRecords = rs.getRecords(new VclQueryResultVMRecord);
            vmCount += vmRecords.length;
            rs = rs.getNextPage();
        }
        return vmCount;
    }
    

    It takes a little more code because the ".ORG" field is not available for the non-Admin queryVMField, but the. VDC IS, so we start by retrieving the TDC for the Org, then for each one, ask the number of vm for VDC.

    Post edited by: Burke - had accidentally initialization of orgVMCount as new Array(); -changed second line to 'var orgVMCount = 0;

  • the most effective configuration using vmware lab environment?

    Hello

    I have a production vmware

    infrastructure. It consists of multiple esx hosts, an iscsi san, and

    about 12 virtual machines.  I would like to get some of these machines in

    a lab environment, which is the most effective way to achieve this?

    have also a few physical machines as well, that I intend to help

    the p2v tool for.  Thank you

    1. create the VLANS separated for the Lab virtual machines and use to limit the bandwidth of the traffic shaping

    2 create a new pool of resources for the virtual laboratory machines, to control the use of resources (configure "share" = low)

    3 use/Take snapshots before allocating virtual users computers, so that you can return it back once the activity is complete.

    See you soon,.

    ~ Jean

    ~ Don't forget to points, if you found the useful answer

  • The most effective component to use

    What is the most effective component to use a piece of a single line of dynamic text?
    A Lable; TextInput or TextArea components?

    I would like to use the more appropriate for a single line of dynamic text.
    Also the esiest of style component I want to 3 sizes of text and being able to change the background.

    I also tried to use the custom declaration and do not know if it would be appropriate or overkill:
    Import mx.styles.CSSStyleDeclaration;
    var new_style:Object = new CSSStyleDeclaration();
    _Global.styles.myLableStyle = new_style;
    new_style. SetStyle ("fontSize", 18);

    myText1.setStyle ("styleName", "myLableStyle");

    When I use the setStyle it seems to work very well for my dynamic TextInput.
    Any info on these components would be really useful.

    Please see code is attached as a reference to what I want to do.
    Thank you.
    Bell W.

    W assume that I wonder, why not just create an instance of TextField? rather than use a component to a single line. You can always ask your TextFormat object to the field on instantiation.

  • The most effective way to store lines

    DB version: 10gRel2 and 11G


    If I want to keep a single column as structure, I would like to use associative arrays for performance reasons. Who is the most effective method to store a multicolumn line?


    You guys are using something like this
    DECLARE
      type v_emprec_array is table of emp%rowtype INDEX BY BINARY_INTEGER;
      v_emprec v_emprec_array;
    BEGIN
      select * bulk collect into v_emprec from emp where empno=7369;
    or this
     declare
      TYPE rec_UpdateEmp IS RECORD
               (
              Inpt_emp_id         t_InptId,
              Stat_Code               gt_StatCode,
              Tms_Proc                pa_TmsProc,
              Tms_Po_Flag             pa_TmsPoFlag,
              Sngl_Unit_Flag          pa_SnglUnitFlag,
              Pkt_Profile_Id          gt_ProfileId,
              Pkt_Type                pa_PktType,
              host_inpt_id            pa_HostInptId
              );
              
          rec                         rec_UpdateEmp;
      

    Ref Cursor is a better option

    create or replace procedure emp_dtls
    (
     p_sal number,
     p_result out sys_refcursor
    )
    as
    begin
     open p_result for
      select ename,sal from emp where sal>p_sal;
    end;
    /
    
    SQL> var myvar refcursor
    SQL> exec emp_dtls(2000,:myvar);
    
    PL/SQL procedure successfully completed.
    
    SQL> print myvar
    
    ENAME             SAL
    ---------- ----------
    JONES            2975
    BLAKE            2850
    CLARK            2450
    SCOTT            3000
    KING             5000
    FORD             3000
    ADAMS            7654
    
  • I pay 9.99 usd per month for the Plan of creative photography Cloud.  I use mainly LR... can I download / use the most powerful Photo Store for this award of contract also?

    I pay 9.99 usd per month for the Plan of creative photography Cloud.  I use mainly LR... can I download / use the most powerful Photo Store for this award of contract also?

    Ask for help here.

    Yes, creative photography plan cloud includes photoshop & Lightroom.

    Concerning

    Baudier

  • The most effective way to create a rendering iPad3

    Hello

    I published three issues in my app now, in which case the last two had made for the iPad3. Both times I followed the same steps, but I find them to be a unnescessarily bit of time, so I wonder if there are faster ways to achieve this.

    Here's my way of doing it;

    1. I have a folio entirely converted in 768 x 1024. The entire development process is done on iPad2 with images of 144dpi.

    2. it's all over, and I'm ready to duplicate the entire folio in 1536 x 2048.

    3. in inDesign, I create a new folio, with the same name and the details (but with 1536 x 2048)

    4. I have an appointment online for the producer of Folio, click on my way to the new empty folio and click 'Add '.

    -This is my main question. Is it possible to add many/all articles at once? As I do, is to add one and a single article in time, and it becomes very painful and long.

    5. After all the items are added, apparently fine, but I can't publish the folio. It gives me an error, indicating that the folio contains a content in the wrong resolution.

    6. I go to inDesign and update of each article. (even once, would take a long time)

    7 folio rendering is finished and ready to publish.

    Is there a better way to do this? Advice would be greatly appreciated.

    Eddie

    Do not use Add. Use the import multiple items ordered... and that's where a sidecar.xml file is very important.

    Bob

  • Query SQL with multiple tables - what is the most effective way?

    Hello I learn PL/SQL. I have a simple procedure, where I need to find the number of employees and departments by location according to location_id user input.

    I have 3 Tables:

    LOCATIONS
    Location_id (pk)
    location_name
    ...
    DEPARTMENTS
    department_id (pk)
    Location_id (fk)
    department_name
    ....
    EMPLOYEES
    employee_id (pk)
    department_id (fk)
    Employee_Name
    ....

    1 location can have 0 - SEVERAL departments
    1 employee has 1 Department

    Here's the query I come up with for PL/SQL procedure:

    / * Ecount, Dcount are variable NUMBERS * /.

    SELECT SUM (EmployeeCount), COUNT (DepartmentNumber)
    IN Ecount, Dcount
    Of
    (SELECT COUNT (employee_id) EmployeeCount, department_id DepartmentNumber
    Employees
    GROUP BY department_id
    HAVING department_id IN
    (SELECT department_id
    Ministries
    WHERE location_id = userInput));

    I get the correct result, but I wonder if my query is on the right track and if there is a more "efficient" method to do so.
    Thanks in advance for help a beginner.

    Hello

    Welcome to the forum!

    Something like this will be more effective:

    SELECT    COUNT (employee_id)               AS ECount
    ,       COUNT (DISTINCT department_id)     AS DCount
    FROM       employees
    WHERE       department_id IN (     SELECT     department_id
                        FROM      departments
                        WHERE      location_id = :userInput
                      )
    ;
    

    You should also try a join instead of the IN subquery.

    For efficiency, do only the things you need to do.
    For example, you need not a number of employees in each Department, in order to not calculate one. This means that you will not need the notice online, so do not have.
    You needn't PL/SQL for this work, so don't use PL/SQL, if you do not have to (I know this question was out of context, then you may have good reasons to do this in PL/SQL.)

    Perform all the filtering as soon as possible. Do not waste it effort on the things that will not be used.
    An example of this is: never use a HAVING clause when you can use a WHERE clause. What is the difference between a WHERE clause and a HAVING clause? The WHERE clause is applied until the aggregate functions are calculated and the HAVING clause is applied after; There is no other difference. Therefore, if the HAVING clause is not reference an aggregate function, it could be done in a WHERE clause instead.

  • The most effective way to import text ('tag' or 'style' pre-text?)

    Once again, my apologies to all the good people here who are so useful that I shows ignorance about the FrameMaker product.

    Always in collaboration with FrameMaker 9, still working on an old background of PageMaker (and print background before that).

    I remember being able to import the tag pre or pre style plain text in PageMaker.  For example, I could put in something the equivalent of a bunch of text that looks like this:

    [body] Lorem ipsum... bibbibity bobbity dooo...

    [subtitle] Presentations to the delicious taste

    [body] More fun text

    And then import this text in PageMaker is pick up these defined styles and make the material much faster import process.

    Is there a way to do the same to that of FrameMaker 9?

    Please feel free to direct me to materials that are in the line/manuals help, but please note that I am following in the paths of a person who used to work and find the manuals and other materials for the software I have * absolutely * know was purchased (I was a systems administrator and know the staff in charge of) (, so I know it was bought and installed using a systems administrator no user has rights to install on their system of my work here) can be which is not simple.

    Thanks in advance

    Oh, a thought here suite.  If something like the above is possible, is it also possible to do the same with materials in the tables?  In other words, can I pre-define the components of a table and see FrameMaker 9 import these materials and create a table for me "automatically"?

    Once again, thank you

    Barry,

    You can use a text editor such as Notepad and the markup of the content in XML format. If this tag is compatible with your ESD, then you can import it into your FrameMaker document for copy or reference and he enrolled in full.

    Tables are a bit more complicated, because you need also some read/write rules to tell FrameMaker which part of the marked-up content is an object table. You can find the details in "DEVELOPING STRUCTURED APPLICATIONS WITHvADOBE® FRAMEMAKER® 9 ' which is supplied with the FrameMaker application.

    Good luck

    Van

  • The most effective way to insert form data into multiple tables and w/autonum

    Hi all, this is my first post here. I am new to APEX and PL/SQL. I have ColdFusion and SQL, and I'm used to perform CRUD operations in my CF Tags application files. From what I've read so far, so if this is accurate, it seems that it is more efficient to perform most of the CRUD operations on the database side, I hope that for advice on the best way to accomplish what I ask - even if I'm trying to do is better off in my new APEX application I am open to this information as well.

    I have a form whose data must reside in two tables. Table A is a one-to-one relationship table and stores General information for each request. Table B is a table of one-to-many observations and should store unique records for each type of comment entered on the form, of which there are 3 comment fields on the form, I'd end up with 3 disks in table B for 1 in table A. I am generating an AutoNumber for table A with a sequence and relaxation. I want to do is take the AutoNumber I just created and use it for insertion in the Table B each insertion I have to do. This is where I am stuck.

    I would like to comment on 1) where I should put all these operations and 2) how best to go about what I want to do coding. In ColdFusion, it is as simple as inserting the record in Table A, immediately asking to table A more recent recording and storing (auto) ID in a variable and then using this var for any other table insertions, I had to do. I know it must be at least a little easier in the Oracle world, I just need a nudge in the right direction. Thank you!

    OraclePledge,

    You're pretty close to not having worked with oracle a lot.

    This section is backwards:

    insert into sch.tbl_main(cust_lname,cust_fname,acct_num)
    values(:P3_CUST_LNAME,:P3_CUST_FNAME,:P3_ACCT_NUM);
    
    select "SCH"."TBL_MAIN_SEQ".currval
          into
          v_ID
          from dual;
    

    Even if it will work if you only have a single user, it's a potential bug with two or more users. First select the key (if it's first use nextval rather than currval) can use it in the insert statement.

    See you soon,.
    Janet Tyson

    Published by: Tyson Janet on June 23, 2011 10:48

  • The most effective way to the U16-> U32 Array pack for DMA data transfer?

    I have a RT controller who wants to send data to an FPGA using DMA.  In LabVIEW 8.2, I have no choice but to switch to the low blocks of data however U32 my my input data is an array of U16.  This leaves me two choices: 1) wire U16 table directly into the DMA node that will be rude to U32 but I lose 16 bit * #of table 2) Pack the U16 elements in a U32 table before sending it to the bottom.    I have #2 and I have a method that works (and seems to be quite effective) but I have the feeling that I'm doing the hard (or roundabout way).   Is their a simpler (but equally effective) way to do this procedure?  Thank you

    Here's a solution that swaps the bytes and key elements the same. There are several ways to do so.

    (for efficiency, you can place the table 'remodel' inside a case structure then, it happens only if necessary)

  • Who is the most preferred antivirus software for windows 7 to be used on a laptop?

    Essentially looking for a safe and hassle free to use the laptop for work online. Any free or paid products as long as it is absolutely reliable.

    Hello

    Here's what I use and recommend: (these are all free and very effective versions.)

    Avast and Prevx proved extremely reliable and compatible with all I have
    launched on them. Microsoft Security Essentials and Prevx have also proven to be very
    reliable and compatible. Use MSE or Avast and Prevx, Prevx 3 but not all.

    Avast Home free - stop any shields is not necessary except leave the file system, Web,.
    Operational network (Script and behavior are also recommended in Ver 6 +).

    Prevx - Home - free

    Windows Firewall

    Windows Defender (is not necessary if you use MSE)

    Protected IE - mode

    IE 8 - SmartScreen filter WE (IE 7 phishing filter)

    I also IE always start with asset if filter InPrivate IE 8.
    (It may temporarily turn off with the little icon to the left of the + bottom
    right of IE)

    Two versions of Avast are available 6.x and 4.8 x

    Avast - home - free - 6.x stop shields you do not use (except files, Web, network, &)
    Shields of behavior) - double click on the icon in the Notification area - real time Orange - click on the
    Shield that you want to stop - STOP. To stop the Orange icon to show an error indicator-
    Click on the Orange icon - top right - settings - click on the status bar - uncheck shields you
    disabled - click OK
    http://www.avast.com/free-antivirus-download

    Avast 4.8 x - home - free - stop shields, you don't need except leaving Standard, Web,.
    and the network running. (Double-click the blue icon - look OK. - upper left - Shields details
    Finish those you don't use).
    http://www.avast.com/free-antivirus-download#TAB4

    Or use Microsoft Security Essentials - free
    http://www.Microsoft.com/Security_Essentials/

    Prevx works well alongside MSE or Avast

    Prevx - home - free small, fast, exceptional protection CLOUD, working with other security
    programs. It is a single scanner, VERY EFFICIENT, if it finds something come back here
    or use Google to see how to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp?prevx=Y<-->

    Choice of PCmag editor - Prevx-
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Also get Malwarebytes - free - use as scanner only. If you ever think malware and that
    would be unusual with Avast and occasional Prevx running with the exception of a low level cookie
    (not much), to UPDATE and then run it as a scanner. I have a lot of scanners and they
    never find anything of note that I started to use this configuration.
    http://www.Malwarebytes.org/products/malwarebytes_free

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • The most effective way to browse the similar named fields?

    Hello

    I have a 5-page document on every page that contains appx. 50 similarly named fields.    For example Viol1Num, Viol2Num, Vio3Num...  Viol50Num.

    I'm looking for an effective way to program a loop to watch each field in Javascript, I can do some manipulations in these areas on what the user has entered.

    In FormCalc, I've used the 'foreach' function similar to:

    foreach (Field1, Field2, Field3 Field50)

    "BLAH".

    ENDFOR

    However, who gets really long especially when it comes to the following pages, where I have to start adding "topmostSubform.Page2." in front of each domain name so that I can access it from the first page, all fields on the following pages.  Also, I need to do it in Javascript, no FormCalc.

    For example, in JS, I use this loop to mark all fields read-only:

    
    
    
        
    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
    
    
       
    
     var oFields = xfa.layout.pageContent(nPageCount, "field");
    
    
       
    
     var nNodesLength = oFields.length;
    
    
       
    
     for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
    
    
       
    
    
     oFields.item(nNodeCount).access = "readOnly";
    
    
       
    
     }
    
    
       
     }
    
    
    
    

    How could I do something similar to that for I can browse each field and perform actions on it without having to list every single domain name?

    I tried to change to watch the fields instead of field properties, but I couldn't run.

    Thank you.

    I solved my problem.   It took a few fighting in javascript using xfa.resolveNode.

    I have 5 pages, each consisting of a series of 60 fields named Viol1Num, Viol2Num, Viol3Num... Viol60Num.

    If when the javascript is executed, it detects an empty field, then insert a '3' in it.

    Here it is the javascript code that runs to the second page of this document.

       While (LoopCounter< 61)="" {="">
       If ((LoopCounter! = 21) & (LoopCounter! = 22)) {}
       If ((xfa.resolveNode("topmostSubform.Page2.Viol"_+_LoopCounter_+_"Num").rawValue == null) |) ((xfa.resolveNode("topmostSubform.Page2.Viol"_+_LoopCounter_+_"Num").rawValue == "")) {
       xfa.resolveNode("topmostSubform.Page2.Viol"_+_LoopCounter_+_"Num").rawValue = 3;
       }
       }
       LoopCounter = LoopCounter + 1
       }
  • The most effective solution to join streams of drive on primary key

    How can two input reader accompanied on a primary key streams more effectively? For example, I have two readers, with the data of person, one with address data; both have a primary key that can be used for a join. OEDQ provides a certain number of nodes Match, and more common merge node, but none of these options provides a simple way to create a join. Combining a flow of merger with a group and merge nodes would be the best way? Thank you

    No, that would not work.

    Group and the merger is like a select distinct on a single stream. Merge data stream is a simple way to gather all the records of several entries.

    The way to do what you want is not to use two readers but to define a lookup against the data that you want to join against, and use a research treatment and return to collect the data. If you do a search for 1:M, which you can then use a single Split chronogram processor Array to create a record in your stream for each rose (a ' join') record.

    In some cases - if you just want to collect data before processing rather than consistency check, etc. - it makes sense to do the join in the snapshot by specifying the snapshot as SQL or using a view... of course, this approach assumes a direct connectivity to the DB, however.

    Kind regards

    Mike

Maybe you are looking for