Is there a way to count the number of times an array moves from positive to negative?

I have an array of values, and I need to find the number of times that the array changes signs (from positive to negative, or vice versa). In other words from a graphical standpoint, how many times a certain line crosses the x-axis. Counting the number of times the array equals zero does not help however, because the array does not always equal exactly zero when it crosses the axis (ie, the points could move from .1 to -.1).
Thanks for you help. Feel free to email me at [email protected] I only have lv 5.1.1 so if you attach any files, they cannot be version 6.0.

Attached is a VI showing the # of Pos and Neg numbers in an array, with 0 considered as non-Pos. It is easily modifiable to other parameters - including using the X-axis value as your compare point versus only Zero.
This is a modified VI from LV (Separate Array.vi)
Compare this with your other responses to find the best fit.
Doug
Attachments:
arraysizesposneg.vi ‏40 KB

Similar Messages

  • Is there any way to limit the number of times that a PDF can be opened?

    I run a small publishing company and we want to provide exam copies of our books to professors.  At present our exam copies have the words EXAM COPY as a water mark on every page and we've also made the files so that they can't be printed or easily copied.  However, we'd like to also restrict these PDFs so that they can only be opened 5 times.  I've read about FileOpen but that approach seems a bit more complex than needed.  Is there any other way to restrict the number of times that a PDF file can be opened once it is downloaded?  Thanks in advance for any suggestions.

    DRM soltions like FileOpen are your best bet for PDFs. Others include Adobe's LiveCycle Rights Managment, LockLizard, Armjisoft PDF Security OwnerGuard, etc.
    They all work and are priced differently, but there's really nothing for what you want to do that is both simpler and secure.

  • Is there a way to keep the Brush HUD up as I move from image to image?

    I did a large set of portraits and would like to keep the Brush HUD up as I move from image to image making edits.
    Being able to do this would save a little time and make the edits a little faster.
    Thanks

    Not that I've found.  Some brush HUDs stay "up" when a different image is selected (crop, retouch), but most do not.
    I suggest assigning easy shortcuts to any of the Quick Brushes you use regularly, and launching them from the keyboard.
    This is also an instance where a multi-button programable mouse could pay for itself.  Assign those shortcuts to some of the mouse buttons.  (I use and recommend the Razer Naga; surely there are others, and newer ones.  The increased resolution alone is worth the price -- but all that is off topic.)

  • Is there a way to count the number of chars in a formatted text box?

    I have a formatted text box in my web dynpro for comments pertaining to workflow.
    in the backend, this is mapped to a char200 field.
    is there a way to have a running counter to let the user know how many chars are left? I'm not sure if there's an event to use for that.
    thanks,
    robert.

    Hello Robert,
    There is no way to get a running total of characters typed by the user - if you really need this functionality - consider creating an Adobe Flash Island.
    There was in the last year another thread which covered pretty much the same theme - it could be worth looking at that - although you will find that the eventual solution is the same as I suggest above.

  • Is there a way to find the number of downloads of music from itunes store?

    Hi,
    Is there any way to find the number of downloads of each music file available on itunes store. If not exact no of downloads but atleast a relative term to find the rank of the music track From any API
    Thanks
    Sandeep

    A: Is there a way to read the number of active sequence executions from the Engine?

    Scott,
    > One way of handling the issue of init once a set of instruments is to
    > create a new sequence file that has a sequence to init and a sequence
    > to close the instruments. Assuming that you always terminate a
    > sequence and do not abort them, you could add a ProcessSetup and
    > ProcessCleanup callback sequences to the client sequence file that
    > using these instruments. These callbacks are automatically called by
    > the process model in both the Single Pass and Test UUTs execution
    > entry points. The callback sequences could call the init and close
    > sequences for the hardware. In the hardware sequence file you could
    > reference count the number of execution that init and close by setting
    > the file globals in the sequence file to be shared across executions
    > and then add a numeric value that keeps track of references for the
    > instruments. The init sequence adds to the count, and the close
    > sequence subtracts from the count. The init sequence inits the HW if
    > the count is 0->1 and the close sequence closes the HW if the count is
    > 1->0.
    >
    > This is one of many ways in TestStand that this could be done, not to
    > mention that this could also be done in a similar way in a LabVIEW VI
    > or DLL directly.
    That sounds like it will work. I'll try adding a client count
    increment/decrement in the DLL initialize and terminate functions. This
    should essentially perform the same tasks as the callback scheme you mention
    above, no?
    The reason I didn't think the 'client counting' scheme would work initially
    was I mistakenly thought that the termination function would not get called
    under Terminate conditions. Since Terminate conditions happen a LOT during
    our initial debug of new UUT types, I didn't think that would be acceptable.
    I forgot that lacing the terminate funciton in a cleanup step group, I can
    force it to be called in Terminate conditions.
    > If you abort an execution then the reference counting idea above would
    > fail to decrement properly. That might b... [Show more]

    Read other 5 answers

  • A quick way to count the number of  newlines '/n' in string of 200 chars

    I am trying to establish the number of lines that a string will generate.
    I can do this by counting the number of '/n' in the string. However my brute force method (shown below) is very slow.
    Normally this would not be a problem on a 2800mhz Athlon (Standard) PC this takes < 1 second. However this code resides within a speed critical loop (not shown). The code shown below is a Achilles heal as far as the performance of this speed critical loop goes.
    Can anyone suggest a faster way to count the number of �/n� (new lines) within a text string of around 50- 1000 chars, given that there may be 10 � 100 newline chars. Speed is a very important factor for this part of my program.
    Thanks in advance
    Andrew.
        int lineCount =0;
        String txt = this.getText();
        //loop throught text and count the carridge returns
        for (int i = 0; i < txt.length(); i++)
          char ch = txt.charAt(i);
          if (ch == '\n')
           lineCount ++;
        }//end forMessage was edited by:
    scottie_uk
    Message was edited by:
    scottie_uk

    Well, here is a C version. On my computer the Java version (reply 9 above) is slightly faster than C. YMMV. For stuff like this a compiler can be hard to beat even with assembler, as you need to do manual loop unrolling and method inlining which turn assembly into a maintenance nightmare.
    // gcc -O6 -fomit-frame-pointer -funroll-loops -finline -o newlines.exe newlines.c
    #include <stdio.h>
    #include <string.h>
    #if defined(__GNUC__) || defined(__unix__)
    #include <time.h>
    #include <sys/time.h>
    #else
    #include <windows.h>
    #endif
    #if defined(__GNUC__) || defined(__unix__)
    typedef struct timeval TIMESTAMP;
    void currentTime(struct timeval *time)
        gettimeofday(time, NULL);
    int milliseconds(struct timeval *start, struct timeval *end)
        int usec = (end->tv_sec - start->tv_sec) * 1000000 +
         end->tv_usec - start->tv_usec;
        return (usec + 500) / 1000;
    #else
    typedef FILETIME TIMESTAMP;
    void currentTime(FILETIME *time)
        GetSystemTimeAsFileTime(time);
    int milliseconds(FILETIME *start, FILETIME *end)
        int usec = (end->dwHighDateTime - start->dwHighDateTime) * 1000000L +
         end->dwLowDateTime - start->dwLowDateTime;
        return (usec + 500) / 1000;
    #endif
    static int count(register char *txt)
        register int count = 0;
        register int c;
        while (c = *txt++)
         if (c == '\n')
             count++;
        return count;
    static void doit(char *str)
        TIMESTAMP start, end;
        long time;
        register int n;
        int total = 0;
        currentTime(&start);
        for (n = 0; n < 1000000; n++)
         total += count(str);
        currentTime(&end);
        time = milliseconds(&start, &end);
        total *= 4;
        printf("time %ld, total %d\n", time, total);
        fflush(stdout);
    int main(int argc, char **argv)
        char buf[1024];
        int n;
        for (n = 0; n < 256 / 4; n++)
         strcat(buf, "abc\n");
        for (n = 0; n < 5; n++)
         doit(buf);
    }

  • Is there a way to control the number of concurrent SMTP connections on Database Mail?

    Las week Rackspace started controlling the number of concurrent SMTP connections and we are now getting the following message when we send as little as 15 messages at a time using Database Mail:
    Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: 4.7.0 smtp13.relay.dfw1a.emailsrvr.com Error: too many connections from IP xxx.xxx.xxx.xxx)
    We are using SQL Server 2005 and Windows 2003 and we have been doing this since 2006 with no problems
    Is there a way to control the number of concurrent SMTP connections used by Database Mail or the Database Mail external executable DatabaseMail90.exe?

    Hi rkohler,
    Usually, we can use the Database Mail Configuration Wizard or the Database Mail stored procedures to determine the server name and port number for the Simple Mail Transfer Protocol (SMTP) server . In the SMTP server points, we can set or increase the number
    of concurrent connections.
    There is similar issue about database email on SQL Server 2005, you can refer to the following post.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6bb7b600-f025-451b-898b-2caa29c10d4d/only-some-email-gets-sent-successfully-from-spsenddbmail-database-mail-on-sql-server-2005
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Is there a way to increase the number of layers in PS touch for iPad? Can Adobe do something about this?

    Is there a way to increase the number of layers in PS touch for iPad? Can Adobe do something about this?  I have been using PS touch for iPad for a few years and ALWAYS end up with a message that I have reached the maximum allowable number of layers.  not to mention of course a simple tool for drawing straight lines which is a must.  I may be missing something.  I would have imagined that a respectable company like Adobe would have added over the years a small upgrade to solve these issues.
    thanks. 

    Hi Patrick,
    I'm working on a 30" monitor, so it's effectively 2560x1600.  It only seems to be showing 2 tracks at a time, unless there is a preference or setting I'm missing that I can't seem to find in the documentation.  Here is a screenshot:
    I don't see any areas for expanding the timeline.  I can scroll vertically in the timeline, but I can't seem to actually get a larger static vertical area for showing more tracks at once.  The only vertical resizing widget is to expand the bottom or top panels, not the timeline.
    Thanks,
    Jason

  • Fastest way to count the number of occurences of string in file

    I have an application that will process a number of records in a plain text file, and the processing takes a long time. Therefore, I'd like to first calculate the number of records in the file so that I can display a progress dialog to the user (e.g. " 1234 out of 5678 records processed"). The records are separated by the string "//" followed by a newline, so all I need to do to get the number of records is to count the number of times that '//' occurs in the file. What's the quickest way to do this? On a test file of ~1.5 Gb with ~500 000 records, grep manages under 5 seconds, whereas a naive Java approach:
    BufferedReader bout = new BufferedReader (new FileReader (sourcefile));
                   String ffline = null;
                   int lcnt = 0;
                   int searchCount = 0;
                   while ((ffline = bout.readLine()) != null) {
                        lcnt++;
                        for(int searchIndex=0;searchIndex<ffline.length();) {
                             int index=ffline.indexOf(searchFor,searchIndex);
                             if(index!=-1) {
                                  //System.out.println("Line number " + lcnt);
                                  searchCount++;
                                  searchIndex+=index+searchLength;
                             } else {
                                  break;
                   }takes about 10 times as long:
    martin@martin-laptop:~$ time grep -c '//' Desktop/moresequences.gb
    544064
    real     0m4.449s
    user     0m3.880s
    sys     0m0.544s
    martin@martin-laptop:~$ time java WordCounter Desktop/moresequences.gb
    SearchCount = 544064
    real     0m42.719s
    user     0m40.843s
    sys     0m1.232sI suspect that dealing with the file as a whole, rather than line-by-line, might be quicker, based on previous experience with Perl.

    Reading lines is very slow. If your file has single byte character encoding then use something like the KMP algorithm on an BufferedInputStream to find the byte sequence of "//\n".getBytes(). If the file has a multi-byte encoding then use the KMP algorithm on a BufferedReader to find the chars "//\n".getCharacters() .
    The basis for this can be found in reply #12 of http://forum.java.sun.com/thread.jspa?threadID=769325&messageID=4386201 .
    Edited by: sabre150 on May 2, 2008 2:10 PM

  • Is there any way to limit the number of Threads running in Application(JVM)

    Hello all,
    is there any way to limit the number of Threads running in Application(JVM)?
    how to ensure that only 100 Threads are running in an Application?
    Thanks
    Mohamed Javeed

    You should definitely use a thread pool for this. You can specify maximum number of threads that can be run. Be note that the thread pool will only limit the number of threads that are submitted to it. So donot call "Thread"s start() method to start thread on your own. Submit it to the pool. To know more, study about executor service and thread pool creation. Actually it will not be more than 20 line code for a class and you might need maximum of 2 such classes, one for threadPool and other one for rejection handler (if you want).
    Just choose the queue used carefully, you just have to pass it as a parameter to the pool.
    You should use "Bounded" queue for limiting threads, but also be careful in using queues like SynchronizedQueue as the queue will execute immediately the threads submitted to it if maximum number of threads have not been running. Otherwise it will reject it and you should use rejection handler. So if your pool has a synchronized queue of size 100, if you submit 101th thread, it will be rejected and is not executed.
    If you want some kind of waiting mechanism, use something like LinkedBlockingQueue. What this will do is even if you want 100 threads, you can specify the queue's size to be 1000, so that you can submit 1000 threads, only 100 will run at a time and the remaining will wait in the queue. They will be executed when each thread already executing will complete. Rejection occurs only when the queue oveflows.

  • My iphone is stolen .. is there any way to know the numbe of the person going to use in the future .. I have the serial no. and every thing .. and it is registered under my name and my information with iTunes ??

    my iphone is stolen .. is there any way to know the numbe of the person going to use in the future .. I have the serial no. and every thing .. and it is registered under my name and my information with iTunes ??

    If you had find my iphone activated on the iphone itself before it was stolen, then you may be able to track it.
    Otherwise, there is nothing you can do.
    Sorry.
    Report it to the police and your wireless carrier and change your password.

  • Is there a way to display the date and time on my officejet 6500

    HP Officejet 6500a Plus Windows XP_ Is there a way to display the date and time on the display of my printer

    Are you referring to the Date and Time some cameras put right on the image?  If so there is nothing really good in iPhoto to do this. You could try the Retouch tool and see how that looks but I think you will need something more precise and powerful, like the clone tool in Aperture.
    Also something like PhotoShop or GIMP - The GNU Image Manipulation Program (free) should do what you want also.
    If your asking about some other date post back.
    regards

  • Count the number of times a character is in a string using pl/sql

    I need to count the number of times ":" appers in the string ":XXX:CCC:BBB:".
    I have sound some solution using SQL but I do not want the context switch.
    Also I am on 10g so I can not use REGEXP_COUNT.
    Any help would be great.

    Hi,
    length(REGEXP_REPLACE(':XXX:CCC:BBB:','[[:alnum:]]'))counts all kinds of punctuation, spaces, etc., not just colons. Change any (or all) of the colons to periods and it will still return 4. Use '[^:]' instead of '[[:alnum:]]' if you really want to count just colons.
    Also, "SELECT ... FROM dual" is usually needed only in SQL*Plus or similar front end tools. In PL/SQL, you can call functions without a query, like this:
    x := NVL (LENGTH (REGEXP_REPLACE (txt, '[^:]')), 0);

  • Is there a way to remove the date and time from pictures?

    Is there a way to remove the date and time from phoos in iPhoto?

    Are you referring to the Date and Time some cameras put right on the image?  If so there is nothing really good in iPhoto to do this. You could try the Retouch tool and see how that looks but I think you will need something more precise and powerful, like the clone tool in Aperture.
    Also something like PhotoShop or GIMP - The GNU Image Manipulation Program (free) should do what you want also.
    If your asking about some other date post back.
    regards

  • Is there a way to control the number of consumed messages from JMS?

    Hi everyone,
    I have a BPEL process that is consumes messages from a foreign queue, performs a transformation, and passes it to Oracle Apps. I'm curious if there is a way to control the number of messages consumed at a time for processing.
    For example, if we place 50 transactions on this queue, I would like to only consume 10. And then as each one is processed and passed to Oracle Apps, I would like to pull another transaction off the queue. So basically I would only be processing 10 at the most.
    The issue I am having is we put 50 on the queue and the 50 are take off right away. But then half are making it into Oracle Apps and the remainder is failing with a JCA Connection Factory max connection error.
    Instead of changing the settings to get more through, I am wondering if it's possible to limit the number being processes at any one time.
    Thanks

    Hi,
    Have a look at the adapter.jms.receive.threads Property for JMS Adapter...
    http://docs.oracle.com/cd/E21764_01/core.1111/e10108/adapters.htm#BABCGCEC
    Cheers,
    Vlad

Maybe you are looking for

  • Apple TV and a server

    Can you store all your movies, music, and pictures on a apple server and access it thru the apple tv?

  • How do I get rid of your Resend pop up?

    Although I have clicked "Block all pop-up windows", every time I hit reload or back, I get a Firefox Pop-up window telling me that it will resend the web page. First of all, why does Firefox make itself an exception to my not wanting pop-ups? They ar

  • BDC for Open Po

    Dear Gurus, Any one can send me the BDC code For ME21N. Kl. Help me... I recorded but not working in multi line items... Rewards will be sure.. Regards, Murugesh R

  • Apache error - oc4j related

    Hi, i've found some errors in the error_log_crit apache logs. I would understand what does they mean. Any help please.. MOD_OC4J_0184: Failed to find an oc4j process for destination: OC4J_PCRM MOD_OC4J_0145: There is no oc4j process (for destination:

  • MacBook Pro Crash

    My MacBook Pro (2010 model) crashed earlier and then would not restart properly, getting stuck on the grey page I followed the advice provided regarding running a Disk Utility check which told me my HD appeared to be ok. However, the MacBook still wo