find the longest series of equal values in table

Hello

I had an array with Boolean values, something like this

[TTFFFFFFFFFFFFTTFFTTT]

and I need to find the longest window were the elements of the array is equal, in the above example, I want to find the index 2 and length 12 for longer window F and index 18, length 3 to T. everyone who has an idea how I can do this?

Hello Tudor,

There is so far, I don't know any loan service in labview to do what you want. However this seems not really hard to do.

You can link your table for a loop and to compare with each iteration, the current Boolean value to the previous. If the two are combined, for example, you can increment a counter until one is true and the other false. Then you can record the length in a separate shift register if this length is greater than pre-existing (initialize to 0).

On the index, you can save the terminal in the County of the foor in a turn loop register when the value N-1 of your table is different from the value of N, the following difference, if the length is the longest, you save this count minus one in another register.

I hipe this helps you.

Concerning

Tags: NI Software

Similar Questions

  • find the nr series of one computer, that a particular hard disk is too

    Hi all

    I was wondering if there is a solution to the following problem:
    I'm HIM offer support for a company using Lenovo Thinkpad T410-T420 and T430. We have many systems used in stock with a password for the user in this regard. I have

    Unfortunately, we do not know these passwords, however we have a tool where we can find the admin password and we are able to start those used systems.
    Now problems occur when the hard drive has been replaced on this system. Is there a way to know which computer hard drive was to find the admin password?

    Hope you can help me

    Kind regards

    Stefan

    Welcome to the forum!

    stefanbonnarens wrote:

    Now problems occur when the hard drive has been replaced on this system. Is there a way to know which computer hard drive was to find the admin password?

    No it's not.

    Please note that all discussion related to the methods of cracking and/or password in order to bypass the machine safety devices is NOT allowed by the rules of the forum.

    Clean the discs, re - install the operating system and be done with it. This is the * only * way correct, legal and legitimate to deal with the issue.

    Good luck.

  • Find the missing series or page n

    I have a table

    document_sl_no, from_page, book_no, to_page

    1                              1          1               9

    2                              1          10             12

    3                              1          18              33

    Documents binded in the books and the Livre_No is entered in the database, so that if we find the hard copy of the document we can search easily.

    I need to write a query that miss me page in the pagination sequence book will give.

    as in the above example page No 13,14,15,16,17 are missing.

    Y at - it no way out.

    I was tring to get the sequence first then thought to find the missing sequence using advance or delay.

    So any suggestions to get the sequence of this wise Livre_No table

    Livre_No page_no

    11
    12
    13
    14
    15
    16
    17
    18
    19
    110
    111
    112
    118
    119
    120
    121
    122

    Something like this:

    books (book_no, from_page, to_page) as)
    Select 1,1,9 from all the double union
    Select 1,10,12 from all the double union
    Select double 1,18,33
    )
    run like)
    Select
    Livre_No
    from_page
    to_page
    , (from_page, 1, to_page) ahead of (Livre_No order of from_page partition)
    -to_page diff
    books
    )

    Select
    Livre_No
    from_page
    to_page
    , case when diff > 2 then
    diff-1 | "the missing pages after" | to_page
    lack of end
    leaks

    BOOK_NO FROM_PAGE TO_PAGE MISSING
    1 1 9 -
    1 10 12 5 missing pages after 12
    1 18 33 -
  • How can I find the longest line in an InDesign document?

    Is there a script that locates the longest line in an InDesign document?

    Hello

    I area with Vamitul (Welcome back, long time no see) that the smaller Panel is fairly trivial.

    Not sure what Vamitul what you were asking about the block of code on the forum.

    I just want to reaffirm it as a loop will be several times faster than sort on the same short document.

    #targetengine longestLine
    var docLines = app.activeDocument.stories.everyItem().lines.everyItem ().getElements(),
        l = docLines.length,
        lineLength, longestLines = [],
        longestLineLength = 0,
        multi;
    while(l--) {
        if ((lineLength = docLines[l].characters.length) >= longestLineLength) {
                if (lineLength === longestLineLength) longestLines.push(docLines[l]);
                else longestLines = [docLines[l]];
                longestLineLength = lineLength;
        }
    }
    multi = longestLines.length ;
    if (multi == 1) longestLines[0].select();
    else {
        var n = 0,
            w = new Window ('palette'),
            b1 = w.add('button', undefined, "Next"),
            b2 = w.add('button', undefined, "Previous");
        w.show();
        b1.onClick = function () {selct(1)};
        b2.onClick = function () {selct(-1)};
        function selct (next) {
            n = (n + multi + next) % multi;
            longestLines[n].select();
        }
    }
    

    Concerning

    Trevor

  • How to find the second largest in a pl/sql table

    Hello friends,

    I want to find the first and second maximum items in a pl/sql table.

    Here's the code...

    DECLARE
    Max_earnings_type TYPE TABLE IS NUMBER;
    max_earnings_tab max_earnings_type: = max_earnings_type();
    number of v_count: = 0;
    number of v_max_earnings;


    Can someone give me how to find the maximum first max and second in the type of the given table.

    appreciate your help.

    Thank you/kumar

    Published by: kumar73 on October 21, 2010 09:42

    kumar73 wrote:

    When I tried to implement your logic in my application, I get the following error...

    PL/SQL: digital or value error: NULL index key value table

    What happens if the PL/SQL table has NULL values. Question is how you want to handle NULL values. You want to ignore nulls as GROUP BY do? If you want to consider NULL values, you can say if you want to order the NULLS FIRST or NULLS LAST. I guess that logical GROUP BY:

    DECLARE
        TYPE max_earnings_type IS TABLE OF NUMBER;
        TYPE max_earnings_sorted_type IS TABLE OF NUMBER
          INDEX BY BINARY_INTEGER;
        max_earnings_tab        max_earnings_type;
        max_earnings_tab_sorted max_earnings_sorted_type;
    BEGIN
        SELECT  sal + comm
          BULK COLLECT
          INTO  max_earnings_tab
          FROM  emp;
        FOR v_i in 1..max_earnings_tab.count LOOP
          IF max_earnings_tab(v_i) IS NOT NULL
            THEN
              max_earnings_tab_sorted(max_earnings_tab(v_i)) := 1;
          END IF;
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('MAX value in PL/SQL table is ' || nvl(to_char(max_earnings_tab_sorted.last),'NULL'));
        DBMS_OUTPUT.PUT_LINE('Second MAX value in PL/SQL table is ' || nvl(to_char(max_earnings_tab_sorted.prior(max_earnings_tab_sorted.last)),'NULL'));
    END;
    /
    MAX value in PL/SQL table is 2650
    Second MAX value in PL/SQL table is 1900
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT  sal + comm
      2    FROM  emp;
    
      SAL+COMM
    ----------
    
          1900
          1750
    
          2650
    
          1500
    
      SAL+COMM
    ----------
    
    14 rows selected.
    
    SQL>
    

    SY.

  • How to find the name of a column in a table

    Hi all

    I have a Table that contains approximately 100 columns.


    I need to find the column name, to find in specific columns containing data like 'abc '.

    Ex: I have a table like temp_table_name
    the columns are col1, col2, col3, col4, col5, col6, col7, col8,.... col99
    I'm looking for with data specific like 'abc '.

    Need to find the name of the table column that contains data of 'abc '.

    Please suggest me. How to find in a single query... :-)

    Actually I'm looking through a column of the table as below
    Select count (*) in the temp_table_name where col1 = 'abc '.

    FOR I IN 1.20 LOOP
    ln_num_of_rows: = 0;
    lv_column_name_search: = "col" | I have;

    lv_sql: = ' select count (*) in the temp_table_name where ' | lv_column_name_search | "= abc";

    EXECUTE IMMEDIATE lv_sql INTO ln_num_of_rows;

    IF ln_num_of_rows > 0
    -column found in lv_column_name_search
    EXIT;
    END IF;
    END LOOP;

    But I'm gettig performance problem.

    How can I do this in any other alternative way? could you suggest any way possible as soon as POSSIBLE.

    It's probably never going to be effective - realistic, you have to scan completes the picture.

    You could probably improve a little things by doing something like

    SELECT DISTINCT column_name
      FROM (
        SELECT (CASE WHEN col1 = 'abc' THEN 'col1'
                    WHEN col2 = 'abc' THEN 'col2'
                    WHEN col3 = 'abc' THEN 'col3'
                    ...
                    WHEN col20 = 'abc' THEN 'col20'
                    ELSE NULL
                    END) column_name
          FROM table_name
        WHERE col1 = 'abc'
            OR col2 = 'abc'
            ...
            OR col20 = 'abc'
      )
    

    but it's never going to be incredibly fast.

    Justin

  • find the average of each 500 values in a column [text file]

    Please help, I have a text file with three columns of integer values of hv. I need to take 500 values in each column and replace them with their average.

    A particular work if it could probably be simplified. Here are a few ideas... Many things could be improved even more.

  • He knows the error code. When he asks if I have an installation CD, and I click on the box that says I'm doing, I'm asking to choose m printer (Lexmark 730 series all-in-one) list I can find the Lexmark but not the 730 series.

    The installation CD and my add new hardware wizard does not appear to recognize this printer.

    Hello Debbie Cross,.

    Thank you for your message.  I struggled to find the 730 series printer, do you actually mean the Z730?  If so, click HERE to download the latest driver for your printer.  Please let us know if it did or did not help to solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • How to find the value duplicate of each column.

    I have it here are four columns,
    How can I find the duplicate of each columns value.

    with All_files like)
    Select ' 1000 'like BILL, "2000" AS DELIVERYNOTE, CANDELINVOICE ' 3000', '4000' CANDELIVERYNOTE of all union double
    Select ' 5000 ', ' 6000', ' 7000 ', ' 8000' Union double all the
    Select '9000 ', '1000', '1100',' 1200' from dual union all
    Select ' 1200 ', ' 3400', ' 6700 ', ' 8790' Union double all the
    Select ' 1000 ', ' 2000', ' 3000 ', ' 9000' Union double all the
    Select '1230', '2340', ' 3450 ', ' 4560' double
    )
    SELECT * from All_files


    Output should be as shown below.

    1000 2000 3000 4000
    9000 1000 1100 1200
    1200 3400 6700 8790
    1000 2000 3000 9000

    Required to check uniqueness columns.

    Thank you.

    Hello

    If you are not too concerned about performance, this should give you the desired result:

    SELECT distinct INVOICE, DELIVERYNOTE, CANDELINVOICE, CANDELIVERYNOTE
    FROM (
      SELECT a.*,
             count(*) over(partition by t.column_value) cnt
      FROM All_files a,
           table(
             sys.odcivarchar2list( a.INVOICE
                                 , a.DELIVERYNOTE
                                 , a.CANDELINVOICE
                                 , a.CANDELIVERYNOTE ) ) t
    )
    WHERE cnt > 1
    ;
    
  • Find the DDL

    Hello
    in 10g R2,.
    I run the following command to find the DDL:
    SQL> select dbms_metadata.get_ddl( 'TABLE', 'MGMT_CURRENT_METRICS') from dual;
    
    DBMS_METADATA.GET_DDL('TABLE','MGMT_CURRENT_METRICS')
    --------------------------------------------------------------------------------
    
      CREATE TABLE "SYSMAN"."MGMT_CURRENT_METRICS"
       (    "TARGET_GUID" RAW(16) DEFA
    The problem is that the whole DDL is not displayed. Then the statement to create the table is not complete. How to see who?
    Thank you.

    Run in SQL * more:

    set long 100000
    
  • find the closest value in table

    Hi all

    I need to find the values in the "C" line which is equal or close to the values 'A' in the 2D array, and then I want to show the values of 'B', corresponding to the values of 'C' in table 2D.

    How can I fix it?

    Thank you!

    0.9967 nearest value is 0.993807 in the 8 Cand in row B row, not 1. The differences are 2.893E - 3 and 3.300E - 3.

    Subtract each value from the table C. take the absolute value of the difference. To find the index of at least using Max & Min value of B. Using autoindexing array Index, create the output array.

    Lynn

  • How to find the mobile average for perticular time step for the same time series

    Hi all

    I'm new in labview and I have a question. I have a huge text with the value of different pressure of various ports.

    I do the VI in which all first I read the text file and identify the column of perticular port. In this column, there is pressure value 32768.

    Port of Port 102 times Num Port 101 103... Port 532

    0         1

    2 0.001

    .          .

    .          .

    50 32768

    And reading this all takes 50 sec and I divide this reading in 4.5 sec... There are in all 4.5 sec 2969 values...

    Now, please check the attached VI... I am able to find the average value in step 12 2969 value time...

    Now, I want to do is to find the average value of 2969 (2970 to 5938) values with time of 12 steps and so on up to 32768. It is 11 times in the series...

    So anyone can change my VI?

    Thank you

    Hello

    Thank you very much. It's the perfect VI that suits my needs.

    Thank you again... Have a great day ahead.

  • How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    See if this application works for you > https://itunes.apple.com/us/app/image-size/id670766542?mt=8

  • How can I find the ink levels in the Photosmart D110 series?

    How can 8.1 Windows, I find the ink levels in the Photosmart D110 series?

    Ink levels can be checked from the front as shown in the document here.

  • Formula to find the value of the channel

    Hi all

    Support: Dat file containing the value of time and acceleration. Now, there are only two Channels.  Channel 1 is time. Channel 2's acceleration.

    Step 1: Create more than two channels. Channel 3 and channel 4

    Step 2: go to the analysis and acceleration channel research where its value is reached xxxxxxxx 1.

    Step 3: where it has reached 1. XXXXXXXX in the process of accelerating from this point in the channel 3 and 4, paste all the values STD. STD values in the attached excel file.

    How can I do this? What is the formula or the script to do this?

    Thanks in advance.

    Hi Rash.patel,

    You didn't yet tell me where to find the Excel file, so I assumed it would be in the same folder as the VBScript script.  I used the DIAdem Excel Import Wizard to create an *.stp file that can be passed as parameter in the ExcelImport() command to load these curves 2 envelopes by program.  I also added a file dialog box, then you can select the *. DAT to deal with file.

    I think that's

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

Maybe you are looking for

  • Qosmio G30 - 190 can't start

    I have the Qosmio G30 - 190 model No computer. PQG30E-039023FR There is often a blue if poster tell me there's an erros on the systemI tried to restore from the TOSHIBA restore CD. but after you create the software image and eject the recovery CD, th

  • Upgrading RAM for the Pavilion P6650z

    I had an analysis of the system of crucial.com who said that I have 4 slots for RAM. 2 are empty; 2 have sticks of 2 concerts each - so I currently have 4 gigs. The results of the analyses say that my max is 8 GB. FWIW, there is a Pavilion P6650z, un

  • Upgrade processor T440p

    Hi all, I've seen some people can gain their t440p i7 cpu. But for what I've read, all of them have integrated the graph. I just got a t440p with nvidia 730 m. CPU is i5 4300 M. is possible to upgrade to i7, like 4810M or something? Thank you very mu

  • HP Officejetpro 8620: HP 8620 fact but don't Print everything

    I just got this printer and have not been able to print since I installed it.  It copies, it analyzes it Fax - it prints even my web browser, but not when I try to print a Word document, etc. I'm about to take it back and get a refund and buying an E

  • Acer Aspire laptop computer does not start

    Lites button power screen stays black, the system tries to start, but he keeps power button light turns off.  I have a new disc of windows 7 32 & 64 bit.  I have the disc as a dvd before I turn on the power button.  With the new windows 7 dvd of 20 t