Pattern Matching functions in DP Macro

Folks,
Can anyone tell me if there are any pattern matching functions in DP Macros? Here is the requirement:
If the time bucket is a quarter, then hide some rows. If the time bucket is  a month or something finer, then show the same row. Assume that all the time buckets in the data view will be the same (no telescoping buckets profile)
So, suppose that I use BUCKET_DESCRIPTION and get the name of the bucket. If it is Q.* (using pattern matching lingo here), then I would like to set the row attributes accordingly. If it is M.* then set the row attributes to visible.
Can you please throw some light on this? Would you do it some other way?
Thanks,
Satish

Hi,
You may try with the macro function BUCKET_DAYS(). This will find number of days in a given bucket.
Then you can write condition, If bucket days is more than 1 and less than 7, then it is weekly.
If bucket days is more than 7, then it is monthly.
Please see if it is helpful for you.
Regards,
Manimaran M.

Similar Messages

  • Pattern Matching

    I have problem to use the pattern matching function when i try to set the the pattern for more than one keyword in one pattern. For example:-
    Pattern pat = ".*when.*or.*\\?"
    check if the sentence containg with both of these keyword "when" and "or" then do something...
    The problem is my project is using this pattern matching function in unicode format, such as:-
    pattern pat = "\u54ea\u4e00\u5929(meaning: "what day" in Chinese)|\u2616(OR)"
    When i try to generate the same function as the first example, which to combined both seperate keyword as ONE KEYWORD PATTERN, but error message occur. What i did I replaced the string of "dot(.)" and "*" in unicode form... unfornately.... is doesnt work...
    Please, anyone ... I need to solve this problem urgently..??? Thanks a lots
    English: What day is boxing day, do you think is on Monday or Tuesday?

    >>>
    >>>
    English: What day is boxing day, do you think ison
    Monday or Tuesday?
    December 26thA Friday this year!Are you sure??
    and M_KHOR,
    You have an error? What a shame. Shame I dont know what it is so I could do something about it....

  • Large size variations with IMAQ Pattern matching?

    Does the pattern matching functions work for only +-5% size variations? Which means that the pattern matching is made for static situations only? (With static I mean a static camera watching e.g. a moving assemblyline)
    I have a scenario where the camera is moving in 6DOF, giving my fiducials very much slant and very large size variations.
    Is it then not possible to use the pattern matching of IMAQ?
    The "IMAQ Vision Concepts Manual" says:
    "Because pattern matching is the first step in many machine vision
    applications, it should work reliably under various conditions.
    In automated machine vision applications, the visual appearance of
    materials or components under inspection can change due to factors such
    as ori
    entation of the part, scale changes, and lighting changes. The pattern
    matching tool maintains its ability to locate the reference patterns despite
    these changes."
    -But with my experience, this is not correct in my scenario. Actually, the pattern matching tool was not able to find a match in any of my tested images. My size variations were large in these images (probably 50-200%).
    Thanks!

    Unfortunately the pattern matching algorithm NI currently uses is not a geometric (scaleable) pattern matching algorithm. The current algorithm works despite orientation, and some lighting changes, but not scale changes.

  • Pattern matching for LCD function test

    Hello,
    I am writing a VI that is taking a single picture from a camera and then compares it with a template extracted before that.
    The camera is looking at LCD display and and the purpose of the matching is to find whether there is a dead pixel or sth wrong at the display. The problem is that the comparison doesn't work as expected.
    I will illustrate this with just one examples with picture attached:
    - At step 1. the template is created. (you can see RUN 2 at the top left corner at the display) 
    - At step 2. pattern matching is performed with the same mode of the LCD but a little bit tilted(score - 972 achieved)
    - At step 3. the mode is changed (you can see RUN 3 at the top left corner at the display, everything else is the same) - but however a bigger score of 974 is achieved
    Any explanation of this and some suggestions that can improve my program !?
    Thanks a lot
    Iliya G. 
    Attachments:
    1step.JPG ‏43 KB
    2step.JPG ‏42 KB
    3step.JPG ‏38 KB

    Hi David,
    I went through this OCR examples that you mentioned but in fact I find them very annoying because in many cases the output string depends on how you draw your ROI. Please, find an example below and could you please tell me if i am doing sth wrong, but in fact i don't think so.
    When I try to read the characters separetely, everythings goes ok - it finds r,u,n and 1.
    But when I make the ROI bigger in order to contain all the characters, the output is the one at the picture. Any ideas?
    Thanks,
    Iliya 
    Attachments:
    1.JPG ‏21 KB

  • Vision assistant steps to be followed for pattern matching

    I am acquiring color images of hands movement using web camera of laptop.
    I want to process the acquired images to use for pattern matching.
    What are the steps to be followed to achieve the above mentioned task.

    In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
    Atom
    Certified LabVIEW Associate Developer

  • Pattern matching in String

    Hi,
    I want to do pattern matching using String. Here is my requirement.
    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");
    So, whereever I have '(apostrophe) I will replace it with pattern "285745@" and then at another jsp where I get this request parameter I do reverse as follows:
    String docname = (String)request.getParameter("doc_name").replace("285745@","'");
    Now I know replace function is not going to do this. It is just a indicative, for you to know what I want to achieve. which other java function / method i can implement to get the desired result.
    thanks,
    pp

    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");The problem here is that String.replace() operates only on char arguments, you cannot replace entire substrings with it.
    The String.replaceAll() method, on the other hand, operates on regular expressions. In many common cases (those in which the substring you want to find contains no characters with special meaning to the regular expression processor) you can use it exactly as you would String.replace() except that it operates on substrings.
    But regular expressions are much more powerful than that. The javadoc for the "Pattern" class has some information on how to use them. There is also a tutorial at http://java.sun.com/docs/books/tutorial/extra/regex/intro.html which you might find helpful.
    In the 1.4 edition of Java there is no longer any need to screw around with while loops and StringBuffers. Nearly any text processing operation can be done with regular expressions.

  • Saving Pattern matching information to an array

    I am using imaqLearnPattern function to create a template image. According the IMAQ documentation, the pattern matching information is "appended" to the image. But when I try to call the imaqImageToArray function on this template image, it does not give me any pattern matching information. Is there any way, that I can save the template data into an array? I do not want to use the imaqWriteVisionFile function because I want the data in an array format and not saved in a file.
    Thanks.

    Normally you cannot save this information without this function. This information saved in *.png file. This format have a possibilities for saving "user data", and this fact used by IMAQ Vision. Theoretically you can extract this information from *.png into array (format of png is a well known format), but what can you do with this information afterwards? You cannot load this information separately without IMAQ Read Image and Vision Info.vi, because (pretty sure) this function allocated memory for Vision Info before loading, but you not able to do this. You can make this only if you know internal representation of IMAQ image in memory. How organized common parameters, such as width, height, pixel pointer, resolution, linewidth - not very complicated (IMAQ Image -
    a cluster of string and pointer to appropriate structure), but where placed vision info - not very easy.
    Better, fastest and easyest way - to use IMAQ Write Image and Vision Info.vi.
    with best regards

  • Pattern Matching/Encoding

    I have the following code working to identify characters in a string that are not in the ASCII character set. Now I want to do the same thing and compare the string to the Cp1252 character set but regex doesn't seem to have that functionality.
    I tried Pattern pattern = Pattern.compile("\\P{Cp1252}");
    Can anyone point me in the right direction?
         Pattern pattern = Pattern.compile("\\P{ASCII}");
         while ((test=r.readLine())!=null) {
                Matcher matcher = pattern.matcher(test);
                boolean found = false;
                while (matcher.find()) {
                    w.write(i + delim + matcher.group() + delim +  (matcher.start() + 1) + delim + (matcher.end() + 1) + delim + test);
                    w.write('\r');
                    w.write('\n');
                    found = true;
                }

    As a rule, regexes don't match characters according to whether they're covered by a given encoding. (The "ASCII" in \p{ASCII} isn't so much a reference to the ASCII charset as it is an acknowledgement that other charsets exist, in the same sense that nobody ever used the phrase "analog wristwatch" until digital watches came out.) However, Java's Pattern class does have a pre-defined character class, \p{L1}, that seems to correspond to Latin1, or ISO-8859-1. Cp1252 is a superset of Latin1 which adds several characters in the 128-159 range that Latin1 doesn't use.
    Matching those characters in a Java program is tricky because (1) if you type them in directly and then save the source file as Latin1 (the default encoding on some systems), they'll all turn to garbage; and (2) you can't use their Cp1252 encodings, as in [0xF0-0x9F], because Java char's are encoded as UTF-16. The only safe way to match them (or not match them, in your case) is to type in their Unicode escapes:
      "[^\\p{L1}\u0152\u0153\u0160\u0161\u0178\u017D\u017E\u0192" +
      "\u02C6\u02DC\u2013\u2014\u2018-\u201A\u201C-\u201E" +
      "\u2020-\u2022\u2026\u2030\u2039\u203A\u20AC\u2122]"

  • Pattern matching String

    Hi,
    I want to do pattern matching using String. Here is my requirement.
    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");
    So, whereever I have '(apostrophe) I will replace it with pattern "285745@" and then at another jsp where I get this request parameter I do reverse as follows:
    String docname = (String)request.getParameter("doc_name").replace("285745@","'");
    Now I know replace function is not going to do this. It is just a indicative, for you to know what I want to achieve. which other java function / method i can implement to get the desired result.
    thanks,
    sa pa

    Hi,
    I want to do pattern matching using String. Here is my requirement.
    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");
    So, whereever I have '(apostrophe) I will replace it with pattern "285745@" and then at another jsp where I get this request parameter I do reverse as follows:
    String docname = (String)request.getParameter("doc_name").replace("285745@","'");
    Now I know replace function is not going to do this. It is just a indicative, for you to know what I want to achieve. which other java function / method i can implement to get the desired result.
    thanks,
    sa pa

  • New language feature: lazy local pattern matching

    <p>In the upcoming release of the Open Quark Framework, CAL gets a new language       feature: lazy local pattern matching.</p> <p>The new local pattern match syntax allows one to bind one or more variables to       the fields of a data constructor or a record in a single declaration inside a       let block.</p> <p>      For example:</p> <p>      // data constructor patterns:<br />      public foo1 = let Prelude.Cons a b = ["foo"]; in a;<br />      public foo2 = let Prelude.Cons {head=a, tail=b} = ["foo"]; in a;<br />      <br />      // list cons patterns:<br />      public foo3 = let a:b = [3]; in a;<br />      <br />      // tuple patterns:<br />      public foo4 = let (a, b, c) = (b, c, 1 :: Prelude.Int); in abc;<br />      <br />      // record patterns:<br />      public foo5 = let = {a = "foo"}; in a; // non-polymorphic record pattern<br />      public foo6 = let {_ | a} = {a = "foo", b = "bar"}; in a; // polymorhpic record       pattern<br />      <br />      Whereas a case expression such as (case expr of a:b -> ...) forces the       evaluation of expr to weak-head normal form (WHNF), a similar pattern match       declaration (let a:b = expr; in ...) does not force the evaluation of expr       until one of a or b is evaluated. In this sense, we can regard this as a form       of lazy pattern matching.<br /> </p> <p>Thus,</p> <p>      let a:b = []; in 3.0;</p> <p>is okay and would not cause a pattern match failure, but the case expression</p> <p>      case [] of a:b -> 3.0;</p> <p>would cause a pattern match failure.</p> <p>This laziness is useful in situations where unpacking via a case expression may       result in an infinite loop. For example, the original definition of List.unzip3       looks like this:</p> <p>// Original implementation of List.unzip3<br />      unzip3 :: [(a, b, c)] -> ([a], <b>, [c]);<br />      public unzip3 !list =<br />          case list of<br />          [] -> ([], [], []);<br />          x : xs -><br />              let<br />                  ys =       unzip3 xs;<br />              in<br />                  case x       of<br />                  (x1,       x2, x3) -><br />                      //do       not do a "case" on the ys, since this makes unzip3 strictly evaluate the list!<br />                      (x1       : field1 ys, x2 : field2 ys, x3 : field3 ys);<br />              ;<br />          ;<br /> </p> <p>The use of the accessor functions field1, field2 and field3 here is necessary,       as the alternate implementation shown below would result in "unzip3 xs" to be       evaluated to WHNF during the evaluation of "unzip3 (x:xs)". Thus if the input       list is infinite, the function would never terminate. </p> <p>// Alternate (defective) implementation of List.unzip3<br />      unzip3 :: [(a, b, c)] -> ([a], <b>, [c]);<br />      public unzip3 !list =<br />          case list of<br />          [] -> ([], [], []);<br />          x : xs -><br />              let<br />                  ys =       unzip3 xs;<br />              in<br />                  case x       of<br />                  (x1,       x2, x3) -><br />                      case       ys of // the use of "case" here is inappropriate, as it causes "unzip3 xs" to       be evaluated to WHNF<br />                      (y1,       y2, y3) -> (x1 : y1, x2 : y2, x3 : y3);<br />                  ;<br />              ;<br />          ;<br /> </p> <p>With the new syntax, the original implementation can be expressed more nicely       without changing its semantics:</p> <p>// New implementation of List.unzip3, revised to use the local pattern match       syntax<br />      unzip3 :: [(a, b, c)] -> ([a], <b>, [c]);<br />      public unzip3 !list =<br />          case list of<br />          [] -> ([], [], []);<br />          x : xs -><br />              let<br />                  (y1,       y2, y3) = unzip3 xs; // using a tuple pattern to perform a lazy local pattern       match<br />              in<br />                  case x       of<br />                  (x1,       x2, x3) -><br />                      (x1       : y1, x2 : y2, x3 : y3);<br />              ;<br />          ;<br /> </p> <p style="text-decoration: underline">It is important to note that in places where       a case expression can be used (without having an unwanted change in the       laziness of the expression being unpacked), it should be used instead of this       local pattern match syntax.</p> <p>Things to note about the new syntax:</p> <p>      - local type declarations on the pattern-bound variables are allowed, and these       type declarations can have associated CALDoc comments. On the other hand, the       actual local pattern match declaration itself cannot have a type declaration       nor a CALDoc comment.</p> <p>      - this syntax cannot be used for top-level definitions, only local definitions       in let blocks</p> <p>      - one cannot use patterns with multiple data constructors, e.g.</p> <p>      let (Left|Right) = ...;</p> <p>      is not allowed</p> <p>      - one cannot specify a variable for the base record pattern, e.g.</p> <p>      let {r | a, b} = ...;</p> <p>      is not allowed, but this is okay:</p> <p>      let {_ | a, b} = ...;</p> <p>      - patterns without no variables are disallowed, e.g.</p> <p>      let _ = ...;<br />      let [] = ...;<br />      let () = ...;<br />      let : = ...;<br />      let {_|#1} = ...;      <br /> </p>

    If you use just / it misinterprets it and it ruins
    your " " tags for a string. I don't think so. '/' is not a special character for Java regex, nor for Java String.
    The reason i used
    literal is to try to force it to directly match,
    originally i thought that was the reason it wasn't
    working.That will be no problem because it enforces '.' to be treated as a dot, not as a regex 'any character'.
    Message was edited by:
    hiwa

  • SLOW pattern matching in VB, FAST in VisionBuil​der?????

    I've built several vision aquisition and analysis apps with VB and CWIMAQ. Now, I'd like to do a pattern matching application, however, I can't seem to get the same functionality and speed with the VB component as I can using VisionBuilder! Attached is a grayscale image of a microtiterplate, and a "pattern" of a well or "hole". Using pattern matching in visionbuilder there are about 96 matches, which is perfect, dang near a match for every well. However, if I try to reverse engineer the VB "FeatureFind" example and use the attached picture and pattern, the "Correlation" takes a VERY long time (14 seconds for VB featurefind app, instant for VisionBuilder), and it doesn't even match!
    Even though I can't use
    visionbuilder in my final application, it works almost perfectly when I use the attached image and pattern while setting the minimum score to 50. I wish I could implement the same thing in VB, that is, if NatInst could tell me the CWIMAQ components function calls used to implement it :-0)
    Any Ideas? Thanks
    Attachments:
    bw.tif ‏301 KB
    test_patt.png ‏57 KB

    I am not familiar with the VB commands you want to use since I use LabVIEW. However, I think you might be using the wrong function. It sounds like the example you tried to modify uses correlation, which is different from pattern matching. As you have seen, pattern matching is much faster and gives better results.
    I would assume that the manual for CWIMAQ would give you the information you need.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Regular exression for matching function declarations or calls

    Hi guys,
    I used a regular expression like \\w + (\\s*) \\( .*\\) (\\s*) [\\{;] to match function
    declarations.This regular expression works fine for all the declarations of the form init_queue(TREE **NODE) {  and even for declarations of the form
    init_queue (TREE **NODE)
    But the problem occurs when i have a declaration of the form
    init_queue(TREE **NODE ,
    int size ) {
    when i have a declaration of this form my regular expression doesnt parse function names.The regular expression . (DOT) means it recognizes anything except for line terminators.So i used the DOTALL option in pattern matching so that .(DOT) matches even line terminators.But using this has a negative effect like i am not able to match declarations of the form
    init_queue(TREE **NODE) { 
    can anyone help me out in solving this
    Thank you,
    Akash

    multipost: http://forum.java.sun.com/thread.jspa?threadID=5168705

  • How to accelerate the processing time of pattern match

    How to accelerate the processing time  of pattern match
      If my camera acquire an image in 50ms, but when we analyze this image with pattern match, we need about 300ms. Except using queue to seprate acquisition
    and analysis to different loops, there is another way to directly accelerate the processing time  of pattern match ? Maybe compact rio with FPGA ?
    But I saw a paper in NI web, there is no this function in c-rio ?  
    Any suggersion will be very apperciated ~
    Ricky
    Attachments:
    aa.png ‏65 KB

    Hello,
    what matching algorithm are you using? You can reduce time using the Gaussian pyramids algorithm.You can fine tune the parameters using the advanced options.
    What is your template size/image resolution?
    I suppose using a computer with better performance would also work...
    Best regards,
    K
    https://decibel.ni.com/content/blogs/kl3m3n
    "Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

  • How do I do input pattern matching with the 6534?

    I am configuring the 6534 to have one 8 bit input port and one 8-bit output port. Both input and output are in continuous mode. The input port is scanning for a specific pattern, but doesn't need to save the data. When this specific pattern is received, the VB program must be notified so that it can perform some action. This will occur every 2 seconds, i.e. the input pattern will match every two seconds. How do I perform this continuous pattern match and how can I throw away the input data without overflowing the input buffer?

    It sounds like you want to do DAQ Event Messaging. With this mechanism, the driver actively notifies the user of a specific DAQ Event by either posting a message on a message queue or calling a callback function.
    There are several documents that describe how you can do this with Visual Basic. You can find some KnowledgeBase entries, and a really useful tutorial called "Using DAQ Event Messaging in Windows under Windows NT/95/3.1". You can find these by searching the http://www.ni.com/support pages for "daq event message", and then go on to choose Visual Basic, and Learning to use product features and functions.
    The feature that you are looking for is pattern matching, which is DAQ Event type 8 ? Digital Pattern Matched. When the document refers to the
    Config_DAQ_Event_Message, you can see the details of this function in the NI-DAQ Help file (Start menu >> Programs >> National Instruments >> NI-DAQ). As you will see in the tutorial, you use a different but analogous method. While you won't be using this particular function for Visual Basic, the description of those events may be helpful.
    Regards,
    Geneva L.
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Programatically extract x,y posisition found by Vision Builder pattern match

    I would like to write the cordinates found by doing pattern match to a file.  Can this be done with the Vision Builder?

    In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
    Atom
    Certified LabVIEW Associate Developer

Maybe you are looking for

  • My iPod is NOT recognized by iTunes

    My iPod worked with iTunes perfectly fine 3 days ago. Then, I got 2 iTunes giftcards for christmas. So I plugged in my iPod christmas day to the computer, but it didn't automatically open iTunes like it normally does. So I clicked on iTunes to use th

  • Payment terms maintenance vs define terms of payment for installment.

    Dear all, In Payment terms we can maintain installment payments then what is the need for Maintaining installment payments again. I am not understanding the functionality any body please explain with example. Thanks, Srini.

  • UDF at header level will not auto refresh before & after adding the invoice.

    Hi All, I have a FMS query in the UDF at AR Invoice header level. I have set the FMS query to auto refresh when tax rate field changes but the UDF doesn't auto refresh when there is a tax code in the document. I will need to add the invoice first the

  • AS 2.0 vs. AS 3.0

    Hi, Sorry for all the silly questions guys, i'm a newbie and this is the only place I can really get proper help. Have tried finding response to most of my questions by google or youtube video tutorials, however this is truly the place to go for help

  • X apps (especially gtk apps) "freeze" while fluxbox keeps working

    HI Everyone, I'm trying to understand if this issue Ive been experienceing for the last several weeks (months?) is related to the "redrawing" and "freezing" issues I've been reading about with KDE. What I experience is the gui application failing to